Class DummyBlockingPool<T>

java.lang.Object
org.apache.druid.collections.DummyBlockingPool<T>
All Implemented Interfaces:
BlockingPool<T>

public final class DummyBlockingPool<T> extends Object implements BlockingPool<T>
BlockingPool with 0 maxSize, all take*() methods immediately throw UnsupportedOperationException.
  • Method Details

    • instance

      public static <T> BlockingPool<T> instance()
    • maxSize

      public int maxSize()
      Specified by:
      maxSize in interface BlockingPool<T>
    • takeBatch

      public List<ReferenceCountingResourceHolder<T>> takeBatch(int elementNum, long timeoutMs)
      Description copied from interface: BlockingPool
      Take resources from the pool, waiting up to the specified wait time if necessary for elements of the given number to become available.
      Specified by:
      takeBatch in interface BlockingPool<T>
      Parameters:
      elementNum - number of resources to take
      timeoutMs - maximum time to wait for resources, in milliseconds.
      Returns:
      a list of resource holders. An empty list is returned if elementNum resources aren't available.
    • takeBatch

      public List<ReferenceCountingResourceHolder<T>> takeBatch(int elementNum)
      Description copied from interface: BlockingPool
      Take resources from the pool, waiting if necessary until the elements of the given number become available.
      Specified by:
      takeBatch in interface BlockingPool<T>
      Parameters:
      elementNum - number of resources to take
      Returns:
      a list of resource holders. An empty list is returned if elementNum resources aren't available.
    • getPendingRequests

      public long getPendingRequests()
      Description copied from interface: BlockingPool
      Returns the count of the requests waiting to acquire a batch of resources.
      Specified by:
      getPendingRequests in interface BlockingPool<T>
      Returns:
      count of pending requests
    • getUsedResourcesCount

      public long getUsedResourcesCount()
      Specified by:
      getUsedResourcesCount in interface BlockingPool<T>
      Returns:
      number of used buffers from the pool