Package org.elasticsearch.gateway
Class ReplicaShardAllocator
java.lang.Object
org.elasticsearch.gateway.BaseGatewayShardAllocator
org.elasticsearch.gateway.ReplicaShardAllocator
public abstract class ReplicaShardAllocator extends BaseGatewayShardAllocator
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ReplicaShardAllocator()
-
Method Summary
Modifier and Type Method Description protected abstract AsyncShardFetch.FetchResult<TransportNodesListShardStoreMetaData.NodeStoreFilesMetaData>
fetchData(ShardRouting shard, RoutingAllocation allocation)
protected abstract boolean
hasInitiatedFetching(ShardRouting shard)
Returns a boolean indicating whether fetching shard data has been triggered at any point for the given shard.AllocateUnassignedDecision
makeAllocationDecision(ShardRouting unassignedShard, RoutingAllocation allocation, org.apache.logging.log4j.Logger logger)
Make a decision on the allocation of an unassigned shard.void
processExistingRecoveries(RoutingAllocation allocation)
Process existing recoveries of replicas and see if we need to cancel them if we find a better match.Methods inherited from class org.elasticsearch.gateway.BaseGatewayShardAllocator
allocateUnassigned, buildDecisionsForAllNodes
-
Constructor Details
-
ReplicaShardAllocator
public ReplicaShardAllocator()
-
-
Method Details
-
processExistingRecoveries
Process existing recoveries of replicas and see if we need to cancel them if we find a better match. Today, a better match is one that can perform a no-op recovery while the previous recovery has to copy segment files. -
makeAllocationDecision
public AllocateUnassignedDecision makeAllocationDecision(ShardRouting unassignedShard, RoutingAllocation allocation, org.apache.logging.log4j.Logger logger)Description copied from class:BaseGatewayShardAllocator
Make a decision on the allocation of an unassigned shard. This method is used byBaseGatewayShardAllocator.allocateUnassigned(RoutingAllocation)
to make decisions about whether or not the shard can be allocated by this allocator and if so, to which node it will be allocated.- Specified by:
makeAllocationDecision
in classBaseGatewayShardAllocator
- Parameters:
unassignedShard
- the unassigned shard to allocateallocation
- the current routing statelogger
- the logger- Returns:
- an
AllocateUnassignedDecision
with the final decision of whether to allocate and details of the decision
-
fetchData
protected abstract AsyncShardFetch.FetchResult<TransportNodesListShardStoreMetaData.NodeStoreFilesMetaData> fetchData(ShardRouting shard, RoutingAllocation allocation) -
hasInitiatedFetching
Returns a boolean indicating whether fetching shard data has been triggered at any point for the given shard.
-