public class IOManagerAsync extends IOManager implements Thread.UncaughtExceptionHandler
IOManager that uses asynchronous I/O.| Constructor and Description |
|---|
IOManagerAsync()
Constructs a new asynchronous I/O manger, writing files to the system 's temp directory.
|
IOManagerAsync(String tempDir)
Constructs a new asynchronous I/O manger, writing file to the given directory.
|
IOManagerAsync(String[] tempDirs)
Constructs a new asynchronous I/O manger, writing file round robin across the given directories.
|
| Modifier and Type | Method and Description |
|---|---|
BlockChannelReader |
createBlockChannelReader(FileIOChannel.ID channelID,
LinkedBlockingQueue<MemorySegment> returnQueue)
Creates a block channel reader that reads blocks from the given channel.
|
BlockChannelWriter |
createBlockChannelWriter(FileIOChannel.ID channelID,
LinkedBlockingQueue<MemorySegment> returnQueue)
Creates a block channel writer that writes to the given channel.
|
BlockChannelWriterWithCallback |
createBlockChannelWriter(FileIOChannel.ID channelID,
RequestDoneCallback callback)
Creates a block channel writer that writes to the given channel.
|
BulkBlockChannelReader |
createBulkBlockChannelReader(FileIOChannel.ID channelID,
List<MemorySegment> targetSegments,
int numBlocks)
Creates a block channel reader that reads all blocks from the given channel directly in one bulk.
|
boolean |
isProperlyShutDown()
Utility method to check whether the IO manager has been properly shut down.
|
void |
shutdown()
Close method.
|
void |
uncaughtException(Thread t,
Throwable e) |
createBlockChannelReader, createBlockChannelWriter, createChannel, createChannelEnumerator, getNextPathNumpublic IOManagerAsync()
public IOManagerAsync(String tempDir)
tempDir - The directory to write temporary files to.public IOManagerAsync(String[] tempDirs)
tempDirs - The directories to write temporary files to.public void shutdown()
public boolean isProperlyShutDown()
isProperlyShutDown in class IOManagerpublic void uncaughtException(Thread t, Throwable e)
uncaughtException in interface Thread.UncaughtExceptionHandlerpublic BlockChannelWriter createBlockChannelWriter(FileIOChannel.ID channelID, LinkedBlockingQueue<MemorySegment> returnQueue) throws IOException
IOManagercreateBlockChannelWriter in class IOManagerchannelID - The descriptor for the channel to write to.returnQueue - The queue to put the written buffers into.IOException - Thrown, if the channel for the writer could not be opened.public BlockChannelWriterWithCallback createBlockChannelWriter(FileIOChannel.ID channelID, RequestDoneCallback callback) throws IOException
IOManagercreateBlockChannelWriter in class IOManagerchannelID - The descriptor for the channel to write to.callback - The callback to be called forIOException - Thrown, if the channel for the writer could not be opened.public BlockChannelReader createBlockChannelReader(FileIOChannel.ID channelID, LinkedBlockingQueue<MemorySegment> returnQueue) throws IOException
createBlockChannelReader in class IOManagerchannelID - The descriptor for the channel to write to.returnQueue - The queue to put the full buffers into.IOException - Thrown, if the channel for the reader could not be opened.public BulkBlockChannelReader createBulkBlockChannelReader(FileIOChannel.ID channelID, List<MemorySegment> targetSegments, int numBlocks) throws IOException
If a channel is not to be read in one bulk, but in multiple smaller batches, a
BlockChannelReader should be used.
createBulkBlockChannelReader in class IOManagerchannelID - The descriptor for the channel to write to.targetSegments - The list to take the segments from into which to read the data.numBlocks - The number of blocks in the channel to read.IOException - Thrown, if the channel for the reader could not be opened.Copyright © 2015 The Apache Software Foundation. All rights reserved.