Tests to see if snapshot 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 Snapshot status has reached a desired state. This is useful when your Snapshot needs to be 100% ready before you can continue with execution.
{@code Snapshot snapshot = snapshotApi.create(volumeId); RetryablePredicate awaitAvailable = RetryablePredicate.create( SnapshotPredicates.available(snapshotApi), 600, 10, 10, TimeUnit.SECONDS);}if (!awaitAvailable.apply(snapshot.getId())) throw new TimeoutException("Timeout on snapshot: " + snapshot); } }
You can also use the static convenience methods as so.
{@code Snapshot snapshot = snapshotApi.create(volumeId);}if (!SnapshotPredicates.awaitAvailable(snapshotApi).apply(snapshot.getId())) throw new TimeoutException("Timeout on snapshot: " + snapshot); } }
@author Everett Toews