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