Java Code Examples for org.elasticsearch.common.util.concurrent.EsExecutors#newSinglePrioritizing()

The following examples show how to use org.elasticsearch.common.util.concurrent.EsExecutors#newSinglePrioritizing() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InternalClusterService.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
protected void doStart() {
    add(localNodeMasterListeners);
    add(taskManager);
    this.clusterState = ClusterState.builder(clusterState).blocks(initialBlocks).build();
    this.updateTasksExecutor = EsExecutors.newSinglePrioritizing(UPDATE_THREAD_NAME, daemonThreadFactory(settings, UPDATE_THREAD_NAME));
    this.reconnectToNodes = threadPool.schedule(reconnectInterval, ThreadPool.Names.GENERIC, new ReconnectToNodes());
    Map<String, String> nodeAttributes = discoveryNodeService.buildAttributes();
    // note, we rely on the fact that its a new id each time we start, see FD and "kill -9" handling
    final String nodeId = DiscoveryService.generateNodeId(settings);
    final TransportAddress publishAddress = transportService.boundAddress().publishAddress();
    DiscoveryNode localNode = new DiscoveryNode(settings.get("name"), nodeId, publishAddress, nodeAttributes, version);
    DiscoveryNodes.Builder nodeBuilder = DiscoveryNodes.builder().put(localNode).localNodeId(localNode.id());
    this.clusterState = ClusterState.builder(clusterState).nodes(nodeBuilder).blocks(initialBlocks).build();
    this.transportService.setLocalNode(localNode);
}
 
Example 2
Source File: MasterService.java    From crate with Apache License 2.0 4 votes vote down vote up
protected PrioritizedEsThreadPoolExecutor createThreadPoolExecutor() {
    return EsExecutors.newSinglePrioritizing(
            nodeName + "/" + MASTER_UPDATE_THREAD_NAME,
            daemonThreadFactory(nodeName, MASTER_UPDATE_THREAD_NAME),
            threadPool.scheduler());
}
 
Example 3
Source File: ClusterApplierService.java    From crate with Apache License 2.0 4 votes vote down vote up
protected PrioritizedEsThreadPoolExecutor createThreadPoolExecutor() {
    return EsExecutors.newSinglePrioritizing(
        nodeName + "/" + CLUSTER_UPDATE_THREAD_NAME,
        daemonThreadFactory(nodeName, CLUSTER_UPDATE_THREAD_NAME),
        threadPool.scheduler());
}