public class IOManagerAsync extends IOManager implements Thread.UncaughtExceptionHandler
IOManager
that uses asynchronous I/O.executorService, LOG
Constructor and Description |
---|
IOManagerAsync()
Constructs a new asynchronous I/O manager, writing files to the system 's temp directory.
|
IOManagerAsync(ExecutorService executorService)
Constructs a new asynchronous I/O manager, writing files to the system 's temp directory.
|
IOManagerAsync(String tempDir)
Constructs a new asynchronous I/O manager, writing file to the given directory.
|
IOManagerAsync(String[] tempDirs,
ExecutorService executorService)
Constructs a new asynchronous I/O manager, writing file round robin across the given
directories.
|
IOManagerAsync(String tempDir,
ExecutorService executorService)
Constructs a new asynchronous I/O manager, writing file to the given directory.
|
createBlockChannelReader, createBlockChannelWriter, createChannel, createChannelEnumerator, deleteChannel, getExecutorService, getSpillingDirectories, getSpillingDirectoriesPaths
@VisibleForTesting public IOManagerAsync()
@VisibleForTesting public IOManagerAsync(ExecutorService executorService)
@VisibleForTesting public IOManagerAsync(String tempDir)
tempDir
- The directory to write temporary files to.@VisibleForTesting public IOManagerAsync(String tempDir, ExecutorService executorService)
tempDir
- The directory to write temporary files to.public IOManagerAsync(String[] tempDirs, ExecutorService executorService)
tempDirs
- The directories to write temporary files to.public void close() throws Exception
close
in interface AutoCloseable
close
in class IOManager
Exception
public void uncaughtException(Thread t, Throwable e)
uncaughtException
in interface Thread.UncaughtExceptionHandler
public BlockChannelWriter<MemorySegment> createBlockChannelWriter(FileIOChannel.ID channelID, LinkedBlockingQueue<MemorySegment> returnQueue) throws IOException
IOManager
createBlockChannelWriter
in class IOManager
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 BlockChannelWriterWithCallback<MemorySegment> createBlockChannelWriter(FileIOChannel.ID channelID, RequestDoneCallback<MemorySegment> callback) throws IOException
IOManager
createBlockChannelWriter
in class IOManager
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<MemorySegment> createBlockChannelReader(FileIOChannel.ID channelID, LinkedBlockingQueue<MemorySegment> returnQueue) throws IOException
createBlockChannelReader
in class IOManager
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 BufferFileWriter createBufferFileWriter(FileIOChannel.ID channelID) throws IOException
createBufferFileWriter
in class IOManager
IOException
public BufferFileReader createBufferFileReader(FileIOChannel.ID channelID, RequestDoneCallback<Buffer> callback) throws IOException
createBufferFileReader
in class IOManager
IOException
public BufferFileSegmentReader createBufferFileSegmentReader(FileIOChannel.ID channelID, RequestDoneCallback<FileSegment> callback) throws IOException
createBufferFileSegmentReader
in class IOManager
IOException
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 IOManager
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.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.