Class AsyncRecoveryTarget
java.lang.Object
org.elasticsearch.indices.recovery.AsyncRecoveryTarget
- All Implemented Interfaces:
org.elasticsearch.indices.recovery.RecoveryTargetHandler
public class AsyncRecoveryTarget
extends Object
implements org.elasticsearch.indices.recovery.RecoveryTargetHandler
Wraps a
RecoveryTarget
to make all remote calls to be executed asynchronously using the provided executor
.-
Constructor Summary
ConstructorDescriptionAsyncRecoveryTarget
(org.elasticsearch.indices.recovery.RecoveryTargetHandler target, Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanFiles
(int totalTranslogOps, long globalCheckpoint, org.elasticsearch.index.store.Store.MetadataSnapshot sourceMetadata, org.elasticsearch.action.ActionListener<Void> listener) void
finalizeRecovery
(long globalCheckpoint, long trimAboveSeqNo, org.elasticsearch.action.ActionListener<Void> listener) void
handoffPrimaryContext
(org.elasticsearch.index.seqno.ReplicationTracker.PrimaryContext primaryContext, org.elasticsearch.action.ActionListener<Void> listener) void
indexTranslogOperations
(List<org.elasticsearch.index.translog.Translog.Operation> operations, int totalTranslogOps, long maxSeenAutoIdTimestampOnPrimary, long maxSeqNoOfDeletesOrUpdatesOnPrimary, org.elasticsearch.index.seqno.RetentionLeases retentionLeases, long mappingVersionOnPrimary, org.elasticsearch.action.ActionListener<Long> listener) void
prepareForTranslogOperations
(int totalTranslogOps, org.elasticsearch.action.ActionListener<Void> listener) void
receiveFileInfo
(List<String> phase1FileNames, List<Long> phase1FileSizes, List<String> phase1ExistingFileNames, List<Long> phase1ExistingFileSizes, int totalTranslogOps, org.elasticsearch.action.ActionListener<Void> listener) void
restoreFileFromSnapshot
(String repository, org.elasticsearch.repositories.IndexId indexId, org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo snapshotFile, org.elasticsearch.action.ActionListener<Void> listener) void
writeFileChunk
(org.elasticsearch.index.store.StoreFileMetadata fileMetadata, long position, org.elasticsearch.common.bytes.ReleasableBytesReference content, boolean lastChunk, int totalTranslogOps, org.elasticsearch.action.ActionListener<Void> listener) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.indices.recovery.RecoveryTargetHandler
cancel
-
Constructor Details
-
AsyncRecoveryTarget
public AsyncRecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTargetHandler target, Executor executor)
-
-
Method Details
-
prepareForTranslogOperations
public void prepareForTranslogOperations(int totalTranslogOps, org.elasticsearch.action.ActionListener<Void> listener) - Specified by:
prepareForTranslogOperations
in interfaceorg.elasticsearch.indices.recovery.RecoveryTargetHandler
-
finalizeRecovery
public void finalizeRecovery(long globalCheckpoint, long trimAboveSeqNo, org.elasticsearch.action.ActionListener<Void> listener) - Specified by:
finalizeRecovery
in interfaceorg.elasticsearch.indices.recovery.RecoveryTargetHandler
-
handoffPrimaryContext
public void handoffPrimaryContext(org.elasticsearch.index.seqno.ReplicationTracker.PrimaryContext primaryContext, org.elasticsearch.action.ActionListener<Void> listener) - Specified by:
handoffPrimaryContext
in interfaceorg.elasticsearch.indices.recovery.RecoveryTargetHandler
-
indexTranslogOperations
public void indexTranslogOperations(List<org.elasticsearch.index.translog.Translog.Operation> operations, int totalTranslogOps, long maxSeenAutoIdTimestampOnPrimary, long maxSeqNoOfDeletesOrUpdatesOnPrimary, org.elasticsearch.index.seqno.RetentionLeases retentionLeases, long mappingVersionOnPrimary, org.elasticsearch.action.ActionListener<Long> listener) - Specified by:
indexTranslogOperations
in interfaceorg.elasticsearch.indices.recovery.RecoveryTargetHandler
-
receiveFileInfo
public void receiveFileInfo(List<String> phase1FileNames, List<Long> phase1FileSizes, List<String> phase1ExistingFileNames, List<Long> phase1ExistingFileSizes, int totalTranslogOps, org.elasticsearch.action.ActionListener<Void> listener) - Specified by:
receiveFileInfo
in interfaceorg.elasticsearch.indices.recovery.RecoveryTargetHandler
-
cleanFiles
public void cleanFiles(int totalTranslogOps, long globalCheckpoint, org.elasticsearch.index.store.Store.MetadataSnapshot sourceMetadata, org.elasticsearch.action.ActionListener<Void> listener) - Specified by:
cleanFiles
in interfaceorg.elasticsearch.indices.recovery.RecoveryTargetHandler
-
writeFileChunk
public void writeFileChunk(org.elasticsearch.index.store.StoreFileMetadata fileMetadata, long position, org.elasticsearch.common.bytes.ReleasableBytesReference content, boolean lastChunk, int totalTranslogOps, org.elasticsearch.action.ActionListener<Void> listener) - Specified by:
writeFileChunk
in interfaceorg.elasticsearch.indices.recovery.RecoveryTargetHandler
-
restoreFileFromSnapshot
public void restoreFileFromSnapshot(String repository, org.elasticsearch.repositories.IndexId indexId, org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo snapshotFile, org.elasticsearch.action.ActionListener<Void> listener) - Specified by:
restoreFileFromSnapshot
in interfaceorg.elasticsearch.indices.recovery.RecoveryTargetHandler
-