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

    Constructors
    Constructor
    Description
    AsyncRecoveryTarget(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 Type
    Method
    Description
    void
    cleanFiles(int totalTranslogOps, long globalCheckpoint, org.opensearch.index.store.Store.MetadataSnapshot sourceMetadata, org.opensearch.core.action.ActionListener<Void> listener)
     
    void
    finalizeRecovery(long globalCheckpoint, long trimAboveSeqNo, org.opensearch.core.action.ActionListener<Void> listener)
     
    void
     
    void
    handoffPrimaryContext(org.opensearch.index.seqno.ReplicationTracker.PrimaryContext primaryContext)
     
    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)
     
    void
    prepareForTranslogOperations(int totalTranslogOps, org.opensearch.core.action.ActionListener<Void> listener)
     
    void
    receiveFileInfo(List<String> phase1FileNames, List<Long> phase1FileSizes, List<String> phase1ExistingFileNames, List<Long> phase1ExistingFileSizes, int totalTranslogOps, org.opensearch.core.action.ActionListener<Void> listener)
     
    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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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:
      prepareForTranslogOperations in interface org.opensearch.indices.recovery.RecoveryTargetHandler
    • forceSegmentFileSync

      public void forceSegmentFileSync()
      Specified by:
      forceSegmentFileSync in interface org.opensearch.indices.recovery.RecoveryTargetHandler
    • finalizeRecovery

      public void finalizeRecovery(long globalCheckpoint, long trimAboveSeqNo, org.opensearch.core.action.ActionListener<Void> listener)
      Specified by:
      finalizeRecovery in interface org.opensearch.indices.recovery.RecoveryTargetHandler
    • handoffPrimaryContext

      public void handoffPrimaryContext(org.opensearch.index.seqno.ReplicationTracker.PrimaryContext primaryContext)
      Specified by:
      handoffPrimaryContext in interface org.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:
      indexTranslogOperations in interface org.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:
      receiveFileInfo in interface org.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:
      cleanFiles in interface org.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:
      writeFileChunk in interface org.opensearch.indices.recovery.FileChunkWriter