adoroszlai commented on code in PR #7368:
URL: https://github.com/apache/ozone/pull/7368#discussion_r1841728815
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/TestFSORepairTool.java:
##########
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.hadoop.fs.ozone;
+package org.apache.hadoop.ozone.repair;
Review Comment:
Should be `org.apache.hadoop.ozone.repair.om` to match `FSORepairTool` and
avoid the need for `@VisibleForTesting`.
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/repair/TestFSORepairTool.java:
##########
@@ -496,10 +497,10 @@ private FSORepairTool.Report buildConnectedTree(String
volume, String bucket, in
assertConnectedTreeReadable(volume, bucket);
+ FSORepairTool.ReportStatistics reachableCount =
+ new FSORepairTool.ReportStatistics(3, 4, fileSize * 4L);
return new org.apache.hadoop.ozone.repair.om.FSORepairTool.Report.Builder()
Review Comment:
nit: package name not necessary.
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/FSORepairTool.java:
##########
@@ -620,77 +605,37 @@ private void createReachableTable() throws IOException {
* Define a Report to be created.
*/
public static class Report {
- private long reachableBytes;
- private long reachableFiles;
- private long reachableDirs;
- private long unreachableBytes;
- private long unreachableFiles;
- private long unreachableDirs;
+ private final ReportStatistics reachable;
+ private final ReportStatistics unreachable;
/**
* Builds one report that is the aggregate of multiple others.
*/
public Report(org.apache.hadoop.ozone.repair.om.FSORepairTool.Report...
reports) {
Review Comment:
nit: please remove package name (few other places, too)
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/FSORepairTool.java:
##########
@@ -418,8 +404,7 @@ private void handleUnreachableObjects(OmVolumeArgs volume,
OmBucketInfo bucket)
// NOTE: We are deserializing the proto of every reachable file
// just to log it's size. If we don't need this information we could
// save time by skipping this step.
- reachableBytes += fileInfo.getDataSize();
- reachableFiles++;
+ reachableStats.add(new ReportStatistics(0, 1,
fileInfo.getDataSize()));
Review Comment:
Let's avoid object churn by introducing with dir- and file-specific methods
in `ReportStatistics`:
```java
public void addDir() {
dirs++;
}
public void addFile(long size) {
files++;
bytes += size;
}
```
--
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]