public interface BlockChannelReader extends FileIOChannel
MemorySegment. To support asynchronous implementations,
the read method does not immediately return the full memory segment, but rather adds it to
a blocking queue of finished read operations.FileIOChannel.Enumerator, FileIOChannel.ID| Modifier and Type | Method and Description |
|---|---|
MemorySegment |
getNextReturnedSegment()
Gets the next memory segment that has been filled with data by the reader.
|
LinkedBlockingQueue<MemorySegment> |
getReturnQueue()
Gets the queue in which the full memory segments are queued after the read is complete.
|
void |
readBlock(MemorySegment segment)
Issues a read request, which will fill the given segment with the next block in the
underlying file channel.
|
close, closeAndDelete, deleteChannel, getChannelID, isClosedvoid readBlock(MemorySegment segment) throws IOException
segment - The segment to read the block into.IOException - Thrown, when the reader encounters an I/O error.MemorySegment getNextReturnedSegment() throws IOException
WARNING: If this method is invoked without any segment ever returning (for example, because the
readBlock(MemorySegment) method has not been invoked appropriately), the method may block
forever.
IOException - Thrown, if an I/O error occurs in the reader while waiting for the request to return.LinkedBlockingQueue<MemorySegment> getReturnQueue()
Copyright © 2015 The Apache Software Foundation. All rights reserved.