Java Code Examples for org.elasticsearch.cluster.metadata.IndexNameExpressionResolver

The following examples show how to use org.elasticsearch.cluster.metadata.IndexNameExpressionResolver. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Elasticsearch   Source File: TransportCancelTasksAction.java    License: Apache License 2.0 6 votes vote down vote up
@Inject
public TransportCancelTasksAction(Settings settings, ClusterName clusterName, ThreadPool threadPool, ClusterService clusterService,
                                  TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver
                                      indexNameExpressionResolver) {
    super(settings, CancelTasksAction.NAME, clusterName, threadPool, clusterService, transportService, actionFilters,
        indexNameExpressionResolver, new Callable<CancelTasksRequest>() {
            @Override
            public CancelTasksRequest call() throws Exception {
                return new CancelTasksRequest();
            }
        }, ThreadPool.Names.MANAGEMENT);
    transportService.registerRequestHandler(BAN_PARENT_ACTION_NAME, new Callable<BanParentTaskRequest>() {
        @Override
        public BanParentTaskRequest call() throws Exception {
            return new BanParentTaskRequest();
        }
    }, ThreadPool.Names.SAME, new
        BanParentRequestHandler());
}
 
Example 2
Source Project: Elasticsearch   Source File: RemoteCollectorFactory.java    License: 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 Project: Elasticsearch   Source File: TransportTasksAction.java    License: 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 Project: Elasticsearch   Source File: ReferenceInfos.java    License: Apache License 2.0 6 votes vote down vote up
@Inject
public ReferenceInfos(Map<String, SchemaInfo> builtInSchemas,
                      ClusterService clusterService,
                      IndexNameExpressionResolver indexNameExpressionResolver,
                      ThreadPool threadPool,
                      Provider<TransportPutIndexTemplateAction> transportPutIndexTemplateAction,
                      Functions functions) {
    this.clusterService = clusterService;
    this.indexNameExpressionResolver = indexNameExpressionResolver;
    this.transportPutIndexTemplateAction = transportPutIndexTemplateAction;
    this.functions = functions;
    this.executorService = (ExecutorService) threadPool.executor(ThreadPool.Names.SUGGEST);
    schemas.putAll(builtInSchemas);
    schemas.remove(BlobSchemaInfo.NAME); // remove blob schema name
    this.builtInSchemas = builtInSchemas;
    clusterService.add(this);
}
 
Example 5
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 Project: Elasticsearch   Source File: DocTableInfoBuilder.java    License: 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 Project: Elasticsearch   Source File: TransportDeleteBlobAction.java    License: 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
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
@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 Project: Elasticsearch   Source File: TransportSearchScrollAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportSearchScrollAction(Settings settings, ThreadPool threadPool, TransportService transportService,
                                   ClusterService clusterService, SearchServiceTransportAction searchService,
                                   SearchPhaseController searchPhaseController,
                                   ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, SearchScrollAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
            SearchScrollRequest.class);
    this.clusterService = clusterService;
    this.searchService = searchService;
    this.searchPhaseController = searchPhaseController;
}
 
Example 11
@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 Project: Elasticsearch   Source File: TransportGetSettingsAction.java    License: 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
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
@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 Project: Elasticsearch   Source File: TransportDfsOnlyAction.java    License: 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
@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
@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
@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 Project: Elasticsearch   Source File: TransportClusterStatsAction.java    License: 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 Project: Elasticsearch   Source File: TransportMultiSearchAction.java    License: 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 Project: Elasticsearch   Source File: TransportShardBulkAction.java    License: 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 Project: Elasticsearch   Source File: TransportIndicesStatsAction.java    License: 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 Project: Elasticsearch   Source File: TransportUpgradeAction.java    License: 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 Project: Elasticsearch   Source File: BulkShardProcessor.java    License: 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
@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 Project: Elasticsearch   Source File: TransportShardFlushAction.java    License: 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 Project: Elasticsearch   Source File: TransportOpenIndexAction.java    License: 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
@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 Project: Elasticsearch   Source File: TransportMultiGetAction.java    License: Apache License 2.0 5 votes vote down vote up
@Inject
public TransportMultiGetAction(Settings settings, ThreadPool threadPool, TransportService transportService,
                               ClusterService clusterService, TransportShardMultiGetAction shardAction,
                               ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, MultiGetAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, MultiGetRequest.class);
    this.clusterService = clusterService;
    this.shardAction = shardAction;
}
 
Example 30
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);
}