@Internal public interface BufferStorage extends AutoCloseable
BufferStorage
takes the buffers and events from a data stream and adds them in a sequence.
After a number of elements have been added, the BufferStorage
can "roll over"
.
After rolling over, previously stored buffers are available for reading via pollNext()
.Modifier and Type | Method and Description |
---|---|
void |
add(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<BufferOrEvent> |
pollNext() |
void |
rollOver()
Start returning next sequence of stored
BufferOrEvent s. |
void add(BufferOrEvent boe) throws IOException
BufferStorage
.boe
- The buffer or event to be added into the blocker.IOException
boolean isFull()
void rollOver() throws IOException
BufferOrEvent
s.IOException
long getPendingBytes()
long getRolledBytes()
boolean isEmpty()
BufferStorage
doesn't store and data.Optional<BufferOrEvent> pollNext() throws IOException
IOException
long getMaxBufferedBytes()
void close() throws IOException
close
in interface AutoCloseable
IOException
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.