Class OpenSearchAllocationTestCase.MockAllocationService

java.lang.Object
org.opensearch.cluster.routing.allocation.AllocationService
org.opensearch.cluster.OpenSearchAllocationTestCase.MockAllocationService
Enclosing class:
OpenSearchAllocationTestCase

protected static class OpenSearchAllocationTestCase.MockAllocationService extends org.opensearch.cluster.routing.allocation.AllocationService
A lock AllocationService allowing tests to override time
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.opensearch.cluster.routing.allocation.AllocationService

    org.opensearch.cluster.routing.allocation.AllocationService.CommandsResult
  • Constructor Summary

    Constructors
    Constructor
    Description
    MockAllocationService(org.opensearch.cluster.routing.allocation.decider.AllocationDeciders allocationDeciders, org.opensearch.gateway.GatewayAllocator gatewayAllocator, org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator shardsAllocator, org.opensearch.cluster.ClusterInfoService clusterInfoService, org.opensearch.snapshots.SnapshotsInfoService snapshotsInfoService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected long
     
    void
    setNanoTimeOverride(long nanoTime)
     

    Methods inherited from class org.opensearch.cluster.routing.allocation.AllocationService

    adaptAutoExpandReplicas, applyFailedShard, applyFailedShards, applyFailedShards, applyStartedShards, buildResultAndLogHealthChange, cleanCaches, disassociateDeadNodes, explainShardAllocation, firstListElementsToCommaDelimitedString, getNumberOfInFlightFetches, reroute, reroute, setExistingShardsAllocators

    Methods inherited from class java.lang.Object

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

    • MockAllocationService

      public MockAllocationService(org.opensearch.cluster.routing.allocation.decider.AllocationDeciders allocationDeciders, org.opensearch.gateway.GatewayAllocator gatewayAllocator, org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator shardsAllocator, org.opensearch.cluster.ClusterInfoService clusterInfoService, org.opensearch.snapshots.SnapshotsInfoService snapshotsInfoService)
  • Method Details

    • setNanoTimeOverride

      public void setNanoTimeOverride(long nanoTime)
    • currentNanoTime

      protected long currentNanoTime()
      Overrides:
      currentNanoTime in class org.opensearch.cluster.routing.allocation.AllocationService