adoroszlai commented on code in PR #4366:
URL: https://github.com/apache/ozone/pull/4366#discussion_r1131507542


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java:
##########
@@ -148,6 +148,7 @@ public BackgroundTaskResult call() throws Exception {
                   dbName, true);
           RocksDatabase db = rdbStore.getDb();
           db.deleteFilesNotMatchingPrefix(prefixPairs, filterFunction);
+          rdbStore.close();

Review Comment:
   Use try-with-resources to ensure close happens even in face of exceptions.
   
   ```java
             try (RDBStore rdbStore = (RDBStore) OmMetadataManagerImpl
                 .loadDB(ozoneManager.getConfiguration(), new File(snapshotDir),
                     dbName, true)) {
               RocksDatabase db = rdbStore.getDb();
               db.deleteFilesNotMatchingPrefix(prefixPairs, filterFunction);
             }
   ```



-- 
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]

Reply via email to