当前位置: 首页>>代码示例>>Java>>正文


Java ThreadPool.terminate方法代码示例

本文整理汇总了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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:ClusterService.java

示例2: tearDown

import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void tearDown() throws Exception {
    try {
        ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
    } finally {
        super.tearDown();
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:IndexShardTestCase.java

示例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);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:InternalClusterService.java

示例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);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:NoOpClient.java

示例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();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:NodeConnectionsServiceTests.java

示例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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:TransportNodesActionTests.java

示例7: close

import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void close() {
    ThreadPool.terminate(unicastZenPingExecutorService, 10, TimeUnit.SECONDS);
    Releasables.close(activePingingRounds.values());
    closed = true;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:UnicastZenPing.java

示例8: afterClass

import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@AfterClass
public static void afterClass() {
    ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
    threadPool = null;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:NodeJoinControllerTests.java

示例9: shutdownThreadPool

import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@AfterClass
public static void shutdownThreadPool() {
    ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
    threadPool = null;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:IndexShardOperationsLockTests.java

示例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;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:TransportServiceHandshakeTests.java

示例11: stopThreadPool

import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@AfterClass
public static void stopThreadPool() {
    ThreadPool.terminate(THREAD_POOL, 30, TimeUnit.SECONDS);
    THREAD_POOL = null;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:ShardStateActionTests.java

示例12: doClose

import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
protected void doClose() {
    ThreadPool.terminate(workers, 10, TimeUnit.SECONDS);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:LocalTransport.java

示例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);
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:62,代码来源:TransportClient.java

示例14: tearDown

import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void tearDown() throws Exception {
    super.tearDown();
    ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:RemoteClusterServiceTests.java

示例15: close

import org.elasticsearch.threadpool.ThreadPool; //导入方法依赖的package包/类
@Override
public void close() {
    ThreadPool.terminate(concurrentStreamPool, 1, TimeUnit.SECONDS);
    ThreadPool.terminate(concurrentSmallFileStreamPool, 1, TimeUnit.SECONDS);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:6,代码来源:RecoverySettings.java


注:本文中的org.elasticsearch.threadpool.ThreadPool.terminate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。