ThreadPool: Rename dynamic to scaling, closes #75.

This commit is contained in:
kimchy 2010-03-20 03:41:41 +02:00
parent fc47bd6f2f
commit 671bc4e734
6 changed files with 14 additions and 14 deletions

View File

@ -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()));

View File

@ -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);

View File

@ -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();
}

View File

@ -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();

View File

@ -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());

View File

@ -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());