Switch the NIO implementation to use AsynchronousFileChannel instead of FileChannel #99
Closed
2 tasks done
Labels
Milestone
Task Description
The AWS SDK for Java 2.x utilizes a new, non-blocking SDK architecture built on Netty to support true non-blocking I/O. Taking advantage of it, we can also switch the NIO implementation to use
AsynchronousFileChannel
. This should give a significant performance boost.A plain
FileChannel
implementsInterruptibleChannel
so it, as well as anything that uses it such as theOutputStream
returned byFiles.newOutputStream()
, has the unfortunate [1], [2] behaviour that performing any blocking operation on it (e.g.read()
andwrite()
) in a thread in interrupted state will cause the Channel itself to close withjava.nio.channels.ClosedByInterruptException
.If this is a problem, using
AsynchronousFileChannel
instead is a possible alternative.Tasks
The following tasks will need to be carried out:
S3FileChannel
extendAsynchronousFileChannel
instead ofFileChannel
and override the respective methods associated to this new class.S3FileSystemProvider
override the methodnewAsynchronousFileChannel
instead ofnewFileChannel
fromFileSystemProvider
.Task Relationships
This task:
Useful Links
Help
The text was updated successfully, but these errors were encountered: