From e450877a7889a86497c8cd9be377e3433ac35997 Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Thu, 8 Oct 2015 10:03:50 -0700 Subject: [PATCH] Make ServerDiscoverySelector more IPv6 friendly --- .../io/druid/curator/discovery/ServerDiscoverySelector.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/io/druid/curator/discovery/ServerDiscoverySelector.java b/server/src/main/java/io/druid/curator/discovery/ServerDiscoverySelector.java index 32f5c0906be..c94cd6cb422 100644 --- a/server/src/main/java/io/druid/curator/discovery/ServerDiscoverySelector.java +++ b/server/src/main/java/io/druid/curator/discovery/ServerDiscoverySelector.java @@ -17,6 +17,7 @@ package io.druid.curator.discovery; +import com.google.common.net.HostAndPort; import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.common.logger.Logger; @@ -62,7 +63,7 @@ public class ServerDiscoverySelector implements DiscoverySelector @Override public String getHost() { - return String.format("%s:%d", getAddress(), getPort()); + return HostAndPort.fromParts(getAddress(), getPort()).toString(); } @Override