Class OpaqueMemoryResource<T>

java.lang.Object
org.apache.flink.runtime.memory.OpaqueMemoryResource<T>
All Implemented Interfaces:
AutoCloseable

public final class OpaqueMemoryResource<T> extends Object implements AutoCloseable
An opaque memory resource, meaning a memory resource not understood by Flink or the JVM. An example for this is a native resource, like RocksDB's block cache memory pool.

The resource must be closed after it is not used any more.

  • Constructor Details

    • OpaqueMemoryResource

      public OpaqueMemoryResource(T resourceHandle, long size, org.apache.flink.util.function.ThrowingRunnable<Exception> disposer)
  • Method Details

    • getResourceHandle

      public T getResourceHandle()
      Gets the handle to the resource.
    • getSize

      public long getSize()
      Gets the size, in bytes.
    • close

      public void close() throws Exception
      Releases this resource. This method is idempotent.
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object