org.elasticsearch.cluster.service.ClusterService Java Examples

The following examples show how to use org.elasticsearch.cluster.service.ClusterService. 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: 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 #2
Source File: TransportKillNodeAction.java    From crate with Apache License 2.0 6 votes vote down vote up
TransportKillNodeAction(String name,
                        TasksService tasksService,
                        ClusterService clusterService,
                        TransportService transportService,
                        Writeable.Reader<Request> reader) {
    this.tasksService = tasksService;
    this.clusterService = clusterService;
    this.transportService = transportService;
    this.reader = reader;
    this.name = name;
    transportService.registerRequestHandler(
        name,
        reader,
        ThreadPool.Names.GENERIC,
        new NodeActionRequestHandler<>(this));
}
 
Example #3
Source File: ShardDMLExecutor.java    From crate with Apache License 2.0 6 votes vote down vote up
public ShardDMLExecutor(int bulkSize,
                        ScheduledExecutorService scheduler,
                        Executor executor,
                        CollectExpression<Row, ?> uidExpression,
                        ClusterService clusterService,
                        NodeJobsCounter nodeJobsCounter,
                        Supplier<TReq> requestFactory,
                        Function<String, TItem> itemFactory,
                        BiConsumer<TReq, ActionListener<ShardResponse>> transportAction,
                        Collector<ShardResponse, TAcc, TResult> collector
                        ) {
    this.bulkSize = bulkSize;
    this.scheduler = scheduler;
    this.executor = executor;
    this.uidExpression = uidExpression;
    this.nodeJobsCounter = nodeJobsCounter;
    this.requestFactory = requestFactory;
    this.itemFactory = itemFactory;
    this.operation = transportAction;
    this.localNodeId = getLocalNodeId(clusterService);
    this.collector = collector;
}
 
Example #4
Source File: TransportGetSnapshotsAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportGetSnapshotsAction(TransportService transportService,
                                   ClusterService clusterService,
                                   ThreadPool threadPool,
                                   SnapshotsService snapshotsService,
                                   IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        GetSnapshotsAction.NAME,
        transportService,
        clusterService,
        threadPool,
        GetSnapshotsRequest::new,
        indexNameExpressionResolver
    );
    this.snapshotsService = snapshotsService;
}
 
Example #5
Source File: InternalCountOperationTest.java    From crate with Apache License 2.0 6 votes vote down vote up
@Test
public void testCount() throws Exception {
    execute("create table t (name string) clustered into 1 shards with (number_of_replicas = 0)");
    ensureYellow();
    execute("insert into t (name) values ('Marvin'), ('Arthur'), ('Trillian')");
    execute("refresh table t");

    CountOperation countOperation = internalCluster().getDataNodeInstance(CountOperation.class);
    ClusterService clusterService = internalCluster().getDataNodeInstance(ClusterService.class);
    CoordinatorTxnCtx txnCtx = CoordinatorTxnCtx.systemTransactionContext();
    MetaData metaData = clusterService.state().getMetaData();
    Index index = metaData.index(getFqn("t")).getIndex();
    assertThat(countOperation.count(txnCtx, index, 0, Literal.BOOLEAN_TRUE), is(3L));

    Schemas schemas = internalCluster().getInstance(Schemas.class);
    TableInfo tableInfo = schemas.getTableInfo(new RelationName(sqlExecutor.getCurrentSchema(), "t"));
    TableRelation tableRelation = new TableRelation(tableInfo);
    Map<RelationName, AnalyzedRelation> tableSources = Map.of(tableInfo.ident(), tableRelation);
    SqlExpressions sqlExpressions = new SqlExpressions(tableSources, tableRelation);

    Symbol filter = sqlExpressions.normalize(sqlExpressions.asSymbol("name = 'Marvin'"));
    assertThat(countOperation.count(txnCtx, index, 0, filter), is(1L));
}
 
Example #6
Source File: Planner.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public Planner(Settings settings,
               ClusterService clusterService,
               Functions functions,
               TableStats tableStats,
               LicenseService licenseService,
               NumberOfShards numberOfShards,
               TableCreator tableCreator,
               Schemas schemas,
               UserManager userManager,
               LoadedRules loadedRules,
               SessionSettingRegistry sessionSettingRegistry) {
    this(
        settings,
        clusterService,
        functions,
        tableStats,
        numberOfShards,
        tableCreator,
        schemas,
        userManager,
        () -> licenseService.getLicenseState() == LicenseService.LicenseState.VALID,
        loadedRules,
        sessionSettingRegistry
    );
}
 
Example #7
Source File: TransportRecoveryAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportRecoveryAction(ThreadPool threadPool,
                               ClusterService clusterService,
                               TransportService transportService,
                               IndicesService indicesService,
                               IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        RecoveryAction.NAME,
        threadPool,
        clusterService,
        transportService,
        indexNameExpressionResolver,
        RecoveryRequest::new,
        ThreadPool.Names.MANAGEMENT,
        true
    );
    this.indicesService = indicesService;
}
 
Example #8
Source File: IndicesStore.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public IndicesStore(Settings settings, IndicesService indicesService,
                    ClusterService clusterService, TransportService transportService, ThreadPool threadPool) {
    this.settings = settings;
    this.indicesService = indicesService;
    this.clusterService = clusterService;
    this.transportService = transportService;
    this.threadPool = threadPool;
    transportService.registerRequestHandler(ACTION_SHARD_EXISTS, ShardActiveRequest::new, ThreadPool.Names.SAME, new ShardActiveRequestHandler());
    this.deleteShardTimeout = INDICES_STORE_DELETE_SHARD_TIMEOUT.get(settings);
    // Doesn't make sense to delete shards on non-data nodes
    if (DiscoveryNode.isDataNode(settings)) {
        // we double check nothing has changed when responses come back from other nodes.
        // it's easier to do that check when the current cluster state is visible.
        // also it's good in general to let things settle down
        clusterService.addListener(this);
    }
}
 
Example #9
Source File: GroupRowsByShard.java    From crate with Apache License 2.0 6 votes vote down vote up
public GroupRowsByShard(ClusterService clusterService,
                        RowShardResolver rowShardResolver,
                        ToLongFunction<Row> estimateRowSize,
                        Supplier<String> indexNameResolver,
                        List<? extends CollectExpression<Row, ?>> expressions,
                        Function<String, TItem> itemFactory,
                        boolean autoCreateIndices,
                        UpsertResultContext upsertContext) {
    this.estimateRowSize = estimateRowSize;
    assert expressions instanceof RandomAccess
        : "expressions should be a RandomAccess list for zero allocation iterations";

    this.clusterService = clusterService;
    this.rowShardResolver = rowShardResolver;
    this.indexNameResolver = indexNameResolver;
    this.expressions = expressions;
    this.sourceInfoExpressions = upsertContext.getSourceInfoExpressions();
    this.itemFactory = itemFactory;
    this.itemFailureRecorder = upsertContext.getItemFailureRecorder();
    this.hasSourceUriFailure = upsertContext.getHasSourceUriFailureChecker();
    this.sourceUriInput = upsertContext.getSourceUriInput();
    this.lineNumberInput = upsertContext.getLineNumberInput();
    this.autoCreateIndices = autoCreateIndices;
}
 
Example #10
Source File: InternalUsersApiAction.java    From deprecated-security-advanced-modules with Apache License 2.0 6 votes vote down vote up
@Inject
public InternalUsersApiAction(final Settings settings, final Path configPath, final RestController controller,
        final Client client, final AdminDNs adminDNs, final ConfigurationRepository cl,
        final ClusterService cs, final PrincipalExtractor principalExtractor, final PrivilegesEvaluator evaluator,
        ThreadPool threadPool, AuditLog auditLog) {
    super(settings, configPath, controller, client, adminDNs, cl, cs, principalExtractor, evaluator, threadPool,
            auditLog);

    // legacy mapping for backwards compatibility
    // TODO: remove in next version
    controller.registerHandler(Method.GET, "/_opendistro/_security/api/user/{name}", this);
    controller.registerHandler(Method.GET, "/_opendistro/_security/api/user/", this);
    controller.registerHandler(Method.DELETE, "/_opendistro/_security/api/user/{name}", this);
    controller.registerHandler(Method.PUT, "/_opendistro/_security/api/user/{name}", this);

    // corrected mapping, introduced in Open Distro Security
    controller.registerHandler(Method.GET, "/_opendistro/_security/api/internalusers/{name}", this);
    controller.registerHandler(Method.GET, "/_opendistro/_security/api/internalusers/", this);
    controller.registerHandler(Method.DELETE, "/_opendistro/_security/api/internalusers/{name}", this);
    controller.registerHandler(Method.PUT, "/_opendistro/_security/api/internalusers/{name}", this);
    controller.registerHandler(Method.PATCH, "/_opendistro/_security/api/internalusers/", this);
    controller.registerHandler(Method.PATCH, "/_opendistro/_security/api/internalusers/{name}", this);

}
 
Example #11
Source File: FieldReadCallback.java    From deprecated-security-advanced-modules with Apache License 2.0 6 votes vote down vote up
public FieldReadCallback(final ThreadContext threadContext, final IndexService indexService,
        final ClusterService clusterService, final ComplianceConfig complianceConfig, final AuditLog auditLog,
        final Set<String> maskedFields, ShardId shardId) {
    super();
    //this.threadContext = Objects.requireNonNull(threadContext);
    //this.clusterService = Objects.requireNonNull(clusterService);
    this.index = Objects.requireNonNull(indexService).index();
    this.complianceConfig = complianceConfig;
    this.auditLog = auditLog;
    this.maskedFields = maskedFields;
    this.shardId = shardId;
    try {
        sfc = (SourceFieldsContext) HeaderHelper.deserializeSafeFromHeader(threadContext, "_opendistro_security_source_field_context");
        if(sfc != null && sfc.hasIncludesOrExcludes()) {
            if(log.isTraceEnabled()) {
                log.trace("_opendistro_security_source_field_context: "+sfc);
            }

            filterFunction = XContentMapValues.filter(sfc.getIncludes(), sfc.getExcludes());
        }
    } catch (Exception e) {
        if(log.isDebugEnabled()) {
            log.debug("Cannot deserialize _opendistro_security_source_field_context because of {}", e.toString());
        }
    }
}
 
Example #12
Source File: BlobTransferTarget.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public BlobTransferTarget(BlobIndicesService blobIndicesService,
                          ThreadPool threadPool,
                          TransportService transportService,
                          ClusterService clusterService) {
    String property = System.getProperty("tests.short_timeouts");
    if (property == null) {
        STATE_REMOVAL_DELAY = new TimeValue(40, TimeUnit.SECONDS);
    } else {
        STATE_REMOVAL_DELAY = new TimeValue(2, TimeUnit.SECONDS);
    }
    this.blobIndicesService = blobIndicesService;
    this.threadPool = threadPool;
    this.transportService = transportService;
    this.clusterService = clusterService;
    this.getHeadRequestLatchFuture = new CompletableFuture<>();
    this.activePutHeadChunkTransfers = new ConcurrentLinkedQueue<>();
}
 
Example #13
Source File: InsertFromValues.java    From crate with Apache License 2.0 6 votes vote down vote up
private static ShardLocation getShardLocation(String indexName,
                                              String id,
                                              @Nullable String routing,
                                              ClusterService clusterService) {
    ShardIterator shardIterator = clusterService.operationRouting().indexShards(
        clusterService.state(),
        indexName,
        id,
        routing);

    final String nodeId;
    ShardRouting shardRouting = shardIterator.nextOrNull();
    if (shardRouting == null) {
        nodeId = null;
    } else if (shardRouting.active() == false) {
        nodeId = shardRouting.relocatingNodeId();
    } else {
        nodeId = shardRouting.currentNodeId();
    }
    return new ShardLocation(shardIterator.shardId(), nodeId);
}
 
Example #14
Source File: AnomalyDetectionIndices.java    From anomaly-detection with Apache License 2.0 6 votes vote down vote up
/**
 * Constructor function
 *
 * @param client         ES client supports administrative actions
 * @param clusterService ES cluster service
 * @param threadPool     ES thread pool
 * @param settings       ES cluster setting
 */
public AnomalyDetectionIndices(Client client, ClusterService clusterService, ThreadPool threadPool, Settings settings) {
    this.adminClient = client.admin();
    this.clusterService = clusterService;
    this.threadPool = threadPool;
    this.clusterService.addLocalNodeMasterListener(this);
    this.historyRolloverPeriod = AD_RESULT_HISTORY_ROLLOVER_PERIOD.get(settings);
    this.historyMaxDocs = AD_RESULT_HISTORY_MAX_DOCS.get(settings);
    this.historyRetentionPeriod = AD_RESULT_HISTORY_RETENTION_PERIOD.get(settings);
    this.clusterService.getClusterSettings().addSettingsUpdateConsumer(AD_RESULT_HISTORY_MAX_DOCS, it -> historyMaxDocs = it);
    this.clusterService.getClusterSettings().addSettingsUpdateConsumer(AD_RESULT_HISTORY_ROLLOVER_PERIOD, it -> {
        historyRolloverPeriod = it;
        rescheduleRollover();
    });
    this.clusterService
        .getClusterSettings()
        .addSettingsUpdateConsumer(AD_RESULT_HISTORY_RETENTION_PERIOD, it -> { historyRetentionPeriod = it; });
}
 
Example #15
Source File: TransportClusterUpdateSettingsAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportClusterUpdateSettingsAction(TransportService transportService,
                                            ClusterService clusterService,
                                            ThreadPool threadPool,
                                            AllocationService allocationService,
                                            IndexNameExpressionResolver indexNameExpressionResolver,
                                            ClusterSettings clusterSettings) {
    super(
        ClusterUpdateSettingsAction.NAME,
        false,
        transportService,
        clusterService,
        threadPool,
        ClusterUpdateSettingsRequest::new,
        indexNameExpressionResolver
    );
    this.allocationService = allocationService;
    this.clusterSettings = clusterSettings;
}
 
Example #16
Source File: PhasesTaskFactory.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public PhasesTaskFactory(ClusterService clusterService,
                         ThreadPool threadPool,
                         JobSetup jobSetup,
                         TasksService tasksService,
                         IndicesService indicesService,
                         TransportJobAction jobAction,
                         TransportKillJobsNodeAction killJobsNodeAction) {
    this.clusterService = clusterService;
    this.jobSetup = jobSetup;
    this.tasksService = tasksService;
    this.indicesService = indicesService;
    this.jobAction = jobAction;
    this.killJobsNodeAction = killJobsNodeAction;
    this.searchExecutor = threadPool.executor(ThreadPool.Names.SEARCH);
}
 
Example #17
Source File: TransportSwapAndDropIndexNameAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportSwapAndDropIndexNameAction(TransportService transportService,
                                           ClusterService clusterService,
                                           ThreadPool threadPool,
                                           AllocationService allocationService,
                                           IndexNameExpressionResolver indexNameExpressionResolver) {
    super(ACTION_NAME,
        transportService,
        clusterService,
        threadPool,
        indexNameExpressionResolver,
        SwapAndDropIndexRequest::new,
        AcknowledgedResponse::new,
        AcknowledgedResponse::new,
        "swap-and-drop-index");
    executor = new SwapAndDropIndexExecutor(allocationService);
}
 
Example #18
Source File: RestIndexAnomalyDetectorAction.java    From anomaly-detection with Apache License 2.0 6 votes vote down vote up
public RestIndexAnomalyDetectorAction(
    Settings settings,
    ClusterService clusterService,
    AnomalyDetectionIndices anomalyDetectionIndices
) {
    this.settings = settings;
    this.anomalyDetectionIndices = anomalyDetectionIndices;
    this.requestTimeout = REQUEST_TIMEOUT.get(settings);
    this.detectionInterval = DETECTION_INTERVAL.get(settings);
    this.detectionWindowDelay = DETECTION_WINDOW_DELAY.get(settings);
    this.maxAnomalyDetectors = MAX_ANOMALY_DETECTORS.get(settings);
    this.maxAnomalyFeatures = MAX_ANOMALY_FEATURES.get(settings);
    this.clusterService = clusterService;
    // TODO: will add more cluster setting consumer later
    // TODO: inject ClusterSettings only if clusterService is only used to get ClusterSettings
    clusterService.getClusterSettings().addSettingsUpdateConsumer(REQUEST_TIMEOUT, it -> requestTimeout = it);
    clusterService.getClusterSettings().addSettingsUpdateConsumer(DETECTION_INTERVAL, it -> detectionInterval = it);
    clusterService.getClusterSettings().addSettingsUpdateConsumer(DETECTION_WINDOW_DELAY, it -> detectionWindowDelay = it);
    clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_ANOMALY_DETECTORS, it -> maxAnomalyDetectors = it);
    clusterService.getClusterSettings().addSettingsUpdateConsumer(MAX_ANOMALY_FEATURES, it -> maxAnomalyFeatures = it);
}
 
Example #19
Source File: TransportSwapRelationsAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportSwapRelationsAction(Settings settings,
                                    TransportService transportService,
                                    ClusterService clusterService,
                                    ThreadPool threadPool,
                                    IndexNameExpressionResolver indexNameExpressionResolver,
                                    DDLClusterStateService ddlClusterStateService,
                                    AllocationService allocationService) {
    super(
        "internal:crate:sql/alter/cluster/indices",
        transportService,
        clusterService,
        threadPool,
        SwapRelationsRequest::new,
        indexNameExpressionResolver
    );
    this.activeShardsObserver = new ActiveShardsObserver(clusterService, threadPool);
    this.swapRelationsOperation = new SwapRelationsOperation(
        allocationService, ddlClusterStateService, indexNameExpressionResolver);
}
 
Example #20
Source File: TableStatsServiceTest.java    From crate with Apache License 2.0 6 votes vote down vote up
@Test
public void testNoUpdateIfLocalNodeNotAvailable() {
    final ClusterService clusterService = Mockito.mock(ClusterService.class);
    Mockito.when(clusterService.localNode()).thenReturn(null);
    Mockito.when(clusterService.getClusterSettings()).thenReturn(this.clusterService.getClusterSettings());
    SQLOperations sqlOperations = Mockito.mock(SQLOperations.class);
    Session session = Mockito.mock(Session.class);
    Mockito.when(sqlOperations.createSession(ArgumentMatchers.anyString(), ArgumentMatchers.any(), ArgumentMatchers.any())).thenReturn(session);

    TableStatsService statsService = new TableStatsService(
        Settings.EMPTY,
        THREAD_POOL,
        clusterService,
        sqlOperations
    );

    statsService.run();
    Mockito.verify(session, Mockito.times(0)).sync();
}
 
Example #21
Source File: CronTransportAction.java    From anomaly-detection with Apache License 2.0 6 votes vote down vote up
@Inject
public CronTransportAction(
    ThreadPool threadPool,
    ClusterService clusterService,
    TransportService transportService,
    ActionFilters actionFilters,
    ADStateManager tarnsportStatemanager,
    ModelManager modelManager,
    FeatureManager featureManager
) {
    super(
        CronAction.NAME,
        threadPool,
        clusterService,
        transportService,
        actionFilters,
        CronRequest::new,
        CronNodeRequest::new,
        ThreadPool.Names.MANAGEMENT,
        CronNodeResponse.class
    );
    this.transportStateManager = tarnsportStatemanager;
    this.modelManager = modelManager;
    this.featureManager = featureManager;
}
 
Example #22
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 #23
Source File: InternalClusterInfoService.java    From crate with Apache License 2.0 6 votes vote down vote up
public InternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client) {
    this.leastAvailableSpaceUsages = ImmutableOpenMap.of();
    this.mostAvailableSpaceUsages = ImmutableOpenMap.of();
    this.shardRoutingToDataPath = ImmutableOpenMap.of();
    this.shardSizes = ImmutableOpenMap.of();
    this.clusterService = clusterService;
    this.threadPool = threadPool;
    this.client = client;
    this.updateFrequency = INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING.get(settings);
    this.fetchTimeout = INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING.get(settings);
    this.enabled = DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.get(settings);
    ClusterSettings clusterSettings = clusterService.getClusterSettings();
    //clusterSettings.addSettingsUpdateConsumer(INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING, this::setFetchTimeout);
    //clusterSettings.addSettingsUpdateConsumer(INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING, this::setUpdateFrequency);
    clusterSettings.addSettingsUpdateConsumer(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING, this::setEnabled);

    // Add InternalClusterInfoService to listen for Master changes
    this.clusterService.addLocalNodeMasterListener(this);
    // Add to listen for state changes (when nodes are added)
    this.clusterService.addListener(this);
}
 
Example #24
Source File: UpdateById.java    From crate with Apache License 2.0 6 votes vote down vote up
private ShardRequestExecutor<ShardUpsertRequest> createExecutor(DependencyCarrier dependencies,
                                                                PlannerContext plannerContext) {
    ClusterService clusterService = dependencies.clusterService();
    CoordinatorTxnCtx txnCtx = plannerContext.transactionContext();
    ShardUpsertRequest.Builder requestBuilder = new ShardUpsertRequest.Builder(
        txnCtx.sessionSettings(),
        ShardingUpsertExecutor.BULK_REQUEST_TIMEOUT_SETTING.setting().get(clusterService.state().metaData().settings()),
        ShardUpsertRequest.DuplicateKeyAction.UPDATE_OR_FAIL,
        true,
        assignments.targetNames(),
        null, // missing assignments are for INSERT .. ON DUPLICATE KEY UPDATE
        returnValues,
        plannerContext.jobId(),
        false
    );
    UpdateRequests updateRequests = new UpdateRequests(requestBuilder, table, assignments);
    return new ShardRequestExecutor<>(
        clusterService,
        txnCtx,
        dependencies.functions(),
        table,
        updateRequests,
        dependencies.transportActionProvider().transportShardUpsertAction()::execute,
        docKeys
    );
}
 
Example #25
Source File: MetaDataCreateIndexService.java    From crate with Apache License 2.0 6 votes vote down vote up
public MetaDataCreateIndexService(
        final Settings settings,
        final ClusterService clusterService,
        final IndicesService indicesService,
        final AllocationService allocationService,
        final AliasValidator aliasValidator,
        final Environment env,
        final IndexScopedSettings indexScopedSettings,
        final ThreadPool threadPool,
        final NamedXContentRegistry xContentRegistry,
        final boolean forbidPrivateIndexSettings) {
    this.settings = settings;
    this.clusterService = clusterService;
    this.indicesService = indicesService;
    this.allocationService = allocationService;
    this.aliasValidator = aliasValidator;
    this.env = env;
    this.indexScopedSettings = indexScopedSettings;
    this.activeShardsObserver = new ActiveShardsObserver(clusterService, threadPool);
    this.xContentRegistry = xContentRegistry;
    this.forbidPrivateIndexSettings = forbidPrivateIndexSettings;
}
 
Example #26
Source File: TransportForceMergeAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportForceMergeAction(ThreadPool threadPool,
                                 ClusterService clusterService,
                                 TransportService transportService,
                                 IndicesService indicesService,
                                 IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        ForceMergeAction.NAME,
        threadPool,
        clusterService,
        transportService,
        indexNameExpressionResolver,
        ForceMergeRequest::new,
        ThreadPool.Names.FORCE_MERGE,
        true
    );
    this.indicesService = indicesService;
}
 
Example #27
Source File: TransportUpgradeSettingsAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportUpgradeSettingsAction(TransportService transportService,
                                      ClusterService clusterService,
                                      ThreadPool threadPool,
                                      MetaDataUpdateSettingsService updateSettingsService,
                                      IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        UpgradeSettingsAction.NAME,
        transportService,
        clusterService,
        threadPool,
        UpgradeSettingsRequest::new,
        indexNameExpressionResolver
    );
    this.updateSettingsService = updateSettingsService;
}
 
Example #28
Source File: TransportOpenCloseTableOrPartitionAction.java    From crate with Apache License 2.0 6 votes vote down vote up
@Inject
public TransportOpenCloseTableOrPartitionAction(TransportService transportService,
                                                ClusterService clusterService,
                                                ThreadPool threadPool,
                                                IndexNameExpressionResolver indexNameExpressionResolver,
                                                AllocationService allocationService,
                                                DDLClusterStateService ddlClusterStateService,
                                                MetaDataIndexUpgradeService metaDataIndexUpgradeService,
                                                IndicesService indexServices) {
    super(ACTION_NAME,
        transportService,
        clusterService,
        threadPool,
        indexNameExpressionResolver,
        OpenCloseTableOrPartitionRequest::new,
        AcknowledgedResponse::new,
        AcknowledgedResponse::new,
        "open-table-or-partition");
    openExecutor = new OpenTableClusterStateTaskExecutor(indexNameExpressionResolver, allocationService,
        ddlClusterStateService, metaDataIndexUpgradeService, indexServices);
    closeExecutor = new CloseTableClusterStateTaskExecutor(indexNameExpressionResolver, allocationService,
        ddlClusterStateService);
}
 
Example #29
Source File: TransportDropUserAction.java    From crate with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportDropUserAction(TransportService transportService,
                               ClusterService clusterService,
                               ThreadPool threadPool,
                               IndexNameExpressionResolver indexNameExpressionResolver) {
    super(
        "internal:crate:sql/user/drop",
        transportService,
        clusterService,
        threadPool,
        DropUserRequest::new,
        indexNameExpressionResolver
    );
}
 
Example #30
Source File: PermissionsInfoAction.java    From deprecated-security-advanced-modules with Apache License 2.0 5 votes vote down vote up
protected PermissionsInfoAction(final Settings settings, final Path configPath, final RestController controller, final Client client,
		final AdminDNs adminDNs, final ConfigurationRepository cl, final ClusterService cs,
		final PrincipalExtractor principalExtractor, final PrivilegesEvaluator privilegesEvaluator, ThreadPool threadPool, AuditLog auditLog) {
	super(settings);
	controller.registerHandler(Method.GET, "/_opendistro/_security/api/permissionsinfo", this);
	this.threadPool = threadPool;
	this.privilegesEvaluator = privilegesEvaluator;
	this.restApiPrivilegesEvaluator = new RestApiPrivilegesEvaluator(settings, adminDNs, privilegesEvaluator, principalExtractor, configPath, threadPool);
}