Class IdRegistry<T>

java.lang.Object
io.trino.operator.IdRegistry<T>

public final 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 Details

    • IdRegistry

      public IdRegistry()
  • Method Details

    • allocateId

      public T 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.