Closed yuzawa-san closed 3 years ago
Looks promising. I'm not sure the class name switch statement prevents the ClassNotFoundException if the optional dependency is not provided. I will evaluate when I get some time.
I modified this pull request to restore the old instanceof checks and catch NoClassDefFoundError when the optional library is not included. Instanceof works better because it handles custom classes that inherit from the classes we are trying to detect.
I also added support for io_uring in the new eventLoopType command line argument in examples, benchmarks, and test.
These changes are included in the stage branch. Stage will be merged into master in the next client release.
Ok sounds good. I'm going to close this PR since these changes have been applied in https://github.com/aerospike/aerospike-client-java/commit/a11f7743d20d98f74524fad01a145c80e7d117cd
Netty has recently added support for an experimental new type of transport which used Linux's io_uring facility. This PR allows users to pass in a IOUringEventLoopGroup to the NettyEventLoops constructor. This is an optional dependency like the other native transports. The EventLoopType determination is currently done sequentially, so I changed it to use a switch statement. I believe if the optional dependency was not provided the instanceof would fail with an ClassNotFoundException instead of falling down to the "Unexpected EventLoopGroup" exception. Using the class names prevents that.