Class AllocateEmptyPrimaryAllocationCommand

All Implemented Interfaces:
AllocationCommand, NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject

public class AllocateEmptyPrimaryAllocationCommand
extends BasePrimaryAllocationCommand
Allocates an unassigned empty primary shard to a specific node. Use with extreme care as this will result in data loss. Allocation deciders are ignored.
  • 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

    • AllocateEmptyPrimaryAllocationCommand

      public AllocateEmptyPrimaryAllocationCommand​(java.lang.String index, int shardId, java.lang.String node, boolean acceptDataLoss)
      Parameters:
      shardId - ShardId of the shard to assign
      node - node id of the node to assign the shard to
      acceptDataLoss - whether the user agrees to data loss
    • AllocateEmptyPrimaryAllocationCommand

      public AllocateEmptyPrimaryAllocationCommand​(StreamInput in) throws java.io.IOException
      Read from a stream.
      Throws:
      java.io.IOException
  • Method Details

    • name

      public java.lang.String name()
      Description copied from interface: AllocationCommand
      Get the name of the command
      Returns:
      name of the command
    • getMessage

      public java.util.Optional<java.lang.String> getMessage()
      Description copied from interface: AllocationCommand
      Returns any feedback the command wants to provide for logging. This message should be appropriate to expose to the user after the command has been applied
    • fromXContent

      public static AllocateEmptyPrimaryAllocationCommand fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • execute

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