GeorgeJahad commented on code in PR #4567:
URL: https://github.com/apache/ozone/pull/4567#discussion_r1234553698
##########
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:
Couldn't the snapshotManager just be added as a parameter to the
OMSnapshotMoveDeletedKeysResponse constructor, similiar to how it is done for
the secretManager here:
https://github.com/apache/ozone/blob/016a433a06506714dcfea5ccb806f758770135e1/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/s3/security/OMSetSecretResponse.java#L51-L60
--
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]