@Override public ConsistencyModel getConsistencyModel() { return context.getConsistencyModel(); }
@Override public ConsistencyModel getConsistencyModel() { return delegate().getConsistencyModel(); }
@Override public ConsistencyModel getConsistencyModel() { return delegate().getConsistencyModel(); }
protected void awaitConsistency() { if (view.getConsistencyModel() == ConsistencyModel.EVENTUAL) { Uninterruptibles.sleepUninterruptibly(AWAIT_CONSISTENCY_TIMEOUT_SECONDS, TimeUnit.SECONDS); } } }
protected void awaitConsistency() { if (view.getConsistencyModel() == ConsistencyModel.EVENTUAL) { Uninterruptibles.sleepUninterruptibly(AWAIT_CONSISTENCY_TIMEOUT_SECONDS, TimeUnit.SECONDS); } } }
protected void awaitConsistency() { if (view.getConsistencyModel() == ConsistencyModel.EVENTUAL) { Uninterruptibles.sleepUninterruptibly(AWAIT_CONSISTENCY_TIMEOUT_SECONDS, TimeUnit.SECONDS); } } }
/** * Due to eventual consistency, container commands may not return correctly immediately. Hence, * we will try up to the inconsistency window to see if the assertion completes. */ protected static void assertConsistencyAware(BlobStoreContext context, Runnable assertion) throws InterruptedException { if (context.getConsistencyModel() == ConsistencyModel.STRICT) { assertion.run(); return; } else { AssertionError error = null; for (int i = 0; i < 30; i++) { try { assertion.run(); return; } catch (AssertionError e) { error = e; } Thread.sleep(INCONSISTENCY_WINDOW / 30); } if (error != null) throw error; } }
/** * Due to eventual consistency, container commands may not return correctly immediately. Hence, * we will try up to the inconsistency window to see if the assertion completes. */ protected static void assertConsistencyAware(BlobStoreContext context, Runnable assertion) throws InterruptedException { if (context.getConsistencyModel() == ConsistencyModel.STRICT) { assertion.run(); return; } else { AssertionError error = null; for (int i = 0; i < 30; i++) { try { assertion.run(); return; } catch (AssertionError e) { error = e; } Thread.sleep(INCONSISTENCY_WINDOW / 30); } if (error != null) throw error; } }
protected static void createContainerAndEnsureEmpty(BlobStoreContext context, final String containerName) throws InterruptedException { context.getBlobStore().createContainerInLocation(null, containerName); if (context.getConsistencyModel() == ConsistencyModel.EVENTUAL) Thread.sleep(1000); context.getBlobStore().clearContainer(containerName); }