Search in sources :

Example 1 with ClusterService

use of org.opensearch.cluster.service.ClusterService in project OpenSearch by opensearch-project.

the class ZenDiscoveryIT method testHandleNodeJoin_incompatibleClusterState.

public void testHandleNodeJoin_incompatibleClusterState() throws InterruptedException, ExecutionException, TimeoutException {
    String masterNode = internalCluster().startMasterOnlyNode();
    String node1 = internalCluster().startNode();
    ClusterService clusterService = internalCluster().getInstance(ClusterService.class, node1);
    Coordinator coordinator = (Coordinator) internalCluster().getInstance(Discovery.class, masterNode);
    final ClusterState state = clusterService.state();
    Metadata.Builder mdBuilder = Metadata.builder(state.metadata());
    mdBuilder.putCustom(CustomMetadata.TYPE, new CustomMetadata("data"));
    ClusterState stateWithCustomMetadata = ClusterState.builder(state).metadata(mdBuilder).build();
    final CompletableFuture<Throwable> future = new CompletableFuture<>();
    DiscoveryNode node = state.nodes().getLocalNode();
    coordinator.sendValidateJoinRequest(stateWithCustomMetadata, new JoinRequest(node, 0L, Optional.empty()), new JoinHelper.JoinCallback() {

        @Override
        public void onSuccess() {
            future.completeExceptionally(new AssertionError("onSuccess should not be called"));
        }

        @Override
        public void onFailure(Exception e) {
            future.complete(e);
        }
    });
    Throwable t = future.get(10, TimeUnit.SECONDS);
    assertTrue(t instanceof IllegalStateException);
    assertTrue(t.getCause() instanceof RemoteTransportException);
    assertTrue(t.getCause().getCause() instanceof IllegalArgumentException);
    assertThat(t.getCause().getCause().getMessage(), containsString("Unknown NamedWriteable"));
}
Also used : ClusterState(org.opensearch.cluster.ClusterState) RemoteTransportException(org.opensearch.transport.RemoteTransportException) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) Discovery(org.opensearch.discovery.Discovery) Metadata(org.opensearch.cluster.metadata.Metadata) TestCustomMetadata(org.opensearch.test.TestCustomMetadata) Matchers.containsString(org.hamcrest.Matchers.containsString) TimeoutException(java.util.concurrent.TimeoutException) RemoteTransportException(org.opensearch.transport.RemoteTransportException) ExecutionException(java.util.concurrent.ExecutionException) CompletableFuture(java.util.concurrent.CompletableFuture) ClusterService(org.opensearch.cluster.service.ClusterService) TestCustomMetadata(org.opensearch.test.TestCustomMetadata)

Example 2 with ClusterService

use of org.opensearch.cluster.service.ClusterService in project OpenSearch by opensearch-project.

the class ShardStateActionIT method testFollowupRerouteCanBeSetToHigherPriority.

public void testFollowupRerouteCanBeSetToHigherPriority() {
    // Shows that in a cluster under unbearable pressure we can still assign replicas (for now at least) by setting
    // cluster.routing.allocation.shard_state.reroute.priority to a higher priority. Can be removed when this setting is removed, as
    // we should at that point be confident that the default priority is appropriate for all clusters.
    internalCluster().ensureAtLeastNumDataNodes(2);
    assertAcked(client().admin().cluster().prepareUpdateSettings().setPersistentSettings(Settings.builder().put(ShardStateAction.FOLLOW_UP_REROUTE_PRIORITY_SETTING.getKey(), "urgent")));
    // ensure that the master always has a HIGH priority pending task
    final AtomicBoolean stopSpammingMaster = new AtomicBoolean();
    final ClusterService masterClusterService = internalCluster().getInstance(ClusterService.class, internalCluster().getMasterName());
    masterClusterService.submitStateUpdateTask("spam", new ClusterStateUpdateTask(Priority.HIGH) {

        @Override
        public ClusterState execute(ClusterState currentState) {
            return currentState;
        }

        @Override
        public void onFailure(String source, Exception e) {
            throw new AssertionError(source, e);
        }

        @Override
        public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
            if (stopSpammingMaster.get() == false) {
                masterClusterService.submitStateUpdateTask("spam", this);
            }
        }
    });
    // even with the master under such pressure, all shards of the index can be assigned; in particular, after the primaries have
    // started there's a follow-up reroute at a higher priority than the spam
    createIndex("test");
    assertFalse(client().admin().cluster().prepareHealth().setWaitForGreenStatus().get().isTimedOut());
    stopSpammingMaster.set(true);
    assertFalse(client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).get().isTimedOut());
    assertAcked(client().admin().cluster().prepareUpdateSettings().setPersistentSettings(Settings.builder().putNull(ShardStateAction.FOLLOW_UP_REROUTE_PRIORITY_SETTING.getKey())));
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ClusterState(org.opensearch.cluster.ClusterState) ClusterService(org.opensearch.cluster.service.ClusterService) ClusterStateUpdateTask(org.opensearch.cluster.ClusterStateUpdateTask) Matchers.containsString(org.hamcrest.Matchers.containsString)

Example 3 with ClusterService

use of org.opensearch.cluster.service.ClusterService in project OpenSearch by opensearch-project.

the class TransportClearVotingConfigExclusionsAction method masterOperation.

@Override
protected void masterOperation(ClearVotingConfigExclusionsRequest request, ClusterState initialState, ActionListener<ClearVotingConfigExclusionsResponse> listener) throws Exception {
    final long startTimeMillis = threadPool.relativeTimeInMillis();
    final Predicate<ClusterState> allExclusionsRemoved = newState -> {
        for (VotingConfigExclusion tombstone : initialState.getVotingConfigExclusions()) {
            // NB checking for the existence of any node with this persistent ID, because persistent IDs are how votes are counted.
            if (newState.nodes().nodeExists(tombstone.getNodeId())) {
                return false;
            }
        }
        return true;
    };
    if (request.getWaitForRemoval() && allExclusionsRemoved.test(initialState) == false) {
        final ClusterStateObserver clusterStateObserver = new ClusterStateObserver(initialState, clusterService, request.getTimeout(), logger, threadPool.getThreadContext());
        clusterStateObserver.waitForNextChange(new Listener() {

            @Override
            public void onNewClusterState(ClusterState state) {
                submitClearVotingConfigExclusionsTask(request, startTimeMillis, listener);
            }

            @Override
            public void onClusterServiceClose() {
                listener.onFailure(new OpenSearchException("cluster service closed while waiting for removal of nodes " + initialState.getVotingConfigExclusions()));
            }

            @Override
            public void onTimeout(TimeValue timeout) {
                listener.onFailure(new OpenSearchTimeoutException("timed out waiting for removal of nodes; if nodes should not be removed, set waitForRemoval to false. " + initialState.getVotingConfigExclusions()));
            }
        }, allExclusionsRemoved);
    } else {
        submitClearVotingConfigExclusionsTask(request, startTimeMillis, listener);
    }
}
Also used : VotingConfigExclusion(org.opensearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion) Metadata(org.opensearch.cluster.metadata.Metadata) ThreadPool(org.opensearch.threadpool.ThreadPool) Priority(org.opensearch.common.Priority) TransportMasterNodeAction(org.opensearch.action.support.master.TransportMasterNodeAction) OpenSearchException(org.opensearch.OpenSearchException) CoordinationMetadata(org.opensearch.cluster.coordination.CoordinationMetadata) ClusterState(org.opensearch.cluster.ClusterState) Inject(org.opensearch.common.inject.Inject) ActionListener(org.opensearch.action.ActionListener) ClusterStateObserver(org.opensearch.cluster.ClusterStateObserver) StreamInput(org.opensearch.common.io.stream.StreamInput) TimeValue(org.opensearch.common.unit.TimeValue) Predicate(java.util.function.Predicate) ClusterBlockLevel(org.opensearch.cluster.block.ClusterBlockLevel) ClusterBlockException(org.opensearch.cluster.block.ClusterBlockException) IOException(java.io.IOException) Listener(org.opensearch.cluster.ClusterStateObserver.Listener) TransportService(org.opensearch.transport.TransportService) ActionFilters(org.opensearch.action.support.ActionFilters) Logger(org.apache.logging.log4j.Logger) ClusterStateUpdateTask(org.opensearch.cluster.ClusterStateUpdateTask) OpenSearchTimeoutException(org.opensearch.OpenSearchTimeoutException) ClusterService(org.opensearch.cluster.service.ClusterService) LogManager(org.apache.logging.log4j.LogManager) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver) Names(org.opensearch.threadpool.ThreadPool.Names) VotingConfigExclusion(org.opensearch.cluster.coordination.CoordinationMetadata.VotingConfigExclusion) ClusterState(org.opensearch.cluster.ClusterState) ClusterStateObserver(org.opensearch.cluster.ClusterStateObserver) ActionListener(org.opensearch.action.ActionListener) Listener(org.opensearch.cluster.ClusterStateObserver.Listener) OpenSearchTimeoutException(org.opensearch.OpenSearchTimeoutException) OpenSearchException(org.opensearch.OpenSearchException) TimeValue(org.opensearch.common.unit.TimeValue)

Example 4 with ClusterService

use of org.opensearch.cluster.service.ClusterService in project OpenSearch by opensearch-project.

the class TransportClusterHealthAction method executeHealth.

private void executeHealth(final ClusterHealthRequest request, final ClusterState currentState, final ActionListener<ClusterHealthResponse> listener, final int waitCount, final Consumer<ClusterState> onNewClusterStateAfterDelay) {
    if (request.timeout().millis() == 0) {
        listener.onResponse(getResponse(request, currentState, waitCount, TimeoutState.ZERO_TIMEOUT));
        return;
    }
    final Predicate<ClusterState> validationPredicate = newState -> validateRequest(request, newState, waitCount);
    if (validationPredicate.test(currentState)) {
        listener.onResponse(getResponse(request, currentState, waitCount, TimeoutState.OK));
    } else {
        final ClusterStateObserver observer = new ClusterStateObserver(currentState, clusterService, null, logger, threadPool.getThreadContext());
        final ClusterStateObserver.Listener stateListener = new ClusterStateObserver.Listener() {

            @Override
            public void onNewClusterState(ClusterState newState) {
                onNewClusterStateAfterDelay.accept(newState);
            }

            @Override
            public void onClusterServiceClose() {
                listener.onFailure(new NodeClosedException(clusterService.localNode()));
            }

            @Override
            public void onTimeout(TimeValue timeout) {
                listener.onResponse(getResponse(request, observer.setAndGetObservedState(), waitCount, TimeoutState.TIMED_OUT));
            }
        };
        observer.waitForNextChange(stateListener, validationPredicate, request.timeout());
    }
}
Also used : ThreadPool(org.opensearch.threadpool.ThreadPool) AllocationService(org.opensearch.cluster.routing.allocation.AllocationService) IndicesOptions(org.opensearch.action.support.IndicesOptions) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) Strings(org.opensearch.common.Strings) ClusterState(org.opensearch.cluster.ClusterState) NotMasterException(org.opensearch.cluster.NotMasterException) NodeClosedException(org.opensearch.node.NodeClosedException) Inject(org.opensearch.common.inject.Inject) ActionListener(org.opensearch.action.ActionListener) ClusterStateObserver(org.opensearch.cluster.ClusterStateObserver) UnassignedInfo(org.opensearch.cluster.routing.UnassignedInfo) ClusterHealthStatus(org.opensearch.cluster.health.ClusterHealthStatus) ProcessClusterEventTimeoutException(org.opensearch.cluster.metadata.ProcessClusterEventTimeoutException) StreamInput(org.opensearch.common.io.stream.StreamInput) TimeValue(org.opensearch.common.unit.TimeValue) CollectionUtils(org.opensearch.common.util.CollectionUtils) Predicate(java.util.function.Predicate) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) ClusterBlockException(org.opensearch.cluster.block.ClusterBlockException) IOException(java.io.IOException) Task(org.opensearch.tasks.Task) TransportService(org.opensearch.transport.TransportService) ActiveShardCount(org.opensearch.action.support.ActiveShardCount) LocalClusterUpdateTask(org.opensearch.cluster.LocalClusterUpdateTask) Consumer(java.util.function.Consumer) ActionFilters(org.opensearch.action.support.ActionFilters) Logger(org.apache.logging.log4j.Logger) ClusterStateUpdateTask(org.opensearch.cluster.ClusterStateUpdateTask) ClusterService(org.opensearch.cluster.service.ClusterService) LogManager(org.apache.logging.log4j.LogManager) TransportMasterNodeReadAction(org.opensearch.action.support.master.TransportMasterNodeReadAction) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver) ClusterState(org.opensearch.cluster.ClusterState) ClusterStateObserver(org.opensearch.cluster.ClusterStateObserver) ActionListener(org.opensearch.action.ActionListener) NodeClosedException(org.opensearch.node.NodeClosedException) TimeValue(org.opensearch.common.unit.TimeValue)

Example 5 with ClusterService

use of org.opensearch.cluster.service.ClusterService in project OpenSearch by opensearch-project.

the class IndexRecoveryIT method testUsesFileBasedRecoveryIfRetentionLeaseAheadOfGlobalCheckpoint.

public void testUsesFileBasedRecoveryIfRetentionLeaseAheadOfGlobalCheckpoint() throws Exception {
    internalCluster().ensureAtLeastNumDataNodes(2);
    String indexName = "test-index";
    createIndex(indexName, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 1).put(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true).put(UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "12h").build());
    indexRandom(randomBoolean(), randomBoolean(), randomBoolean(), IntStream.range(0, between(0, 100)).mapToObj(n -> client().prepareIndex(indexName).setSource("num", n)).collect(toList()));
    ensureGreen(indexName);
    final ShardId shardId = new ShardId(resolveIndex(indexName), 0);
    final DiscoveryNodes discoveryNodes = clusterService().state().nodes();
    final IndexShardRoutingTable indexShardRoutingTable = clusterService().state().routingTable().shardRoutingTable(shardId);
    final IndexShard primary = internalCluster().getInstance(IndicesService.class, discoveryNodes.get(indexShardRoutingTable.primaryShard().currentNodeId()).getName()).getShardOrNull(shardId);
    final ShardRouting replicaShardRouting = indexShardRoutingTable.replicaShards().get(0);
    internalCluster().restartNode(discoveryNodes.get(replicaShardRouting.currentNodeId()).getName(), new InternalTestCluster.RestartCallback() {

        @Override
        public Settings onNodeStopped(String nodeName) throws Exception {
            assertFalse(client().admin().cluster().prepareHealth().setWaitForNodes(Integer.toString(discoveryNodes.getSize() - 1)).setWaitForEvents(Priority.LANGUID).get().isTimedOut());
            indexRandom(randomBoolean(), randomBoolean(), randomBoolean(), IntStream.range(0, between(1, 100)).mapToObj(n -> client().prepareIndex(indexName).setSource("num", n)).collect(toList()));
            // We do not guarantee that the replica can recover locally all the way to its own global checkpoint before starting
            // to recover from the primary, so we must be careful not to perform an operations-based recovery if this would require
            // some operations that are not being retained. Emulate this by advancing the lease ahead of the replica's GCP:
            primary.renewRetentionLease(ReplicationTracker.getPeerRecoveryRetentionLeaseId(replicaShardRouting), primary.seqNoStats().getMaxSeqNo() + 1, ReplicationTracker.PEER_RECOVERY_RETENTION_LEASE_SOURCE);
            return super.onNodeStopped(nodeName);
        }
    });
    ensureGreen(indexName);
    // noinspection OptionalGetWithoutIsPresent because it fails the test if absent
    final RecoveryState recoveryState = client().admin().indices().prepareRecoveries(indexName).get().shardRecoveryStates().get(indexName).stream().filter(rs -> rs.getPrimary() == false).findFirst().get();
    assertThat(recoveryState.getIndex().totalFileCount(), greaterThan(0));
}
Also used : OpenSearchRejectedExecutionException(org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException) SequenceNumbers(org.opensearch.index.seqno.SequenceNumbers) Arrays(java.util.Arrays) IndexResponse(org.opensearch.action.index.IndexResponse) ClusterStateResponse(org.opensearch.action.admin.cluster.state.ClusterStateResponse) SnapshotRecoverySource(org.opensearch.cluster.routing.RecoverySource.SnapshotRecoverySource) Matchers.not(org.hamcrest.Matchers.not) SnapshotState(org.opensearch.snapshots.SnapshotState) ClusterScope(org.opensearch.test.OpenSearchIntegTestCase.ClusterScope) Version(org.opensearch.Version) Strings(org.opensearch.common.Strings) Transport(org.opensearch.transport.Transport) PlainActionFuture(org.opensearch.action.support.PlainActionFuture) Map(java.util.Map) ShardStateAction(org.opensearch.cluster.action.shard.ShardStateAction) Repository(org.opensearch.repositories.Repository) TimeValue(org.opensearch.common.unit.TimeValue) Index(org.opensearch.index.Index) AbstractTokenFilterFactory(org.opensearch.index.analysis.AbstractTokenFilterFactory) TransportRequestOptions(org.opensearch.transport.TransportRequestOptions) Settings(org.opensearch.common.settings.Settings) ReplicationTracker(org.opensearch.index.seqno.ReplicationTracker) Scope(org.opensearch.test.OpenSearchIntegTestCase.Scope) TransportService(org.opensearch.transport.TransportService) Engine(org.opensearch.index.engine.Engine) CountDownLatch(java.util.concurrent.CountDownLatch) UPDATED(org.opensearch.action.DocWriteResponse.Result.UPDATED) NodeStats(org.opensearch.action.admin.cluster.node.stats.NodeStats) IndicesStatsResponse(org.opensearch.action.admin.indices.stats.IndicesStatsResponse) XContentType(org.opensearch.common.xcontent.XContentType) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) Matchers.is(org.hamcrest.Matchers.is) RepositoriesService(org.opensearch.repositories.RepositoriesService) TransportRequestHandler(org.opensearch.transport.TransportRequestHandler) CHUNK_SIZE_SETTING(org.opensearch.node.RecoverySettingsChunkSizePlugin.CHUNK_SIZE_SETTING) MapperParsingException(org.opensearch.index.mapper.MapperParsingException) Priority(org.opensearch.common.Priority) MockTransportService(org.opensearch.test.transport.MockTransportService) ArrayList(java.util.ArrayList) RecoverySource(org.opensearch.cluster.routing.RecoverySource) RestoreSnapshotResponse(org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse) ClusterState(org.opensearch.cluster.ClusterState) ShardRoutingState(org.opensearch.cluster.routing.ShardRoutingState) BiConsumer(java.util.function.BiConsumer) Matchers.hasSize(org.hamcrest.Matchers.hasSize) StreamSupport(java.util.stream.StreamSupport) CircuitBreakingException(org.opensearch.common.breaker.CircuitBreakingException) Matchers.greaterThanOrEqualTo(org.hamcrest.Matchers.greaterThanOrEqualTo) TokenStream(org.apache.lucene.analysis.TokenStream) SetOnce(org.apache.lucene.util.SetOnce) IOException(java.io.IOException) IndexService(org.opensearch.index.IndexService) Plugin(org.opensearch.plugins.Plugin) ExecutionException(java.util.concurrent.ExecutionException) RecoveryResponse(org.opensearch.action.admin.indices.recovery.RecoveryResponse) AnalysisModule(org.opensearch.indices.analysis.AnalysisModule) PluginsService(org.opensearch.plugins.PluginsService) RecoveryStats(org.opensearch.index.recovery.RecoveryStats) RetentionLeases(org.opensearch.index.seqno.RetentionLeases) ClusterService(org.opensearch.cluster.service.ClusterService) ShardStats(org.opensearch.action.admin.indices.stats.ShardStats) IndexRequestBuilder(org.opensearch.action.index.IndexRequestBuilder) MockFSIndexStore(org.opensearch.test.store.MockFSIndexStore) StubbableTransport(org.opensearch.test.transport.StubbableTransport) ByteSizeUnit(org.opensearch.common.unit.ByteSizeUnit) OpenSearchException(org.opensearch.OpenSearchException) MoveAllocationCommand(org.opensearch.cluster.routing.allocation.command.MoveAllocationCommand) CircuitBreaker(org.opensearch.common.breaker.CircuitBreaker) CommonStatsFlags(org.opensearch.action.admin.indices.stats.CommonStatsFlags) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) OpenSearchAssertions.assertHitCount(org.opensearch.test.hamcrest.OpenSearchAssertions.assertHitCount) Matchers.everyItem(org.hamcrest.Matchers.everyItem) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) NodeClosedException(org.opensearch.node.NodeClosedException) RecoveryRequest(org.opensearch.action.admin.indices.recovery.RecoveryRequest) UnassignedInfo(org.opensearch.cluster.routing.UnassignedInfo) IndexShardRoutingTable(org.opensearch.cluster.routing.IndexShardRoutingTable) Matchers.isOneOf(org.hamcrest.Matchers.isOneOf) ReplicaShardAllocatorIT(org.opensearch.gateway.ReplicaShardAllocatorIT) TransportChannel(org.opensearch.transport.TransportChannel) Matchers.lessThanOrEqualTo(org.hamcrest.Matchers.lessThanOrEqualTo) Collection(java.util.Collection) IndicesService(org.opensearch.indices.IndicesService) Task(org.opensearch.tasks.Task) Store(org.opensearch.index.store.Store) NodeIndicesStats(org.opensearch.indices.NodeIndicesStats) Collectors(java.util.stream.Collectors) List(java.util.List) ClusterHealthResponse(org.opensearch.action.admin.cluster.health.ClusterHealthResponse) CREATED(org.opensearch.action.DocWriteResponse.Result.CREATED) Matchers.equalTo(org.hamcrest.Matchers.equalTo) IndexSettings(org.opensearch.index.IndexSettings) ReplicationResponse(org.opensearch.action.support.replication.ReplicationResponse) ConnectTransportException(org.opensearch.transport.ConnectTransportException) OpenSearchIntegTestCase(org.opensearch.test.OpenSearchIntegTestCase) AllocateEmptyPrimaryAllocationCommand(org.opensearch.cluster.routing.allocation.command.AllocateEmptyPrimaryAllocationCommand) RefreshPolicy(org.opensearch.action.support.WriteRequest.RefreshPolicy) IntStream(java.util.stream.IntStream) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) Stage(org.opensearch.indices.recovery.RecoveryState.Stage) TokenFilterFactory(org.opensearch.index.analysis.TokenFilterFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ByteSizeValue(org.opensearch.common.unit.ByteSizeValue) InternalTestCluster(org.opensearch.test.InternalTestCluster) NodeConnectionsService(org.opensearch.cluster.NodeConnectionsService) IndexShard(org.opensearch.index.shard.IndexShard) InternalSettingsPlugin(org.opensearch.test.InternalSettingsPlugin) BackgroundIndexer(org.opensearch.test.BackgroundIndexer) Collections.singletonMap(java.util.Collections.singletonMap) SearchResponse(org.opensearch.action.search.SearchResponse) StoreStats(org.opensearch.index.store.StoreStats) OpenSearchAssertions.assertAcked(org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked) RepositoryData(org.opensearch.repositories.RepositoryData) CreateSnapshotResponse(org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse) PeerRecoverySource(org.opensearch.cluster.routing.RecoverySource.PeerRecoverySource) Matchers.empty(org.hamcrest.Matchers.empty) MockEngineFactoryPlugin(org.opensearch.index.MockEngineFactoryPlugin) TransportRequest(org.opensearch.transport.TransportRequest) Semaphore(java.util.concurrent.Semaphore) MockEngineSupport(org.opensearch.test.engine.MockEngineSupport) ActiveShardCount(org.opensearch.action.support.ActiveShardCount) ShardRouting(org.opensearch.cluster.routing.ShardRouting) ShardId(org.opensearch.index.shard.ShardId) Consumer(java.util.function.Consumer) AnalysisPlugin(org.opensearch.plugins.AnalysisPlugin) Collectors.toList(java.util.stream.Collectors.toList) Snapshot(org.opensearch.snapshots.Snapshot) NodesStatsResponse(org.opensearch.action.admin.cluster.node.stats.NodesStatsResponse) RecoverySettingsChunkSizePlugin(org.opensearch.node.RecoverySettingsChunkSizePlugin) Collections(java.util.Collections) IndexShardRoutingTable(org.opensearch.cluster.routing.IndexShardRoutingTable) IndexShard(org.opensearch.index.shard.IndexShard) IndicesService(org.opensearch.indices.IndicesService) InternalTestCluster(org.opensearch.test.InternalTestCluster) OpenSearchRejectedExecutionException(org.opensearch.common.util.concurrent.OpenSearchRejectedExecutionException) MapperParsingException(org.opensearch.index.mapper.MapperParsingException) CircuitBreakingException(org.opensearch.common.breaker.CircuitBreakingException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) OpenSearchException(org.opensearch.OpenSearchException) NodeClosedException(org.opensearch.node.NodeClosedException) ConnectTransportException(org.opensearch.transport.ConnectTransportException) ShardId(org.opensearch.index.shard.ShardId) ShardRouting(org.opensearch.cluster.routing.ShardRouting) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) Settings(org.opensearch.common.settings.Settings) IndexSettings(org.opensearch.index.IndexSettings)

Aggregations

ClusterService (org.opensearch.cluster.service.ClusterService)140 ClusterState (org.opensearch.cluster.ClusterState)85 Settings (org.opensearch.common.settings.Settings)67 ThreadPool (org.opensearch.threadpool.ThreadPool)67 TransportService (org.opensearch.transport.TransportService)57 TestThreadPool (org.opensearch.threadpool.TestThreadPool)54 ActionFilters (org.opensearch.action.support.ActionFilters)43 DiscoveryNode (org.opensearch.cluster.node.DiscoveryNode)43 OpenSearchTestCase (org.opensearch.test.OpenSearchTestCase)42 ActionListener (org.opensearch.action.ActionListener)41 Before (org.junit.Before)40 IndexMetadata (org.opensearch.cluster.metadata.IndexMetadata)39 ClusterServiceUtils.createClusterService (org.opensearch.test.ClusterServiceUtils.createClusterService)39 IOException (java.io.IOException)36 Metadata (org.opensearch.cluster.metadata.Metadata)36 Index (org.opensearch.index.Index)35 Collections (java.util.Collections)34 CountDownLatch (java.util.concurrent.CountDownLatch)33 Version (org.opensearch.Version)33 HashSet (java.util.HashSet)32