Package org.apache.flink.runtime.memory
Class OpaqueMemoryResource<T>
java.lang.Object
org.apache.flink.runtime.memory.OpaqueMemoryResource<T>
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionOpaqueMemoryResource(T resourceHandle, long size, org.apache.flink.util.function.ThrowingRunnable<Exception> disposer) -
Method Summary
-
Constructor Details
-
OpaqueMemoryResource
-
-
Method Details
-
getResourceHandle
Gets the handle to the resource. -
getSize
public long getSize()Gets the size, in bytes. -
close
Releases this resource. This method is idempotent.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
toString
-