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
-
Fields inherited from class org.elasticsearch.gateway.BaseGatewayShardAllocator
logger
-
-
Constructor Summary
Constructors Constructor Description ReplicaShardAllocator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods 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
-
-
-
-
Method Detail
-
processExistingRecoveries
public void processExistingRecoveries(RoutingAllocation allocation)
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 has full sync id match compared to not having one in the previous recovery.
-
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
protected abstract boolean hasInitiatedFetching(ShardRouting shard)
Returns a boolean indicating whether fetching shard data has been triggered at any point for the given shard.
-
-