Search in sources :

Example 1 with RecoveryTarget

use of org.elasticsearch.indices.recovery.RecoveryTarget in project elasticsearch by elastic.

the class RecoveriesCollectionTests method testResetRecovery.

public void testResetRecovery() throws Exception {
    try (ReplicationGroup shards = createGroup(0)) {
        shards.startAll();
        int numDocs = randomIntBetween(1, 15);
        shards.indexDocs(numDocs);
        final RecoveriesCollection collection = new RecoveriesCollection(logger, threadPool, v -> {
        });
        IndexShard shard = shards.addReplica();
        final long recoveryId = startRecovery(collection, shards.getPrimaryNode(), shard);
        RecoveryTarget recoveryTarget = collection.getRecoveryTarget(recoveryId);
        final int currentAsTarget = shard.recoveryStats().currentAsTarget();
        final int referencesToStore = recoveryTarget.store().refCount();
        IndexShard indexShard = recoveryTarget.indexShard();
        Store store = recoveryTarget.store();
        String tempFileName = recoveryTarget.getTempNameForFile("foobar");
        RecoveryTarget resetRecovery = collection.resetRecovery(recoveryId, TimeValue.timeValueMinutes(60));
        final long resetRecoveryId = resetRecovery.recoveryId();
        assertNotSame(recoveryTarget, resetRecovery);
        assertNotSame(recoveryTarget.cancellableThreads(), resetRecovery.cancellableThreads());
        assertSame(indexShard, resetRecovery.indexShard());
        assertSame(store, resetRecovery.store());
        assertEquals(referencesToStore, resetRecovery.store().refCount());
        assertEquals(currentAsTarget, shard.recoveryStats().currentAsTarget());
        assertEquals(recoveryTarget.refCount(), 0);
        expectThrows(ElasticsearchException.class, () -> recoveryTarget.store());
        expectThrows(ElasticsearchException.class, () -> recoveryTarget.indexShard());
        String resetTempFileName = resetRecovery.getTempNameForFile("foobar");
        assertNotEquals(tempFileName, resetTempFileName);
        assertEquals(currentAsTarget, shard.recoveryStats().currentAsTarget());
        try (RecoveriesCollection.RecoveryRef newRecoveryRef = collection.getRecovery(resetRecoveryId)) {
            shards.recoverReplica(shard, (s, n) -> {
                assertSame(s, newRecoveryRef.target().indexShard());
                return newRecoveryRef.target();
            }, false);
        }
        shards.assertAllEqual(numDocs);
        assertNull("recovery is done", collection.getRecovery(recoveryId));
    }
}
Also used : IndexShard(org.elasticsearch.index.shard.IndexShard) RecoveriesCollection(org.elasticsearch.indices.recovery.RecoveriesCollection) Store(org.elasticsearch.index.store.Store) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget)

Example 2 with RecoveryTarget

use of org.elasticsearch.indices.recovery.RecoveryTarget in project elasticsearch by elastic.

the class IndexLevelReplicationTests method testAppendWhileRecovering.

public void testAppendWhileRecovering() throws Exception {
    try (ReplicationGroup shards = createGroup(0)) {
        shards.startAll();
        IndexShard replica = shards.addReplica();
        CountDownLatch latch = new CountDownLatch(2);
        int numDocs = randomIntBetween(100, 200);
        // just append one to the translog so we can assert below
        shards.appendDocs(1);
        Thread thread = new Thread() {

            @Override
            public void run() {
                try {
                    latch.countDown();
                    latch.await();
                    shards.appendDocs(numDocs - 1);
                } catch (Exception e) {
                    throw new AssertionError(e);
                }
            }
        };
        thread.start();
        Future<Void> future = shards.asyncRecoverReplica(replica, (indexShard, node) -> new RecoveryTarget(indexShard, node, recoveryListener, version -> {
        }) {

            @Override
            public void cleanFiles(int totalTranslogOps, Store.MetadataSnapshot sourceMetaData) throws IOException {
                super.cleanFiles(totalTranslogOps, sourceMetaData);
                latch.countDown();
                try {
                    latch.await();
                } catch (InterruptedException e) {
                    throw new AssertionError(e);
                }
            }
        });
        future.get();
        thread.join();
        shards.assertAllEqual(numDocs);
        Engine engine = IndexShardTests.getEngineFromShard(replica);
        assertEquals("expected at no version lookups ", InternalEngineTests.getNumVersionLookups((InternalEngine) engine), 0);
        for (IndexShard shard : shards) {
            engine = IndexShardTests.getEngineFromShard(shard);
            assertEquals(0, InternalEngineTests.getNumIndexVersionsLookups((InternalEngine) engine));
            assertEquals(0, InternalEngineTests.getNumVersionLookups((InternalEngine) engine));
        }
    }
}
Also used : ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) InternalEngineTests(org.elasticsearch.index.engine.InternalEngineTests) XContentType(org.elasticsearch.common.xcontent.XContentType) IndexShard(org.elasticsearch.index.shard.IndexShard) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) ToXContent(org.elasticsearch.common.xcontent.ToXContent) IOException(java.io.IOException) IndexShardTests(org.elasticsearch.index.shard.IndexShardTests) DocWriteResponse(org.elasticsearch.action.DocWriteResponse) SegmentsStats(org.elasticsearch.index.engine.SegmentsStats) Engine(org.elasticsearch.index.engine.Engine) XContentHelper(org.elasticsearch.common.xcontent.XContentHelper) SeqNoStats(org.elasticsearch.index.seqno.SeqNoStats) CountDownLatch(java.util.concurrent.CountDownLatch) IndexRequest(org.elasticsearch.action.index.IndexRequest) Future(java.util.concurrent.Future) InternalEngine(org.elasticsearch.index.engine.InternalEngine) Store(org.elasticsearch.index.store.Store) Matchers.equalTo(org.hamcrest.Matchers.equalTo) IndexResponse(org.elasticsearch.action.index.IndexResponse) Collections(java.util.Collections) IndexShard(org.elasticsearch.index.shard.IndexShard) Store(org.elasticsearch.index.store.Store) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) IOException(java.io.IOException) CountDownLatch(java.util.concurrent.CountDownLatch) IOException(java.io.IOException) InternalEngine(org.elasticsearch.index.engine.InternalEngine) Engine(org.elasticsearch.index.engine.Engine) InternalEngine(org.elasticsearch.index.engine.InternalEngine)

Example 3 with RecoveryTarget

use of org.elasticsearch.indices.recovery.RecoveryTarget in project elasticsearch by elastic.

the class IndexShardTests method testTranslogRecoverySyncsTranslog.

public void testTranslogRecoverySyncsTranslog() throws IOException {
    Settings settings = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 1).put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1).build();
    IndexMetaData metaData = IndexMetaData.builder("test").putMapping("test", "{ \"properties\": { \"foo\":  { \"type\": \"text\"}}}").settings(settings).primaryTerm(0, 1).build();
    IndexShard primary = newShard(new ShardId(metaData.getIndex(), 0), true, "n1", metaData, null);
    recoveryShardFromStore(primary);
    indexDoc(primary, "test", "0", "{\"foo\" : \"bar\"}");
    IndexShard replica = newShard(primary.shardId(), false, "n2", metaData, null);
    recoverReplica(replica, primary, (shard, discoveryNode) -> new RecoveryTarget(shard, discoveryNode, recoveryListener, aLong -> {
    }) {

        @Override
        public void indexTranslogOperations(List<Translog.Operation> operations, int totalTranslogOps) {
            super.indexTranslogOperations(operations, totalTranslogOps);
            assertFalse(replica.getTranslog().syncNeeded());
        }
    }, true);
    closeShards(primary, replica);
}
Also used : MetaData(org.elasticsearch.cluster.metadata.MetaData) Versions(org.elasticsearch.common.lucene.uid.Versions) Arrays(java.util.Arrays) Releasables(org.elasticsearch.common.lease.Releasables) Term(org.apache.lucene.index.Term) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) TranslogTests(org.elasticsearch.index.translog.TranslogTests) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) ParseContext(org.elasticsearch.index.mapper.ParseContext) EMPTY_REPO_GEN(org.elasticsearch.repositories.RepositoryData.EMPTY_REPO_GEN) Map(java.util.Map) Matchers.nullValue(org.hamcrest.Matchers.nullValue) UidFieldMapper(org.elasticsearch.index.mapper.UidFieldMapper) IOContext(org.apache.lucene.store.IOContext) Path(java.nio.file.Path) NumericDocValuesField(org.apache.lucene.document.NumericDocValuesField) PlainActionFuture(org.elasticsearch.action.support.PlainActionFuture) UUIDs(org.elasticsearch.common.UUIDs) Set(java.util.Set) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) RecoverySource(org.elasticsearch.cluster.routing.RecoverySource) SeqNoFieldMapper(org.elasticsearch.index.mapper.SeqNoFieldMapper) CountDownLatch(java.util.concurrent.CountDownLatch) AbstractRunnable(org.elasticsearch.common.util.concurrent.AbstractRunnable) Logger(org.apache.logging.log4j.Logger) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) Matchers.containsString(org.hamcrest.Matchers.containsString) TestShardRouting(org.elasticsearch.cluster.routing.TestShardRouting) IndexCommit(org.apache.lucene.index.IndexCommit) FieldDataStats(org.elasticsearch.index.fielddata.FieldDataStats) SnapshotId(org.elasticsearch.snapshots.SnapshotId) SnapshotShardFailure(org.elasticsearch.snapshots.SnapshotShardFailure) BytesStreamOutput(org.elasticsearch.common.io.stream.BytesStreamOutput) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) ArrayList(java.util.ArrayList) BytesArray(org.elasticsearch.common.bytes.BytesArray) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) SequenceNumbersService(org.elasticsearch.index.seqno.SequenceNumbersService) Store(org.elasticsearch.index.store.Store) BiConsumer(java.util.function.BiConsumer) Matchers.hasSize(org.hamcrest.Matchers.hasSize) EngineException(org.elasticsearch.index.engine.EngineException) TopDocs(org.apache.lucene.search.TopDocs) EMPTY_PARAMS(org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS) IOException(java.io.IOException) BrokenBarrierException(java.util.concurrent.BrokenBarrierException) UnassignedInfo(org.elasticsearch.cluster.routing.UnassignedInfo) ParsedDocument(org.elasticsearch.index.mapper.ParsedDocument) ExecutionException(java.util.concurrent.ExecutionException) Lucene.cleanLuceneIndex(org.elasticsearch.common.lucene.Lucene.cleanLuceneIndex) CommonStatsFlags(org.elasticsearch.action.admin.indices.stats.CommonStatsFlags) MappingMetaData(org.elasticsearch.cluster.metadata.MappingMetaData) ConcurrentCollections(org.elasticsearch.common.util.concurrent.ConcurrentCollections) IndicesQueryCache(org.elasticsearch.indices.IndicesQueryCache) SnapshotInfo(org.elasticsearch.snapshots.SnapshotInfo) VersionType(org.elasticsearch.index.VersionType) Matchers.hasKey(org.hamcrest.Matchers.hasKey) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) Settings(org.elasticsearch.common.settings.Settings) ShardRoutingHelper(org.elasticsearch.cluster.routing.ShardRoutingHelper) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) MappedFieldType(org.elasticsearch.index.mapper.MappedFieldType) XContentFactory.jsonBuilder(org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder) ThreadPool(org.elasticsearch.threadpool.ThreadPool) NamedXContentRegistry(org.elasticsearch.common.xcontent.NamedXContentRegistry) Releasable(org.elasticsearch.common.lease.Releasable) CyclicBarrier(java.util.concurrent.CyclicBarrier) DirectoryReader(org.apache.lucene.index.DirectoryReader) BytesReference(org.elasticsearch.common.bytes.BytesReference) Collectors(java.util.stream.Collectors) Engine(org.elasticsearch.index.engine.Engine) List(java.util.List) Version(org.elasticsearch.Version) RecoveryState(org.elasticsearch.indices.recovery.RecoveryState) Matchers.equalTo(org.hamcrest.Matchers.equalTo) CommonStats(org.elasticsearch.action.admin.indices.stats.CommonStats) IndexReader(org.apache.lucene.index.IndexReader) IndexSearcher(org.apache.lucene.search.IndexSearcher) RepositoryData(org.elasticsearch.repositories.RepositoryData) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) IntStream(java.util.stream.IntStream) XContentType(org.elasticsearch.common.xcontent.XContentType) PRIMARY(org.elasticsearch.index.engine.Engine.Operation.Origin.PRIMARY) IndexShardSnapshotStatus(org.elasticsearch.index.snapshots.IndexShardSnapshotStatus) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) IndexId(org.elasticsearch.repositories.IndexId) AtomicReference(java.util.concurrent.atomic.AtomicReference) ForceMergeRequest(org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest) HashSet(java.util.HashSet) ShardStats(org.elasticsearch.action.admin.indices.stats.ShardStats) Mapping(org.elasticsearch.index.mapper.Mapping) Collections.emptyMap(java.util.Collections.emptyMap) RepositoryMetaData(org.elasticsearch.cluster.metadata.RepositoryMetaData) Repository(org.elasticsearch.repositories.Repository) Uid(org.elasticsearch.index.mapper.Uid) Collections.emptySet(java.util.Collections.emptySet) Semaphore(java.util.concurrent.Semaphore) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) AbstractLifecycleComponent(org.elasticsearch.common.component.AbstractLifecycleComponent) FieldMaskingReader(org.elasticsearch.test.FieldMaskingReader) VersionUtils(org.elasticsearch.test.VersionUtils) TimeUnit(java.util.concurrent.TimeUnit) TermQuery(org.apache.lucene.search.TermQuery) FlushRequest(org.elasticsearch.action.admin.indices.flush.FlushRequest) Constants(org.apache.lucene.util.Constants) NodeEnvironment(org.elasticsearch.env.NodeEnvironment) Field(org.apache.lucene.document.Field) StreamInput(org.elasticsearch.common.io.stream.StreamInput) IndexFieldData(org.elasticsearch.index.fielddata.IndexFieldData) Translog(org.elasticsearch.index.translog.Translog) AllocationId(org.elasticsearch.cluster.routing.AllocationId) DummyShardLock(org.elasticsearch.test.DummyShardLock) Snapshot(org.elasticsearch.snapshots.Snapshot) Collections(java.util.Collections) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) Settings(org.elasticsearch.common.settings.Settings) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData)

Example 4 with RecoveryTarget

use of org.elasticsearch.indices.recovery.RecoveryTarget in project elasticsearch by elastic.

the class IndexShardTestCase method recoverReplica.

/**
     * Recovers a replica from the give primary, allow the user to supply a custom recovery target. A typical usage of a custom recovery
     * target is to assert things in the various stages of recovery.
     * @param replica                the recovery target shard
     * @param primary                the recovery source shard
     * @param targetSupplier         supplies an instance of {@link RecoveryTarget}
     * @param markAsRecovering       set to {@code false} if the replica is marked as recovering
     */
protected final void recoverReplica(final IndexShard replica, final IndexShard primary, final BiFunction<IndexShard, DiscoveryNode, RecoveryTarget> targetSupplier, final boolean markAsRecovering) throws IOException {
    final DiscoveryNode pNode = getFakeDiscoNode(primary.routingEntry().currentNodeId());
    final DiscoveryNode rNode = getFakeDiscoNode(replica.routingEntry().currentNodeId());
    if (markAsRecovering) {
        replica.markAsRecovering("remote", new RecoveryState(replica.routingEntry(), pNode, rNode));
    } else {
        assertEquals(replica.state(), IndexShardState.RECOVERING);
    }
    replica.prepareForIndexRecovery();
    final RecoveryTarget recoveryTarget = targetSupplier.apply(replica, pNode);
    final Store.MetadataSnapshot snapshot = getMetadataSnapshotOrEmpty(replica);
    final long startingSeqNo;
    if (snapshot.size() > 0) {
        startingSeqNo = PeerRecoveryTargetService.getStartingSeqNo(recoveryTarget);
    } else {
        startingSeqNo = SequenceNumbersService.UNASSIGNED_SEQ_NO;
    }
    final StartRecoveryRequest request = new StartRecoveryRequest(replica.shardId(), pNode, rNode, snapshot, false, 0, startingSeqNo);
    final RecoverySourceHandler recovery = new RecoverySourceHandler(primary, recoveryTarget, request, () -> 0L, e -> () -> {
    }, (int) ByteSizeUnit.MB.toBytes(1), Settings.builder().put(Node.NODE_NAME_SETTING.getKey(), pNode.getName()).build());
    recovery.recoverToTarget();
    recoveryTarget.markAsDone();
    replica.updateRoutingEntry(ShardRoutingHelper.moveToStarted(replica.routingEntry()));
}
Also used : DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) StartRecoveryRequest(org.elasticsearch.indices.recovery.StartRecoveryRequest) RecoverySourceHandler(org.elasticsearch.indices.recovery.RecoverySourceHandler) Store(org.elasticsearch.index.store.Store) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) RecoveryState(org.elasticsearch.indices.recovery.RecoveryState)

Example 5 with RecoveryTarget

use of org.elasticsearch.indices.recovery.RecoveryTarget in project elasticsearch by elastic.

the class IndexShardTests method testShardActiveDuringPeerRecovery.

public void testShardActiveDuringPeerRecovery() throws IOException {
    Settings settings = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 1).put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1).build();
    IndexMetaData metaData = IndexMetaData.builder("test").putMapping("test", "{ \"properties\": { \"foo\":  { \"type\": \"text\"}}}").settings(settings).primaryTerm(0, 1).build();
    IndexShard primary = newShard(new ShardId(metaData.getIndex(), 0), true, "n1", metaData, null);
    recoveryShardFromStore(primary);
    indexDoc(primary, "test", "0", "{\"foo\" : \"bar\"}");
    IndexShard replica = newShard(primary.shardId(), false, "n2", metaData, null);
    DiscoveryNode localNode = new DiscoveryNode("foo", buildNewFakeTransportAddress(), emptyMap(), emptySet(), Version.CURRENT);
    replica.markAsRecovering("for testing", new RecoveryState(replica.routingEntry(), localNode, localNode));
    // Shard is still inactive since we haven't started recovering yet
    assertFalse(replica.isActive());
    recoverReplica(replica, primary, (shard, discoveryNode) -> new RecoveryTarget(shard, discoveryNode, recoveryListener, aLong -> {
    }) {

        @Override
        public void prepareForTranslogOperations(int totalTranslogOps, long maxUnsafeAutoIdTimestamp) throws IOException {
            super.prepareForTranslogOperations(totalTranslogOps, maxUnsafeAutoIdTimestamp);
            // Shard is still inactive since we haven't started recovering yet
            assertFalse(replica.isActive());
        }

        @Override
        public void indexTranslogOperations(List<Translog.Operation> operations, int totalTranslogOps) {
            super.indexTranslogOperations(operations, totalTranslogOps);
            // Shard should now be active since we did recover:
            assertTrue(replica.isActive());
        }
    }, false);
    closeShards(primary, replica);
}
Also used : MetaData(org.elasticsearch.cluster.metadata.MetaData) Versions(org.elasticsearch.common.lucene.uid.Versions) Arrays(java.util.Arrays) Releasables(org.elasticsearch.common.lease.Releasables) Term(org.apache.lucene.index.Term) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) TranslogTests(org.elasticsearch.index.translog.TranslogTests) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) ParseContext(org.elasticsearch.index.mapper.ParseContext) EMPTY_REPO_GEN(org.elasticsearch.repositories.RepositoryData.EMPTY_REPO_GEN) Map(java.util.Map) Matchers.nullValue(org.hamcrest.Matchers.nullValue) UidFieldMapper(org.elasticsearch.index.mapper.UidFieldMapper) IOContext(org.apache.lucene.store.IOContext) Path(java.nio.file.Path) NumericDocValuesField(org.apache.lucene.document.NumericDocValuesField) PlainActionFuture(org.elasticsearch.action.support.PlainActionFuture) UUIDs(org.elasticsearch.common.UUIDs) Set(java.util.Set) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) RecoverySource(org.elasticsearch.cluster.routing.RecoverySource) SeqNoFieldMapper(org.elasticsearch.index.mapper.SeqNoFieldMapper) CountDownLatch(java.util.concurrent.CountDownLatch) AbstractRunnable(org.elasticsearch.common.util.concurrent.AbstractRunnable) Logger(org.apache.logging.log4j.Logger) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) Matchers.containsString(org.hamcrest.Matchers.containsString) TestShardRouting(org.elasticsearch.cluster.routing.TestShardRouting) IndexCommit(org.apache.lucene.index.IndexCommit) FieldDataStats(org.elasticsearch.index.fielddata.FieldDataStats) SnapshotId(org.elasticsearch.snapshots.SnapshotId) SnapshotShardFailure(org.elasticsearch.snapshots.SnapshotShardFailure) BytesStreamOutput(org.elasticsearch.common.io.stream.BytesStreamOutput) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) ArrayList(java.util.ArrayList) BytesArray(org.elasticsearch.common.bytes.BytesArray) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) SequenceNumbersService(org.elasticsearch.index.seqno.SequenceNumbersService) Store(org.elasticsearch.index.store.Store) BiConsumer(java.util.function.BiConsumer) Matchers.hasSize(org.hamcrest.Matchers.hasSize) EngineException(org.elasticsearch.index.engine.EngineException) TopDocs(org.apache.lucene.search.TopDocs) EMPTY_PARAMS(org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS) IOException(java.io.IOException) BrokenBarrierException(java.util.concurrent.BrokenBarrierException) UnassignedInfo(org.elasticsearch.cluster.routing.UnassignedInfo) ParsedDocument(org.elasticsearch.index.mapper.ParsedDocument) ExecutionException(java.util.concurrent.ExecutionException) Lucene.cleanLuceneIndex(org.elasticsearch.common.lucene.Lucene.cleanLuceneIndex) CommonStatsFlags(org.elasticsearch.action.admin.indices.stats.CommonStatsFlags) MappingMetaData(org.elasticsearch.cluster.metadata.MappingMetaData) ConcurrentCollections(org.elasticsearch.common.util.concurrent.ConcurrentCollections) IndicesQueryCache(org.elasticsearch.indices.IndicesQueryCache) SnapshotInfo(org.elasticsearch.snapshots.SnapshotInfo) VersionType(org.elasticsearch.index.VersionType) Matchers.hasKey(org.hamcrest.Matchers.hasKey) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) Settings(org.elasticsearch.common.settings.Settings) ShardRoutingHelper(org.elasticsearch.cluster.routing.ShardRoutingHelper) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) MappedFieldType(org.elasticsearch.index.mapper.MappedFieldType) XContentFactory.jsonBuilder(org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder) ThreadPool(org.elasticsearch.threadpool.ThreadPool) NamedXContentRegistry(org.elasticsearch.common.xcontent.NamedXContentRegistry) Releasable(org.elasticsearch.common.lease.Releasable) CyclicBarrier(java.util.concurrent.CyclicBarrier) DirectoryReader(org.apache.lucene.index.DirectoryReader) BytesReference(org.elasticsearch.common.bytes.BytesReference) Collectors(java.util.stream.Collectors) Engine(org.elasticsearch.index.engine.Engine) List(java.util.List) Version(org.elasticsearch.Version) RecoveryState(org.elasticsearch.indices.recovery.RecoveryState) Matchers.equalTo(org.hamcrest.Matchers.equalTo) CommonStats(org.elasticsearch.action.admin.indices.stats.CommonStats) IndexReader(org.apache.lucene.index.IndexReader) IndexSearcher(org.apache.lucene.search.IndexSearcher) RepositoryData(org.elasticsearch.repositories.RepositoryData) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) IntStream(java.util.stream.IntStream) XContentType(org.elasticsearch.common.xcontent.XContentType) PRIMARY(org.elasticsearch.index.engine.Engine.Operation.Origin.PRIMARY) IndexShardSnapshotStatus(org.elasticsearch.index.snapshots.IndexShardSnapshotStatus) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) IndexId(org.elasticsearch.repositories.IndexId) AtomicReference(java.util.concurrent.atomic.AtomicReference) ForceMergeRequest(org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest) HashSet(java.util.HashSet) ShardStats(org.elasticsearch.action.admin.indices.stats.ShardStats) Mapping(org.elasticsearch.index.mapper.Mapping) Collections.emptyMap(java.util.Collections.emptyMap) RepositoryMetaData(org.elasticsearch.cluster.metadata.RepositoryMetaData) Repository(org.elasticsearch.repositories.Repository) Uid(org.elasticsearch.index.mapper.Uid) Collections.emptySet(java.util.Collections.emptySet) Semaphore(java.util.concurrent.Semaphore) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) AbstractLifecycleComponent(org.elasticsearch.common.component.AbstractLifecycleComponent) FieldMaskingReader(org.elasticsearch.test.FieldMaskingReader) VersionUtils(org.elasticsearch.test.VersionUtils) TimeUnit(java.util.concurrent.TimeUnit) TermQuery(org.apache.lucene.search.TermQuery) FlushRequest(org.elasticsearch.action.admin.indices.flush.FlushRequest) Constants(org.apache.lucene.util.Constants) NodeEnvironment(org.elasticsearch.env.NodeEnvironment) Field(org.apache.lucene.document.Field) StreamInput(org.elasticsearch.common.io.stream.StreamInput) IndexFieldData(org.elasticsearch.index.fielddata.IndexFieldData) Translog(org.elasticsearch.index.translog.Translog) AllocationId(org.elasticsearch.cluster.routing.AllocationId) DummyShardLock(org.elasticsearch.test.DummyShardLock) Snapshot(org.elasticsearch.snapshots.Snapshot) Collections(java.util.Collections) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) IOException(java.io.IOException) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) RecoveryState(org.elasticsearch.indices.recovery.RecoveryState) Settings(org.elasticsearch.common.settings.Settings)

Aggregations

RecoveryTarget (org.elasticsearch.indices.recovery.RecoveryTarget)7 IOException (java.io.IOException)5 CountDownLatch (java.util.concurrent.CountDownLatch)4 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)4 ShardRouting (org.elasticsearch.cluster.routing.ShardRouting)4 Store (org.elasticsearch.index.store.Store)4 RecoveryState (org.elasticsearch.indices.recovery.RecoveryState)4 Collections (java.util.Collections)3 Semaphore (java.util.concurrent.Semaphore)3 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 AtomicReference (java.util.concurrent.atomic.AtomicReference)3 Path (java.nio.file.Path)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 Collections.emptyMap (java.util.Collections.emptyMap)2 Collections.emptySet (java.util.Collections.emptySet)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Map (java.util.Map)2