Class TranslogTransferManager

java.lang.Object
org.opensearch.index.translog.transfer.TranslogTransferManager

public class TranslogTransferManager extends Object
The class responsible for orchestrating the transfer of a TransferSnapshot via a TransferService
Opensearch.internal:
  • Constructor Details

  • Method Details

    • getRemoteTranslogTransferTracker

      public RemoteTranslogTransferTracker getRemoteTranslogTransferTracker()
    • getShardId

      public org.opensearch.core.index.shard.ShardId getShardId()
    • transferSnapshot

      public boolean transferSnapshot(TransferSnapshot transferSnapshot, TranslogTransferListener translogTransferListener) throws IOException
      Throws:
      IOException
    • downloadTranslog

      public boolean downloadTranslog(String primaryTerm, String generation, Path location) throws IOException
      Throws:
      IOException
    • readMetadata

      public TranslogTransferMetadata readMetadata() throws IOException
      Throws:
      IOException
    • getMetadataBytes

      public byte[] getMetadataBytes(TranslogTransferMetadata metadata) throws IOException
      Get the metadata bytes for a TranslogTransferMetadata object
      Parameters:
      metadata - The object to be parsed
      Returns:
      Byte representation for the given metadata
      Throws:
      IOException
    • deleteGenerationAsync

      public void deleteGenerationAsync(long primaryTerm, Set<Long> generations, Runnable onCompletion)
      This method handles deletion of multiple generations for a single primary term. The deletion happens for translog and metadata files.
      Parameters:
      primaryTerm - primary term where the generations will be deleted.
      generations - set of generation to delete.
      onCompletion - runnable to run on completion of deletion regardless of success/failure.
    • deletePrimaryTermsAsync

      public void deletePrimaryTermsAsync(long minPrimaryTermToKeep)
      Deletes all primary terms from remote store that are more than the given minPrimaryTermToKeep. The caller of the method must ensure that the value is lesser than equal to the minimum primary term referenced by the remote translog metadata.
      Parameters:
      minPrimaryTermToKeep - all primary terms below this primary term are deleted.
    • delete

      public void delete()
      Deletes all the translog content related to the underlying shard.
    • deleteStaleTranslogMetadataFilesAsync

      public void deleteStaleTranslogMetadataFilesAsync(Runnable onCompletion)
    • deleteTranslogFiles

      public void deleteTranslogFiles() throws IOException
      Throws:
      IOException
    • getMaxRemoteTranslogReadersSettings

      public int getMaxRemoteTranslogReadersSettings()