org.elasticsearch.cluster.action.shard.ShardStateAction Java Examples

The following examples show how to use org.elasticsearch.cluster.action.shard.ShardStateAction. 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: TransportPutChunkAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportPutChunkAction(Settings settings,
                               TransportService transportService,
                               ClusterService clusterService,
                               IndicesService indicesService,
                               ThreadPool threadPool,
                               ShardStateAction shardStateAction,
                               BlobTransferTarget transferTarget,
                               MappingUpdatedAction mappingUpdatedAction,
                               ActionFilters actionFilters,
                               IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, PutChunkAction.NAME, transportService, clusterService,
            indicesService, threadPool, shardStateAction, mappingUpdatedAction, actionFilters,
            indexNameExpressionResolver, PutChunkRequest.class, PutChunkReplicaRequest.class, ThreadPool.Names.INDEX);

    this.transferTarget = transferTarget;
}
 
Example #2
Source File: TransportShardDeleteActionTest.java    From crate with Apache License 2.0 6 votes vote down vote up
@Before
public void prepare() throws Exception {
    indexUUID = UUIDs.randomBase64UUID();
    IndicesService indicesService = mock(IndicesService.class);
    IndexService indexService = mock(IndexService.class);
    when(indicesService.indexServiceSafe(new Index(TABLE_IDENT.indexNameOrAlias(), indexUUID))).thenReturn(indexService);
    indexShard = mock(IndexShard.class);
    when(indexService.getShard(0)).thenReturn(indexShard);


    transportShardDeleteAction = new TransportShardDeleteAction(
        MockTransportService.createNewService(
            Settings.EMPTY, Version.CURRENT, THREAD_POOL, clusterService.getClusterSettings()),
        mock(IndexNameExpressionResolver.class),
        mock(ClusterService.class),
        indicesService,
        mock(ThreadPool.class),
        mock(ShardStateAction.class),
        mock(SchemaUpdateClient.class)
    );
}
 
Example #3
Source File: TransportStartBlobAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportStartBlobAction(Settings settings,
                                TransportService transportService,
                                ClusterService clusterService,
                                IndicesService indicesService,
                                ThreadPool threadPool,
                                ShardStateAction shardStateAction,
                                BlobTransferTarget transferTarget,
                                IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        StartBlobAction.NAME,
        transportService,
        clusterService,
        indicesService,
        threadPool,
        shardStateAction,
        indexNameExpressionResolver,
        StartBlobRequest::new,
        StartBlobRequest::new,
        ThreadPool.Names.WRITE
    );
    this.transferTarget = transferTarget;
    logger.trace("Constructor");
}
 
Example #4
Source File: TransportPutChunkAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportPutChunkAction(TransportService transportService,
                               ClusterService clusterService,
                               IndicesService indicesService,
                               ThreadPool threadPool,
                               ShardStateAction shardStateAction,
                               BlobTransferTarget transferTarget,
                               IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        PutChunkAction.NAME,
        transportService,
        clusterService,
        indicesService,
        threadPool,
        shardStateAction,
        indexNameExpressionResolver,
        PutChunkRequest::new,
        PutChunkReplicaRequest::new,
        ThreadPool.Names.WRITE
    );
    this.transferTarget = transferTarget;
}
 
Example #5
Source File: TransportDeleteBlobAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportDeleteBlobAction(TransportService transportService,
                                 ClusterService clusterService,
                                 IndicesService indicesService,
                                 ThreadPool threadPool,
                                 ShardStateAction shardStateAction,
                                 BlobIndicesService blobIndicesService,
                                 IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        DeleteBlobAction.NAME,
        transportService,
        clusterService,
        indicesService,
        threadPool,
        shardStateAction,
        indexNameExpressionResolver,
        DeleteBlobRequest::new,
        DeleteBlobRequest::new,
        ThreadPool.Names.WRITE
    );
    this.blobIndicesService = blobIndicesService;
    logger.trace("Constructor");
}
 
Example #6
Source File: TransportShardAction.java    From crate with Apache License 2.0 6 votes vote down vote up
protected TransportShardAction(String actionName,
                               TransportService transportService,
                               IndexNameExpressionResolver indexNameExpressionResolver,
                               ClusterService clusterService,
                               IndicesService indicesService,
                               ThreadPool threadPool,
                               ShardStateAction shardStateAction,
                               Writeable.Reader<Request> reader,
                               SchemaUpdateClient schemaUpdateClient) {
    super(
        actionName,
        transportService,
        clusterService,
        indicesService,
        threadPool,
        shardStateAction,
        indexNameExpressionResolver,
        reader,
        reader,
        ThreadPool.Names.WRITE
    );
    this.mappingUpdate = (update, shardId, type) -> {
        validateMapping(update.root().iterator(), false);
        schemaUpdateClient.blockingUpdateOnMaster(shardId.getIndex(), update);
    };
}
 
Example #7
Source File: TransportShardUpsertAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportShardUpsertAction(ThreadPool threadPool,
                                  ClusterService clusterService,
                                  TransportService transportService,
                                  SchemaUpdateClient schemaUpdateClient,
                                  TasksService tasksService,
                                  IndicesService indicesService,
                                  ShardStateAction shardStateAction,
                                  Functions functions,
                                  Schemas schemas,
                                  IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        ACTION_NAME,
        transportService,
        indexNameExpressionResolver,
        clusterService,
        indicesService,
        threadPool,
        shardStateAction,
        ShardUpsertRequest::new,
        schemaUpdateClient
    );
    this.schemas = schemas;
    this.functions = functions;
    tasksService.addListener(this);
}
 
Example #8
Source File: TransportShardDeleteAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportShardDeleteAction(TransportService transportService,
                                  IndexNameExpressionResolver indexNameExpressionResolver,
                                  ClusterService clusterService,
                                  IndicesService indicesService,
                                  ThreadPool threadPool,
                                  ShardStateAction shardStateAction,
                                  SchemaUpdateClient schemaUpdateClient) {
    super(
        ACTION_NAME,
        transportService,
        indexNameExpressionResolver,
        clusterService,
        indicesService,
        threadPool,
        shardStateAction,
        ShardDeleteRequest::new,
        schemaUpdateClient
    );
}
 
Example #9
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 #10
Source File: ReplicationOperation.java    From crate with Apache License 2.0 6 votes vote down vote up
private void onNoLongerPrimary(Exception failure) {
    final Throwable cause = ExceptionsHelper.unwrapCause(failure);
    final boolean nodeIsClosing =
        cause instanceof NodeClosedException ||
        (cause instanceof TransportException && "TransportService is closed stopped can't send request".equals(cause.getMessage()));

    final String message;
    if (nodeIsClosing) {
        message = String.format(Locale.ROOT,
            "node with primary [%s] is shutting down while failing replica shard", primary.routingEntry());
        // We prefer not to fail the primary to avoid unnecessary warning log
        // when the node with the primary shard is gracefully shutting down.
    } else {
        if (Assertions.ENABLED) {
            if (failure instanceof ShardStateAction.NoLongerPrimaryShardException == false) {
                throw new AssertionError("unexpected failure", failure);
            }
        }
        // we are no longer the primary, fail ourselves and start over
        message = String.format(Locale.ROOT, "primary shard [%s] was demoted while failing replica shard", primary.routingEntry());
        primary.failShard(message, failure);
    }
    finishAsFailed(new RetryOnPrimaryException(primary.routingEntry().shardId(), message, failure));
}
 
Example #11
Source File: TransportWriteAction.java    From crate with Apache License 2.0 6 votes vote down vote up
protected TransportWriteAction(String actionName,
                               TransportService transportService,
                               ClusterService clusterService,
                               IndicesService indicesService,
                               ThreadPool threadPool,
                               ShardStateAction shardStateAction,
                               IndexNameExpressionResolver indexNameExpressionResolver,
                               Writeable.Reader<Request> reader,
                               Writeable.Reader<ReplicaRequest> replicaReader,
                               String executor) {
    super(
        actionName,
        transportService,
        clusterService,
        indicesService,
        threadPool,
        shardStateAction,
        indexNameExpressionResolver,
        reader,
        replicaReader,
        executor,
        true);
}
 
Example #12
Source File: TransportResyncReplicationAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportResyncReplicationAction(TransportService transportService,
                                        ClusterService clusterService,
                                        IndicesService indicesService,
                                        ThreadPool threadPool,
                                        ShardStateAction shardStateAction,
                                        IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        ACTION_NAME,
        transportService,
        clusterService,
        indicesService,
        threadPool,
        shardStateAction,
        indexNameExpressionResolver,
        ResyncReplicationRequest::new,
        ResyncReplicationRequest::new,
        ThreadPool.Names.WRITE
    );
}
 
Example #13
Source File: ClusterModule.java    From crate with Apache License 2.0 6 votes vote down vote up
@Override
protected void configure() {
    bind(GatewayAllocator.class).asEagerSingleton();
    bind(AllocationService.class).toInstance(allocationService);
    bind(ClusterService.class).toInstance(clusterService);
    bind(NodeConnectionsService.class).asEagerSingleton();
    bind(MetaDataDeleteIndexService.class).asEagerSingleton();
    bind(MetaDataMappingService.class).asEagerSingleton();
    bind(MetaDataUpdateSettingsService.class).asEagerSingleton();
    bind(MetaDataIndexTemplateService.class).asEagerSingleton();
    bind(IndexNameExpressionResolver.class).toInstance(indexNameExpressionResolver);
    bind(RoutingService.class).asEagerSingleton();
    bind(DelayedAllocationService.class).asEagerSingleton();
    bind(ShardStateAction.class).asEagerSingleton();
    bind(NodeMappingRefreshAction.class).asEagerSingleton();
    bind(MappingUpdatedAction.class).asEagerSingleton();
    bind(AllocationDeciders.class).toInstance(allocationDeciders);
    bind(ShardsAllocator.class).toInstance(shardsAllocator);
}
 
Example #14
Source File: GlobalCheckpointSyncAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public GlobalCheckpointSyncAction(
        final TransportService transportService,
        final ClusterService clusterService,
        final IndicesService indicesService,
        final ThreadPool threadPool,
        final ShardStateAction shardStateAction,
        final IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
            ACTION_NAME,
            transportService,
            clusterService,
            indicesService,
            threadPool,
            shardStateAction,
            indexNameExpressionResolver,
            Request::new,
            Request::new,
            ThreadPool.Names.MANAGEMENT);
}
 
Example #15
Source File: IndicesClusterStateService.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public IndicesClusterStateService(Settings settings,
                                  IndicesService indicesService,
                                  ClusterService clusterService,
                                  ThreadPool threadPool,
                                  PeerRecoveryTargetService recoveryTargetService,
                                  ShardStateAction shardStateAction,
                                  NodeMappingRefreshAction nodeMappingRefreshAction,
                                  RepositoriesService repositoriesService,
                                  SyncedFlushService syncedFlushService,
                                  PeerRecoverySourceService peerRecoverySourceService,
                                  SnapshotShardsService snapshotShardsService,
                                  PrimaryReplicaSyncer primaryReplicaSyncer,
                                  GlobalCheckpointSyncAction globalCheckpointSyncAction) {
    this(settings, (AllocatedIndices<? extends Shard, ? extends AllocatedIndex<? extends Shard>>) indicesService,
            clusterService, threadPool, recoveryTargetService, shardStateAction,
            nodeMappingRefreshAction, repositoriesService, syncedFlushService, peerRecoverySourceService,
            snapshotShardsService, primaryReplicaSyncer, globalCheckpointSyncAction::updateGlobalCheckpointForShard);
}
 
Example #16
Source File: TransportDeleteBlobAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportDeleteBlobAction(Settings settings,
                                 TransportService transportService,
                                 ClusterService clusterService,
                                 IndicesService indicesService,
                                 ThreadPool threadPool,
                                 ShardStateAction shardStateAction,
                                 BlobIndices blobIndices,
                                 MappingUpdatedAction mappingUpdatedAction,
                                 ActionFilters actionFilters,
                                 IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, DeleteBlobAction.NAME, transportService, clusterService, indicesService, threadPool, shardStateAction,
            mappingUpdatedAction, actionFilters, indexNameExpressionResolver, DeleteBlobRequest.class, DeleteBlobRequest.class, ThreadPool.Names.INDEX);
    this.blobIndices = blobIndices;
    logger.trace("Constructor");
}
 
Example #17
Source File: TransportReplicationAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
protected TransportReplicationAction(Settings settings, String actionName, TransportService transportService,
                                     ClusterService clusterService, IndicesService indicesService,
                                     ThreadPool threadPool, ShardStateAction shardStateAction,
                                     MappingUpdatedAction mappingUpdatedAction, ActionFilters actionFilters,
                                     IndexNameExpressionResolver indexNameExpressionResolver, Class<Request> request,
                                     Class<ReplicaRequest> replicaRequest, String executor) {
    super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
    this.transportService = transportService;
    this.clusterService = clusterService;
    this.indicesService = indicesService;
    this.shardStateAction = shardStateAction;
    this.mappingUpdatedAction = mappingUpdatedAction;

    this.transportPrimaryAction = actionName + "[p]";
    this.transportReplicaAction = actionName + "[r]";
    this.executor = executor;
    this.checkWriteConsistency = checkWriteConsistency();
    transportService.registerRequestHandler(actionName, request, ThreadPool.Names.SAME, new OperationTransportHandler());
    transportService.registerRequestHandler(transportPrimaryAction, request, executor, new PrimaryOperationTransportHandler());
    // we must never reject on because of thread pool capacity on replicas
    transportService.registerRequestHandler(transportReplicaAction, replicaRequest, executor, true, new ReplicaOperationTransportHandler());

    this.transportOptions = transportOptions();

    this.defaultWriteConsistencyLevel = WriteConsistencyLevel.fromString(settings.get("action.write_consistency", "quorum"));
}
 
Example #18
Source File: TransportStartBlobAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportStartBlobAction(Settings settings,
                                TransportService transportService,
                                ClusterService clusterService,
                                IndicesService indicesService,
                                ThreadPool threadPool,
                                ShardStateAction shardStateAction,
                                BlobTransferTarget transferTarget,
                                MappingUpdatedAction mappingUpdatedAction,
                                ActionFilters actionFilters,
                                IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, StartBlobAction.NAME, transportService, clusterService,
            indicesService, threadPool, shardStateAction, mappingUpdatedAction, actionFilters,
            indexNameExpressionResolver, StartBlobRequest.class, StartBlobRequest.class, ThreadPool.Names.INDEX);

    this.transferTarget = transferTarget;
    logger.trace("Constructor");
}
 
Example #19
Source File: TransportShardUpsertAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportShardUpsertAction(Settings settings,
                                  ThreadPool threadPool,
                                  ClusterService clusterService,
                                  TransportService transportService,
                                  ActionFilters actionFilters,
                                  JobContextService jobContextService,
                                  IndicesService indicesService,
                                  ShardStateAction shardStateAction,
                                  Functions functions,
                                  Schemas schemas,
                                  MappingUpdatedAction mappingUpdatedAction,
                                  IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ACTION_NAME, transportService, mappingUpdatedAction, indexNameExpressionResolver, clusterService,
            indicesService, threadPool, shardStateAction, actionFilters, ShardUpsertRequest.class);
    this.indicesService = indicesService;
    this.functions = functions;
    this.schemas = schemas;
    jobContextService.addListener(this);
}
 
Example #20
Source File: IndicesClusterStateService.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public IndicesClusterStateService(Settings settings, IndicesService indicesService, ClusterService clusterService,
                                  ThreadPool threadPool, RecoveryTarget recoveryTarget,
                                  ShardStateAction shardStateAction,
                                  NodeIndexDeletedAction nodeIndexDeletedAction,
                                  NodeMappingRefreshAction nodeMappingRefreshAction) {
    super(settings);
    this.indicesService = indicesService;
    this.clusterService = clusterService;
    this.threadPool = threadPool;
    this.recoveryTarget = recoveryTarget;
    this.shardStateAction = shardStateAction;
    this.nodeIndexDeletedAction = nodeIndexDeletedAction;
    this.nodeMappingRefreshAction = nodeMappingRefreshAction;

    this.sendRefreshMapping = this.settings.getAsBoolean("indices.cluster.send_refresh_mapping", true);
}
 
Example #21
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 #22
Source File: TransportShardFlushAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportShardFlushAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                 IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
                                 MappingUpdatedAction mappingUpdatedAction, ActionFilters actionFilters,
                                 IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, NAME, transportService, clusterService, indicesService, threadPool, shardStateAction, mappingUpdatedAction,
            actionFilters, indexNameExpressionResolver, ShardFlushRequest.class, ShardFlushRequest.class, ThreadPool.Names.FLUSH);
}
 
Example #23
Source File: TransportShardUpsertActionTest.java    From crate with Apache License 2.0 5 votes vote down vote up
@Before
public void prepare() throws Exception {
    Functions functions = getFunctions();

    charactersIndexUUID = UUIDs.randomBase64UUID();
    partitionIndexUUID = UUIDs.randomBase64UUID();

    IndicesService indicesService = mock(IndicesService.class);
    IndexService indexService = mock(IndexService.class);
    Index charactersIndex = new Index(TABLE_IDENT.indexNameOrAlias(), charactersIndexUUID);
    Index partitionIndex = new Index(PARTITION_INDEX, partitionIndexUUID);

    when(indicesService.indexServiceSafe(charactersIndex)).thenReturn(indexService);
    when(indicesService.indexServiceSafe(partitionIndex)).thenReturn(indexService);
    indexShard = mock(IndexShard.class);
    when(indexService.getShard(0)).thenReturn(indexShard);

    // Avoid null pointer exceptions
    DocTableInfo tableInfo = mock(DocTableInfo.class);
    Schemas schemas = mock(Schemas.class);
    when(tableInfo.columns()).thenReturn(Collections.<Reference>emptyList());
    when(schemas.getTableInfo(any(RelationName.class), eq(Operation.INSERT))).thenReturn(tableInfo);

    transportShardUpsertAction = new TestingTransportShardUpsertAction(
        mock(ThreadPool.class),
        clusterService,
        MockTransportService.createNewService(Settings.EMPTY, Version.ES_V_6_5_1, THREAD_POOL, clusterService.getClusterSettings()),
        mock(SchemaUpdateClient.class),
        mock(TasksService.class),
        indicesService,
        mock(ShardStateAction.class),
        functions,
        schemas,
        mock(IndexNameExpressionResolver.class)
    );
}
 
Example #24
Source File: TransportShardUpsertActionTest.java    From crate with Apache License 2.0 5 votes vote down vote up
public TestingTransportShardUpsertAction(ThreadPool threadPool,
                                         ClusterService clusterService,
                                         TransportService transportService,
                                         SchemaUpdateClient schemaUpdateClient,
                                         TasksService tasksService,
                                         IndicesService indicesService,
                                         ShardStateAction shardStateAction,
                                         Functions functions,
                                         Schemas schemas,
                                         IndexNameExpressionResolver indexNameExpressionResolver) {
    super(threadPool, clusterService, transportService, schemaUpdateClient,
        tasksService, indicesService, shardStateAction, functions, schemas, indexNameExpressionResolver);
}
 
Example #25
Source File: TransportShardDeleteAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportShardDeleteAction(Settings settings,
                                  TransportService transportService,
                                  MappingUpdatedAction mappingUpdatedAction,
                                  IndexNameExpressionResolver indexNameExpressionResolver,
                                  ClusterService clusterService,
                                  IndicesService indicesService,
                                  ThreadPool threadPool,
                                  ShardStateAction shardStateAction,
                                  ActionFilters actionFilters) {
    super(settings, ACTION_NAME, transportService, mappingUpdatedAction, indexNameExpressionResolver,
            clusterService, indicesService, threadPool, shardStateAction, actionFilters, ShardDeleteRequest.class);
}
 
Example #26
Source File: TransportShardAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public TransportShardAction(Settings settings,
                            String actionName,
                            TransportService transportService,
                            MappingUpdatedAction mappingUpdatedAction,
                            IndexNameExpressionResolver indexNameExpressionResolver,
                            ClusterService clusterService,
                            IndicesService indicesService,
                            ThreadPool threadPool,
                            ShardStateAction shardStateAction,
                            ActionFilters actionFilters,
                            Class<R> requestClass) {
    super(settings, actionName, transportService, clusterService, indicesService, threadPool, shardStateAction,
            mappingUpdatedAction, actionFilters, indexNameExpressionResolver, requestClass, requestClass, ThreadPool.Names.BULK);
}
 
Example #27
Source File: ClusterModule.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected void configure() {
    bind(DynamicSettings.class).annotatedWith(ClusterDynamicSettings.class).toInstance(clusterDynamicSettings.build());
    bind(DynamicSettings.class).annotatedWith(IndexDynamicSettings.class).toInstance(indexDynamicSettings.build());

    // bind ShardsAllocator
    String shardsAllocatorType = shardsAllocators.bindType(binder(), settings, ClusterModule.SHARDS_ALLOCATOR_TYPE_KEY, ClusterModule.BALANCED_ALLOCATOR);
    if (shardsAllocatorType.equals(ClusterModule.EVEN_SHARD_COUNT_ALLOCATOR)) {
        final ESLogger logger = Loggers.getLogger(getClass(), settings);
        logger.warn("{} allocator has been removed in 2.0 using {} instead", ClusterModule.EVEN_SHARD_COUNT_ALLOCATOR, ClusterModule.BALANCED_ALLOCATOR);
    }
    allocationDeciders.bind(binder());
    indexTemplateFilters.bind(binder());

    bind(ClusterInfoService.class).to(clusterInfoServiceImpl).asEagerSingleton();
    bind(GatewayAllocator.class).asEagerSingleton();
    bind(AllocationService.class).asEagerSingleton();
    bind(DiscoveryNodeService.class).asEagerSingleton();
    bind(ClusterService.class).to(InternalClusterService.class).asEagerSingleton();
    bind(OperationRouting.class).asEagerSingleton();
    bind(MetaDataCreateIndexService.class).asEagerSingleton();
    bind(MetaDataDeleteIndexService.class).asEagerSingleton();
    bind(MetaDataIndexStateService.class).asEagerSingleton();
    bind(MetaDataMappingService.class).asEagerSingleton();
    bind(MetaDataIndexAliasesService.class).asEagerSingleton();
    bind(MetaDataUpdateSettingsService.class).asEagerSingleton();
    bind(MetaDataIndexTemplateService.class).asEagerSingleton();
    bind(IndexNameExpressionResolver.class).asEagerSingleton();
    bind(RoutingService.class).asEagerSingleton();
    bind(ShardStateAction.class).asEagerSingleton();
    bind(NodeIndexDeletedAction.class).asEagerSingleton();
    bind(NodeMappingRefreshAction.class).asEagerSingleton();
    bind(MappingUpdatedAction.class).asEagerSingleton();
}
 
Example #28
Source File: TransportReplicationAction.java    From crate with Apache License 2.0 5 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) {
    this(actionName, transportService, clusterService, indicesService, threadPool, shardStateAction,
            indexNameExpressionResolver, reader, replicaReader, executor, false);
}
 
Example #29
Source File: TransportShardRefreshAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportShardRefreshAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                   IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
                                   MappingUpdatedAction mappingUpdatedAction, ActionFilters actionFilters,
                                   IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, NAME, transportService, clusterService, indicesService, threadPool, shardStateAction, mappingUpdatedAction,
            actionFilters, indexNameExpressionResolver, ReplicationRequest.class, ReplicationRequest.class, ThreadPool.Names.REFRESH);
}
 
Example #30
Source File: TransportDeleteAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportDeleteAction(Settings settings, TransportService transportService, ClusterService clusterService,
                             IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
                             TransportCreateIndexAction createIndexAction, ActionFilters actionFilters,
                             IndexNameExpressionResolver indexNameExpressionResolver, MappingUpdatedAction mappingUpdatedAction,
                             AutoCreateIndex autoCreateIndex) {
    super(settings, DeleteAction.NAME, transportService, clusterService, indicesService, threadPool, shardStateAction,
            mappingUpdatedAction, actionFilters, indexNameExpressionResolver,
            DeleteRequest.class, DeleteRequest.class, ThreadPool.Names.INDEX);
    this.createIndexAction = createIndexAction;
    this.autoCreateIndex = autoCreateIndex;
}