@Override public void setUp() throws Exception { super.setUp(); WaveletNotificationSubscriber notifiee = mock(WaveletNotificationSubscriber.class); DeltaStore deltaStore = new MemoryDeltaStore(); AccessController localAccessController = mock(AccessController.class); AccessController remoteAccessController = mock(AccessController.class); WaveletState localWaveletState = DeltaStoreBasedWaveletState.create(deltaStore.open(localWaveletName), PERSIST_EXECUTOR); localWavelet = new LocalWaveletContainerImpl(localWaveletName, notifiee, Futures.immediateFuture(localWaveletState), localDomain, STORAGE_CONTINUATION_EXECUTOR, localAccessController); localWavelet.awaitLoad(); WaveletState remoteWaveletState = DeltaStoreBasedWaveletState.create(deltaStore.open(remoteWaveletName), PERSIST_EXECUTOR); remoteWavelet = new RemoteWaveletContainerImpl(remoteWaveletName, notifiee, Futures.immediateFuture(remoteWaveletState), STORAGE_CONTINUATION_EXECUTOR, remoteAccessController); remoteWavelet.awaitLoad(); }
@Override public void setUp() throws Exception { super.setUp(); WaveletNotificationSubscriber notifiee = mock(WaveletNotificationSubscriber.class); DeltaStore deltaStore = new MemoryDeltaStore(); WaveletState localWaveletState = DeltaStoreBasedWaveletState.create(deltaStore.open(localWaveletName), PERSIST_EXECUTOR); localWavelet = new LocalWaveletContainerImpl(localWaveletName, notifiee, Futures.immediateFuture(localWaveletState), localDomain, STORAGE_CONTINUATION_EXECUTOR); localWavelet.awaitLoad(); WaveletState remoteWaveletState = DeltaStoreBasedWaveletState.create(deltaStore.open(remoteWaveletName), PERSIST_EXECUTOR); remoteWavelet = new RemoteWaveletContainerImpl(remoteWaveletName, notifiee, Futures.immediateFuture(remoteWaveletState), STORAGE_CONTINUATION_EXECUTOR); remoteWavelet.awaitLoad(); }
@Override public void commit(HashedVersion version) { try { awaitLoad(); } catch(WaveletStateException ex) { LOG.warning("Failed to load " + getWaveletName() + " to perform commit.", ex); acquireWriteLock(); markStateCorrupted(); releaseWriteLock(); return; } acquireWriteLock(); try { attemptCommit(version); } finally { releaseWriteLock(); } }