Class MoveAllocationCommand

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 implements AllocationCommand
A command that moves a shard from a specific node to another node.
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.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 org.elasticsearch.common.xcontent.ParseField
     
    static
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
     index, int shardId,  fromNode,  toNode)
     
    Read from a stream.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     obj)
     
    execute​(RoutingAllocation allocation, boolean explain)
    Executes the command on a RoutingAllocation setup
     
    fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)
     
    int
     
     
    Get the name of the command
    int
     
     
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    void
    Write this into the StreamOutput.

    Methods inherited from class java.lang.

    , , , , , , , ,

    Methods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand

    getMessage, getWriteableName

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject

    isFragment
  • Field Details

    • NAME

      public static final  NAME
      See Also:
      Constant Field Values
    • COMMAND_NAME_FIELD

      public static final org.elasticsearch.common.xcontent.ParseField COMMAND_NAME_FIELD
  • Constructor Details

    • MoveAllocationCommand

      public MoveAllocationCommand( index, int shardId,  fromNode,  toNode)
    • MoveAllocationCommand

      public MoveAllocationCommand(StreamInput in) throws
      Read from a stream.
      Throws:
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
    • name

      public  name()
      Description copied from interface: AllocationCommand
      Get the name of the command
      Specified by:
      name in interface AllocationCommand
      Returns:
      name of the command
    • index

      public  index()
    • shardId

      public int shardId()
    • fromNode

      public  fromNode()
    • toNode

      public  toNode()
    • execute

      public RerouteExplanation execute(RoutingAllocation allocation, boolean explain)
      Description copied from interface: AllocationCommand
      Executes the command on a RoutingAllocation setup
      Specified by:
      execute in interface AllocationCommand
      Parameters:
      allocation - RoutingAllocation to modify
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
    • fromXContent

      public static MoveAllocationCommand fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws
      Throws:
    • equals

      public boolean equals( obj)
      Overrides:
       in class 
    • hashCode

      public int hashCode()
      Overrides:
       in class