devmadhuu commented on code in PR #4626:
URL: https://github.com/apache/ozone/pull/4626#discussion_r1232235785
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskDbEventHandler.java:
##########
@@ -82,23 +106,72 @@ protected void writeNSSummariesToDB(Map<Long, NSSummary>
nsSummaryMap)
e);
}
});
- reconNamespaceSummaryManager.commitBatchOperation(rdbBatchOperation);
+ try {
+ reconNamespaceSummaryManager.commitBatchOperation(rdbBatchOperation);
+ } catch (IOException e) {
+ LOG.error("Failed to commit batch operation for writing NSSummary " +
+ "data in Recon DB.", e);
+ throw e;
+ }
+ }
+ }
+
+ protected void writeOrphanKeysMetaDataToDB(
+ Map<Long, OrphanKeyMetaData> orphanKeyMetaDataMap, long status)
+ throws IOException {
+ try (RDBBatchOperation rdbBatchOperation = new RDBBatchOperation()) {
+ for (Map.Entry<Long, OrphanKeyMetaData> entry :
+ orphanKeyMetaDataMap.entrySet()) {
+ try {
+ Long key = entry.getKey();
+ OrphanKeyMetaData orphanKeyMetaData =
+ orphanKeyMetaDataMap.get(key);
+ if (orphanKeyMetaData.getObjectIds().size() > 0) {
+ orphanKeyMetaData.setStatus(status);
+ reconNamespaceSummaryManager.batchStoreOrphanKeyMetaData(
+ rdbBatchOperation, key, orphanKeyMetaData);
+ } else {
+ orphanKeyMetaDataMap.remove(key);
Review Comment:
done.
--
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]