public class DataQueue<E> extends Object implements Iterable<E>
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
DataQueue(Object name,
SizeInBytes byteLimit,
int elementLimit,
ToLongFunction<E> getNumBytes) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
The same as
Collection.clear(). |
long |
getByteLimit() |
int |
getElementLimit() |
long |
getNumBytes() |
int |
getNumElements() |
boolean |
isEmpty()
The same as
Collection.isEmpty(). |
Iterator<E> |
iterator() |
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.
|
boolean |
remove(E e)
The same as
Collection.remove(Object). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic DataQueue(Object name, SizeInBytes byteLimit, int elementLimit, ToLongFunction<E> getNumBytes)
public int getElementLimit()
public long getByteLimit()
public long getNumBytes()
public int getNumElements()
public final boolean isEmpty()
Collection.isEmpty().public void clear()
Collection.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 boolean remove(E e)
Collection.remove(Object).Copyright © 2017–2022 The Apache Software Foundation. All rights reserved.