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

public class ReferenceCountedDB extends DBHandle
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 Details

  • Method Details

    • getReferenceCount

      public long getReferenceCount()
    • incrementReference

      public void incrementReference()
    • decrementReference

      public void decrementReference()
    • cleanup

      public boolean cleanup()
      Overrides:
      cleanup in class DBHandle
    • 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.