Class SnapshotShardContext

All Implemented Interfaces:
ActionListener<ShardSnapshotResult>

public final class SnapshotShardContext extends DelegatingActionListener<ShardSnapshotResult,ShardSnapshotResult>
Context holding the state for creating a shard snapshot via Repository.snapshotShard(SnapshotShardContext). Wraps a Engine.IndexCommitRef that is released once this instances is completed by invoking either its onResponse(ShardSnapshotResult) or DelegatingActionListener.onFailure(Exception) callback.
  • Constructor Details

    • SnapshotShardContext

      public SnapshotShardContext(Store store, MapperService mapperService, SnapshotId snapshotId, IndexId indexId, SnapshotIndexCommit commitRef, @Nullable String shardStateIdentifier, IndexShardSnapshotStatus snapshotStatus, IndexVersion repositoryMetaVersion, long snapshotStartTime, ActionListener<ShardSnapshotResult> listener)
      Parameters:
      store - store to be snapshotted
      mapperService - the shards mapper service
      snapshotId - snapshot id
      indexId - id for the index being snapshotted
      commitRef - commit point reference
      shardStateIdentifier - a unique identifier of the state of the shard that is stored with the shard's snapshot and used to detect if the shard has changed between snapshots. If null is passed as the identifier snapshotting will be done by inspecting the physical files referenced by snapshotIndexCommit
      snapshotStatus - snapshot status
      repositoryMetaVersion - version of the updated repository metadata to write
      snapshotStartTime - start time of the snapshot found in SnapshotsInProgress.Entry.startTime()
      listener - listener invoked on completion
  • Method Details

    • store

      public Store store()
    • mapperService

      public MapperService mapperService()
    • snapshotId

      public SnapshotId snapshotId()
    • indexId

      public IndexId indexId()
    • indexCommit

      public org.apache.lucene.index.IndexCommit indexCommit()
    • stateIdentifier

      @Nullable public String stateIdentifier()
    • status

      public IndexShardSnapshotStatus status()
    • getRepositoryMetaVersion

      public IndexVersion getRepositoryMetaVersion()
    • snapshotStartTime

      public long snapshotStartTime()
    • onResponse

      public void onResponse(ShardSnapshotResult result)
      Description copied from interface: ActionListener
      Handle action response. This response may constitute a failure or a success but it is up to the listener to make that decision.
    • withCommitRef

      public Releasable withCommitRef()