public class DataQueue<E> extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
LOG |
| 构造器和说明 |
|---|
DataQueue(Object name,
SizeInBytes byteLimit,
int elementLimit,
ToIntFunction<E> getNumBytes) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
int |
getByteLimit() |
int |
getElementLimit() |
int |
getNumBytes() |
int |
getNumElements() |
boolean |
isEmpty() |
boolean |
offer(E element)
Adds an element to this queue.
|
E |
poll()
Poll out the head element from this queue.
|
<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.
|
int |
size() |
public DataQueue(Object name, SizeInBytes byteLimit, int elementLimit, ToIntFunction<E> getNumBytes)
public int getElementLimit()
public int getByteLimit()
public int getNumBytes()
public int getNumElements()
public final boolean isEmpty()
public void clear()
public boolean offer(E element)
public <RESULT,THROWABLE extends Throwable> List<RESULT> pollList(long timeoutMs, CheckedFunctionWithTimeout<E,RESULT,THROWABLE> getResult, TriConsumer<E,TimeDuration,TimeoutException> timeoutHandler) throws THROWABLE extends Throwable
THROWABLE extends Throwablepublic E poll()
public int size()
Copyright © 2017–2021 The Apache Software Foundation. All rights reserved.