Class AllocateStalePrimaryAllocationCommand

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

public class AllocateStalePrimaryAllocationCommand extends BasePrimaryAllocationCommand
Allocates an unassigned stale 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  NAME
      See Also:
      Constant Field Values
    • COMMAND_NAME_FIELD

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

    • AllocateStalePrimaryAllocationCommand

      public AllocateStalePrimaryAllocationCommand( index, int shardId,  node, boolean acceptDataLoss)
      Parameters:
      index - index of the shard to assign
      shardId - id of the shard to assign
      node - node id of the node to assign the shard to
      acceptDataLoss - whether the user agrees to data loss
    • AllocateStalePrimaryAllocationCommand

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

    • name

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

      public <> 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 AllocateStalePrimaryAllocationCommand fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws
      Throws:
    • 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