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
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
- Direct Known Subclasses:
AllocateEmptyPrimaryAllocationCommand
,AllocateStalePrimaryAllocationCommand
Abstract base class for allocating an unassigned primary shard to a node
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
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 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
ModifierConstructorDescriptionprotected
BasePrimaryAllocationCommand(String index, int shardId, String node, boolean acceptDataLoss)
protected
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionboolean
The operation only executes if the user explicitly agrees to possible data lossprotected static <T extends BasePrimaryAllocationCommand.Builder<?>>
org.elasticsearch.common.xcontent.ObjectParser<T,Void>createAllocatePrimaryParser(String command)
boolean
protected void
extraXContent(org.elasticsearch.common.xcontent.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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.cluster.routing.allocation.command.AllocationCommand
execute, getMessage, getWriteableName, name
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
acceptDataLoss
protected final boolean acceptDataLoss
-
-
Constructor Details
-
BasePrimaryAllocationCommand
-
BasePrimaryAllocationCommand
Read from a stream.- Throws:
IOException
-
-
Method Details
-
createAllocatePrimaryParser
protected static <T extends BasePrimaryAllocationCommand.Builder<?>> org.elasticsearch.common.xcontent.ObjectParser<T,Void> createAllocatePrimaryParser(String command) -
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classAbstractAllocateAllocationCommand
- Throws:
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(org.elasticsearch.common.xcontent.XContentBuilder builder) throws IOException- Overrides:
extraXContent
in classAbstractAllocateAllocationCommand
- Throws:
IOException
-
equals
- Overrides:
equals
in classAbstractAllocateAllocationCommand
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractAllocateAllocationCommand
-