smengcl commented on code in PR #4567:
URL: https://github.com/apache/ozone/pull/4567#discussion_r1239108575
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/snapshot/OMSnapshotMoveDeletedKeysResponse.java:
##########
@@ -78,42 +86,74 @@ public OMSnapshotMoveDeletedKeysResponse(@Nonnull
OMResponse omResponse) {
protected void addToDBBatch(OMMetadataManager omMetadataManager,
BatchOperation batchOperation) throws IOException {
- if (nextSnapshot != null) {
- RDBStore nextSnapshotStore =
- (RDBStore) nextSnapshot.getMetadataManager().getStore();
- // Init Batch Operation for snapshot db.
- try (BatchOperation writeBatch = nextSnapshotStore.initBatchOperation())
{
- processKeys(writeBatch, nextSnapshot.getMetadataManager());
- processDirs(writeBatch, nextSnapshot.getMetadataManager());
- nextSnapshotStore.commitBatchOperation(writeBatch);
- nextSnapshotStore.getDb().flushWal(true);
- nextSnapshotStore.getDb().flush();
+ // Note: a trick to get
+ // To do this properly, refactor OzoneManagerDoubleBuffer#addToBatch and
+ // add OmSnapshotManager as a parameter.
Review Comment:
If I hadn't changed `OmMetadataManagerImpl` constructor I might have taken
this "lazy" approach. IMO that doesn't seem to be a memory-efficient way to
pass along something that could be retrieved from the active OM. It is
occupying at least 8 bytes (64-bit pointer plus any JVM overhead) for each such
request that are not flushed in the double buffer.
--
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]