Class Command
- java.lang.Object
-
- org.opensearch.client.opensearch.cluster.reroute.Command
-
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable public class Command extends java.lang.Object implements JsonpSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommand.BuilderBuilder forCommand.
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<Command>_DESERIALIZERJson deserializer forCommand
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandAllocatePrimaryActionallocateEmptyPrimary()Allocate an empty primary shard to a node.CommandAllocateReplicaActionallocateReplica()Allocate an unassigned replica shard to a node.CommandAllocatePrimaryActionallocateStalePrimary()Allocate a primary shard to a node that holds a stale copy.CommandCancelActioncancel()Cancel allocation of a shard (or recovery).CommandMoveActionmove()Move a started shard from one node to another node.static Commandof(java.util.function.Function<Command.Builder,ObjectBuilder<Command>> fn)voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)protected static voidsetupCommandDeserializer(ObjectDeserializer<Command.Builder> op)
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<Command> _DESERIALIZER
Json deserializer forCommand
-
-
Method Detail
-
of
public static Command of(java.util.function.Function<Command.Builder,ObjectBuilder<Command>> fn)
-
cancel
@Nullable public final CommandCancelAction cancel()
Cancel allocation of a shard (or recovery). Accepts index and shard for index name and shard number, and node for the node to cancel the shard allocation on. This can be used to force resynchronization of existing replicas from the primary shard by cancelling them and allowing them to be reinitialized through the standard recovery process. By default only replica shard allocations can be cancelled. If it is necessary to cancel the allocation of a primary shard then the allow_primary flag must also be included in the request.API name:
cancel
-
move
@Nullable public final CommandMoveAction move()
Move a started shard from one node to another node. Accepts index and shard for index name and shard number, from_node for the node to move the shard from, and to_node for the node to move the shard to.API name:
move
-
allocateReplica
@Nullable public final CommandAllocateReplicaAction allocateReplica()
Allocate an unassigned replica shard to a node. Accepts index and shard for index name and shard number, and node to allocate the shard to. Takes allocation deciders into account.API name:
allocate_replica
-
allocateStalePrimary
@Nullable public final CommandAllocatePrimaryAction allocateStalePrimary()
Allocate a primary shard to a node that holds a stale copy. Accepts the index and shard for index name and shard number, and node to allocate the shard to. Using this command may lead to data loss for the provided shard id. If a node which has the good copy of the data rejoins the cluster later on, that data will be deleted or overwritten with the data of the stale copy that was forcefully allocated with this command. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true.API name:
allocate_stale_primary
-
allocateEmptyPrimary
@Nullable public final CommandAllocatePrimaryAction allocateEmptyPrimary()
Allocate an empty primary shard to a node. Accepts the index and shard for index name and shard number, and node to allocate the shard to. Using this command leads to a complete loss of all data that was indexed into this shard, if it was previously started. If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag accept_data_loss to be explicitly set to true.API name:
allocate_empty_primary
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
-
setupCommandDeserializer
protected static void setupCommandDeserializer(ObjectDeserializer<Command.Builder> op)
-
-