Module org.elasticsearch.server
Package org.elasticsearch.cluster
Record Class SnapshotsInProgress.ShardSnapshotStatus
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.SnapshotsInProgress.ShardSnapshotStatus
- 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
Modifier and TypeFieldDescriptionstatic final SnapshotsInProgress.ShardSnapshotStatus
Shard snapshot status for shards that could not be snapshotted because their index was deleted from before the shard snapshot started.static final SnapshotsInProgress.ShardSnapshotStatus
Shard snapshot status for shards that are waiting for another operation to finish before they can be assigned to a node. -
Constructor Summary
ConstructorDescriptionShardSnapshotStatus
(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 aShardSnapshotStatus
record class.ShardSnapshotStatus
(String nodeId, ShardGeneration generation) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thegeneration
record component.final int
hashCode()
Returns a hash code value for this object.boolean
isActive()
Checks if this shard snapshot is actively executing.nodeId()
Returns the value of thenodeId
record component.readFrom
(StreamInput in) reason()
Returns the value of thereason
record component.Returns the value of theshardSnapshotResult
record component.state()
Returns the value of thestate
record component.success
(String nodeId, ShardSnapshotResult shardSnapshotResult) final String
toString()
Returns a string representation of this record class.withUpdatedGeneration
(ShardGeneration newGeneration) void
writeTo
(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
-
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 aShardSnapshotStatus
record class.- Parameters:
nodeId
- the value for thenodeId
record componentstate
- the value for thestate
record componentgeneration
- the value for thegeneration
record componentreason
- the value for thereason
record componentshardSnapshotResult
- the value for theshardSnapshotResult
record component
-
-
Method Details
-
success
public static SnapshotsInProgress.ShardSnapshotStatus success(String nodeId, ShardSnapshotResult shardSnapshotResult) -
readFrom
- Throws:
IOException
-
withUpdatedGeneration
-
shardSnapshotResult
Returns the value of theshardSnapshotResult
record component.- Returns:
- the value of the
shardSnapshotResult
record 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.INIT
orSnapshotsInProgress.ShardState.ABORTED
) or about to write to it in stateSnapshotsInProgress.ShardState.WAITING
orSnapshotsInProgress.ShardState.PAUSED_FOR_NODE_REMOVAL
. -
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in 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 thenodeId
record component.- Returns:
- the value of the
nodeId
record component
-
state
Returns the value of thestate
record component.- Returns:
- the value of the
state
record component
-
generation
Returns the value of thegeneration
record component.- Returns:
- the value of the
generation
record component
-
reason
Returns the value of thereason
record component.- Returns:
- the value of the
reason
record component
-