本文整理了Java中org.elasticsearch.threadpool.ThreadPool.<init>()
方法的一些代码示例,展示了ThreadPool.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ThreadPool.<init>()
方法的具体详情如下:
包路径:org.elasticsearch.threadpool.ThreadPool
类名称:ThreadPool
方法名:<init>
暂无
代码示例来源:origin: NLPchina/elasticsearch-sql
public static String sqlToEsQuery(String sql) throws Exception {
Map actions = new HashMap();
Settings settings = Settings.builder().build();
// Client client = new NodeClient(settings, null, null, actions);
// Settings.builder()
// .put(ThreadContext.PREFIX + ".key1", "val1")
// .put(ThreadContext.PREFIX + ".key2", "val 2")
// .build();
ThreadPool threadPool = new ThreadPool(settings);
Client client = new NodeClient(settings, threadPool);
SearchDao searchDao = new org.nlpcn.es4sql.SearchDao(client);
try {
return searchDao.explain(sql).explain().explain();
} catch (Exception e) {
throw e;
}
}
代码示例来源:origin: org.elasticsearch/elasticsearch
.build();
final List<Closeable> resourcesToClose = new ArrayList<>();
final ThreadPool threadPool = new ThreadPool(settings);
resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS));
final NetworkService networkService = new NetworkService(Collections.emptyList());
代码示例来源:origin: com.bazaarvoice.elasticsearch.client/es-client-java-core
@Override public ThreadPool threadPool() {
// TODO flesh out client
final ThreadPool dummyThreadPool = new ThreadPool("dummy");
return dummyThreadPool;
}
代码示例来源:origin: dadoonet/fscrawler
(request, bulkListener) -> client.bulkAsync(request, bulkListener);
threadPool = new ThreadPool(Settings.builder().put("node.name", "fscrawler-client").build());
bulkProcessor = new BulkProcessor.Builder(bulkConsumer, new DebugListener(logger), threadPool)
.setBulkActions(settings.getElasticsearch().getBulkSize())
代码示例来源:origin: org.elasticsearch/elasticsearch
final ThreadPool threadPool = new ThreadPool(settings, executorBuilders.toArray(new ExecutorBuilder[0]));
resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS));
代码示例来源:origin: stackoverflow.com
ThreadPool threadPool = new ThreadPool();
threadPool.setName(executorName.getKeyProperty("name"));
threadPool.setMaxThreads(JmxTools.getIntAttr(server, executorName, "maxThreads"));
threadPool.setMaxSpareThreads(JmxTools.getIntAttr(server, executorName, "largestPoolSize"));
threadPool.setMinSpareThreads(JmxTools.getIntAttr(server, executorName, "minSpareThreads"));
threadPool.setCurrentThreadsBusy(JmxTools.getIntAttr(server, executorName, "activeCount"));
threadPool.setCurrentThreadCount(JmxTools.getIntAttr(server, executorName, "poolSize"));
代码示例来源:origin: org.nlpcn/elasticsearch-sql
public static String sqlToEsQuery(String sql) throws Exception {
Map actions = new HashMap();
Settings settings = Settings.builder().build();
// Client client = new NodeClient(settings, null, null, actions);
// Settings.builder()
// .put(ThreadContext.PREFIX + ".key1", "val1")
// .put(ThreadContext.PREFIX + ".key2", "val 2")
// .build();
ThreadPool threadPool = new ThreadPool(settings);
Client client = new NodeClient(settings, threadPool);
SearchDao searchDao = new org.nlpcn.es4sql.SearchDao(client);
try {
return searchDao.explain(sql).explain().explain();
} catch (Exception e) {
throw e;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
.build();
final List<Closeable> resourcesToClose = new ArrayList<>();
final ThreadPool threadPool = new ThreadPool(settings);
resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS));
final NetworkService networkService = new NetworkService(Collections.emptyList());
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
final Settings settings = Settings.builder().put(defaultSettings).put(pluginsService.updatedSettings()).build();
final List<Closeable> resourcesToClose = new ArrayList<>();
final ThreadPool threadPool = new ThreadPool(settings);
resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS));
final NetworkService networkService = new NetworkService(settings, Collections.emptyList());
代码示例来源:origin: fr.pilato.elasticsearch.crawler/fscrawler-elasticsearch-client-v5
(request, bulkListener) -> client.bulkAsync(request, bulkListener);
threadPool = new ThreadPool(Settings.builder().put("node.name", "fscrawler-client").build());
bulkProcessor = new BulkProcessor.Builder(bulkConsumer, new DebugListener(logger), threadPool)
.setBulkActions(settings.getElasticsearch().getBulkSize())
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
final ThreadPool threadPool = new ThreadPool(settings, executorBuilders.toArray(new ExecutorBuilder[0]));
resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS));
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
final ThreadPool threadPool = new ThreadPool(settings, executorBuilders.toArray(new ExecutorBuilder[0]));
resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS));
代码示例来源:origin: harbby/presto-connectors
final ThreadPool threadPool = new ThreadPool(settings);
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry();
代码示例来源:origin: apache/servicemix-bundles
final ThreadPool threadPool = new ThreadPool(settings, executorBuilders.toArray(new ExecutorBuilder[0]));
resourcesToClose.add(() -> ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS));
代码示例来源:origin: harbby/presto-connectors
final ThreadPool threadPool = new ThreadPool(settings);
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry();
内容来源于网络,如有侵权,请联系作者删除!