Module org.elasticsearch.server
Package org.elasticsearch.cluster
Record Class SnapshotsInProgress.ShardSnapshotStatus
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.SnapshotsInProgress.ShardSnapshotStatus
- Record Components:
nodeId- node snapshotting the shardstate- the current phase of the snapshotgeneration- shard generation ID identifying a particular snapshot of a shardreason- what initiated the shard snapshotshardSnapshotResult- only set if the snapshot has been successful, contains information for the shard finalization phase
- All Implemented Interfaces:
Writeable
- Enclosing class:
SnapshotsInProgress
public static record SnapshotsInProgress.ShardSnapshotStatus(String nodeId, SnapshotsInProgress.ShardState state, ShardGeneration generation, String reason, ShardSnapshotResult shardSnapshotResult)
extends Record
implements Writeable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SnapshotsInProgress.ShardSnapshotStatusShard snapshot status for shards that could not be snapshotted because their index was deleted from before the shard snapshot started.static final SnapshotsInProgress.ShardSnapshotStatusShard snapshot status for shards that are waiting for another operation to finish before they can be assigned to a node. -
Constructor Summary
ConstructorsConstructorDescriptionShardSnapshotStatus(String nodeId, SnapshotsInProgress.ShardState state, ShardGeneration generation) ShardSnapshotStatus(String nodeId, SnapshotsInProgress.ShardState state, ShardGeneration generation, String reason) ShardSnapshotStatus(String nodeId, SnapshotsInProgress.ShardState state, ShardGeneration generation, String reason, ShardSnapshotResult shardSnapshotResult) Creates an instance of aShardSnapshotStatusrecord class.ShardSnapshotStatus(String nodeId, ShardGeneration generation) Initializes status with stateSnapshotsInProgress.ShardState.INIT. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thegenerationrecord component.final inthashCode()Returns a hash code value for this object.booleanisActive()Checks if this shard snapshot is actively executing.nodeId()Returns the value of thenodeIdrecord component.readFrom(StreamInput in) reason()Returns the value of thereasonrecord component.Returns the value of theshardSnapshotResultrecord component.state()Returns the value of thestaterecord component.success(String nodeId, ShardSnapshotResult shardSnapshotResult) final StringtoString()Returns a string representation of this record class.withUpdatedGeneration(ShardGeneration newGeneration) voidwriteTo(StreamOutput out) Write this into the StreamOutput.
-
Field Details
-
UNASSIGNED_QUEUED
Shard snapshot status for shards that are waiting for another operation to finish before they can be assigned to a node. -
MISSING
Shard snapshot status for shards that could not be snapshotted because their index was deleted from before the shard snapshot started.
-
-
Constructor Details
-
ShardSnapshotStatus
Initializes status with stateSnapshotsInProgress.ShardState.INIT. -
ShardSnapshotStatus
public ShardSnapshotStatus(@Nullable String nodeId, SnapshotsInProgress.ShardState state, @Nullable ShardGeneration generation) -
ShardSnapshotStatus
public ShardSnapshotStatus(@Nullable String nodeId, SnapshotsInProgress.ShardState state, @Nullable ShardGeneration generation, String reason) -
ShardSnapshotStatus
public ShardSnapshotStatus(@Nullable String nodeId, SnapshotsInProgress.ShardState state, @Nullable ShardGeneration generation, String reason, @Nullable ShardSnapshotResult shardSnapshotResult) Creates an instance of aShardSnapshotStatusrecord class.- Parameters:
nodeId- the value for thenodeIdrecord componentstate- the value for thestaterecord componentgeneration- the value for thegenerationrecord componentreason- the value for thereasonrecord componentshardSnapshotResult- the value for theshardSnapshotResultrecord component
-
-
Method Details
-
success
public static SnapshotsInProgress.ShardSnapshotStatus success(String nodeId, ShardSnapshotResult shardSnapshotResult) -
readFrom
- Throws:
IOException
-
withUpdatedGeneration
-
shardSnapshotResult
Returns the value of theshardSnapshotResultrecord component.- Returns:
- the value of the
shardSnapshotResultrecord component
-
isActive
public boolean isActive()Checks if this shard snapshot is actively executing. A shard is defined as actively executing if it either is in a state that may write to the repository (SnapshotsInProgress.ShardState.INITorSnapshotsInProgress.ShardState.ABORTED) or about to write to it in stateSnapshotsInProgress.ShardState.WAITINGorSnapshotsInProgress.ShardState.PAUSED_FOR_NODE_REMOVAL. -
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
nodeId
Returns the value of thenodeIdrecord component.- Returns:
- the value of the
nodeIdrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
generation
Returns the value of thegenerationrecord component.- Returns:
- the value of the
generationrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-