Package org.apache.flink.runtime.memory
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 Summary
Constructors Constructor Description OpaqueMemoryResource(T resourceHandle, long size, org.apache.flink.util.function.ThrowingRunnable<Exception> disposer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Releases this resource.TgetResourceHandle()Gets the handle to the resource.longgetSize()Gets the size, in bytes.StringtoString()
-
-
-
Method Detail
-
getResourceHandle
public T getResourceHandle()
Gets the handle to the resource.
-
getSize
public long getSize()
Gets the size, in bytes.
-
close
public void close() throws ExceptionReleases this resource. This method is idempotent.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-