本文整理汇总了Java中org.elasticsearch.threadpool.ThreadPool.terminate方法的典型用法代码示例。如果您正苦于以下问题:Java ThreadPool.terminate方法的具体用法?Java ThreadPool.terminate怎么用?Java ThreadPool.terminate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.threadpool.ThreadPool
的用法示例。
在下文中一共展示了ThreadPool.terminate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doStop
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
protected synchronized void doStop() {
for (NotifyTimeout onGoingTimeout : onGoingTimeouts) {
onGoingTimeout.cancel();
try {
onGoingTimeout.cancel();
onGoingTimeout.listener.onClose();
} catch (Exception ex) {
logger.debug("failed to notify listeners on shutdown", ex);
}
}
ThreadPool.terminate(threadPoolExecutor, 10, TimeUnit.SECONDS);
// close timeout listeners that did not have an ongoing timeout
timeoutClusterStateListeners.forEach(TimeoutClusterStateListener::onClose);
removeListener(localNodeMasterListeners);
}
示例2: tearDown
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void tearDown() throws Exception {
try {
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
} finally {
super.tearDown();
}
}
示例3: doStop
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
protected void doStop() {
FutureUtils.cancel(this.reconnectToNodes);
for (NotifyTimeout onGoingTimeout : onGoingTimeouts) {
onGoingTimeout.cancel();
onGoingTimeout.listener.onClose();
}
ThreadPool.terminate(updateTasksExecutor, 10, TimeUnit.SECONDS);
remove(localNodeMasterListeners);
}
示例4: close
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void close() {
try {
ThreadPool.terminate(threadPool(), 10, TimeUnit.SECONDS);
} catch (Exception e) {
throw new ElasticsearchException(e.getMessage(), e);
}
}
示例5: tearDown
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
@After
public void tearDown() throws Exception {
transportService.stop();
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
threadPool = null;
super.tearDown();
}
示例6: destroyThreadPool
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@AfterClass
public static void destroyThreadPool() {
ThreadPool.terminate(THREAD_POOL, 30, TimeUnit.SECONDS);
// since static must set to null to be eligible for collection
THREAD_POOL = null;
}
示例7: close
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void close() {
ThreadPool.terminate(unicastZenPingExecutorService, 10, TimeUnit.SECONDS);
Releasables.close(activePingingRounds.values());
closed = true;
}
示例8: afterClass
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@AfterClass
public static void afterClass() {
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
threadPool = null;
}
示例9: shutdownThreadPool
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@AfterClass
public static void shutdownThreadPool() {
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
threadPool = null;
}
示例10: terminateThreadPool
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@AfterClass
public static void terminateThreadPool() {
ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
// since static must set to null to be eligible for collection
threadPool = null;
}
示例11: stopThreadPool
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@AfterClass
public static void stopThreadPool() {
ThreadPool.terminate(THREAD_POOL, 30, TimeUnit.SECONDS);
THREAD_POOL = null;
}
示例12: doClose
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
protected void doClose() {
ThreadPool.terminate(workers, 10, TimeUnit.SECONDS);
}
示例13: build
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
/**
* Builds a new instance of the transport client.
*/
public TransportClient build() {
Settings settings = InternalSettingsPreparer.prepareSettings(this.settings);
settings = settingsBuilder()
.put(NettyTransport.PING_SCHEDULE, "5s") // enable by default the transport schedule ping interval
.put(settings)
.put("network.server", false)
.put("node.client", true)
.put(CLIENT_TYPE_SETTING, CLIENT_TYPE)
.build();
PluginsService pluginsService = new PluginsService(settings, null, null, pluginClasses);
this.settings = pluginsService.updatedSettings();
Version version = Version.CURRENT;
final ThreadPool threadPool = new ThreadPool(settings);
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry();
boolean success = false;
try {
ModulesBuilder modules = new ModulesBuilder();
modules.add(new Version.Module(version));
// plugin modules must be added here, before others or we can get crazy injection errors...
for (Module pluginModule : pluginsService.nodeModules()) {
modules.add(pluginModule);
}
modules.add(new PluginsModule(pluginsService));
modules.add(new SettingsModule(this.settings));
modules.add(new NetworkModule(namedWriteableRegistry));
modules.add(new ClusterNameModule(this.settings));
modules.add(new ThreadPoolModule(threadPool));
modules.add(new TransportModule(this.settings, namedWriteableRegistry));
modules.add(new SearchModule() {
@Override
protected void configure() {
// noop
}
});
modules.add(new ActionModule(true));
modules.add(new ClientTransportModule());
modules.add(new CircuitBreakerModule(this.settings));
pluginsService.processModules(modules);
Injector injector = modules.createInjector();
final TransportService transportService = injector.getInstance(TransportService.class);
transportService.start();
transportService.acceptIncomingRequests();
TransportClient transportClient = new TransportClient(injector);
success = true;
return transportClient;
} finally {
if (!success) {
ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS);
}
}
}
示例14: tearDown
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void tearDown() throws Exception {
super.tearDown();
ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS);
}
示例15: close
import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void close() {
ThreadPool.terminate(concurrentStreamPool, 1, TimeUnit.SECONDS);
ThreadPool.terminate(concurrentSmallFileStreamPool, 1, TimeUnit.SECONDS);
}