From c765e035f4671eb12ab9e1fb501e8f8887847559 Mon Sep 17 00:00:00 2001 From: cj <545665592@qq.com> Date: Wed, 24 Apr 2019 16:05:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9redis-4.0.12=E4=B8=AD?= =?UTF-8?q?=EF=BC=8Ccluster=20nodes=20=E5=91=BD=E4=BB=A4=E4=B8=AD=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E5=90=8E=E9=9D=A2=E4=BC=9A=E6=9C=89@=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../redis/clients/util/ClusterNodeInformationParser.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cachecloud-open-client/cachecloud-jedis/src/main/java/redis/clients/util/ClusterNodeInformationParser.java b/cachecloud-open-client/cachecloud-jedis/src/main/java/redis/clients/util/ClusterNodeInformationParser.java index 8352dc3c..5eab97c9 100644 --- a/cachecloud-open-client/cachecloud-jedis/src/main/java/redis/clients/util/ClusterNodeInformationParser.java +++ b/cachecloud-open-client/cachecloud-jedis/src/main/java/redis/clients/util/ClusterNodeInformationParser.java @@ -34,6 +34,11 @@ private String[] extractSlotParts(String[] nodeInfoPartArray) { public HostAndPort getHostAndPortFromNodeLine(String[] nodeInfoPartArray, HostAndPort current) { String stringHostAndPort = nodeInfoPartArray[HOST_AND_PORT_INDEX]; + int index = stringHostAndPort.indexOf("@"); + if (index != -1 ){ + stringHostAndPort = stringHostAndPort.substring(0, index); + } + String[] arrayHostAndPort = stringHostAndPort.split(":"); return new HostAndPort(arrayHostAndPort[0].isEmpty() ? current.getHost() : arrayHostAndPort[0], arrayHostAndPort[1].isEmpty() ? current.getPort() : Integer.valueOf(arrayHostAndPort[1]));