Package org.apache.solr.common.cloud
Class ClusterStateUtil
- java.lang.Object
- 
- org.apache.solr.common.cloud.ClusterStateUtil
 
- 
 public class ClusterStateUtil extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description ClusterStateUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetLiveAndActiveReplicaCount(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection)static Stream<org.apache.solr.common.cloud.Replica>replicasOfActiveSlicesStream(org.apache.solr.common.cloud.DocCollection collectionState)static StringtoDebugAllStatesString(org.apache.solr.common.cloud.ClusterState clusterState)Produces a String of all the collection states for debugging.static booleanwaitFor(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, long timeout, TimeUnit timeUnit, org.apache.solr.common.cloud.CollectionStatePredicate predicate)CallsZkStateReader.waitForState(String, long, TimeUnit, CollectionStatePredicate)but has an alternative implementation ifcollectionis null, in which the predicate must match *all* collections.static booleanwaitForAllActiveAndLiveReplicas(org.apache.solr.common.cloud.ZkStateReader zkStateReader, int timeoutInMs)Wait to see *all* cores live and active.static booleanwaitForAllActiveAndLiveReplicas(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int timeoutInMs)Wait to see *all* cores live and active.static booleanwaitForAllReplicasNotLive(org.apache.solr.common.cloud.ZkStateReader zkStateReader, int timeoutInMs)static booleanwaitForAllReplicasNotLive(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int timeoutInMs)static booleanwaitForLiveAndActiveReplicaCount(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int replicaCount, int timeoutInMs)
 
- 
- 
- 
Method Detail- 
waitForAllActiveAndLiveReplicaspublic 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 ClusterState
- timeoutInMs- how long to wait before giving up
- Returns:
- false if timed out
 
 - 
waitForAllActiveAndLiveReplicaspublic 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 ClusterState
- collection- to look at
- timeoutInMs- how long to wait before giving up
- Returns:
- false if timed out
 
 - 
waitForAllReplicasNotLivepublic static boolean waitForAllReplicasNotLive(org.apache.solr.common.cloud.ZkStateReader zkStateReader, int timeoutInMs)
 - 
waitForAllReplicasNotLivepublic static boolean waitForAllReplicasNotLive(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int timeoutInMs)
 - 
getLiveAndActiveReplicaCountpublic static int getLiveAndActiveReplicaCount(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection)
 - 
replicasOfActiveSlicesStreampublic static Stream<org.apache.solr.common.cloud.Replica> replicasOfActiveSlicesStream(org.apache.solr.common.cloud.DocCollection collectionState) 
 - 
waitForLiveAndActiveReplicaCountpublic static boolean waitForLiveAndActiveReplicaCount(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, int replicaCount, int timeoutInMs)
 - 
waitForpublic static boolean waitFor(org.apache.solr.common.cloud.ZkStateReader zkStateReader, String collection, long timeout, TimeUnit timeUnit, org.apache.solr.common.cloud.CollectionStatePredicate predicate)CallsZkStateReader.waitForState(String, long, TimeUnit, CollectionStatePredicate)but has an alternative implementation ifcollectionis null, in which the predicate must match *all* collections. Returns whether the predicate matches or not in the allotted time; does *NOT* throwTimeoutException.
 - 
toDebugAllStatesStringpublic static String toDebugAllStatesString(org.apache.solr.common.cloud.ClusterState clusterState) Produces a String of all the collection states for debugging. ZK may be consulted.
 
- 
 
-