Package org.elasticsearch.cluster
Class SnapshotsInProgress.Entry
java.lang.Object
org.elasticsearch.cluster.SnapshotsInProgress.Entry
- All Implemented Interfaces:
Writeable,org.elasticsearch.common.xcontent.ToXContent,RepositoryOperation
- Enclosing class:
- SnapshotsInProgress
public static class SnapshotsInProgress.Entry extends java.lang.Object implements Writeable, org.elasticsearch.common.xcontent.ToXContent, RepositoryOperation
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors Constructor Description Entry(SnapshotsInProgress.Entry entry, SnapshotsInProgress.State state, java.util.List<IndexId> indices, long repositoryStateId, ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, Version version, java.lang.String failure)Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, SnapshotsInProgress.State state, java.util.List<IndexId> indices, java.util.List<java.lang.String> dataStreams, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, java.util.Map<java.lang.String,java.lang.Object> userMetadata, Version version)Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, SnapshotsInProgress.State state, java.util.List<IndexId> indices, java.util.List<java.lang.String> dataStreams, java.util.List<SnapshotFeatureInfo> featureStates, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, java.lang.String failure, java.util.Map<java.lang.String,java.lang.Object> userMetadata, Version version) -
Method Summary
Modifier and Type Method Description SnapshotsInProgress.Entryabort()Create a new instance by aborting this instance.ImmutableOpenMap<RepositoryShardId,SnapshotsInProgress.ShardSnapshotStatus>clones()java.util.List<java.lang.String>dataStreams()booleanequals(java.lang.Object o)SnapshotsInProgress.Entryfail(ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, SnapshotsInProgress.State state, java.lang.String failure)java.lang.Stringfailure()java.util.List<SnapshotFeatureInfo>featureStates()inthashCode()booleanincludeGlobalState()java.util.List<IndexId>indices()booleanisClone()booleanisFragment()booleanpartial()java.lang.Stringrepository()Name of the repository affected.longrepositoryStateId()The repository state id at the time the operation began.ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus>shards()Snapshotsnapshot()SnapshotIdsource()longstartTime()SnapshotsInProgress.Statestate()java.lang.StringtoString()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)java.util.Map<java.lang.String,java.lang.Object>userMetadata()Versionversion()What version of metadata to use for the snapshot in the repositorySnapshotsInProgress.EntrywithClones(ImmutableOpenMap<RepositoryShardId,SnapshotsInProgress.ShardSnapshotStatus> updatedClones)SnapshotsInProgress.EntrywithRepoGen(long newRepoGen)SnapshotsInProgress.EntrywithShardStates(ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards)Create a new instance that has its shard assignments replaced by the given shard assignment map.SnapshotsInProgress.EntrywithStartedShards(ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards)Same aswithShardStates(org.elasticsearch.common.collect.ImmutableOpenMap<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.voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
Entry
public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, SnapshotsInProgress.State state, java.util.List<IndexId> indices, java.util.List<java.lang.String> dataStreams, java.util.List<SnapshotFeatureInfo> featureStates, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, java.lang.String failure, java.util.Map<java.lang.String,java.lang.Object> userMetadata, Version version) -
Entry
public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, SnapshotsInProgress.State state, java.util.List<IndexId> indices, java.util.List<java.lang.String> dataStreams, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, java.util.Map<java.lang.String,java.lang.Object> userMetadata, Version version) -
Entry
public Entry(SnapshotsInProgress.Entry entry, SnapshotsInProgress.State state, java.util.List<IndexId> indices, long repositoryStateId, ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, Version version, java.lang.String failure)
-
-
Method Details
-
withRepoGen
-
withClones
public SnapshotsInProgress.Entry withClones(ImmutableOpenMap<RepositoryShardId,SnapshotsInProgress.ShardSnapshotStatus> updatedClones) -
abort
Create 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
-
fail
public SnapshotsInProgress.Entry fail(ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, SnapshotsInProgress.State state, java.lang.String failure) -
withShardStates
public SnapshotsInProgress.Entry withShardStates(ImmutableOpenMap<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
-
withStartedShards
public SnapshotsInProgress.Entry withStartedShards(ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards)Same aswithShardStates(org.elasticsearch.common.collect.ImmutableOpenMap<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. -
repository
public java.lang.String repository()Description copied from interface:RepositoryOperationName of the repository affected.- Specified by:
repositoryin interfaceRepositoryOperation
-
snapshot
-
shards
-
state
-
indices
-
includeGlobalState
public boolean includeGlobalState() -
userMetadata
public java.util.Map<java.lang.String,java.lang.Object> userMetadata() -
partial
public boolean partial() -
startTime
public long startTime() -
dataStreams
public java.util.List<java.lang.String> dataStreams() -
featureStates
-
repositoryStateId
public long repositoryStateId()Description copied from interface:RepositoryOperationThe repository state id at the time the operation began.- Specified by:
repositoryStateIdin interfaceRepositoryOperation
-
failure
public java.lang.String failure() -
version
What version of metadata to use for the snapshot in the repository -
source
-
isClone
public boolean isClone() -
clones
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
isFragment
public boolean isFragment()- Specified by:
isFragmentin interfaceorg.elasticsearch.common.xcontent.ToXContent
-