Class LocalPrimarySnapshotShardContextFactory

java.lang.Object
org.elasticsearch.repositories.LocalPrimarySnapshotShardContextFactory
All Implemented Interfaces:
SnapshotShardContextFactory

public class LocalPrimarySnapshotShardContextFactory extends Object implements SnapshotShardContextFactory
A factory implementation for creating LocalPrimarySnapshotShardContext instance from the primary shard running on the local node.
  • Constructor Details

    • LocalPrimarySnapshotShardContextFactory

      public LocalPrimarySnapshotShardContextFactory(ClusterService clusterService, IndicesService indicesService)
  • Method Details

    • asyncCreate

      public SubscribableListener<SnapshotShardContext> asyncCreate(ShardId shardId, Snapshot snapshot, IndexId indexId, IndexShardSnapshotStatus snapshotStatus, IndexVersion repositoryMetaVersion, long snapshotStartTime, ActionListener<ShardSnapshotResult> listener) throws IOException
      Description copied from interface: SnapshotShardContextFactory
      Asynchronously creates a SnapshotShardContext for the given shard and snapshot. The passed-in listener is notified once the shard snapshot completes, either successfully or with a failure.
      Specified by:
      asyncCreate in interface SnapshotShardContextFactory
      Parameters:
      shardId - Shard ID of the shard to snapshot
      snapshot - The overall snapshot information
      indexId - The index ID of the index in the snapshot
      snapshotStatus - Status of the shard snapshot
      repositoryMetaVersion - The repository metadata version this snapshot uses
      snapshotStartTime - Start time of the overall snapshot
      listener - Listener to be invoked once the shard snapshot completes
      Returns:
      A subscribable listener that provides the created SnapshotShardContext or an exception if creation failed.
      Throws:
      IOException - Exception that may throw before even the returning subscribable listener is created. When this happens, the passed-in listener will NOT be notified. Caller is responsible to handle this situation.