Class CollectResultIterator<T>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.collect.CollectResultIterator<T>
-
- All Implemented Interfaces:
AutoCloseable,Iterator<T>,org.apache.flink.util.CloseableIterator<T>
public class CollectResultIterator<T> extends Object implements org.apache.flink.util.CloseableIterator<T>
An iterator which iterates through the results of a query job.The behavior of the iterator is slightly different under different checkpointing mode.
- If the user does not specify any checkpointing, results are immediately delivered but exceptions will be thrown when the job restarts.
- If the user specifies exactly-once checkpointing, results are guaranteed to be exactly-once but they're only visible after the corresponding checkpoint completes.
- If the user specifies at-least-once checkpointing, results are immediately delivered but the same result may be delivered multiple times.
NOTE: After using this iterator, the close method MUST be called in order to release job related resources.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.util.CloseableIterator
org.apache.flink.util.CloseableIterator.IteratorAdapter<E extends Object>
-
-
Constructor Summary
Constructors Constructor Description CollectResultIterator(String operatorUid, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, String accumulatorName, CheckpointConfig checkpointConfig, long resultFetchTimeout)CollectResultIterator(AbstractCollectResultBuffer<T> buffer, String operatorUid, String accumulatorName, int retryMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()CollectResultIterator<T>copy()booleanhasNext()Tnext()voidsetJobClient(org.apache.flink.core.execution.JobClient jobClient)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
CollectResultIterator
public CollectResultIterator(String operatorUid, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, String accumulatorName, CheckpointConfig checkpointConfig, long resultFetchTimeout)
-
CollectResultIterator
@VisibleForTesting public CollectResultIterator(AbstractCollectResultBuffer<T> buffer, String operatorUid, String accumulatorName, int retryMillis)
-
-
Method Detail
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
setJobClient
public void setJobClient(org.apache.flink.core.execution.JobClient jobClient)
-
copy
public CollectResultIterator<T> copy()
-
-