Tests to see if Cluster has reached status. This class is most useful when paired with a RetryablePredicate as in the code below. This class can be used to block execution until the Cluster status has reached a desired state. This is useful when your Cluster needs to be 100% ready before you can continue with execution.
{@code Cluster Cluster = ClusterApi.create(100); RetryablePredicate awaitAvailable = RetryablePredicate.create( ClusterPredicates.available(ClusterApi), 600, 10, 10, TimeUnit.SECONDS);}if (!awaitAvailable.apply(Cluster.getId())) throw new TimeoutException("Timeout on Cluster: " + Cluster); } }
You can also use the static convenience methods as follows.
{@code Cluster Cluster = ClusterApi.create(100);}if (!ClusterPredicates.awaitAvailable(ClusterApi).apply(Cluster.getId())) throw new TimeoutException("Timeout on Cluster: " + Cluster); } }