duongkame commented on code in PR #5853:
URL: https://github.com/apache/ozone/pull/5853#discussion_r1435355964
##########
hadoop-hdds/managed-rocksdb/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedRocksObjectUtils.java:
##########
@@ -41,27 +42,24 @@ private ManagedRocksObjectUtils() {
public static final Logger LOG =
LoggerFactory.getLogger(ManagedRocksObjectUtils.class);
+
private static final Duration POLL_DELAY_DURATION = Duration.ZERO;
private static final Duration POLL_INTERVAL_DURATION =
Duration.ofMillis(100);
- public static void assertClosed(ManagedObject<?> object) {
- assertClosed(object.get(), object.getStackTrace());
- }
- static void assertClosed(RocksObject rocksObject, String stackTrace) {
+ private static final LeakDetector LEAK_DETECTOR = new
LeakDetector("ManagedRocksObject");
+
+ static LeakTracker track(AutoCloseable object, @Nullable StackTraceElement[]
stackTrace) {
Review Comment:
There's also `RocksMutableObject` and other custom object in the same
package to be tracked here. `AutoCloseable ` is the most convenient here. Btw,
it's package private and only used for managed object in this package.
--
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]