Interface BlockChannelWriter<T>
-
- All Superinterfaces:
BlockChannelWriterWithCallback<T>
,FileIOChannel
- All Known Implementing Classes:
AsynchronousBlockWriter
public interface BlockChannelWriter<T> extends BlockChannelWriterWithCallback<T>
A writer that writes data in blocks to a file channel. The writer receives the data blocks in the form ofMemorySegment
, which it writes entirely to the channel, regardless of how space in the segment is used. The writing may be realized synchronously, or asynchronously, depending on the implementation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
FileIOChannel.Enumerator, FileIOChannel.ID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
getNextReturnedBlock()
Gets the next memory segment that has been written and is available again.LinkedBlockingQueue<T>
getReturnQueue()
Gets the queue in which the memory segments are queued after the asynchronous write is completed-
Methods inherited from interface org.apache.flink.runtime.io.disk.iomanager.BlockChannelWriterWithCallback
writeBlock
-
Methods inherited from interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
close, closeAndDelete, deleteChannel, getChannelID, getNioFileChannel, getSize, isClosed
-
-
-
-
Method Detail
-
getNextReturnedBlock
T getNextReturnedBlock() throws IOException
Gets the next memory segment that has been written and is available again. This method blocks until such a segment is available, or until an error occurs in the writer, or the writer is closed.NOTE: If this method is invoked without any segment ever returning (for example, because the
BlockChannelWriterWithCallback.writeBlock(T)
method has not been invoked accordingly), the method may block forever.- Returns:
- The next memory segment from the writers's return queue.
- Throws:
IOException
- Thrown, if an I/O error occurs in the writer while waiting for the request to return.
-
getReturnQueue
LinkedBlockingQueue<T> getReturnQueue()
Gets the queue in which the memory segments are queued after the asynchronous write is completed- Returns:
- The queue with the written memory segments.
-
-