Package org.apache.solr.common.cloud
Class ClusterStateUtil
- java.lang.Object
-
- org.apache.solr.common.cloud.ClusterStateUtil
-
public class ClusterStateUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description ClusterStateUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getLiveAndActiveReplicaCount(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection)
static boolean
waitForAllActiveAndLiveReplicas(org.apache.solr.common.cloud.ZkStateReader zkStateReader, int timeoutInMs)
Wait to see *all* cores live and active.static boolean
waitForAllActiveAndLiveReplicas(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int timeoutInMs)
Wait to see *all* cores live and active.static boolean
waitForAllReplicasNotLive(org.apache.solr.common.cloud.ZkStateReader zkStateReader, int timeoutInMs)
static boolean
waitForAllReplicasNotLive(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int timeoutInMs)
static boolean
waitForLiveAndActiveReplicaCount(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int replicaCount, int timeoutInMs)
static boolean
waitToSeeLiveReplica(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, String coreNodeName, String baseUrl, int timeoutInMs)
Wait to see an entry in the ClusterState with a specific coreNodeName and baseUrl.
-
-
-
Method Detail
-
waitForAllActiveAndLiveReplicas
public static boolean waitForAllActiveAndLiveReplicas(org.apache.solr.common.cloud.ZkStateReader zkStateReader, int timeoutInMs)
Wait to see *all* cores live and active.- Parameters:
zkStateReader
- to use for ClusterStatetimeoutInMs
- how long to wait before giving up- Returns:
- false if timed out
-
waitForAllActiveAndLiveReplicas
public static boolean waitForAllActiveAndLiveReplicas(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int timeoutInMs)
Wait to see *all* cores live and active.- Parameters:
zkStateReader
- to use for ClusterStatecollection
- to look attimeoutInMs
- how long to wait before giving up- Returns:
- false if timed out
-
waitToSeeLiveReplica
public static boolean waitToSeeLiveReplica(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, String coreNodeName, String baseUrl, int timeoutInMs)
Wait to see an entry in the ClusterState with a specific coreNodeName and baseUrl.- Parameters:
zkStateReader
- to use for ClusterStatecollection
- to look incoreNodeName
- to wait forbaseUrl
- to wait fortimeoutInMs
- how long to wait before giving up- Returns:
- false if timed out
-
waitForAllReplicasNotLive
public static boolean waitForAllReplicasNotLive(org.apache.solr.common.cloud.ZkStateReader zkStateReader, int timeoutInMs)
-
waitForAllReplicasNotLive
public static boolean waitForAllReplicasNotLive(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int timeoutInMs)
-
getLiveAndActiveReplicaCount
public static int getLiveAndActiveReplicaCount(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection)
-
waitForLiveAndActiveReplicaCount
public static boolean waitForLiveAndActiveReplicaCount(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int replicaCount, int timeoutInMs)
-
-