Class RefCountedMemory

java.lang.Object
org.apache.cassandra.io.util.Memory
org.apache.cassandra.cache.RefCountedMemory
All Implemented Interfaces:
AutoCloseable, ReadableMemory

public class RefCountedMemory extends Memory implements AutoCloseable
  • Constructor Details

    • RefCountedMemory

      public RefCountedMemory(long size)
  • Method Details

    • reference

      public boolean reference()
      Returns:
      true if we succeed in referencing before the reference count reaches zero. (A FreeableMemory object is created with a reference count of one.)
    • unreference

      public void unreference()
      decrement reference count. if count reaches zero, the object is freed.
    • copy

      public RefCountedMemory copy(long newSize)
      Overrides:
      copy in class Memory
    • free

      public void free()
      Overrides:
      free in class Memory
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class Memory