Java Code Examples for org.elasticsearch.transport.TransportService#getTaskManager()

The following examples show how to use org.elasticsearch.transport.TransportService#getTaskManager() . 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: TransportSQLAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportSQLAction(
        ClusterService clusterService,
        Settings settings,
        ThreadPool threadPool,
        Analyzer analyzer,
        Planner planner,
        Provider<Executor> executor,
        TransportService transportService,
        StatsTables statsTables,
        ActionFilters actionFilters,
        IndexNameExpressionResolver indexNameExpressionResolver,
        TransportKillJobsNodeAction transportKillJobsNodeAction) {
    super(clusterService, settings, SQLAction.NAME, threadPool,
        analyzer, planner, executor, statsTables, actionFilters,
        indexNameExpressionResolver, transportKillJobsNodeAction,
        transportService.getTaskManager());
    transportService.registerRequestHandler(SQLAction.NAME, SQLRequest.class, ThreadPool.Names.SAME, new TransportHandler());
}
 
Example 2
Source File: TransportSQLBulkAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportSQLBulkAction(ClusterService clusterService,
                              Settings settings,
                              ThreadPool threadPool,
                              Analyzer analyzer,
                              Planner planner,
                              Provider<Executor> executor,
                              TransportService transportService,
                              StatsTables statsTables,
                              ActionFilters actionFilters,
                              IndexNameExpressionResolver indexNameExpressionResolver,
                              TransportKillJobsNodeAction transportKillJobsNodeAction) {
    super(clusterService, settings, SQLBulkAction.NAME, threadPool, analyzer,
        planner, executor, statsTables, actionFilters, indexNameExpressionResolver, transportKillJobsNodeAction,
        transportService.getTaskManager());

    transportService.registerRequestHandler(SQLBulkAction.NAME, SQLBulkRequest.class, ThreadPool.Names.SAME, new TransportHandler());
}
 
Example 3
Source File: TransportReplicaShardIngestAction.java    From elasticsearch-helper with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportReplicaShardIngestAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                         IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
                                         ActionFilters actionFilters,
                                         IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, IngestAction.NAME, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
    this.transportService = transportService;
    this.clusterService = clusterService;
    this.indicesService = indicesService;
    this.shardStateAction = shardStateAction;
    this.transportAction = transportAction();
    this.transportOptions = transportOptions();
    this.executor = executor();
    transportService.registerRequestHandler(transportAction, ReplicaOperationRequest.class,
            ThreadPool.Names.SAME, new ReplicaOperationTransportHandler());
}
 
Example 4
Source File: ClusteringAction.java    From elasticsearch-carrot2 with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportClusteringAction(TransportService transportService,
                                 TransportSearchAction searchAction,
                                 ClusteringContext controllerSingleton,
                                 ActionFilters actionFilters) {
   super(ClusteringAction.NAME,
       actionFilters,
       transportService.getTaskManager());

   this.searchAction = searchAction;
   this.context = controllerSingleton;
   transportService.registerRequestHandler(
       ClusteringAction.NAME,
       ThreadPool.Names.SAME,
       ClusteringActionRequest::new,
       new TransportHandler());
}
 
Example 5
Source File: TransportReplicationAction.java    From crate with Apache License 2.0 6 votes vote down vote up
protected TransportReplicationAction(String actionName,
                                     TransportService transportService,
                                     ClusterService clusterService,
                                     IndicesService indicesService,
                                     ThreadPool threadPool,
                                     ShardStateAction shardStateAction,
                                     IndexNameExpressionResolver indexNameExpressionResolver,
                                     Writeable.Reader<Request> reader,
                                     Writeable.Reader<ReplicaRequest> replicaReader,
                                     String executor,
                                     boolean syncGlobalCheckpointAfterOperation) {
    super(actionName, threadPool, indexNameExpressionResolver, transportService.getTaskManager());
    this.transportService = transportService;
    this.clusterService = clusterService;
    this.indicesService = indicesService;
    this.shardStateAction = shardStateAction;
    this.executor = executor;

    this.transportPrimaryAction = actionName + "[p]";
    this.transportReplicaAction = actionName + "[r]";
    registerRequestHandlers(actionName, transportService, reader, replicaReader, executor);

    this.transportOptions = transportOptions();

    this.syncGlobalCheckpointAfterOperation = syncGlobalCheckpointAfterOperation;
}
 
Example 6
Source File: HandledTransportAction.java    From crate with Apache License 2.0 6 votes vote down vote up
protected HandledTransportAction(String actionName,
                                 boolean canTripCircuitBreaker,
                                 ThreadPool threadPool,
                                 TransportService transportService,
                                 Writeable.Reader<Request> requestReader,
                                 IndexNameExpressionResolver indexNameExpressionResolver) {
    super(actionName, threadPool, indexNameExpressionResolver, transportService.getTaskManager());
    transportService.registerRequestHandler(
        actionName,
        ThreadPool.Names.SAME,
        false,
        canTripCircuitBreaker,
        requestReader,
        new TransportHandler()
    );
}
 
Example 7
Source File: AppendLuceneTransportAction.java    From ES-Fastloader with Apache License 2.0 5 votes vote down vote up
@Inject
public AppendLuceneTransportAction(Settings settings,
                                   ThreadPool threadPool,
                                   ActionFilters actionFilters,
                                   IndexNameExpressionResolver indexNameExpressionResolver,
                                   TransportService transportService,
                                   IndicesService indexServices) {

    super(settings, AppendLuceneAction.NAME, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
    this.threadPool = threadPool;
    this.indicesService = indexServices;
}
 
Example 8
Source File: InternalClusterService.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public InternalClusterService(Settings settings, DiscoveryService discoveryService, OperationRouting operationRouting, TransportService transportService,
                              NodeSettingsService nodeSettingsService, ThreadPool threadPool, ClusterName clusterName, DiscoveryNodeService discoveryNodeService, Version version) {
    super(settings);
    this.operationRouting = operationRouting;
    this.transportService = transportService;
    this.discoveryService = discoveryService;
    this.threadPool = threadPool;
    this.nodeSettingsService = nodeSettingsService;
    this.discoveryNodeService = discoveryNodeService;
    this.version = version;

    // will be replaced on doStart.
    this.clusterState = ClusterState.builder(clusterName).build();

    this.nodeSettingsService.setClusterService(this);
    this.nodeSettingsService.addListener(new ApplySettings());

    this.reconnectInterval = this.settings.getAsTime(SETTING_CLUSTER_SERVICE_RECONNECT_INTERVAL, TimeValue.timeValueSeconds(10));

    this.slowTaskLoggingThreshold = this.settings.getAsTime(SETTING_CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD, TimeValue.timeValueSeconds(30));

    localNodeMasterListeners = new LocalNodeMasterListeners(threadPool);

    initialBlocks = ClusterBlocks.builder().addGlobalBlock(discoveryService.getNoMasterBlock());

    taskManager = transportService.getTaskManager();

    this.auditService = new AuditService(nodeSettingsService);
}
 
Example 9
Source File: BaseTransportCoordinateSearchAction.java    From siren-join with GNU Affero General Public License v3.0 5 votes vote down vote up
protected BaseTransportCoordinateSearchAction(final Settings settings, final String actionName,
                                              final ThreadPool threadPool, final TransportService transportService,
                                              final ActionFilters actionFilters,
                                              final IndexNameExpressionResolver indexNameExpressionResolver,
                                              final Client client, Class<Request> request) {
  super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
  // Use the generic threadpool, as we can end up with deadlock with the SEARCH threadpool
  transportService.registerRequestHandler(actionName, request, ThreadPool.Names.GENERIC, new TransportHandler());
  this.client = client;
}
 
Example 10
Source File: TransportLangdetectAction.java    From elasticsearch-plugin-bundle with GNU Affero General Public License v3.0 5 votes vote down vote up
@Inject
public TransportLangdetectAction(Settings settings, ThreadPool threadPool,
                                 ActionFilters actionFilters,
                                 IndexNameExpressionResolver indexNameExpressionResolver,
                                 TransportService transportService) {
    super(settings, LangdetectAction.NAME, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
    services.put("", new LangdetectService(settings));
}
 
Example 11
Source File: TransportISBNFormatAction.java    From elasticsearch-plugin-bundle with GNU Affero General Public License v3.0 5 votes vote down vote up
@Inject
public TransportISBNFormatAction(Settings settings, ThreadPool threadPool,
                                 ActionFilters actionFilters,
                                 IndexNameExpressionResolver indexNameExpressionResolver,
                                 TransportService transportService,
                                 StandardnumberService standardnumberService) {
    super(settings, ISBNFormatAction.NAME, threadPool, actionFilters, indexNameExpressionResolver,
            transportService.getTaskManager());
    this.standardnumberService = standardnumberService;
}
 
Example 12
Source File: TransportLeaderShardIngestAction.java    From elasticsearch-helper with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportLeaderShardIngestAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                        IndicesService indicesService, ThreadPool threadPool,
                                        ActionFilters actionFilters,
                                        IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, IngestAction.NAME, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
    this.transportService = transportService;
    this.clusterService = clusterService;
    this.indicesService = indicesService;
    this.transportAction = transportAction();
    this.transportOptions = transportOptions();
    this.executor = executor();
    transportService.registerRequestHandler(transportAction, IngestLeaderShardRequest.class,
            ThreadPool.Names.SAME, new LeaderOperationTransportHandler());
}
 
Example 13
Source File: ListAlgorithmsAction.java    From elasticsearch-carrot2 with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportListAlgorithmsAction(TransportService transportService,
                                     ClusteringContext controllerSingleton,
                                     ActionFilters actionFilters) {
    super(ListAlgorithmsAction.NAME,
          actionFilters,
          transportService.getTaskManager());
    this.controllerSingleton = controllerSingleton;
    transportService.registerRequestHandler(
            ListAlgorithmsAction.NAME,
            ThreadPool.Names.SAME,
            ListAlgorithmsActionRequest::new,
            new TransportHandler());
}
 
Example 14
Source File: HandledTransportAction.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
protected HandledTransportAction(Settings settings, String actionName, ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Class<Request> request) {
    super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
    transportService.registerRequestHandler(actionName, request, ThreadPool.Names.SAME, new TransportHandler());
}
 
Example 15
Source File: HandledTransportAction.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
protected HandledTransportAction(Settings settings, String actionName, ThreadPool threadPool, TransportService transportService,
                                 ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
                                 Callable<Request> request) {
    super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
    transportService.registerRequestHandler(actionName, request, ThreadPool.Names.SAME, new TransportHandler());
}
 
Example 16
Source File: PrimaryReplicaSyncer.java    From crate with Apache License 2.0 4 votes vote down vote up
@Inject
public PrimaryReplicaSyncer(TransportService transportService, TransportResyncReplicationAction syncAction) {
    this(transportService.getTaskManager(), syncAction);
}