rename executors to esexecutors
This commit is contained in:
parent
b0d736b489
commit
d848ab3df3
|
@ -28,7 +28,7 @@ import org.elasticsearch.action.support.nodes.NodesOperationRequest;
|
||||||
*/
|
*/
|
||||||
public class NodesInfoRequest extends NodesOperationRequest {
|
public class NodesInfoRequest extends NodesOperationRequest {
|
||||||
|
|
||||||
protected NodesInfoRequest() {
|
public NodesInfoRequest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import static java.util.concurrent.Executors.*;
|
import static java.util.concurrent.Executors.*;
|
||||||
import static org.elasticsearch.cluster.ClusterState.*;
|
import static org.elasticsearch.cluster.ClusterState.*;
|
||||||
import static org.elasticsearch.common.unit.TimeValue.*;
|
import static org.elasticsearch.common.unit.TimeValue.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
|
|
|
@ -30,7 +30,7 @@ import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.util.concurrent.ThreadFactory;
|
||||||
/**
|
/**
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
*/
|
*/
|
||||||
public class Executors {
|
public class EsExecutors {
|
||||||
|
|
||||||
public static ThreadFactory daemonThreadFactory(Settings settings, String namePrefix) {
|
public static ThreadFactory daemonThreadFactory(Settings settings, String namePrefix) {
|
||||||
String name = settings.get("name");
|
String name = settings.get("name");
|
||||||
|
@ -74,6 +74,6 @@ public class Executors {
|
||||||
/**
|
/**
|
||||||
* Cannot instantiate.
|
* Cannot instantiate.
|
||||||
*/
|
*/
|
||||||
private Executors() {
|
private EsExecutors() {
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -52,7 +52,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||||
import static org.elasticsearch.cluster.node.DiscoveryNode.*;
|
import static org.elasticsearch.cluster.node.DiscoveryNode.*;
|
||||||
import static org.elasticsearch.common.settings.ImmutableSettings.Builder.*;
|
import static org.elasticsearch.common.settings.ImmutableSettings.Builder.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.ConcurrentCollections.*;
|
import static org.elasticsearch.common.util.concurrent.ConcurrentCollections.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
|
|
|
@ -44,7 +44,7 @@ import static java.util.concurrent.Executors.*;
|
||||||
import static org.elasticsearch.cluster.ClusterState.*;
|
import static org.elasticsearch.cluster.ClusterState.*;
|
||||||
import static org.elasticsearch.cluster.metadata.MetaData.*;
|
import static org.elasticsearch.cluster.metadata.MetaData.*;
|
||||||
import static org.elasticsearch.common.unit.TimeValue.*;
|
import static org.elasticsearch.common.unit.TimeValue.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
|
|
|
@ -53,7 +53,7 @@ import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
import static org.elasticsearch.common.network.NetworkService.TcpSettings.*;
|
import static org.elasticsearch.common.network.NetworkService.TcpSettings.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
|
|
|
@ -34,7 +34,7 @@ import javax.management.remote.JMXServiceURL;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import static java.util.concurrent.Executors.*;
|
import static java.util.concurrent.Executors.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (Shay Banon)
|
* @author kimchy (Shay Banon)
|
||||||
|
|
|
@ -24,7 +24,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.ByteSizeUnit;
|
import org.elasticsearch.common.unit.ByteSizeUnit;
|
||||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.util.concurrent.Executors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.common.util.concurrent.TransferThreadPoolExecutor;
|
import org.elasticsearch.common.util.concurrent.TransferThreadPoolExecutor;
|
||||||
import org.elasticsearch.threadpool.support.AbstractThreadPool;
|
import org.elasticsearch.threadpool.support.AbstractThreadPool;
|
||||||
|
|
||||||
|
@ -62,8 +62,8 @@ public class BlockingThreadPool extends AbstractThreadPool {
|
||||||
this.waitTime = componentSettings.getAsTime("wait_time", timeValueSeconds(60));
|
this.waitTime = componentSettings.getAsTime("wait_time", timeValueSeconds(60));
|
||||||
this.keepAlive = componentSettings.getAsTime("keep_alive", timeValueSeconds(60));
|
this.keepAlive = componentSettings.getAsTime("keep_alive", timeValueSeconds(60));
|
||||||
logger.debug("Initializing {} thread pool with min[{}], max[{}], keep_alive[{}], capacity[{}], wait_time[{}], scheduled_size[{}]", getType(), min, max, keepAlive, capacity, waitTime, scheduledSize);
|
logger.debug("Initializing {} thread pool with min[{}], max[{}], keep_alive[{}], capacity[{}], wait_time[{}], scheduled_size[{}]", getType(), min, max, keepAlive, capacity, waitTime, scheduledSize);
|
||||||
executorService = TransferThreadPoolExecutor.newBlockingExecutor(min, max, keepAlive.millis(), TimeUnit.MILLISECONDS, waitTime.millis(), TimeUnit.MILLISECONDS, capacity, Executors.daemonThreadFactory(settings, "[tp]"));
|
executorService = TransferThreadPoolExecutor.newBlockingExecutor(min, max, keepAlive.millis(), TimeUnit.MILLISECONDS, waitTime.millis(), TimeUnit.MILLISECONDS, capacity, EsExecutors.daemonThreadFactory(settings, "[tp]"));
|
||||||
scheduledExecutorService = java.util.concurrent.Executors.newScheduledThreadPool(scheduledSize, Executors.daemonThreadFactory(settings, "[sc]"));
|
scheduledExecutorService = java.util.concurrent.Executors.newScheduledThreadPool(scheduledSize, EsExecutors.daemonThreadFactory(settings, "[sc]"));
|
||||||
started = true;
|
started = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ package org.elasticsearch.threadpool.cached;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.util.concurrent.Executors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.threadpool.support.AbstractThreadPool;
|
import org.elasticsearch.threadpool.support.AbstractThreadPool;
|
||||||
|
|
||||||
import java.util.concurrent.SynchronousQueue;
|
import java.util.concurrent.SynchronousQueue;
|
||||||
|
@ -55,8 +55,8 @@ public class CachedThreadPool extends AbstractThreadPool {
|
||||||
executorService = new ThreadPoolExecutor(0, Integer.MAX_VALUE,
|
executorService = new ThreadPoolExecutor(0, Integer.MAX_VALUE,
|
||||||
keepAlive.millis(), TimeUnit.MILLISECONDS,
|
keepAlive.millis(), TimeUnit.MILLISECONDS,
|
||||||
new SynchronousQueue<Runnable>(),
|
new SynchronousQueue<Runnable>(),
|
||||||
Executors.daemonThreadFactory(settings, "[tp]"));
|
EsExecutors.daemonThreadFactory(settings, "[tp]"));
|
||||||
scheduledExecutorService = java.util.concurrent.Executors.newScheduledThreadPool(scheduledSize, Executors.daemonThreadFactory(settings, "[sc]"));
|
scheduledExecutorService = java.util.concurrent.Executors.newScheduledThreadPool(scheduledSize, EsExecutors.daemonThreadFactory(settings, "[sc]"));
|
||||||
started = true;
|
started = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ package org.elasticsearch.threadpool.scaling;
|
||||||
import org.elasticsearch.common.inject.Inject;
|
import org.elasticsearch.common.inject.Inject;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.util.concurrent.Executors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.common.util.concurrent.TransferThreadPoolExecutor;
|
import org.elasticsearch.common.util.concurrent.TransferThreadPoolExecutor;
|
||||||
import org.elasticsearch.threadpool.support.AbstractThreadPool;
|
import org.elasticsearch.threadpool.support.AbstractThreadPool;
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ public class ScalingThreadPool extends AbstractThreadPool {
|
||||||
this.keepAlive = componentSettings.getAsTime("keep_alive", timeValueSeconds(60));
|
this.keepAlive = componentSettings.getAsTime("keep_alive", timeValueSeconds(60));
|
||||||
this.scheduledSize = componentSettings.getAsInt("scheduled_size", 20);
|
this.scheduledSize = componentSettings.getAsInt("scheduled_size", 20);
|
||||||
logger.debug("Initializing {} thread pool with min[{}], max[{}], keep_alive[{}], scheduled_size[{}]", getType(), min, max, keepAlive, scheduledSize);
|
logger.debug("Initializing {} thread pool with min[{}], max[{}], keep_alive[{}], scheduled_size[{}]", getType(), min, max, keepAlive, scheduledSize);
|
||||||
scheduledExecutorService = java.util.concurrent.Executors.newScheduledThreadPool(scheduledSize, Executors.daemonThreadFactory(settings, "[sc]"));
|
scheduledExecutorService = java.util.concurrent.Executors.newScheduledThreadPool(scheduledSize, EsExecutors.daemonThreadFactory(settings, "[sc]"));
|
||||||
executorService = TransferThreadPoolExecutor.newScalingExecutor(min, max, keepAlive.nanos(), TimeUnit.NANOSECONDS, Executors.daemonThreadFactory(settings, "[tp]"));
|
executorService = TransferThreadPoolExecutor.newScalingExecutor(min, max, keepAlive.nanos(), TimeUnit.NANOSECONDS, EsExecutors.daemonThreadFactory(settings, "[tp]"));
|
||||||
started = true;
|
started = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.concurrent.ScheduledFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static org.elasticsearch.common.unit.TimeValue.*;
|
import static org.elasticsearch.common.unit.TimeValue.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (Shay Banon)
|
* @author kimchy (Shay Banon)
|
||||||
|
|
|
@ -70,7 +70,7 @@ import static org.elasticsearch.common.settings.ImmutableSettings.Builder.*;
|
||||||
import static org.elasticsearch.common.transport.NetworkExceptionHelper.*;
|
import static org.elasticsearch.common.transport.NetworkExceptionHelper.*;
|
||||||
import static org.elasticsearch.common.unit.TimeValue.*;
|
import static org.elasticsearch.common.unit.TimeValue.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.ConcurrentCollections.*;
|
import static org.elasticsearch.common.util.concurrent.ConcurrentCollections.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
import static org.elasticsearch.transport.Transport.Helper.*;
|
import static org.elasticsearch.transport.Transport.Helper.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,7 +23,7 @@ import com.google.inject.Module;
|
||||||
import org.elasticsearch.cloud.jclouds.logging.JCloudsLoggingModule;
|
import org.elasticsearch.cloud.jclouds.logging.JCloudsLoggingModule;
|
||||||
import org.elasticsearch.common.collect.ImmutableList;
|
import org.elasticsearch.common.collect.ImmutableList;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.util.concurrent.Executors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.jclouds.concurrent.config.ExecutorServiceModule;
|
import org.jclouds.concurrent.config.ExecutorServiceModule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,7 @@ public class JCloudsUtils {
|
||||||
public static Iterable<? extends Module> buildModules(Settings settings) {
|
public static Iterable<? extends Module> buildModules(Settings settings) {
|
||||||
return ImmutableList.of(new JCloudsLoggingModule(settings),
|
return ImmutableList.of(new JCloudsLoggingModule(settings),
|
||||||
new ExecutorServiceModule(
|
new ExecutorServiceModule(
|
||||||
java.util.concurrent.Executors.newCachedThreadPool(Executors.daemonThreadFactory(settings, "jclouds-user")),
|
java.util.concurrent.Executors.newCachedThreadPool(EsExecutors.daemonThreadFactory(settings, "jclouds-user")),
|
||||||
java.util.concurrent.Executors.newCachedThreadPool(Executors.daemonThreadFactory(settings, "jclouds-io"))));
|
java.util.concurrent.Executors.newCachedThreadPool(EsExecutors.daemonThreadFactory(settings, "jclouds-io"))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ import java.io.IOException;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
|
|
|
@ -49,7 +49,7 @@ import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
import static org.elasticsearch.common.network.NetworkService.TcpSettings.*;
|
import static org.elasticsearch.common.network.NetworkService.TcpSettings.*;
|
||||||
import static org.elasticsearch.common.util.concurrent.Executors.*;
|
import static org.elasticsearch.common.util.concurrent.EsExecutors.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
|
|
Loading…
Reference in New Issue