Class AsyncRecoveryTarget
java.lang.Object
org.opensearch.indices.recovery.AsyncRecoveryTarget
- All Implemented Interfaces:
org.opensearch.indices.recovery.FileChunkWriter,org.opensearch.indices.recovery.RecoveryTargetHandler
public class AsyncRecoveryTarget
extends Object
implements org.opensearch.indices.recovery.RecoveryTargetHandler
Wraps a
RecoveryTarget to make all remote calls to be executed asynchronously using the provided executor.-
Constructor Summary
ConstructorsConstructorDescriptionAsyncRecoveryTarget(org.opensearch.indices.recovery.RecoveryTargetHandler target, Executor executor) AsyncRecoveryTarget(org.opensearch.indices.recovery.RecoveryTargetHandler target, Executor executor, org.opensearch.index.shard.IndexShard primary, org.opensearch.index.shard.IndexShard replica, Function<List<org.opensearch.index.shard.IndexShard>, List<org.opensearch.indices.replication.SegmentReplicationTarget>> replicatePrimaryFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanFiles(int totalTranslogOps, long globalCheckpoint, org.opensearch.index.store.Store.MetadataSnapshot sourceMetadata, org.opensearch.core.action.ActionListener<Void> listener) voidfinalizeRecovery(long globalCheckpoint, long trimAboveSeqNo, org.opensearch.core.action.ActionListener<Void> listener) voidvoidhandoffPrimaryContext(org.opensearch.index.seqno.ReplicationTracker.PrimaryContext primaryContext) voidindexTranslogOperations(List<org.opensearch.index.translog.Translog.Operation> operations, int totalTranslogOps, long maxSeenAutoIdTimestampOnPrimary, long maxSeqNoOfDeletesOrUpdatesOnPrimary, org.opensearch.index.seqno.RetentionLeases retentionLeases, long mappingVersionOnPrimary, org.opensearch.core.action.ActionListener<Long> listener) voidprepareForTranslogOperations(int totalTranslogOps, org.opensearch.core.action.ActionListener<Void> listener) voidreceiveFileInfo(List<String> phase1FileNames, List<Long> phase1FileSizes, List<String> phase1ExistingFileNames, List<Long> phase1ExistingFileSizes, int totalTranslogOps, org.opensearch.core.action.ActionListener<Void> listener) voidwriteFileChunk(org.opensearch.index.store.StoreFileMetadata fileMetadata, long position, org.opensearch.core.common.bytes.BytesReference content, boolean lastChunk, int totalTranslogOps, org.opensearch.core.action.ActionListener<Void> listener) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.indices.recovery.RecoveryTargetHandler
cancel
-
Constructor Details
-
AsyncRecoveryTarget
public AsyncRecoveryTarget(org.opensearch.indices.recovery.RecoveryTargetHandler target, Executor executor) -
AsyncRecoveryTarget
public AsyncRecoveryTarget(org.opensearch.indices.recovery.RecoveryTargetHandler target, Executor executor, org.opensearch.index.shard.IndexShard primary, org.opensearch.index.shard.IndexShard replica, Function<List<org.opensearch.index.shard.IndexShard>, List<org.opensearch.indices.replication.SegmentReplicationTarget>> replicatePrimaryFunction)
-
-
Method Details
-
prepareForTranslogOperations
public void prepareForTranslogOperations(int totalTranslogOps, org.opensearch.core.action.ActionListener<Void> listener) - Specified by:
prepareForTranslogOperationsin interfaceorg.opensearch.indices.recovery.RecoveryTargetHandler
-
forceSegmentFileSync
public void forceSegmentFileSync()- Specified by:
forceSegmentFileSyncin interfaceorg.opensearch.indices.recovery.RecoveryTargetHandler
-
finalizeRecovery
public void finalizeRecovery(long globalCheckpoint, long trimAboveSeqNo, org.opensearch.core.action.ActionListener<Void> listener) - Specified by:
finalizeRecoveryin interfaceorg.opensearch.indices.recovery.RecoveryTargetHandler
-
handoffPrimaryContext
public void handoffPrimaryContext(org.opensearch.index.seqno.ReplicationTracker.PrimaryContext primaryContext) - Specified by:
handoffPrimaryContextin interfaceorg.opensearch.indices.recovery.RecoveryTargetHandler
-
indexTranslogOperations
public void indexTranslogOperations(List<org.opensearch.index.translog.Translog.Operation> operations, int totalTranslogOps, long maxSeenAutoIdTimestampOnPrimary, long maxSeqNoOfDeletesOrUpdatesOnPrimary, org.opensearch.index.seqno.RetentionLeases retentionLeases, long mappingVersionOnPrimary, org.opensearch.core.action.ActionListener<Long> listener) - Specified by:
indexTranslogOperationsin interfaceorg.opensearch.indices.recovery.RecoveryTargetHandler
-
receiveFileInfo
public void receiveFileInfo(List<String> phase1FileNames, List<Long> phase1FileSizes, List<String> phase1ExistingFileNames, List<Long> phase1ExistingFileSizes, int totalTranslogOps, org.opensearch.core.action.ActionListener<Void> listener) - Specified by:
receiveFileInfoin interfaceorg.opensearch.indices.recovery.RecoveryTargetHandler
-
cleanFiles
public void cleanFiles(int totalTranslogOps, long globalCheckpoint, org.opensearch.index.store.Store.MetadataSnapshot sourceMetadata, org.opensearch.core.action.ActionListener<Void> listener) - Specified by:
cleanFilesin interfaceorg.opensearch.indices.recovery.RecoveryTargetHandler
-
writeFileChunk
public void writeFileChunk(org.opensearch.index.store.StoreFileMetadata fileMetadata, long position, org.opensearch.core.common.bytes.BytesReference content, boolean lastChunk, int totalTranslogOps, org.opensearch.core.action.ActionListener<Void> listener) - Specified by:
writeFileChunkin interfaceorg.opensearch.indices.recovery.FileChunkWriter
-