Search in sources :

Example 1 with SnapshotFilter

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());
    }
}
Also used : Snapshot(org.voltdb.sysprocs.saverestore.SnapshotUtil.Snapshot) HashMap(java.util.HashMap) SpecificSnapshotFilter(org.voltdb.sysprocs.saverestore.SnapshotUtil.SpecificSnapshotFilter) FileFilter(java.io.FileFilter) SnapshotFilter(org.voltdb.sysprocs.saverestore.SnapshotUtil.SnapshotFilter) SpecificSnapshotFilter(org.voltdb.sysprocs.saverestore.SnapshotUtil.SpecificSnapshotFilter) File(java.io.File)

Aggregations

File (java.io.File)1 FileFilter (java.io.FileFilter)1 HashMap (java.util.HashMap)1 Snapshot (org.voltdb.sysprocs.saverestore.SnapshotUtil.Snapshot)1 SnapshotFilter (org.voltdb.sysprocs.saverestore.SnapshotUtil.SnapshotFilter)1 SpecificSnapshotFilter (org.voltdb.sysprocs.saverestore.SnapshotUtil.SpecificSnapshotFilter)1