Class BasePrimaryAllocationCommand
java.lang.Object
org.opensearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
org.opensearch.cluster.routing.allocation.command.BasePrimaryAllocationCommand
- All Implemented Interfaces:
AllocationCommand
,org.opensearch.core.common.io.stream.NamedWriteable
,org.opensearch.core.common.io.stream.Writeable
,org.opensearch.core.xcontent.ToXContent
,org.opensearch.core.xcontent.ToXContentObject
- Direct Known Subclasses:
AllocateEmptyPrimaryAllocationCommand
,AllocateStalePrimaryAllocationCommand
Abstract base class for allocating an unassigned primary shard to a node
- Opensearch.internal:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Base builder class for the primary allocation command.Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.opensearch.cluster.routing.allocation.command.AbstractAllocateAllocationCommand
index, node, shardId
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionprotected
BasePrimaryAllocationCommand
(String index, int shardId, String node, boolean acceptDataLoss) protected
BasePrimaryAllocationCommand
(org.opensearch.core.common.io.stream.StreamInput in) 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.opensearch.core.xcontent.ObjectParser<T, Void> createAllocatePrimaryParser
(String command) boolean
protected void
extraXContent
(org.opensearch.core.xcontent.XContentBuilder builder) int
hashCode()
void
writeTo
(org.opensearch.core.common.io.stream.StreamOutput out) Methods inherited from class org.opensearch.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.opensearch.cluster.routing.allocation.command.AllocationCommand
execute, getMessage, getWriteableName, name
Methods inherited from interface org.opensearch.core.xcontent.ToXContentObject
isFragment
-
Field Details
-
acceptDataLoss
protected final boolean acceptDataLoss
-
-
Constructor Details
-
BasePrimaryAllocationCommand
-
BasePrimaryAllocationCommand
protected BasePrimaryAllocationCommand(org.opensearch.core.common.io.stream.StreamInput in) throws IOException Read from a stream.- Throws:
IOException
-
-
Method Details
-
createAllocatePrimaryParser
protected static <T extends BasePrimaryAllocationCommand.Builder<?>> org.opensearch.core.xcontent.ObjectParser<T,Void> createAllocatePrimaryParser(String command) -
writeTo
- Specified by:
writeTo
in interfaceorg.opensearch.core.common.io.stream.Writeable
- 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.opensearch.core.xcontent.XContentBuilder builder) throws IOException - Overrides:
extraXContent
in classAbstractAllocateAllocationCommand
- Throws:
IOException
-
equals
- Overrides:
equals
in classAbstractAllocateAllocationCommand
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractAllocateAllocationCommand
-