org.elasticsearch.cluster.routing.allocation
Class NodeAllocation

java.lang.Object
  extended by org.elasticsearch.common.component.AbstractComponent
      extended by org.elasticsearch.cluster.routing.allocation.NodeAllocation
Direct Known Subclasses:
BlobReuseExistingNodeAllocation, LocalGatewayNodeAllocation, NodeAllocations, RebalanceOnlyWhenActiveNodeAllocation, ReplicaAfterPrimaryActiveNodeAllocation, SameShardNodeAllocation, ThrottlingNodeAllocation

public abstract class NodeAllocation
extends AbstractComponent

A pluggable logic allowing to control if allocation of a shard is allowed on a specific node.


Nested Class Summary
static class NodeAllocation.Decision
           
 
Field Summary
 
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
componentSettings, logger, settings
 
Constructor Summary
protected NodeAllocation(Settings settings)
           
 
Method Summary
 boolean allocateUnassigned(NodeAllocations nodeAllocations, RoutingAllocation allocation)
           
 void applyFailedShards(NodeAllocations nodeAllocations, FailedRerouteAllocation allocation)
           
 void applyStartedShards(NodeAllocations nodeAllocations, StartedRerouteAllocation allocation)
           
 NodeAllocation.Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation)
           
 boolean canRebalance(ShardRouting shardRouting, RoutingAllocation allocation)
           
 
Methods inherited from class org.elasticsearch.common.component.AbstractComponent
nodeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeAllocation

protected NodeAllocation(Settings settings)
Method Detail

applyStartedShards

public void applyStartedShards(NodeAllocations nodeAllocations,
                               StartedRerouteAllocation allocation)

applyFailedShards

public void applyFailedShards(NodeAllocations nodeAllocations,
                              FailedRerouteAllocation allocation)

allocateUnassigned

public boolean allocateUnassigned(NodeAllocations nodeAllocations,
                                  RoutingAllocation allocation)

canRebalance

public boolean canRebalance(ShardRouting shardRouting,
                            RoutingAllocation allocation)

canAllocate

public NodeAllocation.Decision canAllocate(ShardRouting shardRouting,
                                           RoutingNode node,
                                           RoutingAllocation allocation)