Class ReferenceCountedDB
java.lang.Object
org.apache.hadoop.ozone.container.common.interfaces.DBHandle
org.apache.hadoop.ozone.container.common.utils.ReferenceCountedDB
- All Implemented Interfaces:
AutoCloseable,org.apache.ratis.util.UncheckedAutoCloseable
Class to implement reference counting over instances handed by Container
Cache.
Enable DEBUG log below will enable us quickly locate the leaked reference
from caller stack. When JDK9 StackWalker is available, we can switch to
StackWalker instead of new Exception().printStackTrace().
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.hadoop.ozone.container.common.interfaces.DBHandle
getContainerDBPath, getStore
-
Constructor Details
-
ReferenceCountedDB
-
-
Method Details
-
getReferenceCount
public long getReferenceCount() -
incrementReference
public void incrementReference() -
decrementReference
public void decrementReference() -
cleanup
public boolean cleanup() -
close
public void close() -
isClosed
public boolean isClosed()Returns if the underlying DB is closed. This call is threadsafe.- Returns:
- true if the DB is closed.
-