Class ESAllocationTestCase

java.lang.Object
org.junit.Assert
org.apache.lucene.util.LuceneTestCase
org.elasticsearch.test.ESTestCase
org.elasticsearch.cluster.ESAllocationTestCase

public abstract class ESAllocationTestCase
extends ESTestCase
  • Field Details

    • MASTER_DATA_ROLES

      protected static java.util.Set<org.elasticsearch.cluster.node.DiscoveryNodeRole> MASTER_DATA_ROLES
  • Constructor Details

  • Method Details

    • createAllocationService

      public static ESAllocationTestCase.MockAllocationService createAllocationService()
    • createAllocationService

      public static ESAllocationTestCase.MockAllocationService createAllocationService​(org.elasticsearch.common.settings.Settings settings)
    • createAllocationService

      public static ESAllocationTestCase.MockAllocationService createAllocationService​(org.elasticsearch.common.settings.Settings settings, java.util.Random random)
    • createAllocationService

      public static ESAllocationTestCase.MockAllocationService createAllocationService​(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.common.settings.ClusterSettings clusterSettings, java.util.Random random)
    • createAllocationService

      public static ESAllocationTestCase.MockAllocationService createAllocationService​(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.cluster.ClusterInfoService clusterInfoService)
    • createAllocationService

      public static ESAllocationTestCase.MockAllocationService createAllocationService​(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.gateway.GatewayAllocator gatewayAllocator)
    • randomAllocationDeciders

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

      protected static org.elasticsearch.cluster.node.DiscoveryNode newNode​(java.lang.String nodeId)
    • newNode

      protected static org.elasticsearch.cluster.node.DiscoveryNode newNode​(java.lang.String nodeName, java.lang.String nodeId, java.util.Map<java.lang.String,​java.lang.String> attributes)
    • newNode

      protected static org.elasticsearch.cluster.node.DiscoveryNode newNode​(java.lang.String nodeId, java.util.Map<java.lang.String,​java.lang.String> attributes)
    • newNode

      protected static org.elasticsearch.cluster.node.DiscoveryNode newNode​(java.lang.String nodeId, java.util.Set<org.elasticsearch.cluster.node.DiscoveryNodeRole> roles)
    • newNode

      protected static org.elasticsearch.cluster.node.DiscoveryNode newNode​(java.lang.String nodeId, org.elasticsearch.Version version)
    • startRandomInitializingShard

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

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

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

      protected static org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders throttleAllocationDeciders()
    • applyStartedShardsUntilNoChange

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

      public static org.elasticsearch.cluster.ClusterState startInitializingShardsAndReroute​(org.elasticsearch.cluster.routing.allocation.AllocationService allocationService, org.elasticsearch.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.elasticsearch.cluster.ClusterState startInitializingShardsAndReroute​(org.elasticsearch.cluster.routing.allocation.AllocationService allocationService, org.elasticsearch.cluster.ClusterState clusterState, org.elasticsearch.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.elasticsearch.cluster.ClusterState startInitializingShardsAndReroute​(org.elasticsearch.cluster.routing.allocation.AllocationService allocationService, org.elasticsearch.cluster.ClusterState clusterState, java.lang.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.elasticsearch.cluster.ClusterState startShardsAndReroute​(org.elasticsearch.cluster.routing.allocation.AllocationService allocationService, org.elasticsearch.cluster.ClusterState clusterState, org.elasticsearch.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.elasticsearch.cluster.ClusterState startShardsAndReroute​(org.elasticsearch.cluster.routing.allocation.AllocationService allocationService, org.elasticsearch.cluster.ClusterState clusterState, java.util.List<org.elasticsearch.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.