@Override public void delete(WaveletName waveletName) throws PersistenceException, FileNotFoundPersistenceException { deltaStore.delete(waveletName); }
@Override public ExceptionalIterator<WaveId, PersistenceException> getWaveIdIterator() throws PersistenceException { return deltaStore.getWaveIdIterator(); } }
@Override public ImmutableSet<WaveletId> lookup(WaveId waveId) throws PersistenceException { return deltaStore.lookup(waveId); }
@Override public DeltaStoreBasedWaveletState call() throws PersistenceException { return DeltaStoreBasedWaveletState.create(deltaStore.open(waveletName), persistExecutor); } });
public void testWaveIdIteratorDoesNotReturnEmptyWavelets() throws Exception { DeltaStore store = newDeltaStore(); DeltasAccess wavelet = store.open(WAVE1_WAVELET1); wavelet.close(); assertFalse(store.getWaveIdIterator().hasNext()); }
ExceptionalIterator<WaveId, PersistenceException> srcItr = sourceStore.getWaveIdIterator(); ImmutableSet<WaveletId> waveletIds = sourceStore.lookup(waveId); if (!targetStore.lookup(waveId).isEmpty()) { LOG.info("Skipping Wave because it's found in target store : " + waveId.toString()); continue; + waveletId.toString()); DeltasAccess sourceDeltas = sourceStore.open(WaveletName.of(waveId, waveletId)); DeltasAccess targetDeltas = targetStore.open(WaveletName.of(waveId, waveletId));
public void testDeleteWaveletRemovesDeltas() throws Exception { Pair<DeltaStore, WaveletDeltaRecord> pair = newDeltaStoreWithRecord(WAVE1_WAVELET1); DeltaStore store = pair.first; store.delete(WAVE1_WAVELET1); DeltasAccess wavelet = store.open(WAVE1_WAVELET1); assertTrue(wavelet.isEmpty()); wavelet.close(); }
public void testWaveIdIteratorDoesNotReturnDeletedWavelets() throws Exception { Pair<DeltaStore, WaveletDeltaRecord> pair = newDeltaStoreWithRecord(WAVE1_WAVELET1); DeltaStore store = pair.first; store.delete(WAVE1_WAVELET1); assertFalse(store.getWaveIdIterator().hasNext()); }
@Override public WaveletAccess open(WaveletName waveletName) throws PersistenceException { return createWaveletAccess(deltaStore.open(waveletName)); }
public void testWaveIdIteratorDoesNotReturnEmptyWavelets() throws Exception { DeltaStore store = newDeltaStore(); DeltasAccess wavelet = store.open(WAVE1_WAVELET1); wavelet.close(); assertFalse(store.getWaveIdIterator().hasNext()); }
public void testDeleteWaveletRemovesDeltas() throws Exception { Pair<DeltaStore, WaveletDeltaRecord> pair = newDeltaStoreWithRecord(WAVE1_WAVELET1); DeltaStore store = pair.first; store.delete(WAVE1_WAVELET1); DeltasAccess wavelet = store.open(WAVE1_WAVELET1); assertTrue(wavelet.isEmpty()); wavelet.close(); }
public void testWaveIdIteratorDoesNotReturnDeletedWavelets() throws Exception { Pair<DeltaStore, WaveletDeltaRecord> pair = newDeltaStoreWithRecord(WAVE1_WAVELET1); DeltaStore store = pair.first; store.delete(WAVE1_WAVELET1); assertFalse(store.getWaveIdIterator().hasNext()); }
@Override protected WaveletState createEmptyState(WaveletName name) throws Exception { return DeltaStoreBasedWaveletState.create(store.open(name), PERSIST_EXECUTOR); }
public void testWaveIdIteratorLimits() throws Exception { Pair<DeltaStore,WaveletDeltaRecord> pair = newDeltaStoreWithRecord(WAVE1_WAVELET1); DeltaStore store = pair.first; DeltasAccess wavelet = store.open(WAVE2_WAVELET1); WaveletDeltaRecord record = createRecord(); wavelet.append(ImmutableList.of(record)); wavelet.close(); ExceptionalIterator<WaveId, PersistenceException> iterator = store.getWaveIdIterator(); assertTrue(iterator.hasNext()); WaveId waveId1 = iterator.next(); assertTrue(iterator.hasNext()); WaveId waveId2 = iterator.next(); // This is necessary because the order of waveIds is implementation specific. if (WAVE1_WAVELET1.waveId.equals(waveId1)) { assertEquals(WAVE2_WAVELET1.waveId, waveId2); } else { assertEquals(WAVE2_WAVELET1.waveId, waveId1); assertEquals(WAVE1_WAVELET1.waveId, waveId2); } assertFalse(iterator.hasNext()); try { waveId1 = iterator.next(); // Fail the test, it should have thrown an exception. fail(); } catch (NoSuchElementException e) { // Test passes. } }
public void testWaveIdIteratorReturnsWaveIds() throws Exception { Pair<DeltaStore,WaveletDeltaRecord> pair = newDeltaStoreWithRecord(WAVE1_WAVELET1); DeltaStore store = pair.first; ImmutableSet<WaveId> waveIds = setFromExceptionalIterator(store.getWaveIdIterator()); assertEquals(ImmutableSet.of(WAVE1_WAVELET1.waveId), waveIds); }
public void testLookupReturnsWavelets() throws Exception { Pair<DeltaStore,WaveletDeltaRecord> pair = newDeltaStoreWithRecord(WAVE1_WAVELET1); DeltaStore store = pair.first; assertEquals(ImmutableSet.of(WAVE1_WAVELET1.waveletId), store.lookup(WAVE1_WAVELET1.waveId)); }