public abstract class ReplicaShardAllocator extends BaseGatewayShardAllocator
Method SummaryModifier and TypeMethodDescriptionDetermines if the shard can be allocated on at least one node based on the allocation deciders.
protected abstract AsyncShardFetch.FetchResult<TransportNodesListShardStoreMetadata.NodeStoreFilesMetadata>
protected abstract boolean
ShardRouting shard)(Returns a boolean indicating whether fetching shard data has been triggered at any point for the given shard.
ShardRouting unassignedShard, RoutingAllocation allocation, org.apache.logging.log4j.Logger logger)(Make a decision on the allocation of an unassigned shard.
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, getExpectedShardSize
processExistingRecoveriespublic 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 can perform a no-op recovery while the previous recovery has to copy segment files.
makeAllocationDecisionpublic AllocateUnassignedDecision makeAllocationDecision(ShardRouting unassignedShard, RoutingAllocation allocation, org.apache.logging.log4j.Logger logger)Description copied from class:
BaseGatewayShardAllocatorMake a decision on the allocation of an unassigned shard. This method is used by
BaseGatewayShardAllocator.allocateUnassigned(ShardRouting, RoutingAllocation, ExistingShardsAllocator.UnassignedAllocationHandler)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:
unassignedShard- the unassigned shard to allocate
allocation- the current routing state
logger- the logger
AllocateUnassignedDecisionwith the final decision of whether to allocate and details of the decision
canBeAllocatedToAtLeastOneNodepublic static org.elasticsearch.core.Tuple<Decision,Map<String,NodeAllocationResult>> canBeAllocatedToAtLeastOneNode(ShardRouting shard, RoutingAllocation allocation)Determines if the shard can be allocated on at least one node based on the allocation deciders. Returns the best allocation decision for allocating the shard on any node (i.e. YES if at least one node decided YES, THROTTLE if at least one node decided THROTTLE, and NO if none of the nodes decided YES or THROTTLE). If in explain mode, also returns the node-level explanations as the second element in the returned tuple.
fetchDataprotected abstract AsyncShardFetch.FetchResult<TransportNodesListShardStoreMetadata.NodeStoreFilesMetadata> fetchData(ShardRouting shard, RoutingAllocation allocation)
hasInitiatedFetchingprotected abstract boolean hasInitiatedFetching(ShardRouting shard)Returns a boolean indicating whether fetching shard data has been triggered at any point for the given shard.