ivandika3 commented on code in PR #4696:
URL: https://github.com/apache/ozone/pull/4696#discussion_r1192908986
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperTask.java:
##########
@@ -120,14 +145,42 @@ public Pair<String, Boolean> reprocess(OMMetadataManager
omMetadataManager) {
return new ImmutablePair<>(getTaskName(), false);
}
try {
- writeToTheDB(containerKeyMap, containerKeyCountMap, deletedKeyCountList);
+ // only batch write containerKeyCountMap to the containerKeyCountTable
+ // containerKeyMap has been written to the DB
+ // deleted container list is not needed since "reprocess" only has
+ // put operations
+ writeToTheDB(Collections.emptyMap(), containerKeyCountMap,
+ Collections.emptyList());
} catch (IOException e) {
LOG.error("Unable to write Container Key Prefix data in Recon DB.", e);
return new ImmutablePair<>(getTaskName(), false);
}
return new ImmutablePair<>(getTaskName(), true);
}
+ private boolean flushAndCommitContainerKeyMapToDB(
+ Map<ContainerKeyPrefix, Integer> containerKeyMap) {
+ try {
+ writeToTheDB(containerKeyMap, Collections.emptyMap(),
Review Comment:
Thank you for the suggestion. I have included `containerKeyCountMap` into
the flush, and removing the last `writeToDB` in the 'reprocess' function. I
have also moved the flush function to an outer scope to prevent inaccurate
container key info when there are multiple bucket layouts.
--
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]