/** * Wait to see *all* cores live and active. * * @param zkStateReader * to use for ClusterState * @param timeoutInMs * how long to wait before giving up * @return false if timed out */ public static boolean waitForAllActiveAndLiveReplicas(ZkStateReader zkStateReader, int timeoutInMs) { return waitForAllActiveAndLiveReplicas(zkStateReader, null, timeoutInMs); }
public static boolean waitForAllReplicasNotLive(ZkStateReader zkStateReader, int timeoutInMs) { return waitForAllReplicasNotLive(zkStateReader, null, timeoutInMs); }
public static boolean waitForLiveAndActiveReplicaCount(ZkStateReader zkStateReader, String collection, int replicaCount, int timeoutInMs) { long timeout = System.nanoTime() + TimeUnit.NANOSECONDS.convert(timeoutInMs, TimeUnit.MILLISECONDS); boolean success = false; while (!success && System.nanoTime() < timeout) { success = getLiveAndActiveReplicaCount(zkStateReader, collection) == replicaCount; if (!success) { try { Thread.sleep(TIMEOUT_POLL_MS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new SolrException(ErrorCode.SERVER_ERROR, "Interrupted"); } } } return success; }
public static boolean waitForLiveAndActiveReplicaCount(ZkStateReader zkStateReader, String collection, int replicaCount, int timeoutInMs) { long timeout = System.nanoTime() + TimeUnit.NANOSECONDS.convert(timeoutInMs, TimeUnit.MILLISECONDS); boolean success = false; while (!success && System.nanoTime() < timeout) { success = getLiveAndActiveReplicaCount(zkStateReader, collection) == replicaCount; if (!success) { try { Thread.sleep(TIMEOUT_POLL_MS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new SolrException(ErrorCode.SERVER_ERROR, "Interrupted"); } } } return success; }
/** * Wait to see *all* cores live and active. * * @param zkStateReader * to use for ClusterState * @param timeoutInMs * how long to wait before giving up * @return false if timed out */ public static boolean waitForAllActiveAndLiveReplicas(ZkStateReader zkStateReader, int timeoutInMs) { return waitForAllActiveAndLiveReplicas(zkStateReader, null, timeoutInMs); }
public static boolean waitForAllReplicasNotLive(ZkStateReader zkStateReader, int timeoutInMs) { return waitForAllReplicasNotLive(zkStateReader, null, timeoutInMs); }