public class AsynchronousBufferFileWriter extends AsynchronousFileIOChannel<Buffer,org.apache.flink.runtime.io.disk.iomanager.WriteRequest> implements BufferFileWriter
closed, closeLock, exception, requestQueue, requestsNotReturned, resultHandler
fileChannel, id, LOG
|Modifier||Constructor and Description|
|Modifier and Type||Method and Description|
Returns the number of outstanding requests.
Registers a listener to be notified when all outstanding requests have been processed.
Writes the given block asynchronously.
addRequest, checkErroneous, close, closeAndDelete, handleProcessedBuffer, isClosed
deleteChannel, getChannelID, getNioFileChannel, getSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, closeAndDelete, deleteChannel, getChannelID, getNioFileChannel, getSize, isClosed
protected AsynchronousBufferFileWriter(FileIOChannel.ID channelID, RequestQueue<org.apache.flink.runtime.io.disk.iomanager.WriteRequest> requestQueue) throws IOException
public void writeBlock(Buffer buffer) throws IOException
buffer- the buffer to be written (will be recycled when done)
IOException- thrown if adding the write operation fails
public int getNumberOfOutstandingRequests()
public boolean registerAllRequestsProcessedListener(NotificationListener listener) throws IOException
New requests can arrive right after the listener got notified. Therefore, it is not safe to assume that the number of outstanding requests is still zero after a notification unless there was a close right before the listener got called.
true, if the registration was successful. A registration can fail, if
there are no outstanding requests when trying to register a listener.
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.