Class MoveAllocationCommand
java.lang.Object
org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand
- All Implemented Interfaces:
AllocationCommand,NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentObject
public class MoveAllocationCommand extends java.lang.Object implements AllocationCommand
A command that moves a shard from a specific node to another node.
Note: The shard needs to be in the state
Note: The shard needs to be in the state
ShardRoutingState.STARTED in order to be moved.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested 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 org.elasticsearch.common.ParseFieldCOMMAND_NAME_FIELDstatic java.lang.StringNAME -
Constructor Summary
Constructors Constructor Description MoveAllocationCommand(java.lang.String index, int shardId, java.lang.String fromNode, java.lang.String toNode)MoveAllocationCommand(StreamInput in)Read from a stream. -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object obj)RerouteExplanationexecute(RoutingAllocation allocation, boolean explain)Executes the command on aRoutingAllocationsetupjava.lang.StringfromNode()static MoveAllocationCommandfromXContent(org.elasticsearch.common.xcontent.XContentParser parser)inthashCode()java.lang.Stringindex()java.lang.Stringname()Get the name of the commandintshardId()java.lang.StringtoNode()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand
getMessage, getWriteableName
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
COMMAND_NAME_FIELD
public static final org.elasticsearch.common.ParseField COMMAND_NAME_FIELD
-
-
Constructor Details
-
MoveAllocationCommand
public MoveAllocationCommand(java.lang.String index, int shardId, java.lang.String fromNode, java.lang.String toNode) -
MoveAllocationCommand
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput. -
name
public java.lang.String name()Description copied from interface:AllocationCommandGet the name of the command- Specified by:
namein interfaceAllocationCommand- Returns:
- name of the command
-
index
public java.lang.String index() -
shardId
public int shardId() -
fromNode
public java.lang.String fromNode() -
toNode
public java.lang.String toNode() -
execute
Description copied from interface:AllocationCommandExecutes the command on aRoutingAllocationsetup- Specified by:
executein interfaceAllocationCommand- Parameters:
allocation-RoutingAllocationto modify
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-
fromXContent
public static MoveAllocationCommand fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-