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.ShardsBatchNested 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_KEYFields inherited from interface org.opensearch.cluster.routing.allocation.ExistingShardsAllocator
EXISTING_SHARDS_ALLOCATOR_BATCH_MODE, EXISTING_SHARDS_ALLOCATOR_SETTING -
Constructor Summary
ConstructorsConstructorDescriptionTestShardBatchGatewayAllocator(long maxBatchSize) TestShardBatchGatewayAllocator(CountDownLatch latch, long maxBatchSize, org.opensearch.cluster.routing.RerouteService rerouteService) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterPrimariesBeforeReplicas(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation) org.opensearch.common.util.BatchRunnableExecutorallocateAllUnassignedShards(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation, boolean primary) voidbeforeAllocation(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation) createAndUpdateBatches(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation, boolean primary) org.opensearch.cluster.routing.allocation.AllocateUnassignedDecisionexplainUnassignedShardAllocation(org.opensearch.cluster.routing.ShardRouting unassignedShard, org.opensearch.cluster.routing.allocation.RoutingAllocation routingAllocation) getBatchId(org.opensearch.cluster.routing.ShardRouting shard, boolean primary) protected org.opensearch.indices.replication.checkpoint.ReplicationCheckpointgetReplicationCheckpoint(org.opensearch.core.index.shard.ShardId shardId, String nodeName) getReplicationCheckPointKey(org.opensearch.core.index.shard.ShardId shardId, String nodeName) voidsafelyRemoveShardFromBatch(org.opensearch.cluster.routing.ShardRouting shard) voidsafelyRemoveShardFromBothBatch(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
-
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:
allocateAllUnassignedShardsin interfaceorg.opensearch.cluster.routing.allocation.ExistingShardsAllocator- Overrides:
allocateAllUnassignedShardsin classorg.opensearch.gateway.ShardsBatchGatewayAllocator
-
beforeAllocation
public void beforeAllocation(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation) - Specified by:
beforeAllocationin interfaceorg.opensearch.cluster.routing.allocation.ExistingShardsAllocator- Overrides:
beforeAllocationin classorg.opensearch.gateway.ShardsBatchGatewayAllocator
-
afterPrimariesBeforeReplicas
public void afterPrimariesBeforeReplicas(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation) - Specified by:
afterPrimariesBeforeReplicasin interfaceorg.opensearch.cluster.routing.allocation.ExistingShardsAllocator- Overrides:
afterPrimariesBeforeReplicasin classorg.opensearch.gateway.ShardsBatchGatewayAllocator
-
createAndUpdateBatches
-
safelyRemoveShardFromBatch
public void safelyRemoveShardFromBatch(org.opensearch.cluster.routing.ShardRouting shard) -
safelyRemoveShardFromBothBatch
public void safelyRemoveShardFromBothBatch(org.opensearch.cluster.routing.ShardRouting shardRouting) - Overrides:
safelyRemoveShardFromBothBatchin classorg.opensearch.gateway.ShardsBatchGatewayAllocator
-
getBatchId
- Overrides:
getBatchIdin classorg.opensearch.gateway.ShardsBatchGatewayAllocator
-
getBatchIdToStartedShardBatch
-
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:
explainUnassignedShardAllocationin interfaceorg.opensearch.cluster.routing.allocation.ExistingShardsAllocator- Overrides:
explainUnassignedShardAllocationin classorg.opensearch.gateway.ShardsBatchGatewayAllocator
-
getReplicationCheckpoint
protected org.opensearch.indices.replication.checkpoint.ReplicationCheckpoint getReplicationCheckpoint(org.opensearch.core.index.shard.ShardId shardId, String nodeName) -
getReplicationCheckPointKey
-