smengcl commented on a change in pull request #2389:
URL: https://github.com/apache/ozone/pull/2389#discussion_r667199196
##########
File path:
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/NSSummary.java
##########
@@ -20,51 +20,67 @@
import org.apache.hadoop.ozone.recon.ReconConstants;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
/**
* Class to encapsulate namespace metadata summaries from OM.
*/
public class NSSummary {
private int numOfFiles;
- private int sizeOfFiles;
+ private long sizeOfFiles;
private int[] fileSizeBucket;
+ private List<Long> childDir;
public NSSummary() {
this.numOfFiles = 0;
- this.sizeOfFiles = 0;
+ this.sizeOfFiles = 0L;
this.fileSizeBucket = new int[ReconConstants.NUM_OF_BINS];
+ this.childDir = new ArrayList<>();
}
- public NSSummary(int numOfFiles, int sizeOfFiles, int[] bucket) {
+ public NSSummary(int numOfFiles,
+ long sizeOfFiles,
+ int[] bucket,
+ List<Long> childDir) {
this.numOfFiles = numOfFiles;
this.sizeOfFiles = sizeOfFiles;
setFileSizeBucket(bucket);
+ setChildDir(childDir);
}
public int getNumOfFiles() {
return numOfFiles;
}
- public int getSizeOfFiles() {
+ public long getSizeOfFiles() {
return sizeOfFiles;
}
public int[] getFileSizeBucket() {
return Arrays.copyOf(this.fileSizeBucket, ReconConstants.NUM_OF_BINS);
}
+ public List<Long> getChildDir() {
+ return new ArrayList<>(childDir);
Review comment:
@yuangu002 mentioned a `bugcheck` complaint by just returning the array
ptr itself. As the accessor can inadvertently change its content.
--
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]