public class LinkedBufferStorage extends Object implements BufferStorage
BufferStorage that links two BufferStorage together.
Each of the linked BufferStorage will store buffers independently, but they will be
linked together for rollOver() - if one is rolled over, other will do that as well.
Note that only mainStorage is closed when LinkedBufferStorage instance is closed.
| Constructor and Description |
|---|
LinkedBufferStorage(BufferStorage mainStorage,
BufferStorage linkedStorage,
long maxBufferedBytes) |
| 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
BufferStorage. |
void |
close()
Cleans up all the resources in the current sequence.
|
long |
getMaxBufferedBytes() |
long |
getPendingBytes() |
long |
getRolledBytes() |
boolean |
isEmpty() |
boolean |
isFull() |
Optional<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent> |
pollNext() |
void |
rollOver()
Start returning next sequence of stored
BufferOrEvents. |
public LinkedBufferStorage(BufferStorage mainStorage, BufferStorage linkedStorage, long maxBufferedBytes)
public void add(org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent boe)
BufferStorageBufferStorage.add in interface BufferStorageboe - The buffer or event to be added into the blocker.public boolean isFull()
isFull in interface BufferStoragepublic void rollOver()
BufferStorageBufferOrEvents.rollOver in interface BufferStoragepublic long getPendingBytes()
getPendingBytes in interface BufferStoragepublic long getRolledBytes()
getRolledBytes in interface BufferStoragepublic boolean isEmpty()
isEmpty in interface BufferStorageBufferStorage doesn't store and data.public Optional<org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent> pollNext()
pollNext in interface BufferStoragepublic long getMaxBufferedBytes()
getMaxBufferedBytes in interface BufferStoragepublic void close()
BufferStorageclose in interface AutoCloseableclose in interface BufferStorageCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.