Module org.elasticsearch.server
Package org.elasticsearch.repositories
Interface SnapshotShardContextFactory
- All Known Implementing Classes:
LocalPrimarySnapshotShardContextFactory
public interface SnapshotShardContextFactory
Factory interface to create
SnapshotShardContext instances.-
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.default booleanIndicates whether the factory supports relocating a shard while its snapshot is in progress.
-
Method Details
-
asyncCreate
SubscribableListener<SnapshotShardContext> asyncCreate(ShardId shardId, Snapshot snapshot, IndexId indexId, IndexShardSnapshotStatus snapshotStatus, IndexVersion repositoryMetaVersion, long snapshotStartTime, ActionListener<ShardSnapshotResult> listener) throws IOException Asynchronously creates aSnapshotShardContextfor the given shard and snapshot. The passed-in listener is notified once the shard snapshot completes, either successfully or with a failure.- 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.
-
supportsRelocationDuringSnapshot
default boolean supportsRelocationDuringSnapshot()Indicates whether the factory supports relocating a shard while its snapshot is in progress. Whentrue, lifecycle of the local shard is not tied to its shard snapshot. For example, when the shard closes, it does not automatically abort the snapshotSnapshotShardsService.beforeIndexShardClosed(org.elasticsearch.index.shard.ShardId, org.elasticsearch.index.shard.IndexShard, org.elasticsearch.common.settings.Settings). Note this value indicates whether the feature is supported, but whether relocation will actually happen still depends on other factorsSnapshotInProgressAllocationDecider
-