org.elasticsearch.cluster.metadata.IndexNameExpressionResolver Java Examples

The following examples show how to use org.elasticsearch.cluster.metadata.IndexNameExpressionResolver. 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: TransportCancelTasksAction.java    From Elasticsearch with 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 #2
Source File: RemoteCollectorFactory.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Inject
public RemoteCollectorFactory(ClusterService clusterService,
                              Functions functions,
                              ThreadPool threadPool,
                              JobContextService jobContextService,
                              Settings settings,
                              TransportActionProvider transportActionProvider,
                              BulkRetryCoordinatorPool bulkRetryCoordinatorPool,
                              IndexNameExpressionResolver indexNameExpressionResolver,
                              NestedReferenceResolver referenceResolver) {
    this.clusterService = clusterService;
    this.functions = functions;
    this.threadPool = threadPool;
    this.jobContextService = jobContextService;
    this.settings = settings;
    this.transportActionProvider = transportActionProvider;
    this.bulkRetryCoordinatorPool = bulkRetryCoordinatorPool;
    this.indexNameExpressionResolver = indexNameExpressionResolver;

    normalizer = new EvaluatingNormalizer(functions, RowGranularity.NODE, referenceResolver);
    implementationVisitor = new ImplementationSymbolVisitor(functions);
}
 
Example #3
Source File: TransportTasksAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
protected TransportTasksAction(Settings settings, String actionName, ClusterName clusterName, ThreadPool threadPool,
                               ClusterService clusterService, TransportService transportService, ActionFilters actionFilters,
                               IndexNameExpressionResolver indexNameExpressionResolver, Callable<TasksRequest> requestFactory,
                               String nodeExecutor) {
    super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, requestFactory);
    this.clusterName = clusterName;
    this.clusterService = clusterService;
    this.transportService = transportService;
    this.transportNodeAction = actionName + "[n]";
    this.requestFactory = requestFactory;

    transportService.registerRequestHandler(transportNodeAction, new Callable<NodeTaskRequest>() {
        @Override
        public NodeTaskRequest call() throws Exception {
            return new NodeTaskRequest();
        }
    }, nodeExecutor, new NodeTransportHandler());
}
 
Example #4
Source File: ReferenceInfos.java    From Elasticsearch with 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 #5
Source File: TransportBroadcastByNodeAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public TransportBroadcastByNodeAction(
        Settings settings,
        String actionName,
        ThreadPool threadPool,
        ClusterService clusterService,
        TransportService transportService,
        ActionFilters actionFilters,
        IndexNameExpressionResolver indexNameExpressionResolver,
        Class<Request> request,
        String executor) {
    super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);

    this.clusterService = clusterService;
    this.transportService = transportService;

    transportNodeBroadcastAction = actionName + "[n]";

    transportService.registerRequestHandler(transportNodeBroadcastAction, new Callable<NodeRequest>() {
        @Override
        public NodeRequest call() throws Exception {
            return new NodeRequest();
        }
    }, executor, new BroadcastByNodeTransportRequestHandler());
}
 
Example #6
Source File: DocTableInfoBuilder.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
public DocTableInfoBuilder(Functions functions,
                           TableIdent ident,
                           ClusterService clusterService,
                           IndexNameExpressionResolver indexNameExpressionResolver,
                           TransportPutIndexTemplateAction transportPutIndexTemplateAction,
                           ExecutorService executorService,
                           boolean checkAliasSchema) {
    this.functions = functions;
    this.clusterService = clusterService;
    this.indexNameExpressionResolver = indexNameExpressionResolver;
    this.transportPutIndexTemplateAction = transportPutIndexTemplateAction;
    this.ident = ident;
    this.executorService = executorService;
    this.state = clusterService.state();
    this.metaData = state.metaData();
    this.checkAliasSchema = checkAliasSchema;
}
 
Example #7
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 #8
Source File: AuditLogImpl.java    From deprecated-security-advanced-modules with Apache License 2.0 5 votes vote down vote up
public AuditLogImpl(final Settings settings, final Path configPath, Client clientProvider, ThreadPool threadPool,
					final IndexNameExpressionResolver resolver, final ClusterService clusterService) {
	super(settings, threadPool, resolver, clusterService);

	this.messageRouter = new AuditMessageRouter(settings, clientProvider, threadPool, configPath);
	this.enabled = messageRouter.isEnabled();

	log.info("Message routing enabled: {}", this.enabled);

	final SecurityManager sm = System.getSecurityManager();

	if (sm != null) {
		log.debug("Security Manager present");
		sm.checkPermission(new SpecialPermission());
	}

	AccessController.doPrivileged(new PrivilegedAction<Object>() {
		@Override
		public Object run() {
			Runtime.getRuntime().addShutdownHook(new Thread() {

				@Override
				public void run() {
					try {
						close();
					} catch (final IOException e) {
						log.warn("Exception while shutting down message router", e);
					}
				}
			});
			log.debug("Shutdown Hook registered");
			return null;
		}
	});

}
 
Example #9
Source File: TransportClusterHealthAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportClusterHealthAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                    ThreadPool threadPool, ClusterName clusterName, ActionFilters actionFilters,
                                    IndexNameExpressionResolver indexNameExpressionResolver, GatewayAllocator gatewayAllocator) {
    super(settings, ClusterHealthAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, ClusterHealthRequest.class);
    this.clusterName = clusterName;
    this.gatewayAllocator = gatewayAllocator;
}
 
Example #10
Source File: TransportSearchScrollAction.java    From Elasticsearch with 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 #11
Source File: TransportClearIndicesCacheAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportClearIndicesCacheAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                        TransportService transportService, IndicesService indicesService,
                                        IndicesRequestCache indicesQueryCache, ActionFilters actionFilters,
                                        IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ClearIndicesCacheAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            ClearIndicesCacheRequest.class, ThreadPool.Names.MANAGEMENT);
    this.indicesService = indicesService;
    this.indicesRequestCache = indicesQueryCache;
}
 
Example #12
Source File: TransportGetSettingsAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportGetSettingsAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                  ThreadPool threadPool, SettingsFilter settingsFilter, ActionFilters actionFilters,
                                  IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, GetSettingsAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, GetSettingsRequest.class);
    this.settingsFilter = settingsFilter;
}
 
Example #13
Source File: SearchDfsQueryThenFetchAsyncAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
SearchDfsQueryThenFetchAsyncAction(ESLogger logger, SearchServiceTransportAction searchService,
                                           ClusterService clusterService, IndexNameExpressionResolver indexNameExpressionResolver,
                                           SearchPhaseController searchPhaseController, ThreadPool threadPool,
                                           SearchRequest request, ActionListener<SearchResponse> listener) {
    super(logger, searchService, clusterService, indexNameExpressionResolver, searchPhaseController, threadPool, request, listener);
    queryResults = new AtomicArray<>(firstResults.length());
    fetchResults = new AtomicArray<>(firstResults.length());
    docIdsToLoad = new AtomicArray<>(firstResults.length());
}
 
Example #14
Source File: TransportShardMultiPercolateAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@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 #15
Source File: TransportDfsOnlyAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportDfsOnlyAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
                              ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, SearchService searchService, SearchPhaseController searchPhaseController) {
    super(settings, NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            DfsOnlyRequest.class, ShardDfsOnlyRequest.class, ThreadPool.Names.SEARCH);
    this.searchService = searchService;
    this.searchPhaseController = searchPhaseController;
}
 
Example #16
Source File: ElasticReportPlugin.java    From elasticsearch-report-engine with GNU General Public License v3.0 5 votes vote down vote up
@Override
public List<RestHandler> getRestHandlers(Settings settings,
    RestController restController, ClusterSettings clusterSettings,
    IndexScopedSettings indexScopedSettings,
    SettingsFilter settingsFilter,
    IndexNameExpressionResolver indexNameExpressionResolver,
    Supplier<DiscoveryNodes> nodesInCluster) {
  return Arrays.asList(new ReportGenerateRestAction(settings, restController));
}
 
Example #17
Source File: TransportIndexShardStatsAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportIndexShardStatsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                   TransportService transportService, IndicesService indicesService,
                                   ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, IndexShardStatsAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            IndexShardStatsRequest.class, ThreadPool.Names.MANAGEMENT);
    this.indicesService = indicesService;
}
 
Example #18
Source File: TransportIndicesSegmentsAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportIndicesSegmentsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
                                      IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, IndicesSegmentsAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            IndicesSegmentsRequest.class, ThreadPool.Names.MANAGEMENT);
    this.indicesService = indicesService;
}
 
Example #19
Source File: TransportClusterStatsAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportClusterStatsAction(Settings settings, ClusterName clusterName, ThreadPool threadPool,
                                   ClusterService clusterService, TransportService transportService,
                                   NodeService nodeService, IndicesService indicesService,
                                   ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ClusterStatsAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
            indexNameExpressionResolver, ClusterStatsRequest.class, ClusterStatsNodeRequest.class, ThreadPool.Names.MANAGEMENT);
    this.nodeService = nodeService;
    this.indicesService = indicesService;
}
 
Example #20
Source File: TransportMultiSearchAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportMultiSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService,
                                  ClusterService clusterService, TransportSearchAction searchAction,
                                  ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, MultiSearchAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, MultiSearchRequest.class);
    this.clusterService = clusterService;
    this.searchAction = searchAction;
}
 
Example #21
Source File: TransportShardBulkAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportShardBulkAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
                                MappingUpdatedAction mappingUpdatedAction, UpdateHelper updateHelper, ActionFilters actionFilters,
                                IndexNameExpressionResolver indexNameExpressionResolver, FsService fsService) {
    super(settings, ACTION_NAME, transportService, clusterService, indicesService, threadPool, shardStateAction, mappingUpdatedAction,
            actionFilters, indexNameExpressionResolver,
            BulkShardRequest.class, BulkShardRequest.class, ThreadPool.Names.BULK);
    this.updateHelper = updateHelper;
    this.allowIdGeneration = settings.getAsBoolean("action.allow_id_generation", true);
    this.fsService = fsService;
}
 
Example #22
Source File: TransportIndicesStatsAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportIndicesStatsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                   TransportService transportService, IndicesService indicesService,
                                   ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, IndicesStatsAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            IndicesStatsRequest.class, ThreadPool.Names.MANAGEMENT);
    this.indicesService = indicesService;
}
 
Example #23
Source File: TransportUpgradeAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportUpgradeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                              TransportService transportService, IndicesService indicesService, ActionFilters actionFilters,
                              IndexNameExpressionResolver indexNameExpressionResolver, TransportUpgradeSettingsAction upgradeSettingsAction) {
    super(settings, UpgradeAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver, UpgradeRequest.class, ThreadPool.Names.FORCE_MERGE);
    this.indicesService = indicesService;
    this.upgradeSettingsAction = upgradeSettingsAction;
}
 
Example #24
Source File: BulkShardProcessor.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public BulkShardProcessor(ClusterService clusterService,
                          TransportBulkCreateIndicesAction transportBulkCreateIndicesAction,
                          IndexNameExpressionResolver indexNameExpressionResolver,
                          final Settings settings,
                          BulkRetryCoordinatorPool bulkRetryCoordinatorPool,
                          final boolean autoCreateIndices,
                          int bulkSize,
                          BulkRequestBuilder<Request> requestBuilder,
                          BulkRequestExecutor<Request> requestExecutor,
                          UUID jobId) {
    this.bulkRetryCoordinatorPool = bulkRetryCoordinatorPool;
    this.clusterService = clusterService;
    this.autoCreateIndices = autoCreateIndices;
    this.bulkSize = bulkSize;
    this.jobId = jobId;
    this.createIndicesBulkSize = Math.min(bulkSize, MAX_CREATE_INDICES_BULK_SIZE);


    if (autoCreateIndices) {
        final AutoCreateIndex autoCreateIndex = new AutoCreateIndex(settings, indexNameExpressionResolver);
        shouldAutocreateIndexPredicate = new Predicate<String>() {
            @Override
            public boolean apply(@Nullable String input) {
                assert input != null;
                return autoCreateIndex.shouldAutoCreate(input, BulkShardProcessor.this.clusterService.state());
            }
        };
    } else {
        shouldAutocreateIndexPredicate = Predicates.alwaysFalse();
    }

    this.transportBulkCreateIndicesAction = transportBulkCreateIndicesAction;
    responses = new BitSet();
    result = SettableFuture.create();

    this.requestExecutor = requestExecutor;
    this.requestBuilder = requestBuilder;
}
 
Example #25
Source File: TransportPutIndexTemplateAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportPutIndexTemplateAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                       ThreadPool threadPool, MetaDataIndexTemplateService indexTemplateService,
                                       ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, PutIndexTemplateAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, PutIndexTemplateRequest.class);
    this.indexTemplateService = indexTemplateService;
}
 
Example #26
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 #27
Source File: TransportOpenIndexAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportOpenIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                ThreadPool threadPool, MetaDataIndexStateService indexStateService,
                                NodeSettingsService nodeSettingsService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
                                DestructiveOperations destructiveOperations) {
    super(settings, OpenIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, OpenIndexRequest.class);
    this.indexStateService = indexStateService;
    this.destructiveOperations = destructiveOperations;
}
 
Example #28
Source File: TransportShardMultiTermsVectorAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Inject
public TransportShardMultiTermsVectorAction(Settings settings, ClusterService clusterService, TransportService transportService,
                                            IndicesService indicesService, ThreadPool threadPool, ActionFilters actionFilters,
                                            IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            MultiTermVectorsShardRequest.class, ThreadPool.Names.GET);
    this.indicesService = indicesService;
}
 
Example #29
Source File: TransportMultiGetAction.java    From Elasticsearch with 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 #30
Source File: ProjectionToProjectorVisitor.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public ProjectionToProjectorVisitor(ClusterService clusterService,
                                    Functions functions,
                                    IndexNameExpressionResolver indexNameExpressionResolver,
                                    ThreadPool threadPool,
                                    Settings settings,
                                    TransportActionProvider transportActionProvider,
                                    BulkRetryCoordinatorPool bulkRetryCoordinatorPool,
                                    ImplementationSymbolVisitor symbolVisitor,
                                    EvaluatingNormalizer normalizer) {
    this(clusterService, functions, indexNameExpressionResolver, threadPool, settings, transportActionProvider, bulkRetryCoordinatorPool, symbolVisitor, normalizer, null);
}