Class BasicObjectsPool<T>

java.lang.Object
com.clickhouse.client.api.internal.BasicObjectsPool<T>
Type Parameters:
T - - type of stored objects

public abstract class BasicObjectsPool<T> extends Object
Objects pool. Can be used to reuse object to reduce GC pressure. Thread-safety is not guaranteed. Depends on deque implementation that is passed to the constructor.
  • Constructor Details

    • BasicObjectsPool

      public BasicObjectsPool(Deque<T> objects, int size)
      Creates a pool and pre-populates it with a number of objects equal to the size parameter.
      Parameters:
      objects - object queue
      size - initial size of the object queue
  • Method Details

    • lease

      public T lease()
    • release

      public void release(T obj)
    • create

      protected abstract T create()