Module org.elasticsearch.server
Package org.elasticsearch.repositories
Class SnapshotShardContextHelper
java.lang.Object
org.elasticsearch.repositories.SnapshotShardContextHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionacquireSnapshotIndexCommit(ClusterService clusterService, IndexShard indexShard, Snapshot snapshot, boolean supportsRelocationDuringSnapshot, IndexShardSnapshotStatus snapshotStatus) Acquire an index commit for the shard snapshot, validating that the shard is a started primary and no resharding is in progress.static voidcloseSnapshotIndexCommit(SnapshotIndexCommit snapshotIndexCommit, ShardId shardId, Snapshot snapshot) static voidmaybeEnsureNotAborted(IndexShardSnapshotStatus snapshotStatus) static ReleasablewithSnapshotIndexCommitRef(ShardId shardId, SnapshotId snapshotId, SnapshotIndexCommit snapshotIndexCommit, IndexShardSnapshotStatus snapshotStatus)
-
Field Details
-
logger
-
-
Method Details
-
acquireSnapshotIndexCommit
public static SnapshotShardContextHelper.SnapshotIndexCommitAndShardStateId acquireSnapshotIndexCommit(ClusterService clusterService, IndexShard indexShard, Snapshot snapshot, boolean supportsRelocationDuringSnapshot, @Nullable IndexShardSnapshotStatus snapshotStatus) throws IOException Acquire an index commit for the shard snapshot, validating that the shard is a started primary and no resharding is in progress. AnullsnapshotStatusmeans the snapshot is running on a remote node, abort handling and status updates skipped on this node as they are handled on the remote node. When it is non-null, the snapshot is running locally and abort listener is registered.- Throws:
IOException
-
closeSnapshotIndexCommit
public static void closeSnapshotIndexCommit(SnapshotIndexCommit snapshotIndexCommit, ShardId shardId, Snapshot snapshot) -
withSnapshotIndexCommitRef
public static Releasable withSnapshotIndexCommitRef(ShardId shardId, SnapshotId snapshotId, SnapshotIndexCommit snapshotIndexCommit, @Nullable IndexShardSnapshotStatus snapshotStatus) -
maybeEnsureNotAborted
-