public abstract class IOManager extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG
Logging
|
| Modifier | Constructor and Description |
|---|---|
protected |
IOManager(String[] paths)
Constructs a new IOManager.
|
| Modifier and Type | Method and Description |
|---|---|
BlockChannelReader |
createBlockChannelReader(FileIOChannel.ID channelID)
Creates a block channel reader that reads blocks from the given channel.
|
abstract 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)
Creates a block channel writer that writes to the given channel.
|
abstract BlockChannelWriter |
createBlockChannelWriter(FileIOChannel.ID channelID,
LinkedBlockingQueue<MemorySegment> returnQueue)
Creates a block channel writer that writes to the given channel.
|
abstract BlockChannelWriterWithCallback |
createBlockChannelWriter(FileIOChannel.ID channelID,
RequestDoneCallback callback)
Creates a block channel writer that writes to the given channel.
|
abstract 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.
|
FileIOChannel.ID |
createChannel()
Creates a new
FileIOChannel.ID in one of the temp directories. |
FileIOChannel.Enumerator |
createChannelEnumerator()
Creates a new
FileIOChannel.Enumerator, spreading the channels in a round-robin fashion
across the temporary file directories. |
protected int |
getNextPathNum() |
abstract boolean |
isProperlyShutDown()
Utility method to check whether the IO manager has been properly shut down.
|
abstract void |
shutdown()
Close method, marks the I/O manager as closed.
|
protected IOManager(String[] paths)
paths - the basic directory paths for files underlying anonymous channels.public abstract void shutdown()
public abstract boolean isProperlyShutDown()
public FileIOChannel.ID createChannel()
FileIOChannel.ID in one of the temp directories. Multiple
invocations of this method spread the channels evenly across the different directories.public FileIOChannel.Enumerator createChannelEnumerator()
FileIOChannel.Enumerator, spreading the channels in a round-robin fashion
across the temporary file directories.public BlockChannelWriter createBlockChannelWriter(FileIOChannel.ID channelID) throws IOException
channelID - The descriptor for the channel to write to.IOException - Thrown, if the channel for the writer could not be opened.public abstract BlockChannelWriter createBlockChannelWriter(FileIOChannel.ID channelID, LinkedBlockingQueue<MemorySegment> returnQueue) throws IOException
channelID - 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 abstract BlockChannelWriterWithCallback createBlockChannelWriter(FileIOChannel.ID channelID, RequestDoneCallback callback) throws IOException
channelID - 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) throws IOException
channelID - The descriptor for the channel to write to.IOException - Thrown, if the channel for the reader could not be opened.public abstract BlockChannelReader createBlockChannelReader(FileIOChannel.ID channelID, LinkedBlockingQueue<MemorySegment> returnQueue) throws IOException
channelID - 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 abstract 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.
channelID - 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.protected int getNextPathNum()
Copyright © 2015 The Apache Software Foundation. All rights reserved.