本文整理了Java中org.elasticsearch.threadpool.ThreadPool.shutdown()
方法的一些代码示例,展示了ThreadPool.shutdown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ThreadPool.shutdown()
方法的具体详情如下:
包路径:org.elasticsearch.threadpool.ThreadPool
类名称:ThreadPool
方法名:shutdown
暂无
代码示例来源:origin: org.elasticsearch/elasticsearch
/**
* Returns <code>true</code> if the given pool was terminated successfully. If the termination timed out,
* the service is <code>null</code> this method will return <code>false</code>.
*/
public static boolean terminate(ThreadPool pool, long timeout, TimeUnit timeUnit) {
if (pool != null) {
try {
pool.shutdown();
if (awaitTermination(pool, timeout, timeUnit)) {
return true;
}
// last resort
pool.shutdownNow();
return awaitTermination(pool, timeout, timeUnit);
} finally {
IOUtils.closeWhileHandlingException(pool);
}
}
return false;
}
代码示例来源:origin: com.strapdata.elasticsearch.test/framework
@After
@Override
public void tearDown() throws Exception {
super.tearDown();
threadPool.shutdown();
}
代码示例来源:origin: org.elasticsearch/elasticsearch
toClose.add(() -> injector.getInstance(ThreadPool.class).shutdown());
toClose.add(() -> {
try {
代码示例来源:origin: harbby/presto-connectors
/**
* Returns <code>true</code> if the given pool was terminated successfully. If the termination timed out,
* the service is <code>null</code> this method will return <code>false</code>.
*/
public static boolean terminate(ThreadPool pool, long timeout, TimeUnit timeUnit) {
if (pool != null) {
pool.shutdown();
try {
if (pool.awaitTermination(timeout, timeUnit)) {
return true;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
// last resort
pool.shutdownNow();
}
return false;
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
/**
* Returns <code>true</code> if the given pool was terminated successfully. If the termination timed out,
* the service is <code>null</code> this method will return <code>false</code>.
*/
public static boolean terminate(ThreadPool pool, long timeout, TimeUnit timeUnit) {
if (pool != null) {
try {
pool.shutdown();
if (awaitTermination(pool, timeout, timeUnit)) return true;
// last resort
pool.shutdownNow();
return awaitTermination(pool, timeout, timeUnit);
} finally {
IOUtils.closeWhileHandlingException(pool);
}
}
return false;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
/**
* Returns <code>true</code> if the given pool was terminated successfully. If the termination timed out,
* the service is <code>null</code> this method will return <code>false</code>.
*/
public static boolean terminate(ThreadPool pool, long timeout, TimeUnit timeUnit) {
if (pool != null) {
try {
pool.shutdown();
if (awaitTermination(pool, timeout, timeUnit)) {
return true;
}
// last resort
pool.shutdownNow();
return awaitTermination(pool, timeout, timeUnit);
} finally {
IOUtils.closeWhileHandlingException(pool);
}
}
return false;
}
代码示例来源:origin: apache/servicemix-bundles
/**
* Returns <code>true</code> if the given pool was terminated successfully. If the termination timed out,
* the service is <code>null</code> this method will return <code>false</code>.
*/
public static boolean terminate(ThreadPool pool, long timeout, TimeUnit timeUnit) {
if (pool != null) {
try {
pool.shutdown();
if (awaitTermination(pool, timeout, timeUnit)) {
return true;
}
// last resort
pool.shutdownNow();
return awaitTermination(pool, timeout, timeUnit);
} finally {
IOUtils.closeWhileHandlingException(pool);
}
}
return false;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
toClose.add(() -> injector.getInstance(ThreadPool.class).shutdown());
toClose.add(() -> {
try {
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
toClose.add(() -> injector.getInstance(ThreadPool.class).shutdown());
toClose.add(() -> {
try {
代码示例来源:origin: apache/servicemix-bundles
toClose.add(() -> injector.getInstance(ThreadPool.class).shutdown());
toClose.add(() -> {
try {
代码示例来源:origin: org.fusesource.insight/insight-elasticsearch
injector.getInstance(ThreadPool.class).shutdown();
try {
injector.getInstance(ThreadPool.class).awaitTermination(10, TimeUnit.SECONDS);
代码示例来源:origin: harbby/presto-connectors
injector.getInstance(ThreadPool.class).shutdown();
try {
injector.getInstance(ThreadPool.class).awaitTermination(10, TimeUnit.SECONDS);
代码示例来源:origin: io.fabric8.insight/insight-elasticsearch
injector.getInstance(ThreadPool.class).shutdown();
try {
injector.getInstance(ThreadPool.class).awaitTermination(10, TimeUnit.SECONDS);
内容来源于网络,如有侵权,请联系作者删除!