Skip to content

Commit

Permalink
Merge pull request #82 from dudizimber/rmt-cluster-node-hostname-support
Browse files Browse the repository at this point in the history
use hostname if available
  • Loading branch information
leonchen83 authored Sep 2, 2024
2 parents f3fba93 + 03efbc0 commit a4dcf8a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ public static <T> XClusterNodes parse(List<String> conf, Set<T> set, Map<Short,
String hostAndPort = args.get(1);
int cIdx = hostAndPort.indexOf(":");
int aIdx = hostAndPort.indexOf("@");
String host = hostAndPort.substring(0, cIdx); // ip
int commaIdx = hostAndPort.indexOf(",");
String host = "";
if (commaIdx == -1) {
host = hostAndPort.substring(0, cIdx);
} else {
host = hostAndPort.substring(commaIdx);
}
int port = parseInt(hostAndPort.substring(cIdx + 1, aIdx == -1 ? hostAndPort.length() : aIdx));
node.setHostAndPort(new HostAndPort(host, port));
boolean master = false;
Expand Down

0 comments on commit a4dcf8a

Please sign in to comment.