Java Code Examples for org.elasticsearch.cluster.ClusterService

The following examples show how to use org.elasticsearch.cluster.ClusterService. These examples are extracted from open source projects. 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 Project: Elasticsearch   Source File: ReferenceInfos.java    License: Apache License 2.0 6 votes vote down vote up
@Inject
public ReferenceInfos(Map<String, SchemaInfo> builtInSchemas,
                      ClusterService clusterService,
                      IndexNameExpressionResolver indexNameExpressionResolver,
                      ThreadPool threadPool,
                      Provider<TransportPutIndexTemplateAction> transportPutIndexTemplateAction,
                      Functions functions) {
    this.clusterService = clusterService;
    this.indexNameExpressionResolver = indexNameExpressionResolver;
    this.transportPutIndexTemplateAction = transportPutIndexTemplateAction;
    this.functions = functions;
    this.executorService = (ExecutorService) threadPool.executor(ThreadPool.Names.SUGGEST);
    schemas.putAll(builtInSchemas);
    schemas.remove(BlobSchemaInfo.NAME); // remove blob schema name
    this.builtInSchemas = builtInSchemas;
    clusterService.add(this);
}
 
Example 2
Source Project: Elasticsearch   Source File: SnapshotShardsService.java    License: Apache License 2.0 6 votes vote down vote up
@Inject
public SnapshotShardsService(Settings settings, ClusterService clusterService, SnapshotsService snapshotsService, ThreadPool threadPool,
                             TransportService transportService, IndicesService indicesService) {
    super(settings);
    this.indicesService = indicesService;
    this.snapshotsService = snapshotsService;
    this.transportService = transportService;
    this.clusterService = clusterService;
    this.threadPool = threadPool;
    if (DiscoveryNode.dataNode(settings)) {
        // this is only useful on the nodes that can hold data
        // addLast to make sure that Repository will be created before snapshot
        clusterService.addLast(this);
    }

    if (DiscoveryNode.masterNode(settings)) {
        // This needs to run only on nodes that can become masters
        transportService.registerRequestHandler(UPDATE_SNAPSHOT_ACTION_NAME, UpdateIndexShardSnapshotStatusRequest.class, ThreadPool.Names.SAME, new UpdateSnapshotStateRequestHandler());
    }

}
 
Example 3
Source Project: Elasticsearch   Source File: TransportCancelTasksAction.java    License: Apache License 2.0 6 votes vote down vote up
@Inject
public TransportCancelTasksAction(Settings settings, ClusterName clusterName, ThreadPool threadPool, ClusterService clusterService,
                                  TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver
                                      indexNameExpressionResolver) {
    super(settings, CancelTasksAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
        indexNameExpressionResolver, new Callable<CancelTasksRequest>() {
            @Override
            public CancelTasksRequest call() throws Exception {
                return new CancelTasksRequest();
            }
        }, ThreadPool.Names.MANAGEMENT);
    transportService.registerRequestHandler(BAN_PARENT_ACTION_NAME, new Callable<BanParentTaskRequest>() {
        @Override
        public BanParentTaskRequest call() throws Exception {
            return new BanParentTaskRequest();
        }
    }, ThreadPool.Names.SAME, new
        BanParentRequestHandler());
}
 
Example 4
protected InformationSchemataTableInfo(ClusterService clusterService) {
    super(clusterService, IDENT,
            ImmutableList.of(Columns.SCHEMA_NAME),
            ImmutableSortedMap.<ColumnIdent, ReferenceInfo>naturalOrder ()
                    .put(Columns.SCHEMA_NAME, ReferenceInfos.SCHEMA_NAME)
                    .build()
    );
}
 
Example 5
Source Project: Elasticsearch   Source File: TransportSingleShardAction.java    License: Apache License 2.0 5 votes vote down vote up
protected TransportSingleShardAction(Settings settings, String actionName, ThreadPool threadPool, ClusterService clusterService,
                                     TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
                                     Class<Request> request, String executor) {
    super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
    this.clusterService = clusterService;
    this.transportService = transportService;

    this.transportShardAction = actionName + "[s]";
    this.executor = executor;

    if (!isSubAction()) {
        transportService.registerRequestHandler(actionName, request, ThreadPool.Names.SAME, new TransportHandler());
    }
    transportService.registerRequestHandler(transportShardAction, request, executor, new ShardTransportHandler());
}
 
Example 6
@Inject
public TransportCoordinateMultiSearchAction(Settings settings, ThreadPool threadPool,
                                            TransportService transportService, ClusterService clusterService,
                                            FilterJoinCacheService cacheService,
                                            TransportSearchAction search, ActionFilters actionFilters,
                                            IndexNameExpressionResolver indexNameExpressionResolver, Client client) {
  super(settings, CoordinateMultiSearchAction.NAME, threadPool, transportService, actionFilters,
          indexNameExpressionResolver, client, MultiSearchRequest.class);
  this.searchAction = search;
  this.clusterService = clusterService;
  this.cacheService = cacheService;
}
 
Example 7
Source Project: Elasticsearch   Source File: TransportRefreshAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportRefreshAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                              TransportService transportService, ActionFilters actionFilters,
                              IndexNameExpressionResolver indexNameExpressionResolver,
                              TransportShardRefreshAction shardRefreshAction) {
    super(RefreshAction.NAME, RefreshRequest.class, settings, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver, shardRefreshAction);
}
 
Example 8
Source Project: Elasticsearch   Source File: JoinClusterAction.java    License: Apache License 2.0 5 votes vote down vote up
public JoinClusterAction(Settings settings, TransportService transportService, ClusterService clusterService, 
        ThreadPool threadPool, RoutingService routingService) {
    super(settings);
    this.pingTimeout = this.settings.getAsTime(SETTING_PING_TIMEOUT, timeValueSeconds(3));
    this.joinTimeout = settings.getAsTime(SETTING_JOIN_TIMEOUT, TimeValue.timeValueMillis(this.pingTimeout.millis() * 20));
    this.joinRetryAttempts = settings.getAsInt(SETTING_JOIN_RETRY_ATTEMPTS, 3);
    this.joinRetryDelay = settings.getAsTime(SETTING_JOIN_RETRY_DELAY, TimeValue.timeValueMillis(100));
    
    this.transportService = transportService;
    this.clusterService = clusterService;
    this.threadPool = threadPool;
    this.routingService = routingService;
    
    transportService.registerRequestHandler(JOIN_ACTION_NAME, JoinRequest.class, ThreadPool.Names.GENERIC, new JoinRequestRequestHandler());
}
 
Example 9
@Inject
public TransportShardMultiPercolateAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                          TransportService transportService, PercolatorService percolatorService,
                                          ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            Request.class, ThreadPool.Names.PERCOLATE);
    this.percolatorService = percolatorService;
}
 
Example 10
@Inject
public TransportSearchIntoAction(Settings settings,
        ThreadPool threadPool, ClusterService clusterService,
        TransportService transportService, CacheRecycler cacheRecycler,
        IndicesService indicesService, ScriptService scriptService,
        SearchIntoParser parser, Writer writer) {
    super(settings, threadPool, clusterService, transportService, cacheRecycler, indicesService,
        scriptService, parser, writer);
}
 
Example 11
Source Project: Elasticsearch   Source File: DLBasedIndexShard.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public DLBasedIndexShard(ShardId shardId,
        IndexSettingsService indexSettingsService,
        IndicesLifecycle indicesLifecycle, Store store,
        StoreRecoveryService storeRecoveryService, ThreadPool threadPool,
        MapperService mapperService,
        IndexQueryParserService queryParserService, IndexCache indexCache,
        IndexAliasesService indexAliasesService,
        IndicesQueryCache indicesQueryCache,
        ShardPercolateService shardPercolateService,
        CodecService codecService,
        ShardTermVectorsService termVectorsService,
        IndexFieldDataService indexFieldDataService,
        IndexService indexService, IndicesWarmer warmer,
        SnapshotDeletionPolicy deletionPolicy,
        SimilarityService similarityService, EngineFactory factory,
        ClusterService clusterService, ShardPath path, BigArrays bigArrays,
        IndexSearcherWrappingService wrappingService,
        IndexingMemoryController indexingMemoryController,
        TransportGetOrChangePrimaryShardLeaseAction checkLeaseAction,
        TransportIndexShardStatsAction indexShardStatsAction,
        SearchService shardSearchService) {
    super(shardId, indexSettingsService, indicesLifecycle, store,
            storeRecoveryService, threadPool, mapperService, queryParserService,
            indexCache, indexAliasesService, indicesQueryCache,
            shardPercolateService, codecService, termVectorsService,
            indexFieldDataService, indexService, warmer, deletionPolicy,
            similarityService, factory, clusterService, path, bigArrays,
            wrappingService, indexingMemoryController, shardSearchService);
    this.localNodeId = clusterService.state().nodes().localNodeId();
    this.checkLeaseAction = checkLeaseAction;
    this.indexShardStatsAction = indexShardStatsAction;
}
 
Example 12
Source Project: Elasticsearch   Source File: SysChecksTableInfo.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
protected SysChecksTableInfo(ClusterService clusterService) {
    super(IDENT, new ColumnRegistrar(IDENT, GRANULARITY)
                    .register(Columns.ID, DataTypes.INTEGER)
                    .register(Columns.SEVERITY, DataTypes.INTEGER)
                    .register(Columns.DESCRIPTION, DataTypes.STRING)
                    .register(Columns.PASSED, DataTypes.BOOLEAN),
            PRIMARY_KEYS);
    this.clusterService = clusterService;
}
 
Example 13
@Inject
public AbstractTransportSearchIntoAction(Settings settings,
        ThreadPool threadPool, ClusterService clusterService,
        TransportService transportService, CacheRecycler cacheRecycler,
        IndicesService indicesService, ScriptService scriptService,
        ISearchIntoParser parser, Writer writer) {
    super(settings, threadPool, clusterService, transportService);
    this.indicesService = indicesService;
    this.cacheRecycler = cacheRecycler;
    this.scriptService = scriptService;
    this.parser = parser;
    this.writer = writer;
}
 
Example 14
@Inject
public TransportNodesListGatewayMetaState(Settings settings, ClusterName clusterName, ThreadPool threadPool,
                                          ClusterService clusterService, TransportService transportService,
                                          ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ACTION_NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
            indexNameExpressionResolver, Request.class, NodeRequest.class, ThreadPool.Names.GENERIC);
}
 
Example 15
@Inject
public TransportVerifyRepositoryAction(Settings settings, ClusterName clusterName, TransportService transportService, ClusterService clusterService,
                                       RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
                                       IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, VerifyRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, VerifyRepositoryRequest.class);
    this.repositoriesService = repositoriesService;
    this.clusterName = clusterName;
}
 
Example 16
Source Project: Elasticsearch   Source File: TransportPutMappingAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportPutMappingAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                 ThreadPool threadPool, MetaDataMappingService metaDataMappingService,
                                 ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, PutMappingAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, PutMappingRequest.class);
    this.metaDataMappingService = metaDataMappingService;
}
 
Example 17
Source Project: Elasticsearch   Source File: SysJobsTableInfo.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public SysJobsTableInfo(ClusterService service) {
    super(IDENT, new ColumnRegistrar(IDENT, RowGranularity.DOC)
        .register(Columns.ID, DataTypes.STRING)
        .register(Columns.STMT, DataTypes.STRING)
        .register(Columns.STARTED, DataTypes.TIMESTAMP), PRIMARY_KEY);
    this.service = service;
}
 
Example 18
Source Project: Elasticsearch   Source File: BlobIndex.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public BlobIndex(Index index, IndexSettingsService indexSettingsService,
          OperationRouting operationRouting, ClusterService clusterService) {
    super(index, indexSettingsService.getSettings());
    this.operationRouting = operationRouting;
    this.clusterService = clusterService;
}
 
Example 19
@Inject
public TransportNodesSnapshotsStatus(Settings settings, ClusterName clusterName, ThreadPool threadPool,
                                     ClusterService clusterService, TransportService transportService,
                                     SnapshotShardsService snapshotShardsService, ActionFilters actionFilters,
                                     IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ACTION_NAME, clusterName, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            Request.class, NodeRequest.class, ThreadPool.Names.GENERIC);
    this.snapshotShardsService = snapshotShardsService;
}
 
Example 20
Source Project: Elasticsearch   Source File: TransportSearchScrollAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportSearchScrollAction(Settings settings, ThreadPool threadPool, TransportService transportService,
                                   ClusterService clusterService, SearchServiceTransportAction searchService,
                                   SearchPhaseController searchPhaseController,
                                   ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, SearchScrollAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
            SearchScrollRequest.class);
    this.clusterService = clusterService;
    this.searchService = searchService;
    this.searchPhaseController = searchPhaseController;
}
 
Example 21
Source Project: Elasticsearch   Source File: TransportSearchAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportSearchAction(Settings settings, ThreadPool threadPool, SearchPhaseController searchPhaseController,
                             TransportService transportService, SearchServiceTransportAction searchService,
                             ClusterService clusterService, ActionFilters actionFilters, IndexNameExpressionResolver
                                         indexNameExpressionResolver) {
    super(settings, SearchAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, SearchRequest.class);
    this.searchPhaseController = searchPhaseController;
    this.searchService = searchService;
    this.clusterService = clusterService;
    this.optimizeSingleShard = this.settings.getAsBoolean("action.search.optimize_single_shard", true);
}
 
Example 22
protected InformationRoutinesTableInfo(ClusterService clusterService) {
    super(clusterService,
            IDENT,
            ImmutableList.<ColumnIdent>of(),
            ImmutableSortedMap.<ColumnIdent, ReferenceInfo>naturalOrder()
                .put(Columns.ROUTINE_NAME, ReferenceInfos.ROUTINE_NAME)
                .put(Columns.ROUTINE_TYPE, ReferenceInfos.ROUTINE_TYPE)
                .build()
    );
}
 
Example 23
@Inject
public TransportDumpAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                           TransportService transportService, IndicesService indicesService,
                           ScriptService scriptService, CacheRecycler cacheRecycler,
                           DumpParser dumpParser, Exporter exporter, NodeEnvironment nodeEnv) {
    super(settings, threadPool, clusterService, transportService, indicesService, scriptService,
        cacheRecycler, dumpParser, exporter, nodeEnv);
}
 
Example 24
Source Project: Elasticsearch   Source File: TransportMultiGetAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportMultiGetAction(Settings settings, ThreadPool threadPool, TransportService transportService,
                               ClusterService clusterService, TransportShardMultiGetAction shardAction,
                               ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, MultiGetAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, MultiGetRequest.class);
    this.clusterService = clusterService;
    this.shardAction = shardAction;
}
 
Example 25
Source Project: Elasticsearch   Source File: TransportFlushAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportFlushAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                            TransportService transportService, ActionFilters actionFilters,
                            IndexNameExpressionResolver indexNameExpressionResolver,
                            TransportShardFlushAction replicatedFlushAction) {
    super(FlushAction.NAME, FlushRequest.class, settings, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver, replicatedFlushAction);
}
 
Example 26
Source Project: Elasticsearch   Source File: InformationTableInfo.java    License: Apache License 2.0 5 votes vote down vote up
protected InformationTableInfo(ClusterService clusterService,
                               TableIdent ident,
                               ImmutableList<ColumnIdent> primaryKeyIdentList,
                               Map<ColumnIdent, ReferenceInfo> references,
                               @Nullable ImmutableList<ReferenceInfo> columns) {
    super(ident, references, columns, primaryKeyIdentList);
    this.clusterService = clusterService;
}
 
Example 27
Source Project: Elasticsearch   Source File: TransportKillJobsNodeAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportKillJobsNodeAction(Settings settings,
                                   JobContextService jobContextService,
                                   ClusterService clusterService,
                                   TransportService transportService) {
    super(settings);
    this.jobContextService = jobContextService;
    this.clusterService = clusterService;
    this.transportService = transportService;

    transportService.registerRequestHandler(TRANSPORT_ACTION,
            KillJobsRequest.class,
            ThreadPool.Names.GENERIC,
            new NodeActionRequestHandler<KillJobsRequest, KillResponse>(this) { });
}
 
Example 28
Source Project: Elasticsearch   Source File: BlobTableInfoBuilder.java    License: Apache License 2.0 5 votes vote down vote up
public BlobTableInfoBuilder(TableIdent ident,
                            ClusterService clusterService,
                            IndexNameExpressionResolver indexNameExpressionResolver,
                            BlobEnvironment blobEnvironment,
                            Environment environment,
                            Functions functions) {
    this.clusterService = clusterService;
    this.indexNameExpressionResolver = indexNameExpressionResolver;
    this.blobEnvironment = blobEnvironment;
    this.environment = environment;
    this.functions = functions;
    this.state = clusterService.state();
    this.metaData = state.metaData();
    this.ident = ident;
}
 
Example 29
@Inject
public TransportDeleteRepositoryAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                       RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
                                       IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, DeleteRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, DeleteRepositoryRequest.class);
    this.repositoriesService = repositoriesService;
}
 
Example 30
@Inject
public TransportMultiPercolateAction(Settings settings, ThreadPool threadPool, TransportShardMultiPercolateAction shardMultiPercolateAction,
                                     ClusterService clusterService, TransportService transportService, PercolatorService percolatorService,
                                     TransportMultiGetAction multiGetAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, MultiPercolateAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, MultiPercolateRequest.class);
    this.shardMultiPercolateAction = shardMultiPercolateAction;
    this.clusterService = clusterService;
    this.percolatorService = percolatorService;
    this.multiGetAction = multiGetAction;
}