hemantk-12 commented on code in PR #8085:
URL: https://github.com/apache/ozone/pull/8085#discussion_r2004291078
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServlet.java:
##########
@@ -292,6 +302,33 @@ 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 {
Review Comment:
nit: `getFilesForArchive` is growing larger, and since we can't avoid
calling `getSnapshotDirs()` while keeping the code clean, I suggest moving this
logic to a helper function.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMDBCheckpointServlet.java:
##########
@@ -292,6 +302,33 @@ 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 determine estimated size of transfer to " +
+ "Checkpoint Tarball Stream", e);
Review Comment:
```suggestion
LOG.error("Could not estimate size of transfer to Checkpoint Tarball
Stream.", e);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]