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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to