/** * Returns the log file names available in the snapshot. * * @param fs {@link FileSystem} * @param snapshotDir {@link Path} to the Snapshot directory * @throws IOException if an error occurred while scanning the directory * @return the names of wals in the specified snaphot */ public static Set<String> getWALNames(final FileSystem fs, final Path snapshotDir) throws IOException { final Set<String> names = new HashSet<String>(); visitLogFiles(fs, snapshotDir, new FSVisitor.LogFileVisitor() { @Override public void logFile (final String server, final String logfile) throws IOException { names.add(logfile); } }); return names; } }
/** * Returns the log file names available in the snapshot. * * @param fs {@link FileSystem} * @param snapshotDir {@link Path} to the Snapshot directory * @throws IOException if an error occurred while scanning the directory * @return the names of hlogs in the specified snaphot */ public static Set<String> getHLogNames(final FileSystem fs, final Path snapshotDir) throws IOException { final Set<String> names = new HashSet<String>(); visitLogFiles(fs, snapshotDir, new FSVisitor.LogFileVisitor() { public void logFile (final String server, final String logfile) throws IOException { names.add(logfile); } }); return names; } }
/** * Iterate over the snapshot store files, restored.edits and logs * * @param conf The current {@link Configuration} instance. * @param fs {@link FileSystem} * @param snapshotDir {@link Path} to the Snapshot directory * @param desc the {@link SnapshotDescription} of the snapshot to verify * @param visitor callback object to get the referenced files * @throws IOException if an error occurred while scanning the directory */ public static void visitReferencedFiles(final Configuration conf, final FileSystem fs, final Path snapshotDir, final SnapshotDescription desc, final SnapshotVisitor visitor) throws IOException { visitTableStoreFiles(conf, fs, snapshotDir, desc, visitor); visitLogFiles(fs, snapshotDir, visitor); }
/** * Iterate over the snapshot store files, restored.edits and logs * * @param fs {@link FileSystem} * @param snapshotDir {@link Path} to the Snapshot directory * @param visitor callback object to get the referenced files * @throws IOException if an error occurred while scanning the directory */ public static void visitReferencedFiles(final FileSystem fs, final Path snapshotDir, final FileVisitor visitor) throws IOException { visitTableStoreFiles(fs, snapshotDir, visitor); visitRecoveredEdits(fs, snapshotDir, visitor); visitLogFiles(fs, snapshotDir, visitor); }
SnapshotReferenceUtil.visitLogFiles(fs, snapshotDir, new FSVisitor.LogFileVisitor() { public void logFile (final String server, final String logfile) throws IOException { logSplitter.splitLog(server, logfile);