Interface BlockChannelWriter<T>
- All Superinterfaces:
BlockChannelWriterWithCallback<T>,FileIOChannel
- All Known Implementing Classes:
AsynchronousBlockWriter
A writer that writes data in blocks to a file channel. The writer receives the data blocks in the
form of
MemorySegment, 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
Modifier and TypeMethodDescriptionGets the next memory segment that has been written and is available again.Gets the queue in which the memory segments are queued after the asynchronous write is completedMethods inherited from interface org.apache.flink.runtime.io.disk.iomanager.BlockChannelWriterWithCallback
writeBlockMethods inherited from interface org.apache.flink.runtime.io.disk.iomanager.FileIOChannel
close, closeAndDelete, deleteChannel, getChannelID, getNioFileChannel, getSize, isClosed
-
Method Details
-
getNextReturnedBlock
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.
-