public class RoutingAllocation extends Object
RoutingAllocation
keep the state of the current allocation
of shards and holds the AllocationDeciders
which are responsible
for the current routing state.Modifier and Type | Class and Description |
---|---|
static class |
RoutingAllocation.Result
this class is used to describe results of a
RoutingAllocation |
Constructor and Description |
---|
RoutingAllocation(AllocationDeciders deciders,
RoutingNodes routingNodes,
DiscoveryNodes nodes,
ClusterInfo clusterInfo,
long currentNanoTime)
Creates a new
RoutingAllocation |
Modifier and Type | Method and Description |
---|---|
void |
addIgnoreShardForNode(ShardId shardId,
String nodeId) |
ClusterInfo |
clusterInfo() |
boolean |
debugDecision() |
void |
debugDecision(boolean debug) |
AllocationDeciders |
deciders()
Get
AllocationDeciders used for allocation |
Decision |
decision(Decision decision,
String deciderLabel,
String reason,
Object... params)
Create a routing decision, including the reason if the debug flag is
turned on
|
AllocationExplanation |
explanation()
Get explanations of current routing
|
long |
getCurrentNanoTime()
returns the nano time captured at the beginning of the allocation.
|
Set<String> |
getIgnoreNodes(ShardId shardId) |
boolean |
hasPendingAsyncFetch()
Returns
true iff the current allocation run has not processed all of the in-flight or available
shard or store fetches. |
boolean |
ignoreDisable() |
void |
ignoreDisable(boolean ignoreDisable) |
MetaData |
metaData()
Get metadata of routing nodes
|
DiscoveryNodes |
nodes()
Get discovery nodes in current routing
|
RoutingNodes |
routingNodes()
Get current routing nodes
|
RoutingTable |
routingTable()
Get routing table of current nodes
|
void |
setHasPendingAsyncFetch()
Sets a flag that signals that current allocation run has not processed all of the in-flight or available shard or store fetches.
|
boolean |
shouldIgnoreShardForNode(ShardId shardId,
String nodeId) |
public RoutingAllocation(AllocationDeciders deciders, RoutingNodes routingNodes, DiscoveryNodes nodes, ClusterInfo clusterInfo, long currentNanoTime)
RoutingAllocation
deciders
- AllocationDeciders
to used to make decisions for routing allocationsroutingNodes
- Routing nodes in the current clusternodes
- TODO: DocumentationcurrentNanoTime
- the nano time to use for all delay allocation calculation (typically System.nanoTime()
)public long getCurrentNanoTime()
public AllocationDeciders deciders()
AllocationDeciders
used for allocationAllocationDeciders
used for allocationpublic RoutingTable routingTable()
public RoutingNodes routingNodes()
public MetaData metaData()
public DiscoveryNodes nodes()
public ClusterInfo clusterInfo()
public AllocationExplanation explanation()
public void ignoreDisable(boolean ignoreDisable)
public boolean ignoreDisable()
public void debugDecision(boolean debug)
public boolean debugDecision()
public Decision decision(Decision decision, String deciderLabel, String reason, Object... params)
decision
- decision whether to allow/deny allocationdeciderLabel
- a human readable label for the AllocationDeciderreason
- a format string explanation of the decisionparams
- format string parameterspublic boolean hasPendingAsyncFetch()
true
iff the current allocation run has not processed all of the in-flight or available
shard or store fetches. Otherwise true
public void setHasPendingAsyncFetch()
Copyright © 2009–2017. All rights reserved.