java.lang.Object
org.elasticsearch.cluster.SnapshotsInProgress.Entry
- All Implemented Interfaces:
- Writeable,- RepositoryOperation,- ToXContent
- Enclosing class:
- SnapshotsInProgress
public static class SnapshotsInProgress.Entry
extends Object
implements Writeable, ToXContent, RepositoryOperation
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContentToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.WriteableWriteable.Reader<V>, Writeable.Writer<V>
- 
Field SummaryFields inherited from interface org.elasticsearch.xcontent.ToXContentEMPTY_PARAMS
- 
Constructor SummaryConstructorsConstructorDescriptionEntry(Snapshot snapshot, boolean includeGlobalState, boolean partial, SnapshotsInProgress.State state, Map<String, IndexId> indices, List<String> dataStreams, List<SnapshotFeatureInfo> featureStates, long startTime, long repositoryStateId, Map<ShardId, SnapshotsInProgress.ShardSnapshotStatus> shards, String failure, Map<String, Object> userMetadata, Version version) 
- 
Method SummaryModifier and TypeMethodDescriptionabort()Create a new instance by aborting this instance.booleanfailure()inthashCode()booleanindexByName(String name) indices()booleanisClone()booleanbooleanpartial()Name of the repository affected.longThe repository state id at the time the operation began.shardId(RepositoryShardId repositoryShardId) shards()snapshot()source()longstate()toString()toXContent(XContentBuilder builder, ToXContent.Params params) version()What version of metadata to use for the snapshot in the repositorywithClones(Map<RepositoryShardId, SnapshotsInProgress.ShardSnapshotStatus> updatedClones) withRepoGen(long newRepoGen) Create a new instance that has its shard assignments replaced by the given shard assignment map.Same aswithShardStates(java.util.Map<org.elasticsearch.index.shard.ShardId, org.elasticsearch.cluster.SnapshotsInProgress.ShardSnapshotStatus>)but does not check if the snapshot completed and thus is only to be used when starting new shard snapshots on data nodes for a running snapshot.withUpdatedIndexIds(Map<IndexId, IndexId> updates) voidwriteTo(StreamOutput out) Write this into the StreamOutput.
- 
Constructor Details- 
Entrypublic Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, SnapshotsInProgress.State state, Map<String, IndexId> indices, List<String> dataStreams, List<SnapshotFeatureInfo> featureStates, long startTime, long repositoryStateId, Map<ShardId, SnapshotsInProgress.ShardSnapshotStatus> shards, String failure, Map<String, Object> userMetadata, Version version) 
 
- 
- 
Method Details- 
withRepoGen
- 
withUpdatedIndexIdsReassigns allIndexIdin a snapshot that can be found as keys in the givenupdatesto theIndexIdvalue that they map to. This method is used in an edge case of removing aSnapshotDeletionsInProgress.Entryfrom the cluster state at the end of a delete. If the delete removed the last use of a certainIndexIdfrom the repository then we do not want to reuse thatIndexIdbecause the implementation ofBlobStoreRepositoryassumes that a givenIndexIdwill never be reused if it went from referenced to unreferenced in theRepositoryDatain a delete.
- 
withClonespublic SnapshotsInProgress.Entry withClones(Map<RepositoryShardId, SnapshotsInProgress.ShardSnapshotStatus> updatedClones) 
- 
abortCreate a new instance by aborting this instance. Moving all in-progress shards toSnapshotsInProgress.ShardState.ABORTEDif assigned to a data node or toSnapshotsInProgress.ShardState.FAILEDif not assigned to any data node. If the instance had no in-progress shard snapshots assigned to data nodes it's moved to stateSnapshotsInProgress.State.SUCCESS, otherwise it's moved to stateSnapshotsInProgress.State.ABORTED. In the special case where this instance has not yet made any progress on any shard this method just returnsnullsince no abort is needed and the snapshot can simply be removed from the cluster state outright.- Returns:
- aborted snapshot entry or nullif entry can be removed from the cluster state directly
 
- 
withShardStatespublic SnapshotsInProgress.Entry withShardStates(Map<ShardId, SnapshotsInProgress.ShardSnapshotStatus> shards) Create a new instance that has its shard assignments replaced by the given shard assignment map. If the given shard assignments show all shard snapshots in a completed state then the returned instance will be of stateSnapshotsInProgress.State.SUCCESS, otherwise the state remains unchanged.- Parameters:
- shards- new shard snapshot states
- Returns:
- new snapshot entry
 
- 
withStartedShardspublic SnapshotsInProgress.Entry withStartedShards(Map<ShardId, SnapshotsInProgress.ShardSnapshotStatus> shards) Same aswithShardStates(java.util.Map<org.elasticsearch.index.shard.ShardId, org.elasticsearch.cluster.SnapshotsInProgress.ShardSnapshotStatus>)but does not check if the snapshot completed and thus is only to be used when starting new shard snapshots on data nodes for a running snapshot.
- 
repositoryDescription copied from interface:RepositoryOperationName of the repository affected.- Specified by:
- repositoryin interface- RepositoryOperation
 
- 
snapshot
- 
shardsByRepoShardId
- 
indexByName
- 
shards
- 
shardId
- 
state
- 
indices
- 
includeGlobalStatepublic boolean includeGlobalState()
- 
userMetadata
- 
partialpublic boolean partial()
- 
startTimepublic long startTime()
- 
dataStreams
- 
featureStates
- 
repositoryStateIdpublic long repositoryStateId()Description copied from interface:RepositoryOperationThe repository state id at the time the operation began.- Specified by:
- repositoryStateIdin interface- RepositoryOperation
 
- 
failure
- 
versionWhat version of metadata to use for the snapshot in the repository
- 
source
- 
isClonepublic boolean isClone()
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
toXContentpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
- toXContentin interface- ToXContent
- Throws:
- IOException
 
- 
writeToDescription copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
- writeToin interface- Writeable
- Throws:
- IOException
 
- 
isFragmentpublic boolean isFragment()- Specified by:
- isFragmentin interface- ToXContent
 
 
-