Class Command.Builder
java.lang.Object
org.opensearch.client.util.ObjectBuilderBase
org.opensearch.client.opensearch.cluster.reroute.Command.Builder
- All Implemented Interfaces:
CopyableBuilder<Command.Builder,,Command> MutableBuilder<Command.Builder,,Command> ObjectBuilder<Command>
- Enclosing class:
Command
public static class Command.Builder
extends ObjectBuilderBase
implements CopyableBuilder<Command.Builder,Command>
Builder for
Command.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Command.BuilderallocateEmptyPrimary(Function<CommandAllocatePrimaryAction.Builder, ObjectBuilder<CommandAllocatePrimaryAction>> fn) Allocate an empty primary shard to a node.final Command.BuilderAllocate an empty primary shard to a node.final Command.BuilderallocateReplica(Function<CommandAllocateReplicaAction.Builder, ObjectBuilder<CommandAllocateReplicaAction>> fn) Allocate an unassigned replica shard to a node.final Command.BuilderAllocate an unassigned replica shard to a node.final Command.BuilderallocateStalePrimary(Function<CommandAllocatePrimaryAction.Builder, ObjectBuilder<CommandAllocatePrimaryAction>> fn) Allocate a primary shard to a node that holds a stale copy.final Command.BuilderAllocate a primary shard to a node that holds a stale copy.build()Builds aCommand.final Command.BuilderCancel allocation of a shard (or recovery).final Command.Buildercancel(CommandCancelAction value) Cancel allocation of a shard (or recovery).copy()Create a new builderCopyableBuilderthat is a copy of this one.final Command.BuilderMove a started shard from one node to another node.final 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, _listCopy, _mapCopy, _mapPut, _mapPutAllMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.client.util.MutableBuilder
applyMutation
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
copy
Description copied from interface:CopyableBuilderCreate a new builderCopyableBuilderthat is a copy of this one.- Specified by:
copyin interfaceCopyableBuilder<Command.Builder,Command> - Returns:
- a new builder instance.
-
allocateEmptyPrimary
@Nonnull public final Command.Builder allocateEmptyPrimary(@Nullable CommandAllocatePrimaryAction value) Allocate an empty primary shard to a node. Acceptsindexandshardfor index name and shard number, andnodeto 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 flagaccept_data_lossto be explicitly set to true.API name:
allocate_empty_primary -
allocateEmptyPrimary
@Nonnull public final Command.Builder allocateEmptyPrimary(Function<CommandAllocatePrimaryAction.Builder, ObjectBuilder<CommandAllocatePrimaryAction>> fn) Allocate an empty primary shard to a node. Acceptsindexandshardfor index name and shard number, andnodeto 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 flagaccept_data_lossto be explicitly set to true.API name:
allocate_empty_primary -
allocateReplica
Allocate an unassigned replica shard to a node. Acceptsindexandshardfor index name and shard number, andnodeto allocate the shard to. Takes allocation deciders into account.API name:
allocate_replica -
allocateReplica
@Nonnull public final Command.Builder allocateReplica(Function<CommandAllocateReplicaAction.Builder, ObjectBuilder<CommandAllocateReplicaAction>> fn) Allocate an unassigned replica shard to a node. Acceptsindexandshardfor index name and shard number, andnodeto allocate the shard to. Takes allocation deciders into account.API name:
allocate_replica -
allocateStalePrimary
@Nonnull public final Command.Builder allocateStalePrimary(@Nullable CommandAllocatePrimaryAction value) Allocate a primary shard to a node that holds a stale copy. Acceptsindexandshardfor index name and shard number, andnodeto 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 flagaccept_data_lossto be explicitly set to true.API name:
allocate_stale_primary -
allocateStalePrimary
@Nonnull public final Command.Builder allocateStalePrimary(Function<CommandAllocatePrimaryAction.Builder, ObjectBuilder<CommandAllocatePrimaryAction>> fn) Allocate a primary shard to a node that holds a stale copy. Acceptsindexandshardfor index name and shard number, andnodeto 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 flagaccept_data_lossto be explicitly set to true.API name:
allocate_stale_primary -
cancel
Cancel allocation of a shard (or recovery). Acceptsindexandshardfor index name and shard number, andnodefor 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 theallow_primaryflag must also be included in the request.API name:
cancel -
cancel
@Nonnull public final Command.Builder cancel(Function<CommandCancelAction.Builder, ObjectBuilder<CommandCancelAction>> fn) Cancel allocation of a shard (or recovery). Acceptsindexandshardfor index name and shard number, andnodefor 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 theallow_primaryflag must also be included in the request.API name:
cancel -
move
Move a started shard from one node to another node. Acceptsindexandshardfor index name and shard number,from_nodefor the node to move the shard from, andto_nodefor the node to move the shard to.API name:
move -
move
@Nonnull public final Command.Builder move(Function<CommandMoveAction.Builder, ObjectBuilder<CommandMoveAction>> fn) Move a started shard from one node to another node. Acceptsindexandshardfor index name and shard number,from_nodefor the node to move the shard from, andto_nodefor the node to move the shard to.API name:
move -
build
Builds aCommand.- Specified by:
buildin interfaceObjectBuilder<Command>- Throws:
NullPointerException- if some of the required fields are null.
-