Module org.elasticsearch.server
Package org.elasticsearch.repositories
Class FinalizeSnapshotContext
java.lang.Object
org.elasticsearch.action.DelegatingActionListener<RepositoryData,RepositoryData>
org.elasticsearch.repositories.FinalizeSnapshotContext
- All Implemented Interfaces:
ActionListener<RepositoryData>
public final class FinalizeSnapshotContext
extends DelegatingActionListener<RepositoryData,RepositoryData>
Context for finalizing a snapshot.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
A record used to track the new shard generations that have been written for each shard in a snapshot. -
Field Summary
Fields inherited from class org.elasticsearch.action.DelegatingActionListener
delegate
-
Constructor Summary
ConstructorsConstructorDescriptionFinalizeSnapshotContext
(FinalizeSnapshotContext.UpdatedShardGenerations updatedShardGenerations, long repositoryStateId, Metadata clusterMetadata, SnapshotInfo snapshotInfo, IndexVersion repositoryMetaVersion, ActionListener<RepositoryData> listener, Runnable onDone) -
Method Summary
Modifier and TypeMethodDescriptionvoid
onDone()
void
onResponse
(RepositoryData repositoryData) Complete this listener with a successful (or at least, non-exceptional) response.long
updatedClusterState
(ClusterState state) Returns a newClusterState
, based on the givenstate
with the create-snapshot entry removed.Methods inherited from class org.elasticsearch.action.DelegatingActionListener
onFailure, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateFailureAndWrap, delegateFailureIgnoreResponseAndWrap, delegateResponse, map, safeMap
-
Constructor Details
-
FinalizeSnapshotContext
public FinalizeSnapshotContext(FinalizeSnapshotContext.UpdatedShardGenerations updatedShardGenerations, long repositoryStateId, Metadata clusterMetadata, SnapshotInfo snapshotInfo, IndexVersion repositoryMetaVersion, ActionListener<RepositoryData> listener, Runnable onDone) - Parameters:
updatedShardGenerations
- updated shard generations for both live and deleted indicesrepositoryStateId
- the unique id identifying the state of the repository when the snapshot beganclusterMetadata
- cluster metadatasnapshotInfo
- SnapshotInfo instance to write for this snapshotrepositoryMetaVersion
- version of the updated repository metadata to writelistener
- listener to be invoked with the newRepositoryData
after the snapshot has been successfully added to the repositoryonDone
- consumer of the newSnapshotInfo
for the snapshot that is invoked after thelistener
once all cleanup operations after snapshot completion have executed
-
-
Method Details
-
repositoryStateId
public long repositoryStateId() -
updatedShardGenerations
-
snapshotInfo
-
repositoryMetaVersion
-
clusterMetadata
-
obsoleteShardGenerations
-
updatedClusterState
Returns a newClusterState
, based on the givenstate
with the create-snapshot entry removed. -
onDone
public void onDone() -
onResponse
Description copied from interface:ActionListener
Complete this listener with a successful (or at least, non-exceptional) response.
-