@Test public void shouldReturnSnapshotsInDescendingTimestampOrder() throws InterruptedException, StorageException, IOException { int numSnapshots = 20; createSnapshots(numSnapshots); List<SnapshotMetadata> snapshots = snapshotsStore.getAllSnapshotsFromLatestToOldest(); assertThat(snapshots, hasSize(numSnapshots)); checkSnapshotsExistOnFilesystem(snapshots); long prevTimestamp = Long.MAX_VALUE; for (SnapshotMetadata metadata : snapshots) { assertThat(prevTimestamp, greaterThan(metadata.getTimestamp())); prevTimestamp = metadata.getTimestamp(); } }
public List<SnapshotMetadata> getAllSnapshotsFromLatestToOldest() throws StorageException { checkInitialized(); return getMatchingOrderedSnapshots(MATCH_EVERYTHING_PREDICATE); }
OnDiskSnapshotsStore implements SnapshotsStore { public List<SnapshotMetadata> getAllSnapshotsFromLatestToOldest() throws StorageException { checkInitialized(); return getMatchingOrderedSnapshots(MATCH_EVERYTHING_PREDICATE); } }
OnDiskSnapshotsStore implements SnapshotsStore { public List<SnapshotMetadata> getAllSnapshotsFromLatestToOldest() throws StorageException { checkInitialized(); return getMatchingOrderedSnapshots(MATCH_EVERYTHING_PREDICATE); } OnDiskSnapshotsStore(DBI dbi, String snapshotsDirectory); }
OnDiskSnapshotsStore implements SnapshotsStore { public List<SnapshotMetadata> getAllSnapshotsFromLatestToOldest() throws StorageException { checkInitialized(); return getMatchingOrderedSnapshots(MATCH_EVERYTHING_PREDICATE); } OnDiskSnapshotsStore(DBI dbi, String snapshotsDirectory); void initialize(); void teardown(); @Override ExtendedSnapshotWriter newSnapshotWriter(); @SuppressWarnings("ConstantConditions") @Override void storeSnapshot(ExtendedSnapshotWriter snapshotWriter); @Override @Nullable ExtendedSnapshot getLatestSnapshot(); List<SnapshotMetadata> getAllSnapshotsFromLatestToOldest(); void pruneSnapshots(final int numSnapshotsToKeep); void reconcileSnapshots(); }
OnDiskSnapshotsStore implements SnapshotsStore { public List<SnapshotMetadata> getAllSnapshotsFromLatestToOldest() throws StorageException { checkInitialized(); return getMatchingOrderedSnapshots(MATCH_EVERYTHING_PREDICATE); } OnDiskSnapshotsStore(DBI dbi, String snapshotsDirectory); void initialize(); void teardown(); @Override ExtendedSnapshotWriter newSnapshotWriter(); @SuppressWarnings("ConstantConditions") @Override void storeSnapshot(ExtendedSnapshotWriter snapshotWriter); @Override @Nullable ExtendedSnapshot getLatestSnapshot(); List<SnapshotMetadata> getAllSnapshotsFromLatestToOldest(); void pruneSnapshots(final int numSnapshotsToKeep); void reconcileSnapshots();  }