You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/06/01 06:18:27 UTC

[GitHub] [hadoop-ozone] avijayanhwx commented on a change in pull request #988: HDDS-3681. Recon: Add support to store file size counts in each volum…

avijayanhwx commented on a change in pull request #988:
URL: https://github.com/apache/hadoop-ozone/pull/988#discussion_r433060077



##########
File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/FileSizeCountTask.java
##########
@@ -49,33 +52,28 @@
   private static final Logger LOG =
       LoggerFactory.getLogger(FileSizeCountTask.class);
 
-  private int maxBinSize = -1;
-  private long maxFileSizeUpperBound = 1125899906842624L; // 1 PB
-  private long[] upperBoundCount;
-  private long oneKb = 1024L;
+  // 1125899906842624L = 1PB
+  private static final long MAX_FILE_SIZE_UPPER_BOUND = 1125899906842624L;
   private FileCountBySizeDao fileCountBySizeDao;
+  // Map to store file counts in each <volume,bucket,fileSizeUpperBound>
+  private Map<FileSizeCountKey, Long> fileSizeCountMap;

Review comment:
       IMO, it is OK to have the handleDeleteKeyEvent & handlePutKeyEvent and writeCountsToDB to take the map as a parameter. They are meant to be stateless helper methods that act on the input given to them. In the current implementation, there is an assumption that the task's implementation makes of the higher level caller, which may not be true in the future.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org