Search in sources :

Example 36 with AliasFilter

use of org.opensearch.search.internal.AliasFilter in project OpenSearch by opensearch-project.

the class TransportClusterSearchShardsAction method masterOperation.

@Override
protected void masterOperation(final ClusterSearchShardsRequest request, final ClusterState state, final ActionListener<ClusterSearchShardsResponse> listener) {
    ClusterState clusterState = clusterService.state();
    String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(clusterState, request);
    Map<String, Set<String>> routingMap = indexNameExpressionResolver.resolveSearchRouting(state, request.routing(), request.indices());
    Map<String, AliasFilter> indicesAndFilters = new HashMap<>();
    Set<String> indicesAndAliases = indexNameExpressionResolver.resolveExpressions(clusterState, request.indices());
    for (String index : concreteIndices) {
        final AliasFilter aliasFilter = indicesService.buildAliasFilter(clusterState, index, indicesAndAliases);
        final String[] aliases = indexNameExpressionResolver.indexAliases(clusterState, index, aliasMetadata -> true, true, indicesAndAliases);
        indicesAndFilters.put(index, new AliasFilter(aliasFilter.getQueryBuilder(), aliases));
    }
    Set<String> nodeIds = new HashSet<>();
    GroupShardsIterator<ShardIterator> groupShardsIterator = clusterService.operationRouting().searchShards(clusterState, concreteIndices, routingMap, request.preference());
    ShardRouting shard;
    ClusterSearchShardsGroup[] groupResponses = new ClusterSearchShardsGroup[groupShardsIterator.size()];
    int currentGroup = 0;
    for (ShardIterator shardIt : groupShardsIterator) {
        ShardId shardId = shardIt.shardId();
        ShardRouting[] shardRoutings = new ShardRouting[shardIt.size()];
        int currentShard = 0;
        shardIt.reset();
        while ((shard = shardIt.nextOrNull()) != null) {
            shardRoutings[currentShard++] = shard;
            nodeIds.add(shard.currentNodeId());
        }
        groupResponses[currentGroup++] = new ClusterSearchShardsGroup(shardId, shardRoutings);
    }
    DiscoveryNode[] nodes = new DiscoveryNode[nodeIds.size()];
    int currentNode = 0;
    for (String nodeId : nodeIds) {
        nodes[currentNode++] = clusterState.getNodes().get(nodeId);
    }
    listener.onResponse(new ClusterSearchShardsResponse(groupResponses, nodes, indicesAndFilters));
}
Also used : ClusterState(org.opensearch.cluster.ClusterState) AliasFilter(org.opensearch.search.internal.AliasFilter) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) ShardId(org.opensearch.index.shard.ShardId) ShardIterator(org.opensearch.cluster.routing.ShardIterator) ShardRouting(org.opensearch.cluster.routing.ShardRouting) HashSet(java.util.HashSet)

Example 37 with AliasFilter

use of org.opensearch.search.internal.AliasFilter in project OpenSearch by opensearch-project.

the class SearchContextId method decode.

public static SearchContextId decode(NamedWriteableRegistry namedWriteableRegistry, String id) {
    final ByteBuffer byteBuffer;
    try {
        byteBuffer = ByteBuffer.wrap(Base64.getUrlDecoder().decode(id));
    } catch (Exception e) {
        throw new IllegalArgumentException("invalid id: [" + id + "]", e);
    }
    try (StreamInput in = new NamedWriteableAwareStreamInput(new ByteBufferStreamInput(byteBuffer), namedWriteableRegistry)) {
        final Version version = Version.readVersion(in);
        in.setVersion(version);
        final Map<ShardId, SearchContextIdForNode> shards = in.readMap(ShardId::new, SearchContextIdForNode::new);
        final Map<String, AliasFilter> aliasFilters = in.readMap(StreamInput::readString, AliasFilter::new);
        if (in.available() > 0) {
            throw new IllegalArgumentException("Not all bytes were read");
        }
        return new SearchContextId(Collections.unmodifiableMap(shards), Collections.unmodifiableMap(aliasFilters));
    } catch (IOException e) {
        throw new IllegalArgumentException(e);
    }
}
Also used : AliasFilter(org.opensearch.search.internal.AliasFilter) IOException(java.io.IOException) ByteBuffer(java.nio.ByteBuffer) IOException(java.io.IOException) ShardId(org.opensearch.index.shard.ShardId) ByteBufferStreamInput(org.opensearch.common.io.stream.ByteBufferStreamInput) Version(org.opensearch.Version) StreamInput(org.opensearch.common.io.stream.StreamInput) ByteBufferStreamInput(org.opensearch.common.io.stream.ByteBufferStreamInput) NamedWriteableAwareStreamInput(org.opensearch.common.io.stream.NamedWriteableAwareStreamInput) NamedWriteableAwareStreamInput(org.opensearch.common.io.stream.NamedWriteableAwareStreamInput)

Example 38 with AliasFilter

use of org.opensearch.search.internal.AliasFilter in project OpenSearch by opensearch-project.

the class TransportSearchAction method executeRequest.

private void executeRequest(Task task, SearchRequest searchRequest, SearchAsyncActionProvider searchAsyncActionProvider, ActionListener<SearchResponse> listener) {
    final long relativeStartNanos = System.nanoTime();
    final SearchTimeProvider timeProvider = new SearchTimeProvider(searchRequest.getOrCreateAbsoluteStartMillis(), relativeStartNanos, System::nanoTime);
    ActionListener<SearchSourceBuilder> rewriteListener = ActionListener.wrap(source -> {
        if (source != searchRequest.source()) {
            // only set it if it changed - we don't allow null values to be set but it might be already null. this way we catch
            // situations when source is rewritten to null due to a bug
            searchRequest.source(source);
        }
        final ClusterState clusterState = clusterService.state();
        final SearchContextId searchContext;
        final Map<String, OriginalIndices> remoteClusterIndices;
        if (searchRequest.pointInTimeBuilder() != null) {
            searchContext = SearchContextId.decode(namedWriteableRegistry, searchRequest.pointInTimeBuilder().getId());
            remoteClusterIndices = getIndicesFromSearchContexts(searchContext, searchRequest.indicesOptions());
        } else {
            searchContext = null;
            remoteClusterIndices = remoteClusterService.groupIndices(searchRequest.indicesOptions(), searchRequest.indices(), idx -> indexNameExpressionResolver.hasIndexAbstraction(idx, clusterState));
        }
        OriginalIndices localIndices = remoteClusterIndices.remove(RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY);
        if (remoteClusterIndices.isEmpty()) {
            executeLocalSearch(task, timeProvider, searchRequest, localIndices, clusterState, listener, searchContext, searchAsyncActionProvider);
        } else {
            if (shouldMinimizeRoundtrips(searchRequest)) {
                ccsRemoteReduce(searchRequest, localIndices, remoteClusterIndices, timeProvider, searchService.aggReduceContextBuilder(searchRequest), remoteClusterService, threadPool, listener, (r, l) -> executeLocalSearch(task, timeProvider, r, localIndices, clusterState, l, searchContext, searchAsyncActionProvider));
            } else {
                AtomicInteger skippedClusters = new AtomicInteger(0);
                collectSearchShards(searchRequest.indicesOptions(), searchRequest.preference(), searchRequest.routing(), skippedClusters, remoteClusterIndices, remoteClusterService, threadPool, ActionListener.wrap(searchShardsResponses -> {
                    final BiFunction<String, String, DiscoveryNode> clusterNodeLookup = getRemoteClusterNodeLookup(searchShardsResponses);
                    final Map<String, AliasFilter> remoteAliasFilters;
                    final List<SearchShardIterator> remoteShardIterators;
                    if (searchContext != null) {
                        remoteAliasFilters = searchContext.aliasFilter();
                        remoteShardIterators = getRemoteShardsIteratorFromPointInTime(searchShardsResponses, searchContext, searchRequest.pointInTimeBuilder().getKeepAlive(), remoteClusterIndices);
                    } else {
                        remoteAliasFilters = getRemoteAliasFilters(searchShardsResponses);
                        remoteShardIterators = getRemoteShardsIterator(searchShardsResponses, remoteClusterIndices, remoteAliasFilters);
                    }
                    int localClusters = localIndices == null ? 0 : 1;
                    int totalClusters = remoteClusterIndices.size() + localClusters;
                    int successfulClusters = searchShardsResponses.size() + localClusters;
                    executeSearch((SearchTask) task, timeProvider, searchRequest, localIndices, remoteShardIterators, clusterNodeLookup, clusterState, remoteAliasFilters, listener, new SearchResponse.Clusters(totalClusters, successfulClusters, skippedClusters.get()), searchContext, searchAsyncActionProvider);
                }, listener::onFailure));
            }
        }
    }, listener::onFailure);
    if (searchRequest.source() == null) {
        rewriteListener.onResponse(searchRequest.source());
    } else {
        Rewriteable.rewriteAndFetch(searchRequest.source(), searchService.getRewriteContext(timeProvider::getAbsoluteStartMillis), rewriteListener);
    }
}
Also used : RemoteClusterAware(org.opensearch.transport.RemoteClusterAware) Arrays(java.util.Arrays) LongSupplier(java.util.function.LongSupplier) CountDown(org.opensearch.common.util.concurrent.CountDown) ProfileShardResult(org.opensearch.search.profile.ProfileShardResult) SearchContext(org.opensearch.search.internal.SearchContext) BiFunction(java.util.function.BiFunction) ClusterSearchShardsResponse(org.opensearch.action.admin.cluster.shards.ClusterSearchShardsResponse) CircuitBreaker(org.opensearch.common.breaker.CircuitBreaker) DFS_QUERY_THEN_FETCH(org.opensearch.action.search.SearchType.DFS_QUERY_THEN_FETCH) Strings(org.opensearch.common.Strings) Transport(org.opensearch.transport.Transport) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) QUERY_THEN_FETCH(org.opensearch.action.search.SearchType.QUERY_THEN_FETCH) Property(org.opensearch.common.settings.Setting.Property) InternalAggregations(org.opensearch.search.aggregations.InternalAggregations) AliasFilter(org.opensearch.search.internal.AliasFilter) Map(java.util.Map) Inject(org.opensearch.common.inject.Inject) ActionListener(org.opensearch.action.ActionListener) CancellableTask(org.opensearch.tasks.CancellableTask) Client(org.opensearch.client.Client) TimeValue(org.opensearch.common.unit.TimeValue) NodeClient(org.opensearch.client.node.NodeClient) Index(org.opensearch.index.Index) RemoteTransportException(org.opensearch.transport.RemoteTransportException) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ClusterBlockException(org.opensearch.cluster.block.ClusterBlockException) Set(java.util.Set) Task(org.opensearch.tasks.Task) TransportService(org.opensearch.transport.TransportService) Collectors(java.util.stream.Collectors) OriginalIndices(org.opensearch.action.OriginalIndices) Nullable(org.opensearch.common.Nullable) ActionFilters(org.opensearch.action.support.ActionFilters) OperationRouting(org.opensearch.cluster.routing.OperationRouting) List(java.util.List) SearchPhaseResult(org.opensearch.search.SearchPhaseResult) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder) InternalAggregation(org.opensearch.search.aggregations.InternalAggregation) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver) SearchProfileShardResults(org.opensearch.search.profile.SearchProfileShardResults) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) HandledTransportAction(org.opensearch.action.support.HandledTransportAction) FieldSortBuilder.hasPrimaryFieldSort(org.opensearch.search.sort.FieldSortBuilder.hasPrimaryFieldSort) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ShardIterator(org.opensearch.cluster.routing.ShardIterator) ThreadPool(org.opensearch.threadpool.ThreadPool) HashMap(java.util.HashMap) IndicesOptions(org.opensearch.action.support.IndicesOptions) Writeable(org.opensearch.common.io.stream.Writeable) TimeoutTaskCancellationUtility(org.opensearch.action.support.TimeoutTaskCancellationUtility) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) NamedWriteableRegistry(org.opensearch.common.io.stream.NamedWriteableRegistry) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ClusterState(org.opensearch.cluster.ClusterState) BiConsumer(java.util.function.BiConsumer) StreamSupport(java.util.stream.StreamSupport) SearchService(org.opensearch.search.SearchService) TASKS_ORIGIN(org.opensearch.action.admin.cluster.node.tasks.get.GetTaskAction.TASKS_ORIGIN) Setting(org.opensearch.common.settings.Setting) RemoteClusterService(org.opensearch.transport.RemoteClusterService) Executor(java.util.concurrent.Executor) ClusterBlockLevel(org.opensearch.cluster.block.ClusterBlockLevel) Rewriteable(org.opensearch.index.query.Rewriteable) TaskId(org.opensearch.tasks.TaskId) InternalSearchResponse(org.opensearch.search.internal.InternalSearchResponse) ClusterSearchShardsGroup(org.opensearch.action.admin.cluster.shards.ClusterSearchShardsGroup) ClusterSearchShardsRequest(org.opensearch.action.admin.cluster.shards.ClusterSearchShardsRequest) ShardId(org.opensearch.index.shard.ShardId) TimeUnit(java.util.concurrent.TimeUnit) GroupShardsIterator(org.opensearch.cluster.routing.GroupShardsIterator) SearchShardTarget(org.opensearch.search.SearchShardTarget) CancelTasksRequest(org.opensearch.action.admin.cluster.node.tasks.cancel.CancelTasksRequest) CircuitBreakerService(org.opensearch.indices.breaker.CircuitBreakerService) ClusterService(org.opensearch.cluster.service.ClusterService) Collections(java.util.Collections) OriginSettingClient(org.opensearch.client.OriginSettingClient) ClusterState(org.opensearch.cluster.ClusterState) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) BiFunction(java.util.function.BiFunction) List(java.util.List) ArrayList(java.util.ArrayList) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) OriginalIndices(org.opensearch.action.OriginalIndices)

Example 39 with AliasFilter

use of org.opensearch.search.internal.AliasFilter in project OpenSearch by opensearch-project.

the class IndicesService method buildAliasFilter.

public AliasFilter buildAliasFilter(ClusterState state, String index, Set<String> resolvedExpressions) {
    /* Being static, parseAliasFilter doesn't have access to whatever guts it needs to parse a query. Instead of passing in a bunch
         * of dependencies we pass in a function that can perform the parsing. */
    CheckedFunction<BytesReference, QueryBuilder, IOException> filterParser = bytes -> {
        try (InputStream inputStream = bytes.streamInput();
            XContentParser parser = XContentFactory.xContentType(inputStream).xContent().createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, inputStream)) {
            return parseInnerQueryBuilder(parser);
        }
    };
    IndexMetadata indexMetadata = state.metadata().index(index);
    String[] aliases = indexNameExpressionResolver.filteringAliases(state, index, resolvedExpressions);
    return new AliasFilter(ShardSearchRequest.parseAliasFilter(filterParser, indexMetadata, aliases), aliases);
}
Also used : BytesReference(org.opensearch.common.bytes.BytesReference) OpenSearchRejectedExecutionException(org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException) SeqNoStats(org.opensearch.index.seqno.SeqNoStats) NRTReplicationEngineFactory(org.opensearch.index.engine.NRTReplicationEngineFactory) LongSupplier(java.util.function.LongSupplier) CheckedFunction(org.opensearch.common.CheckedFunction) IndexScopedSettings(org.opensearch.common.settings.IndexScopedSettings) SearchStats(org.opensearch.index.search.stats.SearchStats) Iterables(org.opensearch.common.util.iterable.Iterables) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) Version(org.opensearch.Version) MapBuilder.newMapBuilder(org.opensearch.common.collect.MapBuilder.newMapBuilder) IndexShardStats(org.opensearch.action.admin.indices.stats.IndexShardStats) FileSystemUtils(org.opensearch.common.io.FileSystemUtils) MergeStats(org.opensearch.index.merge.MergeStats) AbstractRefCounted(org.opensearch.common.util.concurrent.AbstractRefCounted) IndexFieldDataCache(org.opensearch.index.fielddata.IndexFieldDataCache) RecoveryState(org.opensearch.indices.recovery.RecoveryState) AliasFilter(org.opensearch.search.internal.AliasFilter) Map(java.util.Map) IndexModule(org.opensearch.index.IndexModule) NodeEnvironment(org.opensearch.env.NodeEnvironment) ScriptService(org.opensearch.script.ScriptService) Client(org.opensearch.client.Client) TimeValue(org.opensearch.common.unit.TimeValue) ShardRequestCache(org.opensearch.index.cache.request.ShardRequestCache) Index(org.opensearch.index.Index) Set(java.util.Set) Settings(org.opensearch.common.settings.Settings) IndexingStats(org.opensearch.index.shard.IndexingStats) GetStats(org.opensearch.index.get.GetStats) Executors(java.util.concurrent.Executors) QueryPhase(org.opensearch.search.query.QueryPhase) OpenSearchThreadPoolExecutor(org.opensearch.common.util.concurrent.OpenSearchThreadPoolExecutor) UncheckedIOException(java.io.UncheckedIOException) AbstractLifecycleComponent(org.opensearch.common.component.AbstractLifecycleComponent) CountDownLatch(java.util.concurrent.CountDownLatch) Logger(org.apache.logging.log4j.Logger) EngineConfigFactory(org.opensearch.index.engine.EngineConfigFactory) XContentType(org.opensearch.common.xcontent.XContentType) ShardLock(org.opensearch.env.ShardLock) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver) RepositoriesService(org.opensearch.repositories.RepositoriesService) IndexShardState(org.opensearch.index.shard.IndexShardState) ThreadPool(org.opensearch.threadpool.ThreadPool) ValuesSourceRegistry(org.opensearch.search.aggregations.support.ValuesSourceRegistry) Releasable(org.opensearch.common.lease.Releasable) Node(org.opensearch.node.Node) OpenSearchExecutors(org.opensearch.common.util.concurrent.OpenSearchExecutors) ArrayList(java.util.ArrayList) RecoverySource(org.opensearch.cluster.routing.RecoverySource) ClusterState(org.opensearch.cluster.ClusterState) LegacyESVersion(org.opensearch.LegacyESVersion) IndexingOperationListener(org.opensearch.index.shard.IndexingOperationListener) MapperRegistry(org.opensearch.indices.mapper.MapperRegistry) RetentionLeaseStats(org.opensearch.index.seqno.RetentionLeaseStats) CommitStats(org.opensearch.index.engine.CommitStats) NamedWriteableAwareStreamInput(org.opensearch.common.io.stream.NamedWriteableAwareStreamInput) EngineFactory(org.opensearch.index.engine.EngineFactory) Files(java.nio.file.Files) SearchType(org.opensearch.action.search.SearchType) FlushStats(org.opensearch.index.flush.FlushStats) IOException(java.io.IOException) BytesStreamOutput(org.opensearch.common.io.stream.BytesStreamOutput) IndexService(org.opensearch.index.IndexService) CollectionUtil(org.apache.lucene.util.CollectionUtil) PluginsService(org.opensearch.plugins.PluginsService) Flag(org.opensearch.action.admin.indices.stats.CommonStatsFlags.Flag) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) RecoveryStats(org.opensearch.index.recovery.RecoveryStats) ClusterService(org.opensearch.cluster.service.ClusterService) ShardStats(org.opensearch.action.admin.indices.stats.ShardStats) RetentionLeaseSyncer(org.opensearch.index.seqno.RetentionLeaseSyncer) CommonStats(org.opensearch.action.admin.indices.stats.CommonStats) CREATE_INDEX(org.opensearch.index.IndexService.IndexCreationContext.CREATE_INDEX) IdFieldMapper(org.opensearch.index.mapper.IdFieldMapper) AbstractRunnable(org.opensearch.common.util.concurrent.AbstractRunnable) SearchContext(org.opensearch.search.internal.SearchContext) OpenSearchException(org.opensearch.OpenSearchException) CircuitBreaker(org.opensearch.common.breaker.CircuitBreaker) CommonStatsFlags(org.opensearch.action.admin.indices.stats.CommonStatsFlags) XContentParser(org.opensearch.common.xcontent.XContentParser) IndexStorePlugin(org.opensearch.plugins.IndexStorePlugin) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) AnalysisRegistry(org.opensearch.index.analysis.AnalysisRegistry) MapperService(org.opensearch.index.mapper.MapperService) RefreshStats(org.opensearch.index.refresh.RefreshStats) CheckedSupplier(org.opensearch.common.CheckedSupplier) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) RecoveryListener(org.opensearch.indices.recovery.RecoveryListener) Locale(java.util.Locale) OpenSearchExecutors.daemonThreadFactory(org.opensearch.common.util.concurrent.OpenSearchExecutors.daemonThreadFactory) Property(org.opensearch.common.settings.Setting.Property) XContentFactory(org.opensearch.common.xcontent.XContentFactory) SegmentReplicationCheckpointPublisher(org.opensearch.indices.replication.checkpoint.SegmentReplicationCheckpointPublisher) IndicesClusterStateService(org.opensearch.indices.cluster.IndicesClusterStateService) CacheHelper(org.apache.lucene.index.IndexReader.CacheHelper) IndexEventListener(org.opensearch.index.shard.IndexEventListener) Predicate(java.util.function.Predicate) Collections.emptyList(java.util.Collections.emptyList) DirectoryReader(org.apache.lucene.index.DirectoryReader) Collection(java.util.Collection) LoggingDeprecationHandler(org.opensearch.common.xcontent.LoggingDeprecationHandler) Collectors(java.util.stream.Collectors) Nullable(org.opensearch.common.Nullable) Objects(java.util.Objects) RamUsageEstimator(org.apache.lucene.util.RamUsageEstimator) List(java.util.List) QueryBuilder(org.opensearch.index.query.QueryBuilder) IndexSettings(org.opensearch.index.IndexSettings) ResourceAlreadyExistsException(org.opensearch.ResourceAlreadyExistsException) Optional(java.util.Optional) BigArrays(org.opensearch.common.util.BigArrays) MetaStateService(org.opensearch.gateway.MetaStateService) AbstractQueryBuilder.parseInnerQueryBuilder(org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder) BytesReference(org.opensearch.common.bytes.BytesReference) NoOpEngine(org.opensearch.index.engine.NoOpEngine) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ShardSearchRequest(org.opensearch.search.internal.ShardSearchRequest) CheckedConsumer(org.opensearch.common.CheckedConsumer) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) StreamOutput(org.opensearch.common.io.stream.StreamOutput) ByteSizeValue(org.opensearch.common.unit.ByteSizeValue) HashMap(java.util.HashMap) EngineConfig(org.opensearch.index.engine.EngineConfig) IndicesFieldDataCache(org.opensearch.indices.fielddata.cache.IndicesFieldDataCache) QuerySearchResult(org.opensearch.search.query.QuerySearchResult) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) Function(java.util.function.Function) NamedWriteableRegistry(org.opensearch.common.io.stream.NamedWriteableRegistry) IndexShard(org.opensearch.index.shard.IndexShard) PeerRecoveryTargetService(org.opensearch.indices.recovery.PeerRecoveryTargetService) MetadataStateFormat(org.opensearch.gateway.MetadataStateFormat) IllegalIndexShardStateException(org.opensearch.index.shard.IllegalIndexShardStateException) ExecutorService(java.util.concurrent.ExecutorService) StreamInput(org.opensearch.common.io.stream.StreamInput) InternalEngineFactory(org.opensearch.index.engine.InternalEngineFactory) Collections.emptyMap(java.util.Collections.emptyMap) Setting(org.opensearch.common.settings.Setting) Iterator(java.util.Iterator) ShardLockObtainFailedException(org.opensearch.env.ShardLockObtainFailedException) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) CollectionUtils.arrayAsArrayList(org.opensearch.common.util.CollectionUtils.arrayAsArrayList) ShardRouting(org.opensearch.cluster.routing.ShardRouting) IOUtils(org.opensearch.core.internal.io.IOUtils) ShardId(org.opensearch.index.shard.ShardId) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Sets(org.opensearch.common.util.set.Sets) METADATA_VERIFICATION(org.opensearch.index.IndexService.IndexCreationContext.METADATA_VERIFICATION) QueryRewriteContext(org.opensearch.index.query.QueryRewriteContext) CircuitBreakerService(org.opensearch.indices.breaker.CircuitBreakerService) Closeable(java.io.Closeable) ALLOW_EXPENSIVE_QUERIES(org.opensearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES) Collections.unmodifiableMap(java.util.Collections.unmodifiableMap) LogManager(org.apache.logging.log4j.LogManager) Collections(java.util.Collections) InputStream(java.io.InputStream) AliasFilter(org.opensearch.search.internal.AliasFilter) InputStream(java.io.InputStream) QueryBuilder(org.opensearch.index.query.QueryBuilder) AbstractQueryBuilder.parseInnerQueryBuilder(org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder) UncheckedIOException(java.io.UncheckedIOException) IOException(java.io.IOException) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) XContentParser(org.opensearch.common.xcontent.XContentParser)

Aggregations

AliasFilter (org.opensearch.search.internal.AliasFilter)39 ShardId (org.opensearch.index.shard.ShardId)21 ShardSearchRequest (org.opensearch.search.internal.ShardSearchRequest)19 DiscoveryNode (org.opensearch.cluster.node.DiscoveryNode)17 CountDownLatch (java.util.concurrent.CountDownLatch)16 OriginalIndices (org.opensearch.action.OriginalIndices)16 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)15 HashMap (java.util.HashMap)14 SearchShardTarget (org.opensearch.search.SearchShardTarget)11 SearchSourceBuilder (org.opensearch.search.builder.SearchSourceBuilder)11 IOException (java.io.IOException)10 ArrayList (java.util.ArrayList)10 HashSet (java.util.HashSet)10 SearchRequest (org.opensearch.action.search.SearchRequest)10 IndexService (org.opensearch.index.IndexService)10 IndexShard (org.opensearch.index.shard.IndexShard)10 ShardSearchContextId (org.opensearch.search.internal.ShardSearchContextId)10 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)9 AtomicReference (java.util.concurrent.atomic.AtomicReference)9 IndicesService (org.opensearch.indices.IndicesService)9