public class AsynchronousBlockWriterWithCallback extends AsynchronousFileIOChannel<MemorySegment,org.apache.flink.runtime.io.disk.iomanager.WriteRequest> implements BlockChannelWriterWithCallback<MemorySegment>
BlockChannelWriterWithCallbackthat queues I/O requests and calls a callback once they have been handled.
closed, closeLock, exception, requestQueue, requestsNotReturned, resultHandler
|Modifier||Constructor and Description|
Creates a new asynchronous block writer for the given channel.
|Modifier and Type||Method and Description|
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
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
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–2023 The Apache Software Foundation. All rights reserved.