Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -300,34 +300,14 @@ private boolean getFilesForArchive(DBCheckpoint checkpoint,
}

AtomicLong copySize = new AtomicLong(0L);
// Get the active fs files.
Path dir = checkpoint.getCheckpointLocation();

// Log estimated total data transferred on first request.
if (sstFilesToExclude.isEmpty()) {
try {
Counters.PathCounters counters = Counters.longPathCounters();
CountingPathVisitor visitor = new CountingPathVisitor(
counters, SST_FILE_FILTER, TRUE);
Files.walkFileTree(dir, visitor);
int totalSnapshots = 0;
if (includeSnapshotData) {
Set<Path> snapshotPaths = getSnapshotDirs(checkpoint, false);
totalSnapshots = snapshotPaths.size();
for (Path snapshotDir: snapshotPaths) {
Files.walkFileTree(snapshotDir, visitor);
}
}
LOG.info("Estimates for Checkpoint Tarball Stream - " +
"Data size: {} KB, " + "SST files: {}{}",
counters.getByteCounter().get() / (1024),
counters.getFileCounter().get(),
(includeSnapshotData ? ", snapshots: " + totalSnapshots : ""));
} catch (Exception e) {
LOG.error("Could not estimate size of transfer to Checkpoint Tarball Stream.", e);
}
logTotals(checkpoint, includeSnapshotData);
}

// Get the active fs files.
Path dir = checkpoint.getCheckpointLocation();
if (!processDir(dir, copyFiles, hardLinkFiles, sstFilesToExclude,
new HashSet<>(), excluded, copySize, null)) {
return false;
Expand Down Expand Up @@ -358,6 +338,30 @@ private boolean getFilesForArchive(DBCheckpoint checkpoint,
compactionLogDir.getOriginalDir().toPath());
}

private void logTotals(
DBCheckpoint checkpoint, boolean includeSnapshotData) {
try {
Counters.PathCounters counters = Counters.longPathCounters();
CountingPathVisitor visitor = new CountingPathVisitor(
counters, SST_FILE_FILTER, TRUE);
Files.walkFileTree(checkpoint.getCheckpointLocation(), visitor);
int totalSnapshots = 0;
if (includeSnapshotData) {
Set<Path> snapshotPaths = getSnapshotDirs(checkpoint, false);
totalSnapshots = snapshotPaths.size();
for (Path snapshotDir: snapshotPaths) {
Files.walkFileTree(snapshotDir, visitor);
}
}
LOG.info("Estimates for Checkpoint Tarball Stream - Data size: {} KB, " + "SST files: {}{}",
counters.getByteCounter().get() / (1024),
counters.getFileCounter().get(),
(includeSnapshotData ? ", snapshots: " + totalSnapshots : ""));
} catch (Exception e) {
LOG.error("Could not estimate size of transfer to Checkpoint Tarball Stream.", e);
}
}

/**
* The snapshotInfo table may contain a snapshot that
* doesn't yet exist on the fs, so wait a few seconds for it.
Expand Down