Class MoveAllocationCommand
java.lang.Object
org.opensearch.cluster.routing.allocation.command.MoveAllocationCommand
- All Implemented Interfaces:
AllocationCommand
,NamedWriteable
,Writeable
,org.opensearch.common.xcontent.ToXContent
,org.opensearch.common.xcontent.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.- Opensearch.internal:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.common.xcontent.ToXContent
org.opensearch.common.xcontent.ToXContent.DelegatingMapParams, org.opensearch.common.xcontent.ToXContent.MapParams, org.opensearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.opensearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.opensearch.common.ParseField
static final String
Fields inherited from interface org.opensearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescriptionMoveAllocationCommand
(String index, int shardId, String fromNode, String toNode) Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionboolean
execute
(RoutingAllocation allocation, boolean explain) Executes the command on aRoutingAllocation
setupfromNode()
static MoveAllocationCommand
fromXContent
(org.opensearch.common.xcontent.XContentParser parser) int
hashCode()
index()
name()
Get the name of the commandint
shardId()
toNode()
org.opensearch.common.xcontent.XContentBuilder
toXContent
(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params) void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensearch.cluster.routing.allocation.command.AllocationCommand
getMessage, getWriteableName
Methods inherited from interface org.opensearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
-
COMMAND_NAME_FIELD
public static final org.opensearch.common.ParseField COMMAND_NAME_FIELD
-
-
Constructor Details
-
MoveAllocationCommand
-
MoveAllocationCommand
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
name
Description copied from interface:AllocationCommand
Get the name of the command- Specified by:
name
in interfaceAllocationCommand
- Returns:
- name of the command
-
index
-
shardId
public int shardId() -
fromNode
-
toNode
-
execute
Description copied from interface:AllocationCommand
Executes the command on aRoutingAllocation
setup- Specified by:
execute
in interfaceAllocationCommand
- Parameters:
allocation
-RoutingAllocation
to modify
-
toXContent
public org.opensearch.common.xcontent.XContentBuilder toXContent(org.opensearch.common.xcontent.XContentBuilder builder, org.opensearch.common.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceorg.opensearch.common.xcontent.ToXContent
- Throws:
IOException
-
fromXContent
public static MoveAllocationCommand fromXContent(org.opensearch.common.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-