Interface ExistingShardsAllocator

All Known Implementing Classes:
GatewayAllocator

public interface ExistingShardsAllocator
Searches for, and allocates, shards for which there is an existing on-disk copy somewhere in the cluster. The default implementation is GatewayAllocator, but plugins can supply their own implementations too.
  • Field Details

    • EXISTING_SHARDS_ALLOCATOR_SETTING

      static final Setting<String> EXISTING_SHARDS_ALLOCATOR_SETTING
      Allows plugins to override how we allocate shards that may already exist on disk in the cluster.
  • Method Details

    • beforeAllocation

      void beforeAllocation(RoutingAllocation allocation)
      Called before starting a round of allocation, allowing the allocator to invalidate some caches if appropriate.
    • afterPrimariesBeforeReplicas

      void afterPrimariesBeforeReplicas(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.
    • allocateUnassigned

      void allocateUnassigned(ShardRouting shardRouting, RoutingAllocation allocation, ExistingShardsAllocator.UnassignedAllocationHandler unassignedAllocationHandler)
      Allocate any unassigned shards in the given RoutingAllocation for which this ExistingShardsAllocator is responsible.
    • explainUnassignedShardAllocation

      AllocateUnassignedDecision explainUnassignedShardAllocation(ShardRouting unassignedShard, RoutingAllocation routingAllocation)
      Returns an explanation for a single unassigned shard.
    • cleanCaches

      void cleanCaches()
      Called 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.
    • applyStartedShards

      void applyStartedShards(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.
    • applyFailedShards

      void applyFailedShards(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.
    • getNumberOfInFlightFetches

      int getNumberOfInFlightFetches()
      Returns:
      the number of in-flight fetches under this allocator's control.