Package org.apache.flink.runtime.memory
Class SharedResources
java.lang.Object
org.apache.flink.runtime.memory.SharedResources
A map that keeps track of acquired shared resources and handles their allocation disposal.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA resource handle with size. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends AutoCloseable>
SharedResources.ResourceAndSize<T>getOrAllocateSharedResource(String type, Object leaseHolder, org.apache.flink.util.function.LongFunctionWithException<T, Exception> initializer, long sizeForInitialization) Gets the shared memory resource for the given owner and registers a lease.voidrelease(String type, Object leaseHolder, LongConsumer releaser) Releases a lease (identified by the lease holder object) for the given type.
-
Constructor Details
-
SharedResources
public SharedResources()
-
-
Method Details
-
release
Releases a lease (identified by the lease holder object) for the given type. If no further leases exist, the resource is disposed.This method takes an additional hook that is called when the resource is disposed.
- Throws:
Exception