Package io.trino.operator
Class IdRegistry<T>
java.lang.Object
io.trino.operator.IdRegistry<T>
Object registration system that allows looking up objects via stable IDs.
This class may recycle deallocated IDs for new allocations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocateId(IntFunction<T> factory) Provides a new ID referencing the provided object.voiddeallocate(int id) get(int id) longsizeOf()Does not include the sizes of the referenced objects themselves.
-
Constructor Details
-
IdRegistry
public IdRegistry()
-
-
Method Details
-
allocateId
Provides a new ID referencing the provided object.- Returns:
- ID referencing the provided object
-
deallocate
public void deallocate(int id) -
get
-
sizeOf
public long sizeOf()Does not include the sizes of the referenced objects themselves.
-