Class TestShardRouting
java.lang.Object
org.elasticsearch.cluster.routing.TestShardRouting
A helper that allows to create shard routing instances within tests, while not requiring to expose
different simplified constructors on the ShardRouting itself.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AllocationId
static RecoverySource
buildRecoveryTarget
(boolean primary, ShardRoutingState state) static RelocationFailureInfo
static UnassignedInfo
static ShardRouting
newShardRouting
(String index, int shardId, String currentNodeId, boolean primary, ShardRoutingState state) static ShardRouting
newShardRouting
(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state) static ShardRouting
newShardRouting
(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, AllocationId allocationId) static ShardRouting
newShardRouting
(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, ShardRouting.Role role) static ShardRouting
newShardRouting
(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, UnassignedInfo unassignedInfo) static ShardRouting
newShardRouting
(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, UnassignedInfo unassignedInfo, ShardRouting.Role role) static ShardRouting
newShardRouting
(ShardId shardId, String currentNodeId, boolean primary, ShardRoutingState state) static ShardRouting
newShardRouting
(ShardId shardId, String currentNodeId, boolean primary, ShardRoutingState state, RecoverySource recoverySource) static ShardRouting
newShardRouting
(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state) static ShardRouting
newShardRouting
(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, AllocationId allocationId) static ShardRouting
newShardRouting
(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, ShardRouting.Role role) static ShardRouting
newShardRouting
(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, UnassignedInfo unassignedInfo) static ShardRouting
newShardRouting
(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, UnassignedInfo unassignedInfo, ShardRouting.Role role) static RecoverySource
static UnassignedInfo
randomUnassignedInfo
(String message) static ShardRouting
relocate
(ShardRouting shardRouting, String relocatingNodeId, long expectedShardSize)
-
Constructor Details
-
TestShardRouting
public TestShardRouting()
-
-
Method Details
-
newShardRouting
public static ShardRouting newShardRouting(String index, int shardId, String currentNodeId, boolean primary, ShardRoutingState state) -
newShardRouting
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, boolean primary, ShardRoutingState state) -
newShardRouting
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, boolean primary, ShardRoutingState state, RecoverySource recoverySource) -
newShardRouting
public static ShardRouting newShardRouting(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state) -
newShardRouting
public static ShardRouting newShardRouting(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, ShardRouting.Role role) -
newShardRouting
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state) -
newShardRouting
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, ShardRouting.Role role) -
newShardRouting
public static ShardRouting newShardRouting(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, AllocationId allocationId) -
newShardRouting
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, AllocationId allocationId) -
newShardRouting
public static ShardRouting newShardRouting(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, UnassignedInfo unassignedInfo) -
newShardRouting
public static ShardRouting newShardRouting(String index, int shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, UnassignedInfo unassignedInfo, ShardRouting.Role role) -
newShardRouting
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, UnassignedInfo unassignedInfo) -
newShardRouting
public static ShardRouting newShardRouting(ShardId shardId, String currentNodeId, String relocatingNodeId, boolean primary, ShardRoutingState state, UnassignedInfo unassignedInfo, ShardRouting.Role role) -
relocate
public static ShardRouting relocate(ShardRouting shardRouting, String relocatingNodeId, long expectedShardSize) -
buildRecoveryTarget
-
buildAllocationId
-
buildUnassignedInfo
-
buildRelocationFailureInfo
-
randomUnassignedInfo
-
randomRecoverySource
-