public class AsynchronousBlockWriterWithCallback extends AsynchronousFileIOChannel<MemorySegment,org.apache.flink.runtime.io.disk.iomanager.WriteRequest> implements BlockChannelWriterWithCallback<MemorySegment>
BlockChannelWriterWithCallback
that queues I/O requests
and calls a callback once they have been handled.FileIOChannel.Enumerator, FileIOChannel.ID
closed, closeLock, exception, requestQueue, requestsNotReturned, resultHandler
fileChannel, id, LOG
Modifier | Constructor and Description |
---|---|
protected |
AsynchronousBlockWriterWithCallback(FileIOChannel.ID channelID,
RequestQueue<org.apache.flink.runtime.io.disk.iomanager.WriteRequest> requestQueue,
RequestDoneCallback<MemorySegment> callback)
Creates a new asynchronous block writer for the given channel.
|
Modifier and Type | Method and Description |
---|---|
void |
writeBlock(MemorySegment segment)
Issues a asynchronous write request to the writer.
|
addRequest, checkErroneous, close, closeAndDelete, handleProcessedBuffer, isClosed, registerAllRequestsProcessedListener
deleteChannel, getChannelID, getNioFileChannel, getSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, closeAndDelete, deleteChannel, getChannelID, getNioFileChannel, getSize, isClosed
protected AsynchronousBlockWriterWithCallback(FileIOChannel.ID channelID, RequestQueue<org.apache.flink.runtime.io.disk.iomanager.WriteRequest> requestQueue, RequestDoneCallback<MemorySegment> callback) 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.callback
- The callback to be invoked when requests are done.IOException
- Thrown, if the underlying file channel could not be opened exclusively.public void writeBlock(MemorySegment segment) throws IOException
writeBlock
in interface BlockChannelWriterWithCallback<MemorySegment>
segment
- The segment to be written.IOException
- Thrown, when the writer encounters an I/O error. Due to the asynchronous nature of the
writer, the exception thrown here may have been caused by an earlier write request.Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.