hemantk-12 commented on code in PR #4692:
URL: https://github.com/apache/ozone/pull/4692#discussion_r1190357639
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RocksDatabase.java:
##########
@@ -73,7 +73,7 @@
* When there is a {@link RocksDBException} with error,
* this class will close the underlying {@link org.rocksdb.RocksObject}s.
*/
-public final class RocksDatabase {
+public final class RocksDatabase implements Closeable {
Review Comment:
It is not advised to override the finalized method to close object. For more
check:
https://softwareengineering.stackexchange.com/questions/288715/is-overriding-object-finalize-really-bad/288724#288724
I added a WARN log statement instead of closing object to catch any memory
leak.
--
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]