@Internal public final class OrderedStreamElementQueue<OUT> extends Object implements StreamElementQueue<OUT>
StreamElementQueue implementation. The ordered stream element queue provides
asynchronous results in the order in which the StreamElementQueueEntry have been added
to the queue. Thus, even if the completion order can be arbitrary, the output order strictly
follows the insertion order (element cannot overtake each other).| 构造器和说明 |
|---|
OrderedStreamElementQueue(int capacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
emitCompletedElement(TimestampedCollector<OUT> output)
Emits one completed element from the head of this queue into the given output.
|
boolean |
hasCompletedElements()
Checks if there is at least one completed head element.
|
boolean |
isEmpty()
True if the queue is empty; otherwise false.
|
int |
size()
Return the size of the queue.
|
Optional<ResultFuture<OUT>> |
tryPut(StreamElement streamElement)
Tries to put the given element in the queue.
|
List<StreamElement> |
values()
Returns the collection of
StreamElement currently contained in this queue for checkpointing. |
public boolean hasCompletedElements()
StreamElementQueuehasCompletedElements 在接口中 StreamElementQueue<OUT>public void emitCompletedElement(TimestampedCollector<OUT> output)
StreamElementQueueWill not emit any element if no element has been completed (check StreamElementQueue.hasCompletedElements() before entering
any critical section).
emitCompletedElement 在接口中 StreamElementQueue<OUT>output - the output into which to emitpublic List<StreamElement> values()
StreamElementQueueStreamElement currently contained in this queue for checkpointing.
This includes all non-emitted, completed and non-completed elements.
values 在接口中 StreamElementQueue<OUT>StreamElement.public boolean isEmpty()
StreamElementQueueisEmpty 在接口中 StreamElementQueue<OUT>public int size()
StreamElementQueuesize 在接口中 StreamElementQueue<OUT>public Optional<ResultFuture<OUT>> tryPut(StreamElement streamElement)
StreamElementQueueThis method returns a handle to the inserted element that allows to set the result of the computation.
tryPut 在接口中 StreamElementQueue<OUT>streamElement - the element to be inserted.Optional.empty() otherwise.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.