Package org.apache.druid.collections
Class DummyBlockingPool
java.lang.Object
org.apache.druid.collections.DummyBlockingPool
- All Implemented Interfaces:
BlockingPool<Object>
BlockingPool with 0 maxSize, all
takeBatch methods immediately throw UnsupportedOperationException.-
Method Summary
Modifier and TypeMethodDescriptionlongReturns the count of the requests waiting to acquire a batch of resources.longstatic <T> BlockingPool<T>instance()intmaxSize()takeBatch(int elementNum) Take resources from the pool, waiting if necessary until the elements of the given number become available.takeBatch(int elementNum, long timeoutMs) Take resources from the pool, waiting up to the specified wait time if necessary for elements of the given number to become available.
-
Method Details
-
instance
-
maxSize
public int maxSize()- Specified by:
maxSizein interfaceBlockingPool<Object>
-
takeBatch
Description copied from interface:BlockingPoolTake resources from the pool, waiting up to the specified wait time if necessary for elements of the given number to become available.- Specified by:
takeBatchin interfaceBlockingPool<Object>- Parameters:
elementNum- number of resources to taketimeoutMs- maximum time to wait for resources, in milliseconds.- Returns:
- a list of resource holders. An empty list is returned if
elementNumresources aren't available.
-
takeBatch
Description copied from interface:BlockingPoolTake resources from the pool, waiting if necessary until the elements of the given number become available.- Specified by:
takeBatchin interfaceBlockingPool<Object>- Parameters:
elementNum- number of resources to take- Returns:
- a list of resource holders. An empty list is returned if
elementNumresources aren't available.
-
getPendingRequests
public long getPendingRequests()Description copied from interface:BlockingPoolReturns the count of the requests waiting to acquire a batch of resources.- Specified by:
getPendingRequestsin interfaceBlockingPool<Object>- Returns:
- count of pending requests
-
getUsedResourcesCount
public long getUsedResourcesCount()- Specified by:
getUsedResourcesCountin interfaceBlockingPool<Object>- Returns:
- number of used buffers from the pool
-