@Internal public class CachedBufferBlocker extends Object implements BufferBlocker
This buffer blocked can be used in credit-based flow control for better barrier alignment in exactly-once mode.
| Modifier and Type | Class and Description |
|---|---|
static class |
CachedBufferBlocker.CachedBufferOrEventSequence
This class represents a sequence of cached buffers and events, created by the
CachedBufferBlocker. |
| Constructor and Description |
|---|
CachedBufferBlocker(int pageSize)
Creates a new buffer blocker, caching the buffers or events in memory queue.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent boe)
Adds a buffer or event to the blocker.
|
void |
close()
Cleans up all the resources in the current sequence.
|
long |
getBytesBlocked()
Gets the number of bytes blocked in the current sequence.
|
BufferOrEventSequence |
rollOverReusingResources()
It is never reusing resources and is defaulting to
rollOverWithoutReusingResources(). |
BufferOrEventSequence |
rollOverWithoutReusingResources()
Starts a new sequence of buffers and event without reusing the same resources and
returns the current sequence of buffers for reading.
|
public CachedBufferBlocker(int pageSize)
pageSize - The page size used to estimate the cached size.public void add(org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent boe)
BufferBlockeradd in interface BufferBlockerboe - The buffer or event to be added into the blocker.public BufferOrEventSequence rollOverReusingResources()
rollOverWithoutReusingResources().rollOverReusingResources in interface BufferBlockerpublic BufferOrEventSequence rollOverWithoutReusingResources()
BufferBlockerrollOverWithoutReusingResources in interface BufferBlockerpublic void close()
BufferBlockerclose in interface BufferBlockerpublic long getBytesBlocked()
BufferBlockergetBytesBlocked in interface BufferBlockerCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.