diff --git a/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerConfig.java b/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerConfig.java index 89922ad4921..1156885bbd1 100644 --- a/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerConfig.java +++ b/indexing-hadoop/src/main/java/io/druid/indexer/HadoopDruidIndexerConfig.java @@ -35,7 +35,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.metamx.common.Granularity; import com.metamx.common.ISE; -import com.metamx.common.MapUtils; import com.metamx.common.guava.FunctionalIterable; import com.metamx.common.logger.Logger; import io.druid.common.utils.JodaUtils; @@ -52,8 +51,6 @@ import io.druid.indexer.rollup.DataRollupSpec; import io.druid.indexer.updater.DbUpdaterJobSpec; import io.druid.jackson.DefaultObjectMapper; import io.druid.query.aggregation.AggregatorFactory; -import io.druid.segment.serde.Registererer; -import io.druid.segment.serde.Registererers; import io.druid.timeline.DataSegment; import io.druid.timeline.partition.ShardSpec; import org.apache.hadoop.conf.Configuration; @@ -65,11 +62,9 @@ import org.joda.time.DateTime; import org.joda.time.Interval; import org.joda.time.format.ISODateTimeFormat; -import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/processing/src/main/java/io/druid/segment/serde/Registererer.java b/processing/src/main/java/io/druid/segment/serde/Registererer.java deleted file mode 100644 index 6c1fdcceb91..00000000000 --- a/processing/src/main/java/io/druid/segment/serde/Registererer.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Druid - a distributed column store. - * Copyright (C) 2012, 2013 Metamarkets Group Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package io.druid.segment.serde; - -import com.fasterxml.jackson.databind.ObjectMapper; - -/** - * This is a "factory" interface for registering handlers in the system. It exists because I'm unaware of - * another way to register the complex serdes in the MR jobs that run on Hadoop. As such, instances of this interface - * must be instantiatable via a no argument default constructor (the MR jobs on Hadoop use reflection to instantiate - * instances). - * - * The name is not a typo, I felt that it needed an extra "er" to make the pronunciation that much more difficult. - */ -public interface Registererer -{ - public void register(); - - public void registerSubType(ObjectMapper jsonMapper); -} diff --git a/processing/src/main/java/io/druid/segment/serde/Registererers.java b/processing/src/main/java/io/druid/segment/serde/Registererers.java deleted file mode 100644 index e56e42605f2..00000000000 --- a/processing/src/main/java/io/druid/segment/serde/Registererers.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Druid - a distributed column store. - * Copyright (C) 2012, 2013 Metamarkets Group Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package io.druid.segment.serde; - -import com.fasterxml.jackson.databind.ObjectMapper; - -/** - */ -public class Registererers -{ - public static void registerHandlers(Iterable registererers, Iterable mappers) - { - for (Registererer registererer : registererers) { - if (!doneRegister) { - registererer.register(); - } - for (ObjectMapper mapper : mappers) { - registererer.registerSubType(mapper); - } - } - doneRegister = true; - } - - private static boolean doneRegister = false; -} diff --git a/server/src/main/java/io/druid/server/http/MasterSegmentSettingsResource.java b/server/src/main/java/io/druid/server/http/MasterDynamicConfigsResource.java similarity index 66% rename from server/src/main/java/io/druid/server/http/MasterSegmentSettingsResource.java rename to server/src/main/java/io/druid/server/http/MasterDynamicConfigsResource.java index e86311ccaec..b1993cd8a5d 100644 --- a/server/src/main/java/io/druid/server/http/MasterSegmentSettingsResource.java +++ b/server/src/main/java/io/druid/server/http/MasterDynamicConfigsResource.java @@ -20,7 +20,7 @@ package io.druid.server.http; import io.druid.common.config.JacksonConfigManager; -import io.druid.server.master.MasterSegmentSettings; +import io.druid.server.master.MasterDynamicConfig; import javax.inject.Inject; import javax.ws.rs.Consumes; @@ -33,38 +33,38 @@ import javax.ws.rs.core.Response; /** */ @Path("/master/config") -public class MasterSegmentSettingsResource +public class MasterDynamicConfigsResource { private final JacksonConfigManager manager; @Inject - public MasterSegmentSettingsResource( + public MasterDynamicConfigsResource( JacksonConfigManager manager ) { - this.manager=manager; + this.manager = manager; } + @GET @Produces("application/json") public Response getDynamicConfigs() { - Response.ResponseBuilder builder = Response.status(Response.Status.OK) - .entity( - manager.watch(MasterSegmentSettings.CONFIG_KEY,MasterSegmentSettings.class).get() - ); - return builder.build(); + return Response.ok( + manager.watch( + MasterDynamicConfig.CONFIG_KEY, + MasterDynamicConfig.class + ).get() + ).build(); } @POST @Consumes("application/json") - public Response setDynamicConfigs( - final MasterSegmentSettings masterSegmentSettings - ) + public Response setDynamicConfigs(final MasterDynamicConfig dynamicConfig) { - if (!manager.set(MasterSegmentSettings.CONFIG_KEY, masterSegmentSettings)) { + if (!manager.set(MasterDynamicConfig.CONFIG_KEY, dynamicConfig)) { return Response.status(Response.Status.BAD_REQUEST).build(); } - return Response.status(Response.Status.OK).build(); + return Response.ok().build(); } } diff --git a/server/src/main/java/io/druid/server/http/MasterMain.java b/server/src/main/java/io/druid/server/http/MasterMain.java deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/server/src/main/java/io/druid/server/http/MasterResource.java b/server/src/main/java/io/druid/server/http/MasterResource.java index 794e48a1c24..f44bb93b72d 100644 --- a/server/src/main/java/io/druid/server/http/MasterResource.java +++ b/server/src/main/java/io/druid/server/http/MasterResource.java @@ -22,6 +22,7 @@ package io.druid.server.http; import com.google.inject.Inject; import io.druid.server.master.DruidMaster; import io.druid.server.master.LoadPeonCallback; +import io.druid.server.master.MasterDynamicConfig; import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -30,7 +31,6 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; import java.util.List; -import java.util.Map; /** */ @@ -113,8 +113,8 @@ public class MasterResource @GET @Path("/loadstatus") @Produces("application/json") - public Map getLoadStatus() + public Response getLoadStatus() { - return master.getLoadStatus(); + return Response.ok(master.getLoadStatus()).build(); } } \ No newline at end of file diff --git a/server/src/main/java/io/druid/server/master/DruidMaster.java b/server/src/main/java/io/druid/server/master/DruidMaster.java index 0c1a5d5419e..26c4ba4d4ad 100644 --- a/server/src/main/java/io/druid/server/master/DruidMaster.java +++ b/server/src/main/java/io/druid/server/master/DruidMaster.java @@ -84,6 +84,7 @@ public class DruidMaster private volatile boolean started = false; private volatile boolean master = false; + private volatile AtomicReference dynamicConfigs; private final DruidMasterConfig config; private final ZkPathsConfig zkPaths; @@ -98,7 +99,6 @@ public class DruidMaster private final LoadQueueTaskMaster taskMaster; private final Map loadManagementPeons; private final AtomicReference leaderLatch; - private volatile AtomicReference segmentSettingsAtomicReference; @Inject public DruidMaster( @@ -161,7 +161,7 @@ public class DruidMaster this.exec = scheduledExecutorFactory.create(1, "Master-Exec--%d"); this.leaderLatch = new AtomicReference<>(null); - this.segmentSettingsAtomicReference = new AtomicReference<>(null); + this.dynamicConfigs = new AtomicReference<>(null); this.loadManagementPeons = loadQueuePeonMap; } @@ -215,6 +215,11 @@ public class DruidMaster return loadStatus; } + public MasterDynamicConfig getDynamicConfigs() + { + return dynamicConfigs.get(); + } + public void removeSegment(DataSegment segment) { log.info("Removing Segment[%s]", segment); @@ -471,10 +476,10 @@ public class DruidMaster serverInventoryView.start(); final List> masterRunnables = Lists.newArrayList(); - segmentSettingsAtomicReference = configManager.watch( - MasterSegmentSettings.CONFIG_KEY, - MasterSegmentSettings.class, - new MasterSegmentSettings.Builder().build() + dynamicConfigs = configManager.watch( + MasterDynamicConfig.CONFIG_KEY, + MasterDynamicConfig.class, + new MasterDynamicConfig.Builder().build() ); masterRunnables.add(Pair.of(new MasterComputeManagerRunnable(), config.getMasterPeriod())); if (indexingServiceClient != null) { @@ -663,7 +668,7 @@ public class DruidMaster DruidMasterRuntimeParams.newBuilder() .withStartTime(startTime) .withDatasources(databaseSegmentManager.getInventory()) - .withMasterSegmentSettings(segmentSettingsAtomicReference.get()) + .withDynamicConfigs(dynamicConfigs.get()) .withEmitter(emitter) .build(); @@ -750,13 +755,11 @@ public class DruidMaster .withLoadManagementPeons(loadManagementPeons) .withSegmentReplicantLookup(segmentReplicantLookup) .withBalancerReferenceTimestamp(DateTime.now()) - .withMasterSegmentSettings(segmentSettingsAtomicReference.get()) + .withDynamicConfigs(dynamicConfigs.get()) .build(); } }, - new DruidMasterRuleRunner( - DruidMaster.this, config.getReplicantLifetime(), config.getReplicantThrottleLimit() - ), + new DruidMasterRuleRunner(DruidMaster.this), new DruidMasterCleanup(DruidMaster.this), new DruidMasterBalancer(DruidMaster.this), new DruidMasterLogger() diff --git a/server/src/main/java/io/druid/server/master/DruidMasterBalancer.java b/server/src/main/java/io/druid/server/master/DruidMasterBalancer.java index 28c966b4162..5a4ae3e9dbe 100644 --- a/server/src/main/java/io/druid/server/master/DruidMasterBalancer.java +++ b/server/src/main/java/io/druid/server/master/DruidMasterBalancer.java @@ -79,7 +79,7 @@ public class DruidMasterBalancer implements DruidMasterHelper final MasterStats stats = new MasterStats(); final DateTime referenceTimestamp = params.getBalancerReferenceTimestamp(); final BalancerStrategy strategy = params.getBalancerStrategyFactory().createBalancerStrategy(referenceTimestamp); - final int maxSegmentsToMove = params.getMasterSegmentSettings().getMaxSegmentsToMove(); + final int maxSegmentsToMove = params.getMasterDynamicConfig().getMaxSegmentsToMove(); for (Map.Entry> entry : params.getDruidCluster().getCluster().entrySet()) { @@ -124,7 +124,7 @@ public class DruidMasterBalancer implements DruidMasterHelper } } stats.addToTieredStat("movedCount", tier, currentlyMovingSegments.get(tier).size()); - if (params.getMasterSegmentSettings().isEmitBalancingStats()) { + if (params.getMasterDynamicConfig().emitBalancingStats()) { strategy.emitStats(tier, stats, serverHolderList); } diff --git a/server/src/main/java/io/druid/server/master/DruidMasterConfig.java b/server/src/main/java/io/druid/server/master/DruidMasterConfig.java index 49594850a91..f5fcd811c52 100644 --- a/server/src/main/java/io/druid/server/master/DruidMasterConfig.java +++ b/server/src/main/java/io/druid/server/master/DruidMasterConfig.java @@ -54,14 +54,6 @@ public abstract class DruidMasterConfig return false; } - @Config("druid.master.replicant.lifetime") - @Default("15") - public abstract int getReplicantLifetime(); - - @Config("druid.master.replicant.throttleLimit") - @Default("10") - public abstract int getReplicantThrottleLimit(); - @Config("druid.master.load.timeout") public Duration getLoadTimeoutDelay() { diff --git a/server/src/main/java/io/druid/server/master/DruidMasterRuleRunner.java b/server/src/main/java/io/druid/server/master/DruidMasterRuleRunner.java index 6f23976f127..a10832c36ee 100644 --- a/server/src/main/java/io/druid/server/master/DruidMasterRuleRunner.java +++ b/server/src/main/java/io/druid/server/master/DruidMasterRuleRunner.java @@ -37,10 +37,21 @@ public class DruidMasterRuleRunner implements DruidMasterHelper private final DruidMaster master; - public DruidMasterRuleRunner(DruidMaster master, int replicantLifeTime, int replicantThrottleLimit) + public DruidMasterRuleRunner(DruidMaster master) { + this( + new ReplicationThrottler( + master.getDynamicConfigs().getReplicationThrottleLimit(), + master.getDynamicConfigs().getReplicantLifetime() + ), + master + ); + } + + public DruidMasterRuleRunner(ReplicationThrottler replicatorThrottler, DruidMaster master) + { + this.replicatorThrottler = replicatorThrottler; this.master = master; - this.replicatorThrottler = new ReplicationThrottler(replicantThrottleLimit, replicantLifeTime); } @Override diff --git a/server/src/main/java/io/druid/server/master/DruidMasterRuntimeParams.java b/server/src/main/java/io/druid/server/master/DruidMasterRuntimeParams.java index 9f89ad1f05b..c1e497eff9b 100644 --- a/server/src/main/java/io/druid/server/master/DruidMasterRuntimeParams.java +++ b/server/src/main/java/io/druid/server/master/DruidMasterRuntimeParams.java @@ -46,7 +46,7 @@ public class DruidMasterRuntimeParams private final Map loadManagementPeons; private final ReplicationThrottler replicationManager; private final ServiceEmitter emitter; - private final MasterSegmentSettings masterSegmentSettings; + private final MasterDynamicConfig masterDynamicConfig; private final MasterStats stats; private final DateTime balancerReferenceTimestamp; private final BalancerStrategyFactory strategyFactory; @@ -61,7 +61,7 @@ public class DruidMasterRuntimeParams Map loadManagementPeons, ReplicationThrottler replicationManager, ServiceEmitter emitter, - MasterSegmentSettings masterSegmentSettings, + MasterDynamicConfig masterDynamicConfig, MasterStats stats, DateTime balancerReferenceTimestamp, BalancerStrategyFactory strategyFactory @@ -76,7 +76,7 @@ public class DruidMasterRuntimeParams this.loadManagementPeons = loadManagementPeons; this.replicationManager = replicationManager; this.emitter = emitter; - this.masterSegmentSettings = masterSegmentSettings; + this.masterDynamicConfig = masterDynamicConfig; this.stats = stats; this.balancerReferenceTimestamp = balancerReferenceTimestamp; this.strategyFactory = strategyFactory; @@ -127,9 +127,9 @@ public class DruidMasterRuntimeParams return emitter; } - public MasterSegmentSettings getMasterSegmentSettings() + public MasterDynamicConfig getMasterDynamicConfig() { - return masterSegmentSettings; + return masterDynamicConfig; } public MasterStats getMasterStats() @@ -149,7 +149,7 @@ public class DruidMasterRuntimeParams public boolean hasDeletionWaitTimeElapsed() { - return (System.currentTimeMillis() - getStartTime() > masterSegmentSettings.getMillisToWaitBeforeDeleting()); + return (System.currentTimeMillis() - getStartTime() > masterDynamicConfig.getMillisToWaitBeforeDeleting()); } public static Builder newBuilder() @@ -169,7 +169,7 @@ public class DruidMasterRuntimeParams loadManagementPeons, replicationManager, emitter, - masterSegmentSettings, + masterDynamicConfig, stats, balancerReferenceTimestamp, strategyFactory @@ -187,7 +187,7 @@ public class DruidMasterRuntimeParams private final Map loadManagementPeons; private ReplicationThrottler replicationManager; private ServiceEmitter emitter; - private MasterSegmentSettings masterSegmentSettings; + private MasterDynamicConfig masterDynamicConfig; private MasterStats stats; private DateTime balancerReferenceTimestamp; private BalancerStrategyFactory strategyFactory; @@ -204,7 +204,7 @@ public class DruidMasterRuntimeParams this.replicationManager = null; this.emitter = null; this.stats = new MasterStats(); - this.masterSegmentSettings = new MasterSegmentSettings.Builder().build(); + this.masterDynamicConfig = new MasterDynamicConfig.Builder().build(); this.balancerReferenceTimestamp = null; this.strategyFactory = new CostBalancerStrategyFactory(); } @@ -219,7 +219,7 @@ public class DruidMasterRuntimeParams Map loadManagementPeons, ReplicationThrottler replicationManager, ServiceEmitter emitter, - MasterSegmentSettings masterSegmentSettings, + MasterDynamicConfig masterDynamicConfig, MasterStats stats, DateTime balancerReferenceTimestamp, BalancerStrategyFactory strategyFactory @@ -234,7 +234,7 @@ public class DruidMasterRuntimeParams this.loadManagementPeons = loadManagementPeons; this.replicationManager = replicationManager; this.emitter = emitter; - this.masterSegmentSettings = masterSegmentSettings; + this.masterDynamicConfig = masterDynamicConfig; this.stats = stats; this.balancerReferenceTimestamp = balancerReferenceTimestamp; this.strategyFactory=strategyFactory; @@ -252,7 +252,7 @@ public class DruidMasterRuntimeParams loadManagementPeons, replicationManager, emitter, - masterSegmentSettings, + masterDynamicConfig, stats, balancerReferenceTimestamp, strategyFactory @@ -319,9 +319,9 @@ public class DruidMasterRuntimeParams return this; } - public Builder withMasterSegmentSettings(MasterSegmentSettings configs) + public Builder withDynamicConfigs(MasterDynamicConfig configs) { - this.masterSegmentSettings = configs; + this.masterDynamicConfig = configs; return this; } diff --git a/server/src/main/java/io/druid/server/master/DruidMasterSegmentMerger.java b/server/src/main/java/io/druid/server/master/DruidMasterSegmentMerger.java index 0ca304ffe91..630bd860c26 100644 --- a/server/src/main/java/io/druid/server/master/DruidMasterSegmentMerger.java +++ b/server/src/main/java/io/druid/server/master/DruidMasterSegmentMerger.java @@ -99,9 +99,9 @@ public class DruidMasterSegmentMerger implements DruidMasterHelper for (int i = 0; i < timelineObjects.size(); i++) { if (!segmentsToMerge.add(timelineObjects.get(i)) - || segmentsToMerge.getByteCount() > params.getMasterSegmentSettings().getMergeBytesLimit() - || segmentsToMerge.getSegmentCount() >= params.getMasterSegmentSettings().getMergeSegmentsLimit()) { - i -= segmentsToMerge.backtrack(params.getMasterSegmentSettings().getMergeBytesLimit()); + || segmentsToMerge.getByteCount() > params.getMasterDynamicConfig().getMergeBytesLimit() + || segmentsToMerge.getSegmentCount() >= params.getMasterDynamicConfig().getMergeSegmentsLimit()) { + i -= segmentsToMerge.backtrack(params.getMasterDynamicConfig().getMergeBytesLimit()); if (segmentsToMerge.getSegmentCount() > 1) { stats.addToGlobalStat("mergedCount", mergeSegments(segmentsToMerge, entry.getKey())); @@ -117,7 +117,7 @@ public class DruidMasterSegmentMerger implements DruidMasterHelper } // Finish any timelineObjects to merge that may have not hit threshold - segmentsToMerge.backtrack(params.getMasterSegmentSettings().getMergeBytesLimit()); + segmentsToMerge.backtrack(params.getMasterDynamicConfig().getMergeBytesLimit()); if (segmentsToMerge.getSegmentCount() > 1) { stats.addToGlobalStat("mergedCount", mergeSegments(segmentsToMerge, entry.getKey())); } diff --git a/server/src/main/java/io/druid/server/master/MasterSegmentSettings.java b/server/src/main/java/io/druid/server/master/MasterDynamicConfig.java similarity index 61% rename from server/src/main/java/io/druid/server/master/MasterSegmentSettings.java rename to server/src/main/java/io/druid/server/master/MasterDynamicConfig.java index 68c733e3c0a..b9ded33bf29 100644 --- a/server/src/main/java/io/druid/server/master/MasterSegmentSettings.java +++ b/server/src/main/java/io/druid/server/master/MasterDynamicConfig.java @@ -21,36 +21,38 @@ package io.druid.server.master; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -public class MasterSegmentSettings +public class MasterDynamicConfig { - public static final String CONFIG_KEY = "master.dynamicConfigs"; - private long millisToWaitBeforeDeleting = 15 * 60 * 1000L; - private long mergeBytesLimit = 100000000L; - private int mergeSegmentsLimit = Integer.MAX_VALUE; - private int maxSegmentsToMove = 5; - private boolean emitBalancingStats = false; + public static final String CONFIG_KEY = "master.config"; + + private final long millisToWaitBeforeDeleting; + private final long mergeBytesLimit; + private final int mergeSegmentsLimit; + private final int maxSegmentsToMove; + private final int replicantLifetime; + private final int replicationThrottleLimit; + private final boolean emitBalancingStats; @JsonCreator - public MasterSegmentSettings( - @JsonProperty("millisToWaitBeforeDeleting") Long millisToWaitBeforeDeleting, - @JsonProperty("mergeBytesLimit") Long mergeBytesLimit, - @JsonProperty("mergeSegmentsLimit") Integer mergeSegmentsLimit, - @JsonProperty("maxSegmentsToMove") Integer maxSegmentsToMove, - @JsonProperty("emitBalancingStats") Boolean emitBalancingStats + public MasterDynamicConfig( + @JsonProperty("millisToWaitBeforeDeleting") long millisToWaitBeforeDeleting, + @JsonProperty("mergeBytesLimit") long mergeBytesLimit, + @JsonProperty("mergeSegmentsLimit") int mergeSegmentsLimit, + @JsonProperty("maxSegmentsToMove") int maxSegmentsToMove, + @JsonProperty("replicantLifetime") int replicantLifetime, + @JsonProperty("replicationThrottleLimit") int replicationThrottleLimit, + @JsonProperty("emitBalancingStats") boolean emitBalancingStats ) { this.maxSegmentsToMove = maxSegmentsToMove; this.millisToWaitBeforeDeleting = millisToWaitBeforeDeleting; this.mergeSegmentsLimit = mergeSegmentsLimit; this.mergeBytesLimit = mergeBytesLimit; + this.replicantLifetime = replicantLifetime; + this.replicationThrottleLimit = replicationThrottleLimit; this.emitBalancingStats = emitBalancingStats; } - public static String getConfigKey() - { - return CONFIG_KEY; - } - @JsonProperty public long getMillisToWaitBeforeDeleting() { @@ -64,7 +66,7 @@ public class MasterSegmentSettings } @JsonProperty - public boolean isEmitBalancingStats() + public boolean emitBalancingStats() { return emitBalancingStats; } @@ -81,25 +83,40 @@ public class MasterSegmentSettings return maxSegmentsToMove; } + @JsonProperty + public int getReplicantLifetime() + { + return replicantLifetime; + } + + @JsonProperty + public int getReplicationThrottleLimit() + { + return replicationThrottleLimit; + } + public static class Builder { - public static final String CONFIG_KEY = "master.dynamicConfigs"; private long millisToWaitBeforeDeleting; private long mergeBytesLimit; private int mergeSegmentsLimit; private int maxSegmentsToMove; + private int replicantLifetime; + private int replicationThrottleLimit; private boolean emitBalancingStats; public Builder() { - this(15 * 60 * 1000L, 100000000L, Integer.MAX_VALUE, 5, false); + this(15 * 60 * 1000L, 100000000L, Integer.MAX_VALUE, 5, 15, 10, false); } - public Builder( + private Builder( long millisToWaitBeforeDeleting, long mergeBytesLimit, int mergeSegmentsLimit, int maxSegmentsToMove, + int replicantLifetime, + int replicationThrottleLimit, boolean emitBalancingStats ) { @@ -107,6 +124,8 @@ public class MasterSegmentSettings this.mergeBytesLimit = mergeBytesLimit; this.mergeSegmentsLimit = mergeSegmentsLimit; this.maxSegmentsToMove = maxSegmentsToMove; + this.replicantLifetime = replicantLifetime; + this.replicationThrottleLimit = replicationThrottleLimit; this.emitBalancingStats = emitBalancingStats; } @@ -134,13 +153,27 @@ public class MasterSegmentSettings return this; } - public MasterSegmentSettings build() + public Builder withReplicantLifetime(int replicantLifetime) { - return new MasterSegmentSettings( + this.replicantLifetime = replicantLifetime; + return this; + } + + public Builder withReplicationThrottleLimit(int replicationThrottleLimit) + { + this.replicationThrottleLimit = replicationThrottleLimit; + return this; + } + + public MasterDynamicConfig build() + { + return new MasterDynamicConfig( millisToWaitBeforeDeleting, mergeBytesLimit, mergeSegmentsLimit, maxSegmentsToMove, + replicantLifetime, + replicationThrottleLimit, emitBalancingStats ); } diff --git a/server/src/main/resources/static/config.html b/server/src/main/resources/static/config.html new file mode 100644 index 00000000000..7ca2cb4f7a2 --- /dev/null +++ b/server/src/main/resources/static/config.html @@ -0,0 +1,57 @@ + + + + + + Druid Master Console - Rule Configuration + + + + + + + + + + + + + + +
+
Master Configuration
+ +
+
+ + +
+

Are you sure you want to update?

+
+ +
+

Are you sure you want to cancel? All changes will be lost.

+
+ +
+
+
+ + \ No newline at end of file diff --git a/server/src/main/resources/static/css/config.css b/server/src/main/resources/static/css/config.css new file mode 100644 index 00000000000..2c5f3e98b83 --- /dev/null +++ b/server/src/main/resources/static/css/config.css @@ -0,0 +1,8 @@ +#config_list { + margin: 20px 0px; +} + +.config_label { + width: 250px; + float: left; +} \ No newline at end of file diff --git a/server/src/main/resources/static/index.html b/server/src/main/resources/static/index.html index 35febbea6b8..b158c671bef 100644 --- a/server/src/main/resources/static/index.html +++ b/server/src/main/resources/static/index.html @@ -18,6 +18,7 @@ ~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. --> + Druid Master Console @@ -38,7 +39,7 @@ Configure Compute Node Rules
Enable/Disable Datasources diff --git a/server/src/main/resources/static/js/config-0.0.1.js b/server/src/main/resources/static/js/config-0.0.1.js new file mode 100644 index 00000000000..32bdfb7b093 --- /dev/null +++ b/server/src/main/resources/static/js/config-0.0.1.js @@ -0,0 +1,105 @@ +var configs = []; + +function makeConfigDiv(key, value) { + var retVal = "
"; + + retVal += "" + key + ""; + retVal += ""; + + retVal += "
"; + return retVal; +} + +function domToConfig(configDiv) { + var retVal = {}; + + retVal.key = $($(configDiv).find(".config_label")).text(); + retVal.value = $($(configDiv).find(".value")).val(); + + return retVal; +} + +function getConfigs() { + $.getJSON("/master/config", function(data) { + $('#config_list').empty(); + + $.each(data, function (key, value) { + $('#config_list').append(makeConfigDiv(key, value)); + }); + }); +} + +$(document).ready(function() { + $("button").button(); + + $("#error_dialog").dialog({ + autoOpen: false, + modal:true, + resizeable: false, + buttons: { + Ok : function() { + $(this).dialog("close"); + } + } + }); + + $("#cancel_dialog").dialog({ + autoOpen: false, + modal:true, + resizeable: false, + buttons: { + Yes : function() { + getConfigs(); + $(this).dialog("close"); + }, + No: function() { + $(this).dialog("close"); + } + } + }); + + $("#update_dialog").dialog({ + autoOpen: false, + modal:true, + resizeable: false, + buttons: { + Yes : function() { + var configs = {}; + $.each($("#config_list").children(), function(index, configDiv) { + var config = domToConfig(configDiv); + configs[config.key] = config.value; + }); + + $.ajax({ + type: 'POST', + url:'/master/config', + data: JSON.stringify(configs), + contentType:"application/json; charset=utf-8", + dataType:"json", + error: function(xhr, status, error) { + $("#update_dialog").dialog("close"); + $("#error_dialog").html(xhr.responseText); + $("#error_dialog").dialog("open"); + }, + success: function(data, status, xhr) { + getConfigs(); + $("#update_dialog").dialog("close"); + } + }); + }, + Cancel: function() { + $(this).dialog("close"); + } + } + }); + + getConfigs(); + + $("#cancel").click(function() { + $("#cancel_dialog").dialog("open"); + }); + + $('#update').click(function (){ + $("#update_dialog").dialog("open") + }); +}); \ No newline at end of file diff --git a/server/src/main/resources/static/js/masterSegmentSettings.js b/server/src/main/resources/static/js/masterSegmentSettings.js deleted file mode 100644 index 832859d97e1..00000000000 --- a/server/src/main/resources/static/js/masterSegmentSettings.js +++ /dev/null @@ -1,26 +0,0 @@ -$(function () { - $.get('../master/config', function (data) { - document.getElementById("millis").value=data["millisToWaitBeforeDeleting"]; - document.getElementById("mergeBytes").value = data["mergeBytesLimit"]; - document.getElementById("mergeSegments").value = data["mergeSegmentsLimit"]; - document.getElementById("maxSegments").value = data["maxSegmentsToMove"]; - document.getElementById("emitBalancingStats").value = data["emitBalancingStats"]; - }); - - $("#submit").click( function () - { - values = {}; - list = $('form').serializeArray(); - for (var i=0;i< list.length;i++) - { - values[list[i]["name"]]=list[i]["value"]; - } - $.ajax({ - url:'../master/config', - type:"POST", - data: JSON.stringify(values), - contentType:"application/json; charset=utf-8", - dataType:"json" - }); - }); -}); diff --git a/server/src/main/resources/static/masterSegmentSettings.html b/server/src/main/resources/static/masterSegmentSettings.html deleted file mode 100644 index 4306305d252..00000000000 --- a/server/src/main/resources/static/masterSegmentSettings.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - Configure Dynamic Master Parameters - - -
- millisToWaitBeforeDeleting: -
- mergeBytesLimit: -
- mergeSegmentsLimit: -
- maxSegmentsToMove: -
- emitBalancingStats: - -
- - - - - - \ No newline at end of file diff --git a/server/src/test/java/io/druid/server/master/DruidMasterBalancerProfiler.java b/server/src/test/java/io/druid/server/master/DruidMasterBalancerProfiler.java index 9830f3c71ef..568a8d8b863 100644 --- a/server/src/test/java/io/druid/server/master/DruidMasterBalancerProfiler.java +++ b/server/src/test/java/io/druid/server/master/DruidMasterBalancerProfiler.java @@ -53,7 +53,7 @@ public class DruidMasterBalancerProfiler Map segments = Maps.newHashMap(); ServiceEmitter emitter; DatabaseRuleManager manager; - PeriodLoadRule loadRule = new PeriodLoadRule(new Period("P5000Y"),3,"normal"); + PeriodLoadRule loadRule = new PeriodLoadRule(new Period("P5000Y"), 3, "normal"); List rules = ImmutableList.of(loadRule); @Before @@ -71,7 +71,7 @@ public class DruidMasterBalancerProfiler { Stopwatch watch = new Stopwatch(); int numSegments = 55000; - int numServers=50; + int numServers = 50; EasyMock.expect(manager.getAllRules()).andReturn(ImmutableMap.>of("test", rules)).anyTimes(); EasyMock.expect(manager.getRules(EasyMock.anyObject())).andReturn(rules).anyTimes(); EasyMock.expect(manager.getRulesWithDefault(EasyMock.anyObject())).andReturn(rules).anyTimes(); @@ -89,9 +89,8 @@ public class DruidMasterBalancerProfiler List serverList = Lists.newArrayList(); Map peonMap = Maps.newHashMap(); List serverHolderList = Lists.newArrayList(); - Map segmentMap = Maps.newHashMap(); - for (int i=0;i segmentMap = Maps.newHashMap(); + for (int i = 0; i < numSegments; i++) { segmentMap.put( "segment" + i, new DataSegment( @@ -108,30 +107,26 @@ public class DruidMasterBalancerProfiler ); } - for (int i=0;i()).anyTimes(); } EasyMock.expect(server.getSegment(EasyMock.anyObject())).andReturn(null).anyTimes(); EasyMock.replay(server); LoadQueuePeon peon = new LoadQueuePeonTester(); - peonMap.put(Integer.toString(i),peon); + peonMap.put(Integer.toString(i), peon); serverHolderList.add(new ServerHolder(server, peon)); - } + } DruidMasterRuntimeParams params = DruidMasterRuntimeParams.newBuilder() @@ -150,27 +145,34 @@ public class DruidMasterBalancerProfiler peonMap ) .withAvailableSegments(segmentMap.values()) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMaxSegmentsToMove(MAX_SEGMENTS_TO_MOVE).build()) + .withDynamicConfigs( + new MasterDynamicConfig.Builder().withMaxSegmentsToMove( + MAX_SEGMENTS_TO_MOVE + ).withReplicantLifetime(500) + .withReplicationThrottleLimit(5) + .build() + ) .withBalancerReferenceTimestamp(new DateTime("2013-01-01")) .withEmitter(emitter) .withDatabaseRuleManager(manager) .withReplicationManager(new ReplicationThrottler(2, 500)) .withSegmentReplicantLookup( - SegmentReplicantLookup.make(new DruidCluster( - ImmutableMap.>of( - "normal", - MinMaxPriorityQueue.orderedBy(DruidMasterBalancerTester.percentUsedComparator) - .create( - serverHolderList - ) + SegmentReplicantLookup.make( + new DruidCluster( + ImmutableMap.>of( + "normal", + MinMaxPriorityQueue.orderedBy(DruidMasterBalancerTester.percentUsedComparator) + .create( + serverHolderList + ) + ) ) ) - ) ) .build(); DruidMasterBalancerTester tester = new DruidMasterBalancerTester(master); - DruidMasterRuleRunner runner = new DruidMasterRuleRunner(master,500,5); + DruidMasterRuleRunner runner = new DruidMasterRuleRunner(master); watch.start(); DruidMasterRuntimeParams balanceParams = tester.run(params); DruidMasterRuntimeParams assignParams = runner.run(params); @@ -178,56 +180,68 @@ public class DruidMasterBalancerProfiler } - public void profileRun(){ - Stopwatch watch = new Stopwatch(); - LoadQueuePeonTester fromPeon = new LoadQueuePeonTester(); - LoadQueuePeonTester toPeon = new LoadQueuePeonTester(); + public void profileRun() + { + Stopwatch watch = new Stopwatch(); + LoadQueuePeonTester fromPeon = new LoadQueuePeonTester(); + LoadQueuePeonTester toPeon = new LoadQueuePeonTester(); - EasyMock.expect(druidServer1.getName()).andReturn("from").atLeastOnce(); - EasyMock.expect(druidServer1.getCurrSize()).andReturn(30L).atLeastOnce(); - EasyMock.expect(druidServer1.getMaxSize()).andReturn(100L).atLeastOnce(); - EasyMock.expect(druidServer1.getSegments()).andReturn(segments).anyTimes(); - EasyMock.expect(druidServer1.getSegment(EasyMock.anyObject())).andReturn(null).anyTimes(); - EasyMock.replay(druidServer1); + EasyMock.expect(druidServer1.getName()).andReturn("from").atLeastOnce(); + EasyMock.expect(druidServer1.getCurrSize()).andReturn(30L).atLeastOnce(); + EasyMock.expect(druidServer1.getMaxSize()).andReturn(100L).atLeastOnce(); + EasyMock.expect(druidServer1.getSegments()).andReturn(segments).anyTimes(); + EasyMock.expect(druidServer1.getSegment(EasyMock.anyObject())).andReturn(null).anyTimes(); + EasyMock.replay(druidServer1); - EasyMock.expect(druidServer2.getName()).andReturn("to").atLeastOnce(); - EasyMock.expect(druidServer2.getTier()).andReturn("normal").anyTimes(); - EasyMock.expect(druidServer2.getCurrSize()).andReturn(0L).atLeastOnce(); - EasyMock.expect(druidServer2.getMaxSize()).andReturn(100L).atLeastOnce(); - EasyMock.expect(druidServer2.getSegments()).andReturn(new HashMap()).anyTimes(); - EasyMock.expect(druidServer2.getSegment(EasyMock.anyObject())).andReturn(null).anyTimes(); - EasyMock.replay(druidServer2); + EasyMock.expect(druidServer2.getName()).andReturn("to").atLeastOnce(); + EasyMock.expect(druidServer2.getTier()).andReturn("normal").anyTimes(); + EasyMock.expect(druidServer2.getCurrSize()).andReturn(0L).atLeastOnce(); + EasyMock.expect(druidServer2.getMaxSize()).andReturn(100L).atLeastOnce(); + EasyMock.expect(druidServer2.getSegments()).andReturn(new HashMap()).anyTimes(); + EasyMock.expect(druidServer2.getSegment(EasyMock.anyObject())).andReturn(null).anyTimes(); + EasyMock.replay(druidServer2); - master.moveSegment( - EasyMock.anyObject(), - EasyMock.anyObject(), - EasyMock.anyObject(), - EasyMock.anyObject() - ); - EasyMock.expectLastCall().anyTimes(); - EasyMock.replay(master); + master.moveSegment( + EasyMock.anyObject(), + EasyMock.anyObject(), + EasyMock.anyObject(), + EasyMock.anyObject() + ); + EasyMock.expectLastCall().anyTimes(); + EasyMock.replay(master); - DruidMasterRuntimeParams params = - DruidMasterRuntimeParams.newBuilder() - .withDruidCluster( - new DruidCluster( - ImmutableMap.>of( - "normal", - MinMaxPriorityQueue.orderedBy(DruidMasterBalancerTester.percentUsedComparator) - .create( - Arrays.asList( - new ServerHolder(druidServer1, fromPeon), - new ServerHolder(druidServer2, toPeon) - ) - ) - ) - ) - ) - .withLoadManagementPeons(ImmutableMap.of("from", fromPeon, "to", toPeon)) - .withAvailableSegments(segments.values()) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMaxSegmentsToMove(MAX_SEGMENTS_TO_MOVE).build()) - .withBalancerReferenceTimestamp(new DateTime("2013-01-01")) - .build(); + DruidMasterRuntimeParams params = + DruidMasterRuntimeParams.newBuilder() + .withDruidCluster( + new DruidCluster( + ImmutableMap.>of( + "normal", + MinMaxPriorityQueue.orderedBy(DruidMasterBalancerTester.percentUsedComparator) + .create( + Arrays.asList( + new ServerHolder(druidServer1, fromPeon), + new ServerHolder(druidServer2, toPeon) + ) + ) + ) + ) + ) + .withLoadManagementPeons( + ImmutableMap.of( + "from", + fromPeon, + "to", + toPeon + ) + ) + .withAvailableSegments(segments.values()) + .withDynamicConfigs( + new MasterDynamicConfig.Builder().withMaxSegmentsToMove( + MAX_SEGMENTS_TO_MOVE + ).build() + ) + .withBalancerReferenceTimestamp(new DateTime("2013-01-01")) + .build(); DruidMasterBalancerTester tester = new DruidMasterBalancerTester(master); watch.start(); DruidMasterRuntimeParams balanceParams = tester.run(params); diff --git a/server/src/test/java/io/druid/server/master/DruidMasterBalancerTest.java b/server/src/test/java/io/druid/server/master/DruidMasterBalancerTest.java index a284bbe9931..4b25de80e01 100644 --- a/server/src/test/java/io/druid/server/master/DruidMasterBalancerTest.java +++ b/server/src/test/java/io/druid/server/master/DruidMasterBalancerTest.java @@ -192,7 +192,11 @@ public class DruidMasterBalancerTest ) ) .withAvailableSegments(segments.values()) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMaxSegmentsToMove(MAX_SEGMENTS_TO_MOVE).build()) + .withDynamicConfigs( + new MasterDynamicConfig.Builder().withMaxSegmentsToMove( + MAX_SEGMENTS_TO_MOVE + ).build() + ) .withBalancerReferenceTimestamp(new DateTime("2013-01-01")) .build(); @@ -264,9 +268,9 @@ public class DruidMasterBalancerTest ) ) .withAvailableSegments(segments.values()) - .withMasterSegmentSettings( - new MasterSegmentSettings.Builder().withMaxSegmentsToMove(MAX_SEGMENTS_TO_MOVE) - .build() + .withDynamicConfigs( + new MasterDynamicConfig.Builder().withMaxSegmentsToMove(MAX_SEGMENTS_TO_MOVE) + .build() ) .withBalancerReferenceTimestamp(new DateTime("2013-01-01")) .build(); @@ -357,8 +361,8 @@ public class DruidMasterBalancerTest ) ) .withAvailableSegments(segments.values()) - .withMasterSegmentSettings( - new MasterSegmentSettings.Builder().withMaxSegmentsToMove( + .withDynamicConfigs( + new MasterDynamicConfig.Builder().withMaxSegmentsToMove( MAX_SEGMENTS_TO_MOVE ).build() ) diff --git a/server/src/test/java/io/druid/server/master/DruidMasterRuleRunnerTest.java b/server/src/test/java/io/druid/server/master/DruidMasterRuleRunnerTest.java index 937430d5d15..65948802ef1 100644 --- a/server/src/test/java/io/druid/server/master/DruidMasterRuleRunnerTest.java +++ b/server/src/test/java/io/druid/server/master/DruidMasterRuleRunnerTest.java @@ -86,7 +86,7 @@ public class DruidMasterRuleRunnerTest start = start.plusHours(1); } - ruleRunner = new DruidMasterRuleRunner(master, 1, 24); + ruleRunner = new DruidMasterRuleRunner(new ReplicationThrottler(24, 1), master); } @After @@ -177,7 +177,7 @@ public class DruidMasterRuleRunnerTest .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(SegmentReplicantLookup.make(new DruidCluster())) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMaxSegmentsToMove(5).build()) + .withDynamicConfigs(new MasterDynamicConfig.Builder().withMaxSegmentsToMove(5).build()) .build(); DruidMasterRuntimeParams afterParams = ruleRunner.run(params); @@ -522,7 +522,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withDynamicConfigs(new MasterDynamicConfig.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -596,7 +596,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withDynamicConfigs(new MasterDynamicConfig.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -677,7 +677,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withDynamicConfigs(new MasterDynamicConfig.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -754,7 +754,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withDynamicConfigs(new MasterDynamicConfig.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -843,7 +843,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withDynamicConfigs(new MasterDynamicConfig.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -1029,7 +1029,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withDynamicConfigs(new MasterDynamicConfig.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(longerAvailableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) diff --git a/server/src/test/java/io/druid/server/master/DruidMasterSegmentMergerTest.java b/server/src/test/java/io/druid/server/master/DruidMasterSegmentMergerTest.java index 37392ac2e9a..4338ecbbc7a 100644 --- a/server/src/test/java/io/druid/server/master/DruidMasterSegmentMergerTest.java +++ b/server/src/test/java/io/druid/server/master/DruidMasterSegmentMergerTest.java @@ -459,13 +459,13 @@ public class DruidMasterSegmentMergerTest final DruidMasterSegmentMerger merger = new DruidMasterSegmentMerger(indexingServiceClient, whitelistRef); final DruidMasterRuntimeParams params = DruidMasterRuntimeParams.newBuilder() .withAvailableSegments(ImmutableSet.copyOf(segments)) - .withMasterSegmentSettings( - new MasterSegmentSettings.Builder().withMergeBytesLimit( + .withDynamicConfigs( + new MasterDynamicConfig.Builder().withMergeBytesLimit( mergeBytesLimit ).withMergeSegmentsLimit( mergeSegmentsLimit ) - .build() + .build() ) .build(); merger.run(params); diff --git a/server/src/test/java/io/druid/server/master/DruidMasterTest.java b/server/src/test/java/io/druid/server/master/DruidMasterTest.java index a1334718e94..44773da97d8 100644 --- a/server/src/test/java/io/druid/server/master/DruidMasterTest.java +++ b/server/src/test/java/io/druid/server/master/DruidMasterTest.java @@ -93,18 +93,6 @@ public class DruidMasterTest { return null; } - - @Override - public int getReplicantLifetime() - { - return 0; - } - - @Override - public int getReplicantThrottleLimit() - { - return 0; - } }, new ZkPathsConfig(){ diff --git a/services/src/main/java/io/druid/cli/CliCoordinator.java b/services/src/main/java/io/druid/cli/CliCoordinator.java index 4879ed35bc7..9afe9ef02d0 100644 --- a/services/src/main/java/io/druid/cli/CliCoordinator.java +++ b/services/src/main/java/io/druid/cli/CliCoordinator.java @@ -44,6 +44,7 @@ import io.druid.guice.ManageLifecycle; import io.druid.guice.annotations.Self; import io.druid.server.http.BackwardsCompatiableInfoResource; import io.druid.server.http.InfoResource; +import io.druid.server.http.MasterDynamicConfigsResource; import io.druid.server.http.MasterRedirectInfo; import io.druid.server.http.MasterResource; import io.druid.server.http.RedirectFilter; @@ -111,6 +112,7 @@ public class CliCoordinator extends ServerRunnable Jerseys.addResource(binder, BackwardsCompatiableInfoResource.class); Jerseys.addResource(binder, InfoResource.class); Jerseys.addResource(binder, MasterResource.class); + Jerseys.addResource(binder, MasterDynamicConfigsResource.class); LifecycleModule.register(binder, Server.class); }