public abstract class AbstractAllocateAllocationCommand extends java.lang.Object implements AllocationCommand
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractAllocateAllocationCommand.Builder<T extends AbstractAllocateAllocationCommand>
Works around ObjectParser not supporting constructor arguments.
|
AllocationCommand.Parser<T extends AllocationCommand>
Writeable.Reader<R>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
index |
protected java.lang.String |
node |
protected int |
shardId |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
AbstractAllocateAllocationCommand(StreamInput in)
Read from a stream.
|
protected |
AbstractAllocateAllocationCommand(java.lang.String index,
int shardId,
java.lang.String node) |
Modifier and Type | Method and Description |
---|---|
protected static <T extends AbstractAllocateAllocationCommand.Builder<?>> |
createAllocateParser(java.lang.String command) |
protected RerouteExplanation |
explainOrThrowMissingRoutingNode(RoutingAllocation allocation,
boolean explain,
DiscoveryNode discoNode)
Handle case where a disco node cannot be found in the routing table.
|
protected RerouteExplanation |
explainOrThrowRejectedCommand(boolean explain,
RoutingAllocation allocation,
java.lang.RuntimeException rte)
Utility method for rejecting the current allocation command based on provided exception
|
protected RerouteExplanation |
explainOrThrowRejectedCommand(boolean explain,
RoutingAllocation allocation,
java.lang.String reason)
Utility method for rejecting the current allocation command based on provided reason
|
protected void |
extraXContent(XContentBuilder builder) |
java.lang.String |
index()
Get the index name
|
protected void |
initializeUnassignedShard(RoutingAllocation allocation,
RoutingNodes routingNodes,
RoutingNode routingNode,
ShardRouting shardRouting)
Initializes an unassigned shard on a node and removes it from the unassigned
|
protected void |
initializeUnassignedShard(RoutingAllocation allocation,
RoutingNodes routingNodes,
RoutingNode routingNode,
ShardRouting shardRouting,
java.util.function.Consumer<ShardRouting> shardRoutingChanges)
Initializes an unassigned shard on a node and removes it from the unassigned
|
java.lang.String |
node()
Get the id of the node
|
int |
shardId()
Get the shard id
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, getWriteableName, name
protected final java.lang.String index
protected final int shardId
protected final java.lang.String node
protected AbstractAllocateAllocationCommand(java.lang.String index, int shardId, java.lang.String node)
protected AbstractAllocateAllocationCommand(StreamInput in) throws java.io.IOException
java.io.IOException
protected static <T extends AbstractAllocateAllocationCommand.Builder<?>> ObjectParser<T,ParseFieldMatcherSupplier> createAllocateParser(java.lang.String command)
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public java.lang.String index()
public int shardId()
public java.lang.String node()
protected RerouteExplanation explainOrThrowMissingRoutingNode(RoutingAllocation allocation, boolean explain, DiscoveryNode discoNode)
protected RerouteExplanation explainOrThrowRejectedCommand(boolean explain, RoutingAllocation allocation, java.lang.String reason)
protected RerouteExplanation explainOrThrowRejectedCommand(boolean explain, RoutingAllocation allocation, java.lang.RuntimeException rte)
protected void initializeUnassignedShard(RoutingAllocation allocation, RoutingNodes routingNodes, RoutingNode routingNode, ShardRouting shardRouting)
allocation
- the allocationroutingNodes
- the routing nodesroutingNode
- the node to initialize it toshardRouting
- the shard routing that is to be matched in unassigned shardsprotected void initializeUnassignedShard(RoutingAllocation allocation, RoutingNodes routingNodes, RoutingNode routingNode, ShardRouting shardRouting, @Nullable java.util.function.Consumer<ShardRouting> shardRoutingChanges)
allocation
- the allocationroutingNodes
- the routing nodesroutingNode
- the node to initialize it toshardRouting
- the shard routing that is to be matched in unassigned shardsshardRoutingChanges
- changes to apply for shard routing in unassigned shards before initializationpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
protected void extraXContent(XContentBuilder builder) throws java.io.IOException
java.io.IOException