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.Params
Nested 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.Entry
abort()
Create a new instance by aborting this instance.ImmutableOpenMap<RepositoryShardId,SnapshotsInProgress.ShardSnapshotStatus>
clones()
java.util.List<java.lang.String>
dataStreams()
boolean
equals(java.lang.Object o)
SnapshotsInProgress.Entry
fail(ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards, SnapshotsInProgress.State state, java.lang.String failure)
java.lang.String
failure()
java.util.List<SnapshotFeatureInfo>
featureStates()
int
hashCode()
boolean
includeGlobalState()
java.util.List<IndexId>
indices()
boolean
isClone()
boolean
isFragment()
boolean
partial()
java.lang.String
repository()
Name of the repository affected.long
repositoryStateId()
The repository state id at the time the operation began.ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus>
shards()
Snapshot
snapshot()
SnapshotId
source()
long
startTime()
SnapshotsInProgress.State
state()
java.lang.String
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
java.util.Map<java.lang.String,java.lang.Object>
userMetadata()
Version
version()
What version of metadata to use for the snapshot in the repositorySnapshotsInProgress.Entry
withClones(ImmutableOpenMap<RepositoryShardId,SnapshotsInProgress.ShardSnapshotStatus> updatedClones)
SnapshotsInProgress.Entry
withRepoGen(long newRepoGen)
SnapshotsInProgress.Entry
withShardStates(ImmutableOpenMap<ShardId,SnapshotsInProgress.ShardSnapshotStatus> shards)
Create a new instance that has its shard assignments replaced by the given shard assignment map.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.void
writeTo(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.ABORTED
if assigned to a data node or toSnapshotsInProgress.ShardState.FAILED
if 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 returnsnull
since no abort is needed and the snapshot can simply be removed from the cluster state outright.- Returns:
- aborted snapshot entry or
null
if 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:RepositoryOperation
Name of the repository affected.- Specified by:
repository
in 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:RepositoryOperation
The repository state id at the time the operation began.- Specified by:
repositoryStateId
in 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in 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:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
isFragment
public boolean isFragment()- Specified by:
isFragment
in interfaceorg.elasticsearch.common.xcontent.ToXContent
-