Class AllocateReplicaAllocationCommand
- java.lang.Object
-
- org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
-
- org.elasticsearch.cluster.routing.allocation.command.AllocateReplicaAllocationCommand
-
- All Implemented Interfaces:
AllocationCommand,NamedWriteable,Writeable,ToXContent,ToXContentObject
public class AllocateReplicaAllocationCommand extends AbstractAllocateAllocationCommand
Allocates an unassigned replica shard to a specific node. Checks if allocation deciders allow allocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAllocateReplicaAllocationCommand.Builder-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static ParseFieldCOMMAND_NAME_FIELDstatic StringNAME-
Fields inherited from class org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
index, node, shardId
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description AllocateReplicaAllocationCommand(String index, int shardId, String node)Creates a newAllocateReplicaAllocationCommandAllocateReplicaAllocationCommand(StreamInput in)Read from a stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RerouteExplanationexecute(RoutingAllocation allocation, boolean explain)Executes the command on aRoutingAllocationsetupstatic AllocateReplicaAllocationCommandfromXContent(XContentParser parser)Stringname()Get the name of the command-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
createAllocateParser, equals, explainOrThrowMissingRoutingNode, explainOrThrowRejectedCommand, explainOrThrowRejectedCommand, extraXContent, hashCode, index, initializeUnassignedShard, initializeUnassignedShard, node, shardId, toXContent, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand
getMessage, getWriteableName
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
COMMAND_NAME_FIELD
public static final ParseField COMMAND_NAME_FIELD
-
-
Constructor Detail
-
AllocateReplicaAllocationCommand
public AllocateReplicaAllocationCommand(String index, int shardId, String node)
Creates a newAllocateReplicaAllocationCommand- Parameters:
index- index of the shard to assignshardId- id of the shard to assignnode- node id of the node to assign the shard to
-
AllocateReplicaAllocationCommand
public AllocateReplicaAllocationCommand(StreamInput in) throws IOException
Read from a stream.- Throws:
IOException
-
-
Method Detail
-
name
public String name()
Description copied from interface:AllocationCommandGet the name of the command- Returns:
- name of the command
-
fromXContent
public static AllocateReplicaAllocationCommand fromXContent(XContentParser parser) throws IOException
- Throws:
IOException
-
execute
public RerouteExplanation execute(RoutingAllocation allocation, boolean explain)
Description copied from interface:AllocationCommandExecutes the command on aRoutingAllocationsetup- Parameters:
allocation-RoutingAllocationto modify
-
-