diff --git a/server/src/main/java/io/druid/server/router/TieredBrokerConfig.java b/server/src/main/java/io/druid/server/router/TieredBrokerConfig.java index 4729d0a5d03..ccb8202d98e 100644 --- a/server/src/main/java/io/druid/server/router/TieredBrokerConfig.java +++ b/server/src/main/java/io/druid/server/router/TieredBrokerConfig.java @@ -34,9 +34,12 @@ import java.util.List; */ public class TieredBrokerConfig { + public static final String DEFAULT_COORDINATOR_SERVICE_NAME = "druid/coordinator"; + public static final String DEFAULT_BROKER_SERVICE_NAME = "druid/broker"; + @JsonProperty @NotNull - private String defaultBrokerServiceName = ""; + private String defaultBrokerServiceName = DEFAULT_BROKER_SERVICE_NAME; @JsonProperty private LinkedHashMap tierToBrokerMap; @@ -51,7 +54,7 @@ public class TieredBrokerConfig @JsonProperty @NotNull - private String coordinatorServiceName = "druid/coordinator"; + private String coordinatorServiceName = DEFAULT_COORDINATOR_SERVICE_NAME; @JsonProperty @NotNull diff --git a/services/src/main/java/io/druid/cli/CliBroker.java b/services/src/main/java/io/druid/cli/CliBroker.java index f0ceac08ac3..877a356103e 100644 --- a/services/src/main/java/io/druid/cli/CliBroker.java +++ b/services/src/main/java/io/druid/cli/CliBroker.java @@ -50,6 +50,7 @@ import io.druid.server.QueryResource; import io.druid.server.coordination.broker.DruidBroker; import io.druid.server.initialization.JettyServerInitializer; import io.druid.server.metrics.MetricsModule; +import io.druid.server.router.TieredBrokerConfig; import org.eclipse.jetty.server.Server; import java.util.List; @@ -78,7 +79,9 @@ public class CliBroker extends ServerRunnable @Override public void configure(Binder binder) { - binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/broker"); + binder.bindConstant().annotatedWith(Names.named("serviceName")).to( + TieredBrokerConfig.DEFAULT_BROKER_SERVICE_NAME + ); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8082); binder.bind(QueryToolChestWarehouse.class).to(MapQueryToolChestWarehouse.class); diff --git a/services/src/main/java/io/druid/cli/CliCoordinator.java b/services/src/main/java/io/druid/cli/CliCoordinator.java index b1f670350bb..ee9f9e8bdb5 100644 --- a/services/src/main/java/io/druid/cli/CliCoordinator.java +++ b/services/src/main/java/io/druid/cli/CliCoordinator.java @@ -58,6 +58,7 @@ import io.druid.server.http.RulesResource; import io.druid.server.http.ServersResource; import io.druid.server.http.TiersResource; import io.druid.server.initialization.JettyServerInitializer; +import io.druid.server.router.TieredBrokerConfig; import org.apache.curator.framework.CuratorFramework; import org.eclipse.jetty.server.Server; @@ -88,7 +89,7 @@ public class CliCoordinator extends ServerRunnable @Override public void configure(Binder binder) { - binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/coordinator"); + binder.bindConstant().annotatedWith(Names.named("serviceName")).to(TieredBrokerConfig.DEFAULT_COORDINATOR_SERVICE_NAME); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(8081); ConfigProvider.bind(binder, DruidCoordinatorConfig.class);