Class SafeMemory

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

public class SafeMemory extends Memory implements SharedCloseable
  • Constructor Details

    • SafeMemory

      public SafeMemory(long size)
  • Method Details

    • sharedCopy

      public SafeMemory sharedCopy()
      Specified by:
      sharedCopy in interface SharedCloseable
      Returns:
      a new instance of the object representing the same state and backed by the same underlying resources. Coordinates with the original (and other instances) when the underlying resource should be closed. Throws an exception if the shared resource has already been closed.
    • free

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

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

      public Throwable close(Throwable accumulate)
      Specified by:
      close in interface SharedCloseable
    • copy

      public SafeMemory copy(long newSize)
      Overrides:
      copy in class Memory
    • checkBounds

      @Inline protected void checkBounds(long start, long end)
      Overrides:
      checkBounds in class Memory
    • addTo

      public void addTo(Ref.IdentityCollection identities)
      Specified by:
      addTo in interface SharedCloseable