public class AsynchronousBlockWriter extends AsynchronousBlockWriterWithCallback implements BlockChannelWriter<MemorySegment>
FileIOChannel.Enumerator, FileIOChannel.ID
closed, closeLock, exception, requestQueue, requestsNotReturned, resultHandler
fileChannel, 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 |
getNextReturnedBlock()
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.
|
writeBlock
addRequest, checkErroneous, close, closeAndDelete, handleProcessedBuffer, isClosed, registerAllRequestsProcessedListener
deleteChannel, getChannelID, getNioFileChannel, getSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
writeBlock
close, closeAndDelete, deleteChannel, getChannelID, getNioFileChannel, getSize, isClosed
protected 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 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<MemorySegment>
IOException
- Thrown, if an I/O error occurs in the writer while waiting for the
request to return.public LinkedBlockingQueue<MemorySegment> getReturnQueue()
getReturnQueue
in interface BlockChannelWriter<MemorySegment>
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.