From c4f0e4d96d75434ea8e9b62b8ef846ed73dda4b3 Mon Sep 17 00:00:00 2001 From: Dhruv Parthasarathy Date: Wed, 7 Aug 2013 10:53:37 -0700 Subject: [PATCH] fixed with Erics feedback --- .../com/metamx/druid/http/InfoResource.java | 33 --------- .../com/metamx/druid/http/MasterMain.java | 1 + .../com/metamx/druid/http/MasterResource.java | 11 +-- .../http/MasterSegmentSettingsResource.java | 71 +++++++++++++++++++ .../druid/http/MasterServletModule.java | 2 + .../com/metamx/druid/master/DruidMaster.java | 13 ++-- .../druid/master/DruidMasterBalancer.java | 2 +- .../master/DruidMasterRuntimeParams.java | 43 ++++------- .../master/DruidMasterSegmentMerger.java | 8 +-- ...onfigs.java => MasterSegmentSettings.java} | 15 ++-- server/src/main/resources/static/index.html | 2 +- ...micConfigs.js => masterSegmentSettings.js} | 4 +- ...onfigs.html => masterSegmentSettings.html} | 2 +- .../druid/master/DruidMasterBalancerTest.java | 11 ++- .../master/DruidMasterRuleRunnerTest.java | 14 ++-- .../master/DruidMasterSegmentMergerTest.java | 11 ++- 16 files changed, 137 insertions(+), 106 deletions(-) create mode 100644 server/src/main/java/com/metamx/druid/http/MasterSegmentSettingsResource.java rename server/src/main/java/com/metamx/druid/master/{DynamicConfigs.java => MasterSegmentSettings.java} (86%) rename server/src/main/resources/static/js/{dynamicConfigs.js => masterSegmentSettings.js} (87%) rename server/src/main/resources/static/{dynamicConfigs.html => masterSegmentSettings.html} (90%) diff --git a/server/src/main/java/com/metamx/druid/http/InfoResource.java b/server/src/main/java/com/metamx/druid/http/InfoResource.java index 02de4c15c2f..8fd17f315de 100644 --- a/server/src/main/java/com/metamx/druid/http/InfoResource.java +++ b/server/src/main/java/com/metamx/druid/http/InfoResource.java @@ -31,11 +31,9 @@ import com.metamx.druid.client.DruidDataSource; import com.metamx.druid.client.DruidServer; import com.metamx.druid.client.InventoryView; import com.metamx.druid.client.indexing.IndexingServiceClient; -import com.metamx.druid.config.JacksonConfigManager; import com.metamx.druid.db.DatabaseRuleManager; import com.metamx.druid.db.DatabaseSegmentManager; import com.metamx.druid.master.DruidMaster; -import com.metamx.druid.master.DynamicConfigs; import com.metamx.druid.master.rules.Rule; import org.joda.time.Interval; @@ -103,7 +101,6 @@ public class InfoResource private final DatabaseSegmentManager databaseSegmentManager; private final DatabaseRuleManager databaseRuleManager; private final IndexingServiceClient indexingServiceClient; - private final JacksonConfigManager configManager; @Inject @@ -112,7 +109,6 @@ public class InfoResource InventoryView serverInventoryView, DatabaseSegmentManager databaseSegmentManager, DatabaseRuleManager databaseRuleManager, - JacksonConfigManager configManager, @Nullable IndexingServiceClient indexingServiceClient ) @@ -121,7 +117,6 @@ public class InfoResource this.serverInventoryView = serverInventoryView; this.databaseSegmentManager = databaseSegmentManager; this.databaseRuleManager = databaseRuleManager; - this.configManager = configManager; this.indexingServiceClient = indexingServiceClient; } @@ -135,20 +130,6 @@ public class InfoResource .build(); } - @GET - @Path("/master/config") - @Produces("application/json") - public Response getDynamicConfigs() - { - Response.ResponseBuilder builder = Response.status(Response.Status.OK) - .entity( - configManager.watch( - DynamicConfigs.CONFIG_KEY, - DynamicConfigs.class - ).get() - ); - return builder.build(); - } @GET @Path("/cluster") @@ -394,20 +375,6 @@ public class InfoResource return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } - @POST - @Path("master/config") - @Consumes("application/json") - public Response setDynamicConfigs( - final DynamicConfigs dynamicConfigs - ) - { - if (!configManager.set(DynamicConfigs.CONFIG_KEY, dynamicConfigs)) { - return Response.status(Response.Status.BAD_REQUEST).build(); - } - return Response.status(Response.Status.OK).build(); - } - - @GET @Path("/datasources") @Produces("application/json") diff --git a/server/src/main/java/com/metamx/druid/http/MasterMain.java b/server/src/main/java/com/metamx/druid/http/MasterMain.java index 6dc8fa8ad0a..851aea69103 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterMain.java +++ b/server/src/main/java/com/metamx/druid/http/MasterMain.java @@ -332,6 +332,7 @@ public class MasterMain ); root.addFilter(GuiceFilter.class, "/info/*", 0); root.addFilter(GuiceFilter.class, "/master/*", 0); + root.addFilter(GuiceFilter.class, "/masterSegmentSettings/*",0); server.start(); server.join(); diff --git a/server/src/main/java/com/metamx/druid/http/MasterResource.java b/server/src/main/java/com/metamx/druid/http/MasterResource.java index 9bb59d79d43..7bbf045d732 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterResource.java +++ b/server/src/main/java/com/metamx/druid/http/MasterResource.java @@ -24,13 +24,10 @@ import com.metamx.druid.master.LoadPeonCallback; import javax.inject.Inject; import javax.ws.rs.Consumes; -import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; -import javax.ws.rs.Produces; import javax.ws.rs.core.Response; import java.util.List; -import java.util.Map; /** */ @@ -110,11 +107,5 @@ public class MasterResource return resp; } - @GET - @Path("/loadstatus") - @Produces("application/json") - public Map getLoadStatus() - { - return master.getLoadStatus(); - } + } \ No newline at end of file diff --git a/server/src/main/java/com/metamx/druid/http/MasterSegmentSettingsResource.java b/server/src/main/java/com/metamx/druid/http/MasterSegmentSettingsResource.java new file mode 100644 index 00000000000..ab342500c1d --- /dev/null +++ b/server/src/main/java/com/metamx/druid/http/MasterSegmentSettingsResource.java @@ -0,0 +1,71 @@ +/* +* Druid - a distributed column store. +* Copyright (C) 2012 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 com.metamx.druid.http; + +import com.metamx.druid.config.JacksonConfigManager; +import com.metamx.druid.master.MasterSegmentSettings; + +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Response; + +/** + */ +@Path("/masterSegmentSettings") +public class MasterSegmentSettingsResource +{ + private final JacksonConfigManager manager; + + @Inject + public MasterSegmentSettingsResource( + JacksonConfigManager manager + ) + { + this.manager=manager; + } + @GET + @Path("/config") + @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(); + } + + @POST + @Path("/config") + @Consumes("application/json") + public Response setDynamicConfigs( + final MasterSegmentSettings masterSegmentSettings + ) + { + if (!manager.set(MasterSegmentSettings.CONFIG_KEY, masterSegmentSettings)) { + return Response.status(Response.Status.BAD_REQUEST).build(); + } + return Response.status(Response.Status.OK).build(); + } + +} diff --git a/server/src/main/java/com/metamx/druid/http/MasterServletModule.java b/server/src/main/java/com/metamx/druid/http/MasterServletModule.java index 31fa2fa0db0..51d57492914 100644 --- a/server/src/main/java/com/metamx/druid/http/MasterServletModule.java +++ b/server/src/main/java/com/metamx/druid/http/MasterServletModule.java @@ -46,6 +46,7 @@ public class MasterServletModule extends JerseyServletModule private final IndexingServiceClient indexingServiceClient; private final JacksonConfigManager configManager; + public MasterServletModule( InventoryView serverInventoryView, DatabaseSegmentManager segmentInventoryManager, @@ -68,6 +69,7 @@ public class MasterServletModule extends JerseyServletModule @Override protected void configureServlets() { + bind(MasterSegmentSettingsResource.class); bind(InfoResource.class); bind(MasterResource.class); bind(InventoryView.class).toInstance(serverInventoryView); diff --git a/server/src/main/java/com/metamx/druid/master/DruidMaster.java b/server/src/main/java/com/metamx/druid/master/DruidMaster.java index 7ae6bb4a7f9..fde2de38239 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMaster.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMaster.java @@ -95,6 +95,7 @@ public class DruidMaster private final Map loadManagementPeons; private final AtomicReference leaderLatch; + private AtomicReference segmentSettingsAtomicReference; public DruidMaster( DruidMasterConfig config, @@ -156,6 +157,7 @@ public class DruidMaster this.exec = scheduledExecutorFactory.create(1, "Master-Exec--%d"); this.leaderLatch = new AtomicReference(null); + this.segmentSettingsAtomicReference= new AtomicReference(null); this.loadManagementPeons = loadQueuePeonMap; } @@ -465,8 +467,7 @@ public class DruidMaster serverInventoryView.start(); final List> masterRunnables = Lists.newArrayList(); - configManager.watch(DynamicConfigs.CONFIG_KEY, DynamicConfigs.class); - configManager.set(DynamicConfigs.CONFIG_KEY, (new DynamicConfigs.Builder()).build()); + segmentSettingsAtomicReference = configManager.watch(MasterSegmentSettings.CONFIG_KEY, MasterSegmentSettings.class,(new MasterSegmentSettings.Builder()).build()); masterRunnables.add(Pair.of(new MasterComputeManagerRunnable(), config.getMasterPeriod())); if (indexingServiceClient != null) { @@ -651,13 +652,11 @@ public class DruidMaster } // Do master stuff. - DynamicConfigs dynamicConfigs = configManager.watch(DynamicConfigs.CONFIG_KEY,DynamicConfigs.class).get(); - DruidMasterRuntimeParams params = DruidMasterRuntimeParams.newBuilder() .withStartTime(startTime) .withDatasources(databaseSegmentManager.getInventory()) - .withDynamicConfigs(dynamicConfigs) + .withMasterSegmentSettings(segmentSettingsAtomicReference.get()) .withEmitter(emitter) .build(); @@ -756,7 +755,9 @@ public class DruidMaster .withLoadManagementPeons(loadManagementPeons) .withSegmentReplicantLookup(segmentReplicantLookup) .withBalancerReferenceTimestamp(DateTime.now()) - .withDynamicConfigs(configManager.watch(DynamicConfigs.CONFIG_KEY,DynamicConfigs.class).get()) + .withMasterSegmentSettings( + segmentSettingsAtomicReference.get() + ) .build(); } }, diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java b/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java index 05e5992466d..d1a96a00cbb 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterBalancer.java @@ -79,7 +79,7 @@ public class DruidMasterBalancer implements DruidMasterHelper final MasterStats stats = new MasterStats(); final DateTime referenceTimestamp = params.getBalancerReferenceTimestamp(); final BalancerCostAnalyzer analyzer = params.getBalancerCostAnalyzer(referenceTimestamp); - final int maxSegmentsToMove = params.getMaxSegmentsToMove(); + final int maxSegmentsToMove = params.getMasterSegmentSettings().getMaxSegmentsToMove(); for (Map.Entry> entry : params.getDruidCluster().getCluster().entrySet()) { diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java b/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java index efa2632e13f..3c76b587229 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterRuntimeParams.java @@ -46,7 +46,7 @@ public class DruidMasterRuntimeParams private final Map loadManagementPeons; private final ReplicationThrottler replicationManager; private final ServiceEmitter emitter; - private final DynamicConfigs dynamicConfigs; + private final MasterSegmentSettings masterSegmentSettings; private final MasterStats stats; private final DateTime balancerReferenceTimestamp; @@ -60,7 +60,7 @@ public class DruidMasterRuntimeParams Map loadManagementPeons, ReplicationThrottler replicationManager, ServiceEmitter emitter, - DynamicConfigs dynamicConfigs, + MasterSegmentSettings masterSegmentSettings, MasterStats stats, DateTime balancerReferenceTimestamp ) @@ -74,7 +74,7 @@ public class DruidMasterRuntimeParams this.loadManagementPeons = loadManagementPeons; this.replicationManager = replicationManager; this.emitter = emitter; - this.dynamicConfigs = dynamicConfigs; + this.masterSegmentSettings = masterSegmentSettings; this.stats = stats; this.balancerReferenceTimestamp = balancerReferenceTimestamp; } @@ -124,9 +124,9 @@ public class DruidMasterRuntimeParams return emitter; } - public long getMillisToWaitBeforeDeleting() + public MasterSegmentSettings getMasterSegmentSettings() { - return dynamicConfigs.getMillisToWaitBeforeDeleting(); + return masterSegmentSettings; } public MasterStats getMasterStats() @@ -134,21 +134,6 @@ public class DruidMasterRuntimeParams return stats; } - public long getMergeBytesLimit() - { - return dynamicConfigs.getMergeBytesLimit(); - } - - public int getMergeSegmentsLimit() - { - return dynamicConfigs.getMergeSegmentsLimit(); - } - - public int getMaxSegmentsToMove() - { - return dynamicConfigs.getMaxSegmentsToMove(); - } - public DateTime getBalancerReferenceTimestamp() { return balancerReferenceTimestamp; @@ -161,7 +146,7 @@ public class DruidMasterRuntimeParams public boolean hasDeletionWaitTimeElapsed() { - return (System.currentTimeMillis() - getStartTime() > getMillisToWaitBeforeDeleting()); + return (System.currentTimeMillis() - getStartTime() > masterSegmentSettings.getMillisToWaitBeforeDeleting()); } public static Builder newBuilder() @@ -181,7 +166,7 @@ public class DruidMasterRuntimeParams loadManagementPeons, replicationManager, emitter, - dynamicConfigs, + masterSegmentSettings, stats, balancerReferenceTimestamp ); @@ -198,7 +183,7 @@ public class DruidMasterRuntimeParams private final Map loadManagementPeons; private ReplicationThrottler replicationManager; private ServiceEmitter emitter; - private DynamicConfigs dynamicConfigs; + private MasterSegmentSettings masterSegmentSettings; private MasterStats stats; private DateTime balancerReferenceTimestamp; @@ -214,7 +199,7 @@ public class DruidMasterRuntimeParams this.replicationManager = null; this.emitter = null; this.stats = new MasterStats(); - this.dynamicConfigs = new DynamicConfigs.Builder().build(); + this.masterSegmentSettings = new MasterSegmentSettings.Builder().build(); this.balancerReferenceTimestamp = null; } @@ -228,7 +213,7 @@ public class DruidMasterRuntimeParams Map loadManagementPeons, ReplicationThrottler replicationManager, ServiceEmitter emitter, - DynamicConfigs dynamicConfigs, + MasterSegmentSettings masterSegmentSettings, MasterStats stats, DateTime balancerReferenceTimestamp ) @@ -242,7 +227,7 @@ public class DruidMasterRuntimeParams this.loadManagementPeons = loadManagementPeons; this.replicationManager = replicationManager; this.emitter = emitter; - this.dynamicConfigs=dynamicConfigs; + this.masterSegmentSettings = masterSegmentSettings; this.stats = stats; this.balancerReferenceTimestamp = balancerReferenceTimestamp; } @@ -259,7 +244,7 @@ public class DruidMasterRuntimeParams loadManagementPeons, replicationManager, emitter, - dynamicConfigs, + masterSegmentSettings, stats, balancerReferenceTimestamp ); @@ -325,9 +310,9 @@ public class DruidMasterRuntimeParams return this; } - public Builder withDynamicConfigs(DynamicConfigs configs) + public Builder withMasterSegmentSettings(MasterSegmentSettings configs) { - this.dynamicConfigs = configs; + this.masterSegmentSettings = configs; return this; } diff --git a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java index 8be132b9400..5805559e731 100644 --- a/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java +++ b/server/src/main/java/com/metamx/druid/master/DruidMasterSegmentMerger.java @@ -107,9 +107,9 @@ public class DruidMasterSegmentMerger implements DruidMasterHelper throw Throwables.propagate(e); } - if (segmentsToMerge.getByteCount() > params.getMergeBytesLimit() - || segmentsToMerge.getSegmentCount() >= params.getMergeSegmentsLimit()) { - i -= segmentsToMerge.backtrack(params.getMergeBytesLimit()); + if (segmentsToMerge.getByteCount() > params.getMasterSegmentSettings().getMergeBytesLimit() + || segmentsToMerge.getSegmentCount() >= params.getMasterSegmentSettings().getMergeSegmentsLimit()) { + i -= segmentsToMerge.backtrack(params.getMasterSegmentSettings().getMergeBytesLimit()); if (segmentsToMerge.getSegmentCount() > 1) { stats.addToGlobalStat("mergedCount", mergeSegments(segmentsToMerge, entry.getKey())); @@ -125,7 +125,7 @@ public class DruidMasterSegmentMerger implements DruidMasterHelper } // Finish any timelineObjects to merge that may have not hit threshold - segmentsToMerge.backtrack(params.getMergeBytesLimit()); + segmentsToMerge.backtrack(params.getMasterSegmentSettings().getMergeBytesLimit()); if (segmentsToMerge.getSegmentCount() > 1) { stats.addToGlobalStat("mergedCount", mergeSegments(segmentsToMerge, entry.getKey())); } diff --git a/server/src/main/java/com/metamx/druid/master/DynamicConfigs.java b/server/src/main/java/com/metamx/druid/master/MasterSegmentSettings.java similarity index 86% rename from server/src/main/java/com/metamx/druid/master/DynamicConfigs.java rename to server/src/main/java/com/metamx/druid/master/MasterSegmentSettings.java index 1e934b2d1a4..cd6502be130 100644 --- a/server/src/main/java/com/metamx/druid/master/DynamicConfigs.java +++ b/server/src/main/java/com/metamx/druid/master/MasterSegmentSettings.java @@ -21,7 +21,7 @@ package com.metamx.druid.master; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -public class DynamicConfigs +public class MasterSegmentSettings { public static final String CONFIG_KEY = "master.dynamicConfigs"; private long millisToWaitBeforeDeleting=15 * 60 * 1000L; @@ -30,10 +30,11 @@ public class DynamicConfigs private int maxSegmentsToMove = 5; @JsonCreator - public DynamicConfigs(@JsonProperty("millisToWaitBeforeDeleting") Long millisToWaitBeforeDeleting, - @JsonProperty("mergeBytesLimit") Long mergeBytesLimit, - @JsonProperty("mergeSegmentsLimit") Integer mergeSegmentsLimit, - @JsonProperty("maxSegmentsToMove") Integer maxSegmentsToMove + public MasterSegmentSettings( + @JsonProperty("millisToWaitBeforeDeleting") Long millisToWaitBeforeDeleting, + @JsonProperty("mergeBytesLimit") Long mergeBytesLimit, + @JsonProperty("mergeSegmentsLimit") Integer mergeSegmentsLimit, + @JsonProperty("maxSegmentsToMove") Integer maxSegmentsToMove ) { this.maxSegmentsToMove=maxSegmentsToMove; @@ -120,9 +121,9 @@ public class DynamicConfigs return this; } - public DynamicConfigs build() + public MasterSegmentSettings build() { - return new DynamicConfigs(millisToWaitBeforeDeleting,mergeBytesLimit,mergeSegmentsLimit,maxSegmentsToMove); + return new MasterSegmentSettings(millisToWaitBeforeDeleting,mergeBytesLimit,mergeSegmentsLimit,maxSegmentsToMove); } } } diff --git a/server/src/main/resources/static/index.html b/server/src/main/resources/static/index.html index 97e80fad9b9..35febbea6b8 100644 --- a/server/src/main/resources/static/index.html +++ b/server/src/main/resources/static/index.html @@ -38,7 +38,7 @@ Configure Compute Node Rules
Enable/Disable Datasources diff --git a/server/src/main/resources/static/js/dynamicConfigs.js b/server/src/main/resources/static/js/masterSegmentSettings.js similarity index 87% rename from server/src/main/resources/static/js/dynamicConfigs.js rename to server/src/main/resources/static/js/masterSegmentSettings.js index c7774451dee..6eb614b52cf 100644 --- a/server/src/main/resources/static/js/dynamicConfigs.js +++ b/server/src/main/resources/static/js/masterSegmentSettings.js @@ -1,5 +1,5 @@ $(function () { - $.get('../info/master/config', function (data) { + $.get('../masterSegmentSettings/config', function (data) { document.getElementById("millis").value=data["millisToWaitBeforeDeleting"]; document.getElementById("mergeBytes").value = data["mergeBytesLimit"]; document.getElementById("mergeSegments").value = data["mergeSegmentsLimit"]; @@ -15,7 +15,7 @@ $(function () { values[list[i]["name"]]=list[i]["value"]; } $.ajax({ - url:'../info/master/config', + url:'../masterSegmentSettings/config', type:"POST", data: JSON.stringify(values), contentType:"application/json; charset=utf-8", diff --git a/server/src/main/resources/static/dynamicConfigs.html b/server/src/main/resources/static/masterSegmentSettings.html similarity index 90% rename from server/src/main/resources/static/dynamicConfigs.html rename to server/src/main/resources/static/masterSegmentSettings.html index 63751c3413f..c4f06ec25db 100644 --- a/server/src/main/resources/static/dynamicConfigs.html +++ b/server/src/main/resources/static/masterSegmentSettings.html @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java b/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java index 93b1f4b5050..4f594832406 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterBalancerTest.java @@ -192,8 +192,9 @@ public class DruidMasterBalancerTest ) ) .withAvailableSegments(segments.values()) - .withDynamicConfigs( - new DynamicConfigs.Builder().withMaxSegmentsToMove(MAX_SEGMENTS_TO_MOVE).build() + .withMasterSegmentSettings( + new MasterSegmentSettings.Builder().withMaxSegmentsToMove(MAX_SEGMENTS_TO_MOVE) + .build() ) .withBalancerReferenceTimestamp(new DateTime("2013-01-01")) .build(); @@ -283,7 +284,11 @@ public class DruidMasterBalancerTest ) ) .withAvailableSegments(segments.values()) - .withDynamicConfigs(new DynamicConfigs.Builder().withMaxSegmentsToMove(MAX_SEGMENTS_TO_MOVE).build()) + .withMasterSegmentSettings( + new MasterSegmentSettings.Builder().withMaxSegmentsToMove( + MAX_SEGMENTS_TO_MOVE + ).build() + ) .withBalancerReferenceTimestamp(new DateTime("2013-01-01")) .build(); diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterRuleRunnerTest.java b/server/src/test/java/com/metamx/druid/master/DruidMasterRuleRunnerTest.java index 7e32b5a6fda..27dc46636ac 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterRuleRunnerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterRuleRunnerTest.java @@ -177,7 +177,7 @@ public class DruidMasterRuleRunnerTest .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(SegmentReplicantLookup.make(new DruidCluster())) - .withDynamicConfigs(new DynamicConfigs.Builder().withMaxSegmentsToMove(5).build()) + .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMaxSegmentsToMove(5).build()) .build(); DruidMasterRuntimeParams afterParams = ruleRunner.run(params); @@ -522,7 +522,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withDynamicConfigs(new DynamicConfigs.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -596,7 +596,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withDynamicConfigs(new DynamicConfigs.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -677,7 +677,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withDynamicConfigs(new DynamicConfigs.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -754,7 +754,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withDynamicConfigs(new DynamicConfigs.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -843,7 +843,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withDynamicConfigs(new DynamicConfigs.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(availableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) @@ -1029,7 +1029,7 @@ public class DruidMasterRuleRunnerTest DruidMasterRuntimeParams params = new DruidMasterRuntimeParams.Builder() .withDruidCluster(druidCluster) - .withDynamicConfigs(new DynamicConfigs.Builder().withMillisToWaitBeforeDeleting(0L).build()) + .withMasterSegmentSettings(new MasterSegmentSettings.Builder().withMillisToWaitBeforeDeleting(0L).build()) .withAvailableSegments(longerAvailableSegments) .withDatabaseRuleManager(databaseRuleManager) .withSegmentReplicantLookup(segmentReplicantLookup) diff --git a/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java b/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java index 6550b03091b..915e7989797 100644 --- a/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java +++ b/server/src/test/java/com/metamx/druid/master/DruidMasterSegmentMergerTest.java @@ -421,8 +421,15 @@ public class DruidMasterSegmentMergerTest final DruidMasterSegmentMerger merger = new DruidMasterSegmentMerger(indexingServiceClient, whitelistRef); final DruidMasterRuntimeParams params = DruidMasterRuntimeParams.newBuilder() .withAvailableSegments(ImmutableSet.copyOf(segments)) - .withDynamicConfigs( - new DynamicConfigs.Builder().withMergeBytesLimit(mergeBytesLimit).withMergeSegmentsLimit(mergeSegmentsLimit).build()) + .withMasterSegmentSettings( + new MasterSegmentSettings.Builder().withMergeBytesLimit( + mergeBytesLimit + ) + .withMergeSegmentsLimit( + mergeSegmentsLimit + ) + .build() + ) .build(); merger.run(params); return retVal;