public class DataBlockingQueue<E> extends DataQueue<E>
| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
LOG |
| 构造器和说明 |
|---|
DataBlockingQueue(Object name,
SizeInBytes byteLimit,
int elementLimit,
ToIntFunction<E> getNumBytes) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
int |
getNumBytes() |
int |
getNumElements() |
boolean |
offer(E element)
Adds an element to this queue.
|
boolean |
offer(E element,
TimeDuration timeout)
Adds an element to this queue, waiting up to the given timeout.
|
E |
poll()
Poll out the head element from this queue.
|
E |
poll(TimeDuration timeout)
Poll out the head element from this queue, waiting up to the given timeout.
|
<RESULT,THROWABLE extends Throwable> |
pollList(long timeoutMs,
CheckedFunctionWithTimeout<E,RESULT,THROWABLE> getResult,
TriConsumer<E,TimeDuration,TimeoutException> timeoutHandler)
Poll a list of the results within the given timeout.
|
getByteLimit, getElementLimit, isEmpty, sizepublic DataBlockingQueue(Object name, SizeInBytes byteLimit, int elementLimit, ToIntFunction<E> getNumBytes)
public int getNumBytes()
getNumBytes 在类中 DataQueue<E>public int getNumElements()
getNumElements 在类中 DataQueue<E>public boolean offer(E element, TimeDuration timeout) throws InterruptedException
InterruptedExceptionpublic E poll(TimeDuration timeout) throws InterruptedException
public <RESULT,THROWABLE extends Throwable> List<RESULT> pollList(long timeoutMs, CheckedFunctionWithTimeout<E,RESULT,THROWABLE> getResult, TriConsumer<E,TimeDuration,TimeoutException> timeoutHandler) throws THROWABLE extends Throwable
DataQueueCopyright © 2017–2021 The Apache Software Foundation. All rights reserved.