Class StreamRecordQueueEntry<OUT>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.async.queue.StreamRecordQueueEntry<OUT>
-
- Type Parameters:
OUT- Type of the asynchronous collection result.
- All Implemented Interfaces:
ResultFuture<OUT>,StreamElementQueueEntry<OUT>
@Internal public class StreamRecordQueueEntry<OUT> extends Object implements StreamElementQueueEntry<OUT>
StreamElementQueueEntryimplementation forStreamRecord. This class also acts as theResultFutureimplementation which is given to theAsyncFunction. The async function completes this class with a collection of results.
-
-
Constructor Summary
Constructors Constructor Description StreamRecordQueueEntry(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?> inputRecord)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete(Collection<OUT> result)Completes the result future with a collection of result objects.voidemitResult(org.apache.flink.streaming.api.operators.TimestampedCollector<OUT> output)Emits the results associated with this queue entry.org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?>getInputElement()The input element for this queue entry, for which the calculation is performed asynchronously.booleanisDone()True if the stream element queue entry has been completed; otherwise false.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.streaming.api.operators.async.queue.StreamElementQueueEntry
complete, completeExceptionally
-
-
-
-
Method Detail
-
isDone
public boolean isDone()
Description copied from interface:StreamElementQueueEntryTrue if the stream element queue entry has been completed; otherwise false.- Specified by:
isDonein interfaceStreamElementQueueEntry<OUT>- Returns:
- True if the stream element queue entry has been completed; otherwise false.
-
getInputElement
@Nonnull public org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?> getInputElement()
Description copied from interface:StreamElementQueueEntryThe input element for this queue entry, for which the calculation is performed asynchronously.- Specified by:
getInputElementin interfaceStreamElementQueueEntry<OUT>- Returns:
- the input element.
-
emitResult
public void emitResult(org.apache.flink.streaming.api.operators.TimestampedCollector<OUT> output)
Description copied from interface:StreamElementQueueEntryEmits the results associated with this queue entry.- Specified by:
emitResultin interfaceStreamElementQueueEntry<OUT>- Parameters:
output- the output into which to emit.
-
complete
public void complete(Collection<OUT> result)
Description copied from interface:ResultFutureCompletes the result future with a collection of result objects.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
Collectionand then emit output.- Specified by:
completein interfaceResultFuture<OUT>- Parameters:
result- A list of results.
-
-