Class BasePrimaryAllocationCommand
- java.lang.Object
-
- org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
-
- org.elasticsearch.cluster.routing.allocation.command.BasePrimaryAllocationCommand
-
- All Implemented Interfaces:
AllocationCommand
,NamedWriteable
,Writeable
,ToXContent
,ToXContentObject
- Direct Known Subclasses:
AllocateEmptyPrimaryAllocationCommand
,AllocateStalePrimaryAllocationCommand
public abstract class BasePrimaryAllocationCommand extends AbstractAllocateAllocationCommand
Abstract base class for allocating an unassigned primary shard to a node
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
BasePrimaryAllocationCommand.Builder<T extends BasePrimaryAllocationCommand>
-
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 protected boolean
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 Modifier Constructor Description protected
BasePrimaryAllocationCommand(java.lang.String index, int shardId, java.lang.String node, boolean acceptDataLoss)
protected
BasePrimaryAllocationCommand(StreamInput in)
Read from a stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptDataLoss()
The operation only executes if the user explicitly agrees to possible data lossprotected static <T extends BasePrimaryAllocationCommand.Builder<?>>
ObjectParser<T,java.lang.Void>createAllocatePrimaryParser(java.lang.String command)
boolean
equals(java.lang.Object obj)
protected void
extraXContent(XContentBuilder builder)
int
hashCode()
void
writeTo(StreamOutput out)
Write this into the StreamOutput.-
Methods inherited from class org.elasticsearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
createAllocateParser, explainOrThrowMissingRoutingNode, explainOrThrowRejectedCommand, explainOrThrowRejectedCommand, index, initializeUnassignedShard, initializeUnassignedShard, node, shardId, toXContent
-
Methods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand
execute, getMessage, getWriteableName, name
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Constructor Detail
-
BasePrimaryAllocationCommand
protected BasePrimaryAllocationCommand(java.lang.String index, int shardId, java.lang.String node, boolean acceptDataLoss)
-
BasePrimaryAllocationCommand
protected BasePrimaryAllocationCommand(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
createAllocatePrimaryParser
protected static <T extends BasePrimaryAllocationCommand.Builder<?>> ObjectParser<T,java.lang.Void> createAllocatePrimaryParser(java.lang.String command)
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classAbstractAllocateAllocationCommand
- Throws:
java.io.IOException
-
acceptDataLoss
public boolean acceptDataLoss()
The operation only executes if the user explicitly agrees to possible data loss- Returns:
- whether data loss is acceptable
-
extraXContent
protected void extraXContent(XContentBuilder builder) throws java.io.IOException
- Overrides:
extraXContent
in classAbstractAllocateAllocationCommand
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classAbstractAllocateAllocationCommand
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractAllocateAllocationCommand
-
-