public class AsynchronousBlockWriter extends AsynchronousBlockWriterWithCallback implements BlockChannelWriter
FileIOChannel.Enumerator, FileIOChannel.IDclosed, closeLock, exception, requestQueue, requestsNotReturned, resultHanderfileChannel, id, LOG| Modifier | Constructor and Description |
|---|---|
protected |
AsynchronousBlockWriter(FileIOChannel.ID channelID,
RequestQueue<org.apache.flink.runtime.io.disk.iomanager.WriteRequest> requestQueue,
LinkedBlockingQueue<MemorySegment> returnSegments)
Creates a new block channel writer for the given channel.
|
| Modifier and Type | Method and Description |
|---|---|
MemorySegment |
getNextReturnedSegment()
Gets the next memory segment that has been written and is available again.
|
LinkedBlockingQueue<MemorySegment> |
getReturnQueue()
Gets the queue in which the memory segments are queued after the asynchronous write is completed.
|
writeBlockcheckErroneous, close, closeAndDelete, isCloseddeleteChannel, getChannelIDclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteBlockclose, closeAndDelete, deleteChannel, getChannelID, isClosedprotected AsynchronousBlockWriter(FileIOChannel.ID channelID, RequestQueue<org.apache.flink.runtime.io.disk.iomanager.WriteRequest> requestQueue, LinkedBlockingQueue<MemorySegment> returnSegments) throws IOException
channelID - The ID of the channel to write to.requestQueue - The request queue of the asynchronous writer thread, to which the I/O requests
are added.returnSegments - The return queue, to which the processed Memory Segments are added.IOException - Thrown, if the underlying file channel could not be opened exclusively.public MemorySegment getNextReturnedSegment() throws IOException
NOTE: If this method is invoked without any segment ever returning (for example, because the
AsynchronousBlockWriterWithCallback.writeBlock(MemorySegment) method has not been invoked accordingly), the method may block
forever.
getNextReturnedSegment in interface BlockChannelWriterIOException - Thrown, if an I/O error occurs in the writer while waiting for the request to return.public LinkedBlockingQueue<MemorySegment> getReturnQueue()
getReturnQueue in interface BlockChannelWriterCopyright © 2015 The Apache Software Foundation. All rights reserved.