Class AbstractCollectResultBuffer<T>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.collect.AbstractCollectResultBuffer<T>
-
- Direct Known Subclasses:
CheckpointedCollectResultBuffer,UncheckpointedCollectResultBuffer
public abstract class AbstractCollectResultBuffer<T> extends Object
A buffer which encapsulates the logic of dealing with the response from theCollectSinkFunction.
-
-
Constructor Summary
Constructors Constructor Description AbstractCollectResultBuffer(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcomplete()voiddealWithResponse(CollectCoordinationResponse response, long responseOffset)longgetOffset()StringgetVersion()protected abstract voidmaintainVisibility(long currentVisiblePos, long lastCheckpointedOffset)protected voidmakeResultsVisible(long visiblePos)Tnext()Get next user visible result, returns null if currently there is no more.protected voidreset()Clear the whole buffer and discard all results.protected voidrevert(long checkpointedOffset)Revert the buffer back to the result whose offset is `checkpointedOffset`.protected abstract voidsinkRestarted(long lastCheckpointedOffset)
-
-
-
Constructor Detail
-
AbstractCollectResultBuffer
public AbstractCollectResultBuffer(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
-
-
Method Detail
-
next
public T next()
Get next user visible result, returns null if currently there is no more.
-
getOffset
public long getOffset()
-
getVersion
public String getVersion()
-
dealWithResponse
public void dealWithResponse(CollectCoordinationResponse response, long responseOffset) throws IOException
- Throws:
IOException
-
complete
public void complete()
-
sinkRestarted
protected abstract void sinkRestarted(long lastCheckpointedOffset)
-
maintainVisibility
protected abstract void maintainVisibility(long currentVisiblePos, long lastCheckpointedOffset)
-
makeResultsVisible
protected void makeResultsVisible(long visiblePos)
-
revert
protected void revert(long checkpointedOffset)
Revert the buffer back to the result whose offset is `checkpointedOffset`.
-
reset
protected void reset()
Clear the whole buffer and discard all results.
-
-