From 671bc4e734a0f900c24ff6103093e5550f1a0163 Mon Sep 17 00:00:00 2001
From: kimchy <kimchy@gmail.com>
Date: Sat, 20 Mar 2010 03:41:41 +0200
Subject: [PATCH] ThreadPool: Rename dynamic to scaling, closes #75.

---
 .../benchmark/index/engine/SimpleEngineBenchmark.java     | 4 ++--
 .../ScalingThreadPool.java}                               | 8 ++++----
 .../elasticsearch/index/shard/SimpleIndexShardTests.java  | 4 ++--
 .../org/elasticsearch/monitor/jvm/DeadlockSimulator.java  | 4 ++--
 .../transport/local/SimpleLocalTransportTests.java        | 4 ++--
 .../transport/netty/SimpleNettyTransportTests.java        | 4 ++--
 6 files changed, 14 insertions(+), 14 deletions(-)
 rename modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/{dynamic/DynamicThreadPool.java => scaling/ScalingThreadPool.java} (92%)

diff --git a/modules/benchmark/micro/src/main/java/org/elasticsearch/benchmark/index/engine/SimpleEngineBenchmark.java b/modules/benchmark/micro/src/main/java/org/elasticsearch/benchmark/index/engine/SimpleEngineBenchmark.java
index 7a6e68a3e17..5b855bd0d76 100644
--- a/modules/benchmark/micro/src/main/java/org/elasticsearch/benchmark/index/engine/SimpleEngineBenchmark.java
+++ b/modules/benchmark/micro/src/main/java/org/elasticsearch/benchmark/index/engine/SimpleEngineBenchmark.java
@@ -39,7 +39,7 @@ import org.elasticsearch.index.store.Store;
 import org.elasticsearch.index.store.memory.ByteBufferStore;
 import org.elasticsearch.index.translog.memory.MemoryTranslog;
 import org.elasticsearch.threadpool.ThreadPool;
-import org.elasticsearch.threadpool.dynamic.DynamicThreadPool;
+import org.elasticsearch.threadpool.scaling.ScalingThreadPool;
 import org.elasticsearch.util.StopWatch;
 import org.elasticsearch.util.TimeValue;
 import org.elasticsearch.util.lucene.Lucene;
@@ -285,7 +285,7 @@ public class SimpleEngineBenchmark {
 
         store.deleteContent();
 
-        ThreadPool threadPool = new DynamicThreadPool();
+        ThreadPool threadPool = new ScalingThreadPool();
         SnapshotDeletionPolicy deletionPolicy = new SnapshotDeletionPolicy(new KeepOnlyLastDeletionPolicy(shardId, settings));
         Engine engine = new RobinEngine(shardId, settings, store, deletionPolicy, new MemoryTranslog(shardId, settings), new LogByteSizeMergePolicyProvider(store),
                 new ConcurrentMergeSchedulerProvider(shardId, settings), new AnalysisService(shardId.index()), new SimilarityService(shardId.index()));
diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/dynamic/DynamicThreadPool.java b/modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/scaling/ScalingThreadPool.java
similarity index 92%
rename from modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/dynamic/DynamicThreadPool.java
rename to modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/scaling/ScalingThreadPool.java
index 223a1d7b489..943e4ece350 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/dynamic/DynamicThreadPool.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/threadpool/scaling/ScalingThreadPool.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.elasticsearch.threadpool.dynamic;
+package org.elasticsearch.threadpool.scaling;
 
 import com.google.inject.Inject;
 import org.elasticsearch.threadpool.support.AbstractThreadPool;
@@ -33,7 +33,7 @@ import static org.elasticsearch.util.settings.ImmutableSettings.Builder.*;
 /**
  * @author kimchy (Shay Banon)
  */
-public class DynamicThreadPool extends AbstractThreadPool {
+public class ScalingThreadPool extends AbstractThreadPool {
 
     private final int min;
     private final int max;
@@ -41,11 +41,11 @@ public class DynamicThreadPool extends AbstractThreadPool {
 
     private final int scheduledSize;
 
-    public DynamicThreadPool() {
+    public ScalingThreadPool() {
         this(EMPTY_SETTINGS);
     }
 
-    @Inject public DynamicThreadPool(Settings settings) {
+    @Inject public ScalingThreadPool(Settings settings) {
         super(settings);
         this.min = componentSettings.getAsInt("min", 1);
         this.max = componentSettings.getAsInt("max", 100);
diff --git a/modules/elasticsearch/src/test/java/org/elasticsearch/index/shard/SimpleIndexShardTests.java b/modules/elasticsearch/src/test/java/org/elasticsearch/index/shard/SimpleIndexShardTests.java
index fda657ea06c..bd4c722e394 100644
--- a/modules/elasticsearch/src/test/java/org/elasticsearch/index/shard/SimpleIndexShardTests.java
+++ b/modules/elasticsearch/src/test/java/org/elasticsearch/index/shard/SimpleIndexShardTests.java
@@ -38,7 +38,7 @@ import org.elasticsearch.index.store.Store;
 import org.elasticsearch.index.store.ram.RamStore;
 import org.elasticsearch.index.translog.memory.MemoryTranslog;
 import org.elasticsearch.threadpool.ThreadPool;
-import org.elasticsearch.threadpool.dynamic.DynamicThreadPool;
+import org.elasticsearch.threadpool.scaling.ScalingThreadPool;
 import org.elasticsearch.util.Unicode;
 import org.elasticsearch.util.settings.Settings;
 import org.testng.annotations.AfterMethod;
@@ -75,7 +75,7 @@ public class SimpleIndexShardTests {
                 new LogByteSizeMergePolicyProvider(store), new SerialMergeSchedulerProvider(shardId, settings),
                 analysisService, new SimilarityService(shardId.index()));
 
-        threadPool = new DynamicThreadPool();
+        threadPool = new ScalingThreadPool();
 
         indexShard = new InternalIndexShard(shardId, EMPTY_SETTINGS, store, engine, translog, threadPool, mapperService, queryParserService, filterCache).start();
     }
diff --git a/modules/elasticsearch/src/test/java/org/elasticsearch/monitor/jvm/DeadlockSimulator.java b/modules/elasticsearch/src/test/java/org/elasticsearch/monitor/jvm/DeadlockSimulator.java
index da584e106a8..040a1b30406 100644
--- a/modules/elasticsearch/src/test/java/org/elasticsearch/monitor/jvm/DeadlockSimulator.java
+++ b/modules/elasticsearch/src/test/java/org/elasticsearch/monitor/jvm/DeadlockSimulator.java
@@ -21,7 +21,7 @@ package org.elasticsearch.monitor.jvm;
 
 import org.elasticsearch.monitor.dump.DumpMonitorService;
 import org.elasticsearch.threadpool.ThreadPool;
-import org.elasticsearch.threadpool.dynamic.DynamicThreadPool;
+import org.elasticsearch.threadpool.scaling.ScalingThreadPool;
 
 import static org.elasticsearch.util.settings.ImmutableSettings.Builder.*;
 
@@ -31,7 +31,7 @@ import static org.elasticsearch.util.settings.ImmutableSettings.Builder.*;
 public class DeadlockSimulator {
 
     public static void main(String[] args) {
-        ThreadPool threadPool = new DynamicThreadPool();
+        ThreadPool threadPool = new ScalingThreadPool();
         DumpMonitorService dumpMonitorService = new DumpMonitorService();
         JvmMonitorService jvmMonitorService = new JvmMonitorService(EMPTY_SETTINGS, threadPool, dumpMonitorService).start();
 
diff --git a/modules/elasticsearch/src/test/java/org/elasticsearch/transport/local/SimpleLocalTransportTests.java b/modules/elasticsearch/src/test/java/org/elasticsearch/transport/local/SimpleLocalTransportTests.java
index 66cb97e335e..8d8bc34b32a 100644
--- a/modules/elasticsearch/src/test/java/org/elasticsearch/transport/local/SimpleLocalTransportTests.java
+++ b/modules/elasticsearch/src/test/java/org/elasticsearch/transport/local/SimpleLocalTransportTests.java
@@ -21,7 +21,7 @@ package org.elasticsearch.transport.local;
 
 import org.elasticsearch.cluster.node.Node;
 import org.elasticsearch.threadpool.ThreadPool;
-import org.elasticsearch.threadpool.dynamic.DynamicThreadPool;
+import org.elasticsearch.threadpool.scaling.ScalingThreadPool;
 import org.elasticsearch.transport.*;
 import org.elasticsearch.util.io.stream.StreamInput;
 import org.elasticsearch.util.io.stream.StreamOutput;
@@ -45,7 +45,7 @@ public class SimpleLocalTransportTests {
     private Node serviceBNode;
 
     @BeforeClass public void setUp() {
-        threadPool = new DynamicThreadPool();
+        threadPool = new ScalingThreadPool();
 
         serviceA = new TransportService(new LocalTransport(threadPool), threadPool).start();
         serviceANode = new Node("A", serviceA.boundAddress().publishAddress());
diff --git a/modules/elasticsearch/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java b/modules/elasticsearch/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java
index dc99ca683cc..f238cc6c891 100644
--- a/modules/elasticsearch/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java
+++ b/modules/elasticsearch/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java
@@ -21,7 +21,7 @@ package org.elasticsearch.transport.netty;
 
 import org.elasticsearch.cluster.node.Node;
 import org.elasticsearch.threadpool.ThreadPool;
-import org.elasticsearch.threadpool.dynamic.DynamicThreadPool;
+import org.elasticsearch.threadpool.scaling.ScalingThreadPool;
 import org.elasticsearch.transport.*;
 import org.elasticsearch.util.io.stream.StreamInput;
 import org.elasticsearch.util.io.stream.StreamOutput;
@@ -45,7 +45,7 @@ public class SimpleNettyTransportTests {
     private Node serviceBNode;
 
     @BeforeClass public void setUp() {
-        threadPool = new DynamicThreadPool();
+        threadPool = new ScalingThreadPool();
 
         serviceA = new TransportService(new NettyTransport(threadPool), threadPool).start();
         serviceANode = new Node("A", serviceA.boundAddress().publishAddress());