From d8b3bfa63c9a8ff680a7eb967bc12c845cbadcd8 Mon Sep 17 00:00:00 2001 From: Roman Leventov Date: Wed, 20 Sep 2017 23:27:43 -0500 Subject: [PATCH] Remove SegmentLoaderConfig.numLoadingThreads config (#4829) --- docs/content/configuration/historical.md | 3 +-- .../druid/segment/loading/SegmentLoaderConfig.java | 12 +++--------- .../io/druid/server/coordination/ZkCoordinator.java | 2 +- .../druid/server/coordination/ZkCoordinatorTest.java | 12 ------------ 4 files changed, 5 insertions(+), 24 deletions(-) diff --git a/docs/content/configuration/historical.md b/docs/content/configuration/historical.md index 28319fd230f..c972cbe65d1 100644 --- a/docs/content/configuration/historical.md +++ b/docs/content/configuration/historical.md @@ -36,8 +36,7 @@ The historical node uses several of the global configs in [Configuration](../con |`druid.segmentCache.dropSegmentDelayMillis`|How long a node delays before completely dropping segment.|30000 (30 seconds)| |`druid.segmentCache.infoDir`|Historical nodes keep track of the segments they are serving so that when the process is restarted they can reload the same segments without waiting for the Coordinator to reassign. This path defines where this metadata is kept. Directory will be created if needed.|${first_location}/info_dir| |`druid.segmentCache.announceIntervalMillis`|How frequently to announce segments while segments are loading from cache. Set this value to zero to wait for all segments to be loaded before announcing.|5000 (5 seconds)| -|`druid.segmentCache.numLoadingThreads`|How many segments to load concurrently from from deep storage.|1| -|`druid.segmentCache.numBootstrapThreads`|How many segments to load concurrently from local storage at startup.|Same as numLoadingThreads| +|`druid.segmentCache.numBootstrapThreads`|How many segments to load concurrently from local storage at startup.|1| ### Query Configs diff --git a/server/src/main/java/io/druid/segment/loading/SegmentLoaderConfig.java b/server/src/main/java/io/druid/segment/loading/SegmentLoaderConfig.java index f67cd649bfa..a0d66c1f402 100644 --- a/server/src/main/java/io/druid/segment/loading/SegmentLoaderConfig.java +++ b/server/src/main/java/io/druid/segment/loading/SegmentLoaderConfig.java @@ -31,6 +31,8 @@ import java.util.List; */ public class SegmentLoaderConfig { + private static final int DEFAULT_NUM_BOOTSTRAP_THREADS = 1; + @JsonProperty @NotEmpty private List locations = null; @@ -44,9 +46,6 @@ public class SegmentLoaderConfig @JsonProperty("announceIntervalMillis") private int announceIntervalMillis = 0; // do not background announce - @JsonProperty("numLoadingThreads") - private int numLoadingThreads = 1; - @JsonProperty("numBootstrapThreads") private Integer numBootstrapThreads = null; @@ -73,14 +72,9 @@ public class SegmentLoaderConfig return announceIntervalMillis; } - public int getNumLoadingThreads() - { - return numLoadingThreads; - } - public int getNumBootstrapThreads() { - return numBootstrapThreads == null ? numLoadingThreads : numBootstrapThreads; + return numBootstrapThreads == null ? DEFAULT_NUM_BOOTSTRAP_THREADS : numBootstrapThreads; } public File getInfoDir() diff --git a/server/src/main/java/io/druid/server/coordination/ZkCoordinator.java b/server/src/main/java/io/druid/server/coordination/ZkCoordinator.java index 4ae8887694e..0d6fc933f9a 100644 --- a/server/src/main/java/io/druid/server/coordination/ZkCoordinator.java +++ b/server/src/main/java/io/druid/server/coordination/ZkCoordinator.java @@ -127,7 +127,7 @@ public class ZkCoordinator implements DataSegmentChangeHandler loadQueueLocation, true, true, - Execs.multiThreaded(config.getNumLoadingThreads(), "ZkCoordinator-%s") + Execs.singleThreaded("ZkCoordinator-%s") ); try { diff --git a/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java b/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java index dc14592b820..fbd40726528 100644 --- a/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java +++ b/server/src/test/java/io/druid/server/coordination/ZkCoordinatorTest.java @@ -202,12 +202,6 @@ public class ZkCoordinatorTest extends CuratorTestBase return infoDir; } - @Override - public int getNumLoadingThreads() - { - return 5; - } - @Override public int getAnnounceIntervalMillis() { @@ -493,12 +487,6 @@ public class ZkCoordinatorTest extends CuratorTestBase return infoDir; } - @Override - public int getNumLoadingThreads() - { - return 5; - } - @Override public int getAnnounceIntervalMillis() {