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(TypeSerializer<T> serializer)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
complete()
void
dealWithResponse(CollectCoordinationResponse response, long responseOffset)
long
getOffset()
String
getVersion()
protected abstract void
maintainVisibility(long currentVisiblePos, long lastCheckpointedOffset)
protected void
makeResultsVisible(long visiblePos)
T
next()
Get next user visible result, returns null if currently there is no more.protected void
reset()
Clear the whole buffer and discard all results.protected void
revert(long checkpointedOffset)
Revert the buffer back to the result whose offset is `checkpointedOffset`.protected abstract void
sinkRestarted(long lastCheckpointedOffset)
-
-
-
Constructor Detail
-
AbstractCollectResultBuffer
public AbstractCollectResultBuffer(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.
-
-