Module org.elasticsearch.server
Class MoveAllocationCommand
java.lang.Object
org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand
- All Implemented Interfaces:
- AllocationCommand,- NamedWriteable,- Writeable,- ToXContent,- ToXContentObject
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 SummaryNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContentToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.WriteableWriteable.Reader<V>, Writeable.Writer<V>
- 
Field SummaryFieldsFields inherited from interface org.elasticsearch.xcontent.ToXContentEMPTY_PARAMS
- 
Constructor SummaryConstructorsConstructorDescriptionMoveAllocationCommand(String index, int shardId, String fromNode, String toNode) Read from a stream.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanexecute(RoutingAllocation allocation, boolean explain) Executes the command on aRoutingAllocationsetupfromNode()static MoveAllocationCommandfromXContent(XContentParser parser) inthashCode()index()name()Get the name of the commandintshardId()toNode()toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommandgetMessage, getWriteableNameMethods inherited from interface org.elasticsearch.xcontent.ToXContentObjectisFragment
- 
Field Details- 
NAME- See Also:
 
- 
COMMAND_NAME_FIELD
 
- 
- 
Constructor Details- 
MoveAllocationCommand
- 
MoveAllocationCommandRead from a stream.- Throws:
- IOException
 
 
- 
- 
Method Details- 
writeToDescription copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
- writeToin interface- Writeable
- Throws:
- IOException
 
- 
nameDescription copied from interface:AllocationCommandGet the name of the command- Specified by:
- namein interface- AllocationCommand
- Returns:
- name of the command
 
- 
index
- 
shardIdpublic int shardId()
- 
fromNode
- 
toNode
- 
executeDescription copied from interface:AllocationCommandExecutes the command on aRoutingAllocationsetup- Specified by:
- executein interface- AllocationCommand
- Parameters:
- allocation-- RoutingAllocationto modify
 
- 
toXContentpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
- toXContentin interface- ToXContent
- Throws:
- IOException
 
- 
fromXContent- Throws:
- IOException
 
- 
equals
- 
hashCodepublic int hashCode()
 
-