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> -
Field Summary
Fields inherited from interface org.apache.flink.util.CloseableIterator
EMPTY_INSTANCE -
Constructor Summary
ConstructorsConstructorDescriptionCollectResultIterator(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
Modifier and TypeMethodDescriptionvoidclose()copy()booleanhasNext()next()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, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
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 Details