diff --git a/server/src/main/java/io/druid/server/router/TieredBrokerHostSelector.java b/server/src/main/java/io/druid/server/router/TieredBrokerHostSelector.java index a28e6ffc2ff..9e5daa3bc62 100644 --- a/server/src/main/java/io/druid/server/router/TieredBrokerHostSelector.java +++ b/server/src/main/java/io/druid/server/router/TieredBrokerHostSelector.java @@ -28,6 +28,7 @@ import com.metamx.common.lifecycle.LifecycleStart; import com.metamx.common.lifecycle.LifecycleStop; import com.metamx.emitter.EmittingLogger; import io.druid.client.selector.HostSelector; +import io.druid.curator.discovery.CuratorServiceUtils; import io.druid.curator.discovery.ServerDiscoveryFactory; import io.druid.curator.discovery.ServerDiscoverySelector; import io.druid.query.Query; @@ -183,7 +184,7 @@ public class TieredBrokerHostSelector implements HostSelector brokerServiceName = tierConfig.getDefaultBrokerServiceName(); } - ServerDiscoverySelector retVal = selectorMap.get(brokerServiceName); + ServerDiscoverySelector retVal = selectorMap.get(CuratorServiceUtils.makeCanonicalServiceName(brokerServiceName)); if (retVal == null) { log.error( @@ -191,7 +192,7 @@ public class TieredBrokerHostSelector implements HostSelector brokerServiceName, tierConfig.getDefaultBrokerServiceName() ); - retVal = selectorMap.get(tierConfig.getDefaultBrokerServiceName()); + retVal = selectorMap.get(CuratorServiceUtils.makeCanonicalServiceName(tierConfig.getDefaultBrokerServiceName())); } return new Pair<>(brokerServiceName, retVal); @@ -200,7 +201,7 @@ public class TieredBrokerHostSelector implements HostSelector public Pair getDefaultLookup() { final String brokerServiceName = tierConfig.getDefaultBrokerServiceName(); - final ServerDiscoverySelector retVal = selectorMap.get(brokerServiceName); + final ServerDiscoverySelector retVal = selectorMap.get(CuratorServiceUtils.makeCanonicalServiceName(brokerServiceName)); return new Pair<>(brokerServiceName, retVal); } }