Search in sources :

Example 21 with ShardStats

use of org.elasticsearch.action.admin.indices.stats.ShardStats in project crate by crate.

the class MasterDisruptionIT method testMappingNewFieldsTimeoutDoesntAffectCheckpoints.

@Test
public void testMappingNewFieldsTimeoutDoesntAffectCheckpoints() throws Exception {
    InternalTestCluster internalCluster = internalCluster();
    internalCluster.startNodes(3, Settings.builder().put(MappingUpdatedAction.INDICES_MAPPING_DYNAMIC_TIMEOUT_SETTING.getKey(), "1ms").build());
    ensureStableCluster(3);
    logger.info("creating table t with 1 shards and 1 replica");
    execute("create table t (id int primary key, x object(dynamic)) clustered into 1 shards with " + "(number_of_replicas = 1, \"routing.allocation.exclude._name\" = '" + internalCluster().getMasterName() + "', \"write.wait_for_active_shards\" = 1)");
    ensureGreen();
    execute("insert into t values (?, ?)", new Object[] { 1, Map.of("first field", "first value") });
    ServiceDisruptionScheme disruption = new BlockMasterServiceOnMaster(random());
    setDisruptionScheme(disruption);
    disruption.startDisrupting();
    try {
        execute("insert into t values (?, ?), (?, ?), (?, ?)", new Object[] { 2, Map.of("2nd field", "2nd value"), 3, Map.of("3rd field", "3rd value"), 4, Map.of("4th field", "4th value") });
    } catch (Exception e) {
    // failure is acceptable
    }
    disruption.stopDisrupting();
    String indexName = toIndexName(sqlExecutor.getCurrentSchema(), "t", null);
    assertBusy(() -> {
        IndicesStatsResponse stats = client().admin().indices().prepareStats(indexName).clear().get();
        for (ShardStats shardStats : stats.getShards()) {
            assertThat(shardStats.getShardRouting().toString(), shardStats.getSeqNoStats().getGlobalCheckpoint(), equalTo(shardStats.getSeqNoStats().getLocalCheckpoint()));
        }
    }, 1, TimeUnit.MINUTES);
}
Also used : ShardStats(org.elasticsearch.action.admin.indices.stats.ShardStats) IndicesStatsResponse(org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse) ServiceDisruptionScheme(org.elasticsearch.test.disruption.ServiceDisruptionScheme) InternalTestCluster(org.elasticsearch.test.InternalTestCluster) BlockMasterServiceOnMaster(org.elasticsearch.test.disruption.BlockMasterServiceOnMaster) Test(org.junit.Test)

Example 22 with ShardStats

use of org.elasticsearch.action.admin.indices.stats.ShardStats in project crate by crate.

the class IndexRecoveryIT method testUsesFileBasedRecoveryIfOperationsBasedRecoveryWouldBeUnreasonable.

@Test
public void testUsesFileBasedRecoveryIfOperationsBasedRecoveryWouldBeUnreasonable() throws Exception {
    internalCluster().ensureAtLeastNumDataNodes(2);
    String indexName = "test";
    var settings = new ArrayList<String>();
    settings.add("number_of_replicas = 1");
    settings.add("\"unassigned.node_left.delayed_timeout\"='12h'");
    settings.add("\"soft_deletes.enabled\"=true");
    settings.add("\"soft_deletes.retention_lease.sync_interval\"='100ms'");
    final double reasonableOperationsBasedRecoveryProportion;
    if (randomBoolean()) {
        reasonableOperationsBasedRecoveryProportion = biasedDoubleBetween(0.05, 0.99);
        settings.add("\"recovery.file_based_threshold\"=" + reasonableOperationsBasedRecoveryProportion);
    } else {
        reasonableOperationsBasedRecoveryProportion = IndexSettings.FILE_BASED_RECOVERY_THRESHOLD_SETTING.get(Settings.EMPTY);
    }
    logger.info("--> performing ops-based recoveries up to [{}%] of docs", reasonableOperationsBasedRecoveryProportion * 100.0);
    execute("CREATE TABLE doc.test (num INT)" + " CLUSTERED INTO 1 SHARDS" + " WITH (" + String.join(",", settings) + ")");
    int numDocs = randomIntBetween(1, 100);
    var args = new Object[numDocs][];
    for (int i = 0; i < numDocs; i++) {
        args[i] = new Object[] { i };
    }
    execute("INSERT INTO doc.test (num) VALUES (?)", args);
    ensureGreen(indexName);
    execute("OPTIMIZE TABLE doc.test");
    // wait for all history to be discarded
    assertBusy(() -> {
        for (ShardStats shardStats : client().admin().indices().prepareStats(indexName).get().getShards()) {
            final long maxSeqNo = shardStats.getSeqNoStats().getMaxSeqNo();
            assertTrue(shardStats.getRetentionLeaseStats().leases() + " should discard history up to " + maxSeqNo, shardStats.getRetentionLeaseStats().leases().leases().stream().allMatch(l -> l.retainingSequenceNumber() == maxSeqNo + 1));
        }
    });
    // ensure that all operations are in the safe commit
    execute("OPTIMIZE TABLE doc.test");
    final ShardStats shardStats = client().admin().indices().prepareStats(indexName).get().getShards()[0];
    final long docCount = shardStats.getStats().docs.getCount();
    assertThat(shardStats.getStats().docs.getDeleted(), equalTo(0L));
    assertThat(shardStats.getSeqNoStats().getMaxSeqNo() + 1, equalTo(docCount));
    final ShardId shardId = new ShardId(resolveIndex(indexName), 0);
    final DiscoveryNodes discoveryNodes = clusterService().state().nodes();
    final IndexShardRoutingTable indexShardRoutingTable = clusterService().state().routingTable().shardRoutingTable(shardId);
    final ShardRouting replicaShardRouting = indexShardRoutingTable.replicaShards().get(0);
    assertTrue("should have lease for " + replicaShardRouting, client().admin().indices().prepareStats(indexName).get().getShards()[0].getRetentionLeaseStats().leases().contains(ReplicationTracker.getPeerRecoveryRetentionLeaseId(replicaShardRouting)));
    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());
            final int newDocCount = Math.toIntExact(Math.round(Math.ceil((1 + Math.ceil(docCount * reasonableOperationsBasedRecoveryProportion)) / (1 - reasonableOperationsBasedRecoveryProportion))));
            /*
                                               *     newDocCount >= (ceil(docCount * p) + 1) / (1-p)
                                               *
                                               * ==> 0 <= newDocCount * (1-p) - ceil(docCount * p) - 1
                                               *       =  newDocCount - (newDocCount * p + ceil(docCount * p) + 1)
                                               *       <  newDocCount - (ceil(newDocCount * p) + ceil(docCount * p))
                                               *       <= newDocCount -  ceil(newDocCount * p + docCount * p)
                                               *
                                               * ==> docCount <  newDocCount + docCount - ceil((newDocCount + docCount) * p)
                                               *              == localCheckpoint + 1    - ceil((newDocCount + docCount) * p)
                                               *              == firstReasonableSeqNo
                                               *
                                               * The replica has docCount docs, i.e. has operations with seqnos [0..docCount-1], so a seqno-based recovery will start
                                               * from docCount < firstReasonableSeqNo
                                               *
                                               * ==> it is unreasonable to recover the replica using a seqno-based recovery
                                               */
            var args = new Object[newDocCount][];
            for (int i = 0; i < newDocCount; i++) {
                args[i] = new Object[] { i };
            }
            execute("INSERT INTO doc.test (num) VALUES (?)", args);
            execute("OPTIMIZE TABLE doc.test");
            assertBusy(() -> assertFalse("should no longer have lease for " + replicaShardRouting, client().admin().indices().prepareStats(indexName).get().getShards()[0].getRetentionLeaseStats().leases().contains(ReplicationTracker.getPeerRecoveryRetentionLeaseId(replicaShardRouting))));
            return super.onNodeStopped(nodeName);
        }
    });
    ensureGreen(indexName);
    // noinspection OptionalGetWithoutIsPresent because it fails the test if absent
    final var recoveryState = client().execute(RecoveryAction.INSTANCE, new RecoveryRequest()).get().shardRecoveryStates().get(indexName).stream().filter(rs -> rs.getPrimary() == false).findFirst().get();
    assertThat(recoveryState.getIndex().totalFileCount(), greaterThan(0));
}
Also used : ShardStats(org.elasticsearch.action.admin.indices.stats.ShardStats) ShardId(org.elasticsearch.index.shard.ShardId) Arrays(java.util.Arrays) ByteSizeUnit(org.elasticsearch.common.unit.ByteSizeUnit) SyncedFlushUtil(org.elasticsearch.indices.flush.SyncedFlushUtil) Matchers.not(org.hamcrest.Matchers.not) MoveAllocationCommand(org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand) RecoverySettingsChunkSizePlugin(org.elasticsearch.node.RecoverySettingsChunkSizePlugin) ClusterState(org.elasticsearch.cluster.ClusterState) ConnectTransportException(org.elasticsearch.transport.ConnectTransportException) Scope(org.elasticsearch.test.ESIntegTestCase.Scope) Map(java.util.Map) AnalysisModule(org.elasticsearch.indices.analysis.AnalysisModule) Priority(org.elasticsearch.common.Priority) Transport(org.elasticsearch.transport.Transport) TestLogging(org.elasticsearch.test.junit.annotations.TestLogging) PlainActionFuture(org.elasticsearch.action.support.PlainActionFuture) Set(java.util.Set) TransportRequestHandler(org.elasticsearch.transport.TransportRequestHandler) CountDownLatch(java.util.concurrent.CountDownLatch) RecoverySource(org.elasticsearch.cluster.routing.RecoverySource) Stream(java.util.stream.Stream) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) Matchers.is(org.hamcrest.Matchers.is) ReplicationTracker(org.elasticsearch.index.seqno.ReplicationTracker) TransportRequestOptions(org.elasticsearch.transport.TransportRequestOptions) TransportChannel(org.elasticsearch.transport.TransportChannel) ClusterService(org.elasticsearch.cluster.service.ClusterService) SQLIntegrationTestCase(io.crate.integrationtests.SQLIntegrationTestCase) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) RandomizedTest.biasedDoubleBetween(com.carrotsearch.randomizedtesting.RandomizedTest.biasedDoubleBetween) ArrayList(java.util.ArrayList) RetentionLeases(org.elasticsearch.index.seqno.RetentionLeases) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) BiConsumer(java.util.function.BiConsumer) Matchers.hasSize(org.hamcrest.Matchers.hasSize) StreamSupport(java.util.stream.StreamSupport) IndicesService(org.elasticsearch.indices.IndicesService) TransportService(org.elasticsearch.transport.TransportService) Matchers.greaterThanOrEqualTo(org.hamcrest.Matchers.greaterThanOrEqualTo) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) ClusterScope(org.elasticsearch.test.ESIntegTestCase.ClusterScope) SequenceNumbers(org.elasticsearch.index.seqno.SequenceNumbers) MockFSIndexStore(org.elasticsearch.test.store.MockFSIndexStore) TokenStream(org.apache.lucene.analysis.TokenStream) SetOnce(org.apache.lucene.util.SetOnce) IndexShard(org.elasticsearch.index.shard.IndexShard) BackgroundIndexer(org.elasticsearch.test.BackgroundIndexer) IOException(java.io.IOException) Test(org.junit.Test) ReplicationResponse(org.elasticsearch.action.support.replication.ReplicationResponse) EsRejectedExecutionException(org.elasticsearch.common.util.concurrent.EsRejectedExecutionException) AnalysisPlugin(org.elasticsearch.plugins.AnalysisPlugin) IndexParts(io.crate.metadata.IndexParts) TransportRequest(org.elasticsearch.transport.TransportRequest) CHUNK_SIZE_SETTING(org.elasticsearch.node.RecoverySettingsChunkSizePlugin.CHUNK_SIZE_SETTING) GetSnapshotsRequest(org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest) Settings(org.elasticsearch.common.settings.Settings) SyncedFlushAction(org.elasticsearch.action.admin.indices.flush.SyncedFlushAction) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) GetSnapshotsAction(org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsAction) RecoveryAction(org.elasticsearch.action.admin.indices.recovery.RecoveryAction) ByteSizeValue(org.elasticsearch.common.unit.ByteSizeValue) RecoveryResponse(org.elasticsearch.action.admin.indices.recovery.RecoveryResponse) PluginsService(org.elasticsearch.plugins.PluginsService) Matchers.lessThanOrEqualTo(org.hamcrest.Matchers.lessThanOrEqualTo) Collection(java.util.Collection) IndexShardRoutingTable(org.elasticsearch.cluster.routing.IndexShardRoutingTable) Collectors(java.util.stream.Collectors) Engine(org.elasticsearch.index.engine.Engine) InternalSettingsPlugin(org.elasticsearch.test.InternalSettingsPlugin) List(java.util.List) Version(org.elasticsearch.Version) Matchers.equalTo(org.hamcrest.Matchers.equalTo) TimeValue(io.crate.common.unit.TimeValue) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) InternalTestCluster(org.elasticsearch.test.InternalTestCluster) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Index(org.elasticsearch.index.Index) Strings(org.elasticsearch.common.Strings) ShardStats(org.elasticsearch.action.admin.indices.stats.ShardStats) IndexSettings(org.elasticsearch.index.IndexSettings) Collections.singletonMap(java.util.Collections.singletonMap) MockTransportService(org.elasticsearch.test.transport.MockTransportService) SyncedFlushRequest(org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest) MockEngineFactoryPlugin(org.elasticsearch.index.MockEngineFactoryPlugin) MapperParsingException(org.elasticsearch.index.mapper.MapperParsingException) Matchers.empty(org.hamcrest.Matchers.empty) Semaphore(java.util.concurrent.Semaphore) StubbableTransport(org.elasticsearch.test.transport.StubbableTransport) RecoveryRequest(org.elasticsearch.action.admin.indices.recovery.RecoveryRequest) Plugin(org.elasticsearch.plugins.Plugin) ClusterHealthResponse(org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse) Consumer(java.util.function.Consumer) ClusterStateResponse(org.elasticsearch.action.admin.cluster.state.ClusterStateResponse) NodeConnectionsService(org.elasticsearch.cluster.NodeConnectionsService) AbstractTokenFilterFactory(org.elasticsearch.index.analysis.AbstractTokenFilterFactory) CircuitBreakingException(org.elasticsearch.common.breaker.CircuitBreakingException) Ignore(org.junit.Ignore) TokenFilterFactory(org.elasticsearch.index.analysis.TokenFilterFactory) Snapshot(org.elasticsearch.snapshots.Snapshot) IndexShardRoutingTable(org.elasticsearch.cluster.routing.IndexShardRoutingTable) ArrayList(java.util.ArrayList) InternalTestCluster(org.elasticsearch.test.InternalTestCluster) ConnectTransportException(org.elasticsearch.transport.ConnectTransportException) IOException(java.io.IOException) EsRejectedExecutionException(org.elasticsearch.common.util.concurrent.EsRejectedExecutionException) MapperParsingException(org.elasticsearch.index.mapper.MapperParsingException) CircuitBreakingException(org.elasticsearch.common.breaker.CircuitBreakingException) ShardId(org.elasticsearch.index.shard.ShardId) RecoveryRequest(org.elasticsearch.action.admin.indices.recovery.RecoveryRequest) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) Settings(org.elasticsearch.common.settings.Settings) IndexSettings(org.elasticsearch.index.IndexSettings) Test(org.junit.Test)

Example 23 with ShardStats

use of org.elasticsearch.action.admin.indices.stats.ShardStats in project crate by crate.

the class IndexRecoveryIT method testRecoveryFlushReplica.

@Test
public void testRecoveryFlushReplica() throws Exception {
    internalCluster().ensureAtLeastNumDataNodes(3);
    String indexName = "test";
    execute("CREATE TABLE doc.test (num INT)" + " CLUSTERED INTO 1 SHARDS" + " WITH (number_of_replicas = 0)");
    int numDocs = randomIntBetween(1, 10);
    var args = new Object[numDocs][];
    for (int i = 0; i < numDocs; i++) {
        args[i] = new Object[] { i };
    }
    execute("INSERT INTO doc.test (num) VALUES (?)", args);
    execute("ALTER TABLE doc.test SET (number_of_replicas = 1)");
    ensureGreen();
    ShardId shardId = null;
    for (ShardStats shardStats : client().admin().indices().prepareStats(indexName).get().getIndex(indexName).getShards()) {
        shardId = shardStats.getShardRouting().shardId();
        if (shardStats.getShardRouting().primary() == false) {
            assertThat(shardStats.getCommitStats().getNumDocs(), equalTo(numDocs));
            SequenceNumbers.CommitInfo commitInfo = SequenceNumbers.loadSeqNoInfoFromLuceneCommit(shardStats.getCommitStats().getUserData().entrySet());
            assertThat(commitInfo.localCheckpoint, equalTo(shardStats.getSeqNoStats().getLocalCheckpoint()));
            assertThat(commitInfo.maxSeqNo, equalTo(shardStats.getSeqNoStats().getMaxSeqNo()));
        }
    }
    SyncedFlushUtil.attemptSyncedFlush(logger, internalCluster(), shardId);
    assertBusy(() -> assertThat(client().execute(SyncedFlushAction.INSTANCE, new SyncedFlushRequest(indexName)).get().failedShards(), equalTo(0)));
    execute("ALTER TABLE doc.test SET (number_of_replicas = 2)");
    ensureGreen(indexName);
    // Recovery should keep syncId if no indexing activity on the primary after synced-flush.
    Set<String> syncIds = Stream.of(client().admin().indices().prepareStats(indexName).get().getIndex(indexName).getShards()).map(shardStats -> shardStats.getCommitStats().syncId()).collect(Collectors.toSet());
    assertThat(syncIds, hasSize(1));
}
Also used : ShardId(org.elasticsearch.index.shard.ShardId) ShardStats(org.elasticsearch.action.admin.indices.stats.ShardStats) ShardId(org.elasticsearch.index.shard.ShardId) Arrays(java.util.Arrays) ByteSizeUnit(org.elasticsearch.common.unit.ByteSizeUnit) SyncedFlushUtil(org.elasticsearch.indices.flush.SyncedFlushUtil) Matchers.not(org.hamcrest.Matchers.not) MoveAllocationCommand(org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand) RecoverySettingsChunkSizePlugin(org.elasticsearch.node.RecoverySettingsChunkSizePlugin) ClusterState(org.elasticsearch.cluster.ClusterState) ConnectTransportException(org.elasticsearch.transport.ConnectTransportException) Scope(org.elasticsearch.test.ESIntegTestCase.Scope) Map(java.util.Map) AnalysisModule(org.elasticsearch.indices.analysis.AnalysisModule) Priority(org.elasticsearch.common.Priority) Transport(org.elasticsearch.transport.Transport) TestLogging(org.elasticsearch.test.junit.annotations.TestLogging) PlainActionFuture(org.elasticsearch.action.support.PlainActionFuture) Set(java.util.Set) TransportRequestHandler(org.elasticsearch.transport.TransportRequestHandler) CountDownLatch(java.util.concurrent.CountDownLatch) RecoverySource(org.elasticsearch.cluster.routing.RecoverySource) Stream(java.util.stream.Stream) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) Matchers.is(org.hamcrest.Matchers.is) ReplicationTracker(org.elasticsearch.index.seqno.ReplicationTracker) TransportRequestOptions(org.elasticsearch.transport.TransportRequestOptions) TransportChannel(org.elasticsearch.transport.TransportChannel) ClusterService(org.elasticsearch.cluster.service.ClusterService) SQLIntegrationTestCase(io.crate.integrationtests.SQLIntegrationTestCase) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) RandomizedTest.biasedDoubleBetween(com.carrotsearch.randomizedtesting.RandomizedTest.biasedDoubleBetween) ArrayList(java.util.ArrayList) RetentionLeases(org.elasticsearch.index.seqno.RetentionLeases) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) BiConsumer(java.util.function.BiConsumer) Matchers.hasSize(org.hamcrest.Matchers.hasSize) StreamSupport(java.util.stream.StreamSupport) IndicesService(org.elasticsearch.indices.IndicesService) TransportService(org.elasticsearch.transport.TransportService) Matchers.greaterThanOrEqualTo(org.hamcrest.Matchers.greaterThanOrEqualTo) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) ClusterScope(org.elasticsearch.test.ESIntegTestCase.ClusterScope) SequenceNumbers(org.elasticsearch.index.seqno.SequenceNumbers) MockFSIndexStore(org.elasticsearch.test.store.MockFSIndexStore) TokenStream(org.apache.lucene.analysis.TokenStream) SetOnce(org.apache.lucene.util.SetOnce) IndexShard(org.elasticsearch.index.shard.IndexShard) BackgroundIndexer(org.elasticsearch.test.BackgroundIndexer) IOException(java.io.IOException) Test(org.junit.Test) ReplicationResponse(org.elasticsearch.action.support.replication.ReplicationResponse) EsRejectedExecutionException(org.elasticsearch.common.util.concurrent.EsRejectedExecutionException) AnalysisPlugin(org.elasticsearch.plugins.AnalysisPlugin) IndexParts(io.crate.metadata.IndexParts) TransportRequest(org.elasticsearch.transport.TransportRequest) CHUNK_SIZE_SETTING(org.elasticsearch.node.RecoverySettingsChunkSizePlugin.CHUNK_SIZE_SETTING) GetSnapshotsRequest(org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest) Settings(org.elasticsearch.common.settings.Settings) SyncedFlushAction(org.elasticsearch.action.admin.indices.flush.SyncedFlushAction) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) GetSnapshotsAction(org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsAction) RecoveryAction(org.elasticsearch.action.admin.indices.recovery.RecoveryAction) ByteSizeValue(org.elasticsearch.common.unit.ByteSizeValue) RecoveryResponse(org.elasticsearch.action.admin.indices.recovery.RecoveryResponse) PluginsService(org.elasticsearch.plugins.PluginsService) Matchers.lessThanOrEqualTo(org.hamcrest.Matchers.lessThanOrEqualTo) Collection(java.util.Collection) IndexShardRoutingTable(org.elasticsearch.cluster.routing.IndexShardRoutingTable) Collectors(java.util.stream.Collectors) Engine(org.elasticsearch.index.engine.Engine) InternalSettingsPlugin(org.elasticsearch.test.InternalSettingsPlugin) List(java.util.List) Version(org.elasticsearch.Version) Matchers.equalTo(org.hamcrest.Matchers.equalTo) TimeValue(io.crate.common.unit.TimeValue) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) InternalTestCluster(org.elasticsearch.test.InternalTestCluster) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Index(org.elasticsearch.index.Index) Strings(org.elasticsearch.common.Strings) ShardStats(org.elasticsearch.action.admin.indices.stats.ShardStats) IndexSettings(org.elasticsearch.index.IndexSettings) Collections.singletonMap(java.util.Collections.singletonMap) MockTransportService(org.elasticsearch.test.transport.MockTransportService) SyncedFlushRequest(org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest) MockEngineFactoryPlugin(org.elasticsearch.index.MockEngineFactoryPlugin) MapperParsingException(org.elasticsearch.index.mapper.MapperParsingException) Matchers.empty(org.hamcrest.Matchers.empty) Semaphore(java.util.concurrent.Semaphore) StubbableTransport(org.elasticsearch.test.transport.StubbableTransport) RecoveryRequest(org.elasticsearch.action.admin.indices.recovery.RecoveryRequest) Plugin(org.elasticsearch.plugins.Plugin) ClusterHealthResponse(org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse) Consumer(java.util.function.Consumer) ClusterStateResponse(org.elasticsearch.action.admin.cluster.state.ClusterStateResponse) NodeConnectionsService(org.elasticsearch.cluster.NodeConnectionsService) AbstractTokenFilterFactory(org.elasticsearch.index.analysis.AbstractTokenFilterFactory) CircuitBreakingException(org.elasticsearch.common.breaker.CircuitBreakingException) Ignore(org.junit.Ignore) TokenFilterFactory(org.elasticsearch.index.analysis.TokenFilterFactory) Snapshot(org.elasticsearch.snapshots.Snapshot) SequenceNumbers(org.elasticsearch.index.seqno.SequenceNumbers) SyncedFlushRequest(org.elasticsearch.action.admin.indices.flush.SyncedFlushRequest) Test(org.junit.Test)

Aggregations

ShardStats (org.elasticsearch.action.admin.indices.stats.ShardStats)23 ShardRouting (org.elasticsearch.cluster.routing.ShardRouting)11 ShardId (org.elasticsearch.index.shard.ShardId)8 IndexStats (org.elasticsearch.action.admin.indices.stats.IndexStats)7 Index (org.elasticsearch.index.Index)7 ArrayList (java.util.ArrayList)6 CommonStats (org.elasticsearch.action.admin.indices.stats.CommonStats)5 ClusterState (org.elasticsearch.cluster.ClusterState)5 IOException (java.io.IOException)4 List (java.util.List)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 IndicesStatsResponse (org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse)4 MoveAllocationCommand (org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand)4 ClusterService (org.elasticsearch.cluster.service.ClusterService)4 IndexShard (org.elasticsearch.index.shard.IndexShard)4 Arrays (java.util.Arrays)3 Collection (java.util.Collection)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 Semaphore (java.util.concurrent.Semaphore)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3