public class AsynchronousBlockWriter extends AsynchronousBlockWriterWithCallback implements BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>
FileIOChannel.Enumerator, FileIOChannel.IDclosed, closeLock, exception, requestQueue, requestsNotReturned, resultHandlerfileChannel, id, LOG| Modifier | Constructor and Description |
|---|---|
protected |
AsynchronousBlockWriter(FileIOChannel.ID channelID,
RequestQueue<org.apache.flink.runtime.io.disk.iomanager.WriteRequest> requestQueue,
LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment> returnSegments)
Creates a new block channel writer for the given channel.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.flink.core.memory.MemorySegment |
getNextReturnedBlock()
Gets the next memory segment that has been written and is available again.
|
LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment> |
getReturnQueue()
Gets the queue in which the memory segments are queued after the asynchronous write is
completed.
|
writeBlockaddRequest, checkErroneous, close, closeAndDelete, handleProcessedBuffer, isClosed, registerAllRequestsProcessedListenerdeleteChannel, getChannelID, getNioFileChannel, getSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwriteBlockclose, closeAndDelete, deleteChannel, getChannelID, getNioFileChannel, getSize, isClosedprotected AsynchronousBlockWriter(FileIOChannel.ID channelID, RequestQueue<org.apache.flink.runtime.io.disk.iomanager.WriteRequest> requestQueue, LinkedBlockingQueue<org.apache.flink.core.memory.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 org.apache.flink.core.memory.MemorySegment getNextReturnedBlock()
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.
getNextReturnedBlock in interface BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>IOException - Thrown, if an I/O error occurs in the writer while waiting for the
request to return.public LinkedBlockingQueue<org.apache.flink.core.memory.MemorySegment> getReturnQueue()
getReturnQueue in interface BlockChannelWriter<org.apache.flink.core.memory.MemorySegment>Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.