Class Command.Builder
- java.lang.Object
-
- org.opensearch.client.util.ObjectBuilderBase
-
- org.opensearch.client.opensearch.cluster.reroute.Command.Builder
-
- All Implemented Interfaces:
ObjectBuilder<Command>
- Enclosing class:
- Command
public static class Command.Builder extends ObjectBuilderBase implements ObjectBuilder<Command>
Builder forCommand.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Command.BuilderallocateEmptyPrimary(java.util.function.Function<CommandAllocatePrimaryAction.Builder,ObjectBuilder<CommandAllocatePrimaryAction>> fn)Allocate an empty primary shard to a node.Command.BuilderallocateEmptyPrimary(CommandAllocatePrimaryAction value)Allocate an empty primary shard to a node.Command.BuilderallocateReplica(java.util.function.Function<CommandAllocateReplicaAction.Builder,ObjectBuilder<CommandAllocateReplicaAction>> fn)Allocate an unassigned replica shard to a node.Command.BuilderallocateReplica(CommandAllocateReplicaAction value)Allocate an unassigned replica shard to a node.Command.BuilderallocateStalePrimary(java.util.function.Function<CommandAllocatePrimaryAction.Builder,ObjectBuilder<CommandAllocatePrimaryAction>> fn)Allocate a primary shard to a node that holds a stale copy.Command.BuilderallocateStalePrimary(CommandAllocatePrimaryAction value)Allocate a primary shard to a node that holds a stale copy.Commandbuild()Builds aCommand.Command.Buildercancel(java.util.function.Function<CommandCancelAction.Builder,ObjectBuilder<CommandCancelAction>> fn)Cancel allocation of a shard (or recovery).Command.Buildercancel(CommandCancelAction value)Cancel allocation of a shard (or recovery).Command.Buildermove(java.util.function.Function<CommandMoveAction.Builder,ObjectBuilder<CommandMoveAction>> fn)Move a started shard from one node to another node.Command.Buildermove(CommandMoveAction value)Move a started shard from one node to another node.-
Methods inherited from class org.opensearch.client.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
-
-
-
Method Detail
-
cancel
public final Command.Builder cancel(@Nullable CommandCancelAction value)
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
-
cancel
public final Command.Builder cancel(java.util.function.Function<CommandCancelAction.Builder,ObjectBuilder<CommandCancelAction>> fn)
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
public final Command.Builder move(@Nullable CommandMoveAction value)
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
-
move
public final Command.Builder move(java.util.function.Function<CommandMoveAction.Builder,ObjectBuilder<CommandMoveAction>> fn)
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
public final Command.Builder allocateReplica(@Nullable CommandAllocateReplicaAction value)
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
-
allocateReplica
public final Command.Builder allocateReplica(java.util.function.Function<CommandAllocateReplicaAction.Builder,ObjectBuilder<CommandAllocateReplicaAction>> fn)
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
public final Command.Builder allocateStalePrimary(@Nullable CommandAllocatePrimaryAction value)
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
-
allocateStalePrimary
public final Command.Builder allocateStalePrimary(java.util.function.Function<CommandAllocatePrimaryAction.Builder,ObjectBuilder<CommandAllocatePrimaryAction>> fn)
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
public final Command.Builder allocateEmptyPrimary(@Nullable CommandAllocatePrimaryAction value)
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
-
allocateEmptyPrimary
public final Command.Builder allocateEmptyPrimary(java.util.function.Function<CommandAllocatePrimaryAction.Builder,ObjectBuilder<CommandAllocatePrimaryAction>> fn)
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
-
build
public Command build()
Builds aCommand.- Specified by:
buildin interfaceObjectBuilder<Command>- Throws:
java.lang.NullPointerException- if some of the required fields are null.
-
-