use of org.voltdb.sysprocs.saverestore.SnapshotUtil.SnapshotFilter in project voltdb by VoltDB.
the class SnapshotVerifier method verifySnapshots.
/**
* Perform snapshot verification.
* @param directories list of directories to search for snapshots
* @param snapshotNames set of snapshot names/nonces to verify
*/
public static void verifySnapshots(final List<String> directories, final Set<String> snapshotNames, boolean expectHashinator) {
FileFilter filter = new SnapshotFilter();
if (!snapshotNames.isEmpty()) {
filter = new SpecificSnapshotFilter(snapshotNames);
}
Map<String, Snapshot> snapshots = new HashMap<String, Snapshot>();
for (String directory : directories) {
SnapshotUtil.retrieveSnapshotFiles(new File(directory), snapshots, filter, true, SnapshotPathType.SNAP_PATH, CONSOLE_LOG);
}
if (snapshots.isEmpty()) {
System.out.println("Snapshot corrupted");
System.out.println("No files found");
}
for (Snapshot s : snapshots.values()) {
System.out.println(SnapshotUtil.generateSnapshotReport(s.getTxnId(), s, expectHashinator).getSecond());
}
}
Aggregations