Class AllocateStalePrimaryAllocationCommand
- java.lang.Object
-
- org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
-
- org.elasticsearch.cluster.routing.allocation.command.BasePrimaryAllocationCommand
-
- org.elasticsearch.cluster.routing.allocation.command.AllocateStalePrimaryAllocationCommand
-
- All Implemented Interfaces:
AllocationCommand
,NamedWriteable
,Writeable
,ToXContent
,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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AllocateStalePrimaryAllocationCommand.Builder
-
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand
AllocationCommand.Parser<T extends AllocationCommand>
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, 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 ParseField
COMMAND_NAME_FIELD
static java.lang.String
NAME
-
Fields inherited from class org.elasticsearch.cluster.routing.allocation.command.BasePrimaryAllocationCommand
acceptDataLoss
-
Fields inherited from class org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
index, node, shardId
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description AllocateStalePrimaryAllocationCommand(java.lang.String index, int shardId, java.lang.String node, boolean acceptDataLoss)
Creates a newAllocateStalePrimaryAllocationCommand
AllocateStalePrimaryAllocationCommand(StreamInput in)
Read from a stream.
-
Method Summary
Modifier and Type Method Description RerouteExplanation
execute(RoutingAllocation allocation, boolean explain)
Executes the command on aRoutingAllocation
setupstatic AllocateStalePrimaryAllocationCommand
fromXContent(XContentParser parser)
java.util.Optional<java.lang.String>
getMessage()
Returns any feedback the command wants to provide for logging.java.lang.String
name()
Get the name of the command-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.command.BasePrimaryAllocationCommand
acceptDataLoss, createAllocatePrimaryParser, equals, extraXContent, hashCode, writeTo
-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
createAllocateParser, explainOrThrowMissingRoutingNode, explainOrThrowRejectedCommand, explainOrThrowRejectedCommand, index, initializeUnassignedShard, initializeUnassignedShard, node, shardId, toXContent
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand
getWriteableName
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
COMMAND_NAME_FIELD
public static final ParseField COMMAND_NAME_FIELD
-
-
Constructor Detail
-
AllocateStalePrimaryAllocationCommand
public AllocateStalePrimaryAllocationCommand(java.lang.String index, int shardId, java.lang.String node, boolean acceptDataLoss)
Creates a newAllocateStalePrimaryAllocationCommand
- Parameters:
index
- index of the shard to assignshardId
- id of the shard to assignnode
- node id of the node to assign the shard toacceptDataLoss
- whether the user agrees to data loss
-
AllocateStalePrimaryAllocationCommand
public AllocateStalePrimaryAllocationCommand(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
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 AllocateStalePrimaryAllocationCommand fromXContent(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 aRoutingAllocation
setup- Parameters:
allocation
-RoutingAllocation
to modify
-
-