Skip to content

Commit

Permalink
add broker default and define constants
Browse files Browse the repository at this point in the history
  • Loading branch information
xvrl committed Nov 12, 2014
1 parent 42a6129 commit 3a9def7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@
*/
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<String, String> tierToBrokerMap;
Expand All @@ -51,7 +54,7 @@ public class TieredBrokerConfig

@JsonProperty
@NotNull
private String coordinatorServiceName = "druid/coordinator";
private String coordinatorServiceName = DEFAULT_COORDINATOR_SERVICE_NAME;

@JsonProperty
@NotNull
Expand Down
5 changes: 4 additions & 1 deletion services/src/main/java/io/druid/cli/CliBroker.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
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;
Expand Down Expand Up @@ -78,7 +79,9 @@ protected List<Object> getModules()
@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);
Expand Down
3 changes: 2 additions & 1 deletion services/src/main/java/io/druid/cli/CliCoordinator.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
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;

Expand Down Expand Up @@ -88,7 +89,7 @@ protected List<Object> getModules()
@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);
Expand Down

0 comments on commit 3a9def7

Please sign in to comment.