OUT
- Type of the asynchronous collection result@Internal public class StreamRecordQueueEntry<OUT> extends StreamElementQueueEntry<Collection<OUT>> implements AsyncCollectionResult<OUT>, ResultFuture<OUT>
StreamElementQueueEntry
implementation for StreamRecord
. This class also acts
as the ResultFuture
implementation which is given to the AsyncFunction
. The
async function completes this class with a collection of results.Constructor and Description |
---|
StreamRecordQueueEntry(StreamRecord<?> streamRecord) |
Modifier and Type | Method and Description |
---|---|
void |
complete(Collection<OUT> result)
Completes the result future with a collection of result objects.
|
void |
completeExceptionally(Throwable error)
Completes the result future exceptionally with an exception.
|
Collection<OUT> |
get()
Return the asynchronous result collection.
|
protected CompletableFuture<Collection<OUT>> |
getFuture() |
long |
getTimestamp() |
boolean |
hasTimestamp() |
asResultCollection, asWatermark, getStreamElement, isDone, isResultCollection, isWatermark, onComplete
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asResultCollection, asWatermark, isResultCollection, isWatermark
public StreamRecordQueueEntry(StreamRecord<?> streamRecord)
public boolean hasTimestamp()
hasTimestamp
in interface AsyncCollectionResult<OUT>
public long getTimestamp()
getTimestamp
in interface AsyncCollectionResult<OUT>
public Collection<OUT> get() throws Exception
AsyncCollectionResult
get
in interface AsyncCollectionResult<OUT>
Exception
- if the asynchronous result collection could not be completedprotected CompletableFuture<Collection<OUT>> getFuture()
getFuture
in class StreamElementQueueEntry<Collection<OUT>>
public void complete(Collection<OUT> result)
ResultFuture
Note that it should be called for exactly one time in the user code. Calling this function for multiple times will cause data lose.
Put all results in a Collection
and then emit output.
complete
in interface ResultFuture<OUT>
result
- A list of results.public void completeExceptionally(Throwable error)
ResultFuture
completeExceptionally
in interface ResultFuture<OUT>
error
- A Throwable object.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.