Package org.opensearch.cluster
Class OpenSearchAllocationTestCase.DelayedShardsMockGatewayAllocator
java.lang.Object
org.opensearch.gateway.GatewayAllocator
org.opensearch.cluster.OpenSearchAllocationTestCase.DelayedShardsMockGatewayAllocator
- All Implemented Interfaces:
org.opensearch.cluster.routing.allocation.ExistingShardsAllocator
- Enclosing class:
- OpenSearchAllocationTestCase
protected static class OpenSearchAllocationTestCase.DelayedShardsMockGatewayAllocator
extends org.opensearch.gateway.GatewayAllocator
Mocks behavior in ReplicaShardAllocator to remove delayed shards from list of unassigned shards so they don't get reassigned yet.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DelayedShardsMockGatewayAllocator() -
Method Summary
Modifier and Type Method Description voidafterPrimariesBeforeReplicas(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)voidallocateUnassigned(org.opensearch.cluster.routing.ShardRouting shardRouting, org.opensearch.cluster.routing.allocation.RoutingAllocation allocation, org.opensearch.cluster.routing.allocation.ExistingShardsAllocator.UnassignedAllocationHandler unassignedAllocationHandler)voidapplyFailedShards(java.util.List<org.opensearch.cluster.routing.allocation.FailedShard> failedShards, org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)voidapplyStartedShards(java.util.List<org.opensearch.cluster.routing.ShardRouting> startedShards, org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)voidbeforeAllocation(org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)
-
Constructor Details
-
DelayedShardsMockGatewayAllocator
public DelayedShardsMockGatewayAllocator()
-
-
Method Details
-
applyStartedShards
public void applyStartedShards(java.util.List<org.opensearch.cluster.routing.ShardRouting> startedShards, org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)- Specified by:
applyStartedShardsin interfaceorg.opensearch.cluster.routing.allocation.ExistingShardsAllocator- Overrides:
applyStartedShardsin classorg.opensearch.gateway.GatewayAllocator
-
applyFailedShards
public void applyFailedShards(java.util.List<org.opensearch.cluster.routing.allocation.FailedShard> failedShards, org.opensearch.cluster.routing.allocation.RoutingAllocation allocation)- Specified by:
applyFailedShardsin interfaceorg.opensearch.cluster.routing.allocation.ExistingShardsAllocator- Overrides:
applyFailedShardsin classorg.opensearch.gateway.GatewayAllocator
-
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.GatewayAllocator
-
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.GatewayAllocator
-
allocateUnassigned
public void allocateUnassigned(org.opensearch.cluster.routing.ShardRouting shardRouting, org.opensearch.cluster.routing.allocation.RoutingAllocation allocation, org.opensearch.cluster.routing.allocation.ExistingShardsAllocator.UnassignedAllocationHandler unassignedAllocationHandler)- Specified by:
allocateUnassignedin interfaceorg.opensearch.cluster.routing.allocation.ExistingShardsAllocator- Overrides:
allocateUnassignedin classorg.opensearch.gateway.GatewayAllocator
-