Class OpenSearchAllocationTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.tests.util.LuceneTestCase
org.opensearch.test.OpenSearchTestCase
org.opensearch.cluster.OpenSearchAllocationTestCase
Direct Known Subclasses:
OpenSearchAllocationWithConstraintsTestCase

public abstract class OpenSearchAllocationTestCase extends OpenSearchTestCase
  • Field Details

    • SNAPSHOT_INFO_SERVICE_WITH_NO_SHARD_SIZES

      public static final org.opensearch.snapshots.SnapshotsInfoService SNAPSHOT_INFO_SERVICE_WITH_NO_SHARD_SIZES
    • CLUSTER_MANAGER_DATA_ROLES

      protected static Set<org.opensearch.cluster.node.DiscoveryNodeRole> CLUSTER_MANAGER_DATA_ROLES
    • SEARCH_ROLE

      protected static Set<org.opensearch.cluster.node.DiscoveryNodeRole> SEARCH_ROLE
  • Constructor Details

    • OpenSearchAllocationTestCase

      public OpenSearchAllocationTestCase()
  • Method Details

    • createAllocationService

      public static OpenSearchAllocationTestCase.MockAllocationService createAllocationService()
    • createAllocationService

      public static OpenSearchAllocationTestCase.MockAllocationService createAllocationService(org.opensearch.common.settings.Settings settings)
    • createAllocationService

      public static OpenSearchAllocationTestCase.MockAllocationService createAllocationService(org.opensearch.common.settings.Settings settings, Random random)
    • createAllocationService

      public static OpenSearchAllocationTestCase.MockAllocationService createAllocationService(org.opensearch.common.settings.Settings settings, org.opensearch.common.settings.ClusterSettings clusterSettings, Random random)
    • createAllocationService

      public static OpenSearchAllocationTestCase.MockAllocationService createAllocationService(org.opensearch.common.settings.Settings settings, org.opensearch.cluster.ClusterInfoService clusterInfoService)
    • createAllocationService

      public static OpenSearchAllocationTestCase.MockAllocationService createAllocationService(org.opensearch.common.settings.Settings settings, org.opensearch.gateway.GatewayAllocator gatewayAllocator)
    • createAllocationService

      public static OpenSearchAllocationTestCase.MockAllocationService createAllocationService(org.opensearch.common.settings.Settings settings, org.opensearch.snapshots.SnapshotsInfoService snapshotsInfoService)
    • createAllocationService

      public static OpenSearchAllocationTestCase.MockAllocationService createAllocationService(org.opensearch.common.settings.Settings settings, org.opensearch.gateway.GatewayAllocator gatewayAllocator, org.opensearch.snapshots.SnapshotsInfoService snapshotsInfoService)
    • randomAllocationDeciders

      public static org.opensearch.cluster.routing.allocation.decider.AllocationDeciders randomAllocationDeciders(org.opensearch.common.settings.Settings settings, org.opensearch.common.settings.ClusterSettings clusterSettings, Random random)
    • newNode

      protected static org.opensearch.cluster.node.DiscoveryNode newNode(String nodeId)
    • newSearchNode

      protected static org.opensearch.cluster.node.DiscoveryNode newSearchNode(String nodeId)
    • newSearchNode

      protected static org.opensearch.cluster.node.DiscoveryNode newSearchNode(String nodeId, org.opensearch.Version version)
    • newSearchNode

      protected static org.opensearch.cluster.node.DiscoveryNode newSearchNode(String nodeId, Map<String,String> attributes)
    • newSearchNode

      protected static org.opensearch.cluster.node.DiscoveryNode newSearchNode(String nodeName, String nodeId, Map<String,String> attributes)
    • newNode

      protected static org.opensearch.cluster.node.DiscoveryNode newNode(String nodeName, String nodeId, Map<String,String> attributes)
    • newNode

      protected static org.opensearch.cluster.node.DiscoveryNode newNode(String nodeId, Map<String,String> attributes)
    • newNode

      protected static org.opensearch.cluster.node.DiscoveryNode newNode(String nodeId, Set<org.opensearch.cluster.node.DiscoveryNodeRole> roles)
    • newNode

      protected static org.opensearch.cluster.node.DiscoveryNode newNode(String nodeName, String nodeId, Set<org.opensearch.cluster.node.DiscoveryNodeRole> roles)
    • newNode

      protected static org.opensearch.cluster.node.DiscoveryNode newNode(String nodeId, org.opensearch.Version version)
    • startRandomInitializingShard

      protected static org.opensearch.cluster.ClusterState startRandomInitializingShard(org.opensearch.cluster.ClusterState clusterState, org.opensearch.cluster.routing.allocation.AllocationService strategy)
    • startRandomInitializingShard

      protected static org.opensearch.cluster.ClusterState startRandomInitializingShard(org.opensearch.cluster.ClusterState clusterState, org.opensearch.cluster.routing.allocation.AllocationService strategy, String index)
    • yesAllocationDeciders

      protected static org.opensearch.cluster.routing.allocation.decider.AllocationDeciders yesAllocationDeciders()
    • noAllocationDeciders

      protected static org.opensearch.cluster.routing.allocation.decider.AllocationDeciders noAllocationDeciders()
    • throttleAllocationDeciders

      protected static org.opensearch.cluster.routing.allocation.decider.AllocationDeciders throttleAllocationDeciders()
    • allocationDecidersForExcludeAPI

      protected static org.opensearch.cluster.routing.allocation.decider.AllocationDeciders allocationDecidersForExcludeAPI(org.opensearch.common.settings.Settings settings)
    • applyStartedShardsUntilNoChange

      protected org.opensearch.cluster.ClusterState applyStartedShardsUntilNoChange(org.opensearch.cluster.ClusterState clusterState, org.opensearch.cluster.routing.allocation.AllocationService service)
    • startInitializingShardsAndReroute

      public static org.opensearch.cluster.ClusterState startInitializingShardsAndReroute(org.opensearch.cluster.routing.allocation.AllocationService allocationService, org.opensearch.cluster.ClusterState clusterState)
      Mark all initializing shards as started, then perform a reroute (which may start some other shards initializing).
      Returns:
      the cluster state after completing the reroute.
    • startInitializingShardsAndReroute

      public static org.opensearch.cluster.ClusterState startInitializingShardsAndReroute(org.opensearch.cluster.routing.allocation.AllocationService allocationService, org.opensearch.cluster.ClusterState clusterState, org.opensearch.cluster.routing.RoutingNode routingNode)
      Mark all initializing shards on the given node as started, then perform a reroute (which may start some other shards initializing).
      Returns:
      the cluster state after completing the reroute.
    • startInitializingShardsAndReroute

      public static org.opensearch.cluster.ClusterState startInitializingShardsAndReroute(org.opensearch.cluster.routing.allocation.AllocationService allocationService, org.opensearch.cluster.ClusterState clusterState, String index)
      Mark all initializing shards for the given index as started, then perform a reroute (which may start some other shards initializing).
      Returns:
      the cluster state after completing the reroute.
    • startShardsAndReroute

      public static org.opensearch.cluster.ClusterState startShardsAndReroute(org.opensearch.cluster.routing.allocation.AllocationService allocationService, org.opensearch.cluster.ClusterState clusterState, org.opensearch.cluster.routing.ShardRouting... initializingShards)
      Mark the given shards as started, then perform a reroute (which may start some other shards initializing).
      Returns:
      the cluster state after completing the reroute.
    • startShardsAndReroute

      public static org.opensearch.cluster.ClusterState startShardsAndReroute(org.opensearch.cluster.routing.allocation.AllocationService allocationService, org.opensearch.cluster.ClusterState clusterState, List<org.opensearch.cluster.routing.ShardRouting> initializingShards)
      Mark the given shards as started, then perform a reroute (which may start some other shards initializing).
      Returns:
      the cluster state after completing the reroute.
    • newRoutingAllocation

      protected org.opensearch.cluster.routing.allocation.RoutingAllocation newRoutingAllocation(org.opensearch.cluster.routing.allocation.decider.AllocationDeciders deciders, org.opensearch.cluster.ClusterState state)