-
Notifications
You must be signed in to change notification settings - Fork 25
Switch the NIO implementation to use AsynchronousFileChannel instead of FileChannel #99
Description
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 implements InterruptibleChannel so it, as well as anything that uses it such as the OutputStream returned by Files.newOutputStream(), has the unfortunate [1], [2] behaviour that performing any blocking operation on it (e.g. read() and write()) in a thread in interrupted state will cause the Channel itself to close with java.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:
- Make
S3FileChannelextendAsynchronousFileChannelinstead ofFileChanneland override the respective methods associated to this new class. - Make
S3FileSystemProvideroverride the methodnewAsynchronousFileChannelinstead ofnewFileChannelfromFileSystemProvider.
Task Relationships
This task:
- Is a follow-up of: Upgrade to aws-sdk-java-v2 #63
Useful Links
Help
- Our chat channel
- Points of contact: