Class TestShardBatchGatewayAllocator

java.lang.Object
org.opensearch.gateway.ShardsBatchGatewayAllocator
org.opensearch.test.gateway.TestShardBatchGatewayAllocator
All Implemented Interfaces:
org.opensearch.cluster.routing.allocation.ExistingShardsAllocator

public class TestShardBatchGatewayAllocator extends org.opensearch.gateway.ShardsBatchGatewayAllocator
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.opensearch.gateway.ShardsBatchGatewayAllocator

    org.opensearch.gateway.ShardsBatchGatewayAllocator.ShardsBatch

    Nested classes/interfaces inherited from interface org.opensearch.cluster.routing.allocation.ExistingShardsAllocator

    org.opensearch.cluster.routing.allocation.ExistingShardsAllocator.UnassignedAllocationHandler
  • Field Summary

    Fields inherited from class org.opensearch.gateway.ShardsBatchGatewayAllocator

    ALLOCATOR_NAME, batchIdToStartedShardBatch, batchIdToStoreShardBatch, DEFAULT_ALLOCATOR_TIMEOUT, FOLLOW_UP_REROUTE_PRIORITY_SETTING, GATEWAY_ALLOCATOR_BATCH_SIZE, MIN_ALLOCATOR_TIMEOUT, PRIMARY_BATCH_ALLOCATOR_TIMEOUT_SETTING, PRIMARY_BATCH_ALLOCATOR_TIMEOUT_SETTING_KEY, REPLICA_BATCH_ALLOCATOR_TIMEOUT_SETTING, REPLICA_BATCH_ALLOCATOR_TIMEOUT_SETTING_KEY

    Fields inherited from interface org.opensearch.cluster.routing.allocation.ExistingShardsAllocator

    EXISTING_SHARDS_ALLOCATOR_BATCH_MODE, EXISTING_SHARDS_ALLOCATOR_SETTING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    TestShardBatchGatewayAllocator(long maxBatchSize)
     
    TestShardBatchGatewayAllocator(CountDownLatch latch, long maxBatchSize, org.opensearch.cluster.routing.RerouteService rerouteService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterPrimariesBeforeReplicas(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)
     
    org.opensearch.common.util.BatchRunnableExecutor
    allocateAllUnassignedShards(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation, boolean primary)
     
    void
    beforeAllocation(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)
     
    createAndUpdateBatches(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation, boolean primary)
     
    org.opensearch.cluster.routing.allocation.AllocateUnassignedDecision
    explainUnassignedShardAllocation(org.opensearch.cluster.routing.ShardRouting unassignedShard, org.opensearch.cluster.routing.allocation.RoutingAllocation routingAllocation)
     
    getBatchId(org.opensearch.cluster.routing.ShardRouting shard, boolean primary)
     
    Map<String, org.opensearch.gateway.ShardsBatchGatewayAllocator.ShardsBatch>
     
    Map<String, org.opensearch.gateway.ShardsBatchGatewayAllocator.ShardsBatch>
     
    protected org.opensearch.indices.replication.checkpoint.ReplicationCheckpoint
    getReplicationCheckpoint(org.opensearch.core.index.shard.ShardId shardId, String nodeName)
     
    getReplicationCheckPointKey(org.opensearch.core.index.shard.ShardId shardId, String nodeName)
     
    void
    safelyRemoveShardFromBatch(org.opensearch.cluster.routing.ShardRouting shard)
     
    void
    safelyRemoveShardFromBothBatch(org.opensearch.cluster.routing.ShardRouting shardRouting)
     

    Methods inherited from class org.opensearch.gateway.ShardsBatchGatewayAllocator

    allocateUnassigned, applyFailedShards, applyStartedShards, cleanCaches, getNumberOfInFlightFetches, getNumberOfStartedShardBatches, getNumberOfStoreShardBatches, innerAllocateUnassignedBatch, safelyRemoveShardFromBatch, setFollowUpRerouteTaskPriority, setPrimaryBatchAllocatorTimeout, setReplicaBatchAllocatorTimeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TestShardBatchGatewayAllocator

      public TestShardBatchGatewayAllocator()
    • TestShardBatchGatewayAllocator

      public TestShardBatchGatewayAllocator(CountDownLatch latch, long maxBatchSize, org.opensearch.cluster.routing.RerouteService rerouteService)
    • TestShardBatchGatewayAllocator

      public TestShardBatchGatewayAllocator(long maxBatchSize)
  • Method Details

    • allocateAllUnassignedShards

      public org.opensearch.common.util.BatchRunnableExecutor allocateAllUnassignedShards(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation, boolean primary)
      Specified by:
      allocateAllUnassignedShards in interface org.opensearch.cluster.routing.allocation.ExistingShardsAllocator
      Overrides:
      allocateAllUnassignedShards in class org.opensearch.gateway.ShardsBatchGatewayAllocator
    • beforeAllocation

      public void beforeAllocation(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)
      Specified by:
      beforeAllocation in interface org.opensearch.cluster.routing.allocation.ExistingShardsAllocator
      Overrides:
      beforeAllocation in class org.opensearch.gateway.ShardsBatchGatewayAllocator
    • afterPrimariesBeforeReplicas

      public void afterPrimariesBeforeReplicas(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)
      Specified by:
      afterPrimariesBeforeReplicas in interface org.opensearch.cluster.routing.allocation.ExistingShardsAllocator
      Overrides:
      afterPrimariesBeforeReplicas in class org.opensearch.gateway.ShardsBatchGatewayAllocator
    • createAndUpdateBatches

      public Set<String> createAndUpdateBatches(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation, boolean primary)
      Overrides:
      createAndUpdateBatches in class org.opensearch.gateway.ShardsBatchGatewayAllocator
    • safelyRemoveShardFromBatch

      public void safelyRemoveShardFromBatch(org.opensearch.cluster.routing.ShardRouting shard)
    • safelyRemoveShardFromBothBatch

      public void safelyRemoveShardFromBothBatch(org.opensearch.cluster.routing.ShardRouting shardRouting)
      Overrides:
      safelyRemoveShardFromBothBatch in class org.opensearch.gateway.ShardsBatchGatewayAllocator
    • getBatchId

      public String getBatchId(org.opensearch.cluster.routing.ShardRouting shard, boolean primary)
      Overrides:
      getBatchId in class org.opensearch.gateway.ShardsBatchGatewayAllocator
    • getBatchIdToStartedShardBatch

      public Map<String, org.opensearch.gateway.ShardsBatchGatewayAllocator.ShardsBatch> getBatchIdToStartedShardBatch()
    • getBatchIdToStoreShardBatch

      public Map<String, org.opensearch.gateway.ShardsBatchGatewayAllocator.ShardsBatch> getBatchIdToStoreShardBatch()
    • explainUnassignedShardAllocation

      public org.opensearch.cluster.routing.allocation.AllocateUnassignedDecision explainUnassignedShardAllocation(org.opensearch.cluster.routing.ShardRouting unassignedShard, org.opensearch.cluster.routing.allocation.RoutingAllocation routingAllocation)
      Specified by:
      explainUnassignedShardAllocation in interface org.opensearch.cluster.routing.allocation.ExistingShardsAllocator
      Overrides:
      explainUnassignedShardAllocation in class org.opensearch.gateway.ShardsBatchGatewayAllocator
    • getReplicationCheckpoint

      protected org.opensearch.indices.replication.checkpoint.ReplicationCheckpoint getReplicationCheckpoint(org.opensearch.core.index.shard.ShardId shardId, String nodeName)
    • getReplicationCheckPointKey

      public String getReplicationCheckPointKey(org.opensearch.core.index.shard.ShardId shardId, String nodeName)