vivekratnavel commented on a change in pull request #988:
URL: https://github.com/apache/hadoop-ozone/pull/988#discussion_r432754315
##########
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:
Moving it to local variable would then require `writeCountsToDB`,
`handlePutKeyEvent` and `handleDeleteKeyEvent` methods to take
`Map<FileSizeCountKey, Long> fileSizeCountMap` as another argument. Currently,
initializing this map in reprocess and process is just enough since both
methods will never be called at the same time.
----------------------------------------------------------------
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]