Package org.elasticsearch.gateway
Class GatewayAllocator
java.lang.Object
org.elasticsearch.gateway.GatewayAllocator
- All Implemented Interfaces:
ExistingShardsAllocator
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator
ExistingShardsAllocator.UnassignedAllocationHandler -
Field Summary
FieldsFields inherited from interface org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator
EXISTING_SHARDS_ALLOCATOR_SETTING -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGatewayAllocator(RerouteService rerouteService, TransportNodesListGatewayStartedShards startedAction, TransportNodesListShardStoreMetadata storeAction) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterPrimariesBeforeReplicas(RoutingAllocation allocation)Called during a round of allocation after attempting to allocate all the primaries but before any replicas, allowing the allocator to prepare for replica allocation.voidallocateUnassigned(ShardRouting shardRouting, RoutingAllocation allocation, ExistingShardsAllocator.UnassignedAllocationHandler unassignedAllocationHandler)Allocate any unassigned shards in the givenRoutingAllocationfor which thisExistingShardsAllocatoris responsible.voidapplyFailedShards(List<FailedShard> failedShards, RoutingAllocation allocation)Called when the given shards have failed, so that implementations can invalidate caches and clean up any in-flight activity for those shards.voidapplyStartedShards(List<ShardRouting> startedShards, RoutingAllocation allocation)Called when the given shards have started, so that implementations can invalidate caches and clean up any in-flight activity for those shards.voidbeforeAllocation(RoutingAllocation allocation)Called before starting a round of allocation, allowing the allocator to invalidate some caches if appropriate.voidCalled when this node becomes the elected master and when it stops being the elected master, so that implementations can clean up any in-flight activity from an earlier mastership.explainUnassignedShardAllocation(ShardRouting unassignedShard, RoutingAllocation routingAllocation)Returns an explanation for a single unassigned shard.intprotected static voidinnerAllocatedUnassigned(RoutingAllocation allocation, PrimaryShardAllocator primaryShardAllocator, ReplicaShardAllocator replicaShardAllocator, ShardRouting shardRouting, ExistingShardsAllocator.UnassignedAllocationHandler unassignedAllocationHandler)
-
Field Details
-
ALLOCATOR_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
GatewayAllocator
@Inject public GatewayAllocator(RerouteService rerouteService, TransportNodesListGatewayStartedShards startedAction, TransportNodesListShardStoreMetadata storeAction) -
GatewayAllocator
protected GatewayAllocator()
-
-
Method Details
-
cleanCaches
public void cleanCaches()Description copied from interface:ExistingShardsAllocatorCalled when this node becomes the elected master and when it stops being the elected master, so that implementations can clean up any in-flight activity from an earlier mastership.- Specified by:
cleanCachesin interfaceExistingShardsAllocator
-
getNumberOfInFlightFetches
public int getNumberOfInFlightFetches()- Specified by:
getNumberOfInFlightFetchesin interfaceExistingShardsAllocator- Returns:
- the number of in-flight fetches under this allocator's control.
-
applyStartedShards
Description copied from interface:ExistingShardsAllocatorCalled when the given shards have started, so that implementations can invalidate caches and clean up any in-flight activity for those shards.- Specified by:
applyStartedShardsin interfaceExistingShardsAllocator
-
applyFailedShards
Description copied from interface:ExistingShardsAllocatorCalled when the given shards have failed, so that implementations can invalidate caches and clean up any in-flight activity for those shards.- Specified by:
applyFailedShardsin interfaceExistingShardsAllocator
-
beforeAllocation
Description copied from interface:ExistingShardsAllocatorCalled before starting a round of allocation, allowing the allocator to invalidate some caches if appropriate.- Specified by:
beforeAllocationin interfaceExistingShardsAllocator
-
afterPrimariesBeforeReplicas
Description copied from interface:ExistingShardsAllocatorCalled during a round of allocation after attempting to allocate all the primaries but before any replicas, allowing the allocator to prepare for replica allocation.- Specified by:
afterPrimariesBeforeReplicasin interfaceExistingShardsAllocator
-
allocateUnassigned
public void allocateUnassigned(ShardRouting shardRouting, RoutingAllocation allocation, ExistingShardsAllocator.UnassignedAllocationHandler unassignedAllocationHandler)Description copied from interface:ExistingShardsAllocatorAllocate any unassigned shards in the givenRoutingAllocationfor which thisExistingShardsAllocatoris responsible.- Specified by:
allocateUnassignedin interfaceExistingShardsAllocator
-
innerAllocatedUnassigned
protected static void innerAllocatedUnassigned(RoutingAllocation allocation, PrimaryShardAllocator primaryShardAllocator, ReplicaShardAllocator replicaShardAllocator, ShardRouting shardRouting, ExistingShardsAllocator.UnassignedAllocationHandler unassignedAllocationHandler) -
explainUnassignedShardAllocation
public AllocateUnassignedDecision explainUnassignedShardAllocation(ShardRouting unassignedShard, RoutingAllocation routingAllocation)Description copied from interface:ExistingShardsAllocatorReturns an explanation for a single unassigned shard.- Specified by:
explainUnassignedShardAllocationin interfaceExistingShardsAllocator
-