Module org.elasticsearch.server
Package org.elasticsearch.repositories
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 Summary
ConstructorsConstructorDescriptionLocalPrimarySnapshotShardContextFactory(ClusterService clusterService, IndicesService indicesService) -
Method Summary
Modifier and TypeMethodDescriptionasyncCreate(ShardId shardId, Snapshot snapshot, IndexId indexId, IndexShardSnapshotStatus snapshotStatus, IndexVersion repositoryMetaVersion, long snapshotStartTime, ActionListener<ShardSnapshotResult> listener) Asynchronously creates aSnapshotShardContextfor the given shard and snapshot.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.repositories.SnapshotShardContextFactory
supportsRelocationDuringSnapshot
-
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:SnapshotShardContextFactoryAsynchronously creates aSnapshotShardContextfor the given shard and snapshot. The passed-in listener is notified once the shard snapshot completes, either successfully or with a failure.- Specified by:
asyncCreatein interfaceSnapshotShardContextFactory- Parameters:
shardId- Shard ID of the shard to snapshotsnapshot- The overall snapshot informationindexId- The index ID of the index in the snapshotsnapshotStatus- Status of the shard snapshotrepositoryMetaVersion- The repository metadata version this snapshot usessnapshotStartTime- Start time of the overall snapshotlistener- Listener to be invoked once the shard snapshot completes- Returns:
- A subscribable listener that provides the created
SnapshotShardContextor 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.
-