2121import io .netty .channel .EventLoop ;
2222import io .netty .channel .EventLoopGroup ;
2323import io .netty .channel .MultiThreadIoEventLoopGroup ;
24- import io .netty .channel .epoll .EpollEventLoopGroup ;
2524import io .netty .channel .epoll .EpollIoHandler ;
26- import io .netty .channel .kqueue .KQueueEventLoopGroup ;
2725import io .netty .channel .kqueue .KQueueIoHandler ;
2826import io .netty .channel .nio .NioIoHandler ;
2927import io .netty .channel .uring .IoUringIoHandler ;
@@ -107,6 +105,7 @@ public void init(CamelliaTranspondProperties properties, ProxyBeanFactory proxyB
107105 this .udsEventLoopGroup = eventLoopGroup ;
108106 } else if (nettyTransportMode == NettyTransportMode .io_uring ) {
109107 this .eventLoopGroup = new MultiThreadIoEventLoopGroup (redisConf .getDefaultTranspondWorkThread (), new DefaultThreadFactory ("camellia-redis-connection" ), IoUringIoHandler .newFactory ());
108+ this .udsEventLoopGroup = eventLoopGroup ;
110109 } else {
111110 this .eventLoopGroup = new MultiThreadIoEventLoopGroup (redisConf .getDefaultTranspondWorkThread (), new DefaultThreadFactory ("camellia-redis-connection" ), NioIoHandler .newFactory ());
112111 }
@@ -115,6 +114,8 @@ public void init(CamelliaTranspondProperties properties, ProxyBeanFactory proxyB
115114 this .udsEventLoopGroup = new MultiThreadIoEventLoopGroup (redisConf .getDefaultTranspondWorkThread (), new DefaultThreadFactory ("camellia-redis-connection-uds" ), EpollIoHandler .newFactory ());
116115 } else if (GlobalRedisProxyEnv .isKQueueAvailable ()) {
117116 this .udsEventLoopGroup = new MultiThreadIoEventLoopGroup (redisConf .getDefaultTranspondWorkThread (), new DefaultThreadFactory ("camellia-redis-connection-uds" ), KQueueIoHandler .newFactory ());
117+ } else if (GlobalRedisProxyEnv .isIOUringAvailable ()) {
118+ this .udsEventLoopGroup = new MultiThreadIoEventLoopGroup (redisConf .getDefaultTranspondWorkThread (), new DefaultThreadFactory ("camellia-redis-connection-uds" ), IoUringIoHandler .newFactory ());
118119 }
119120 }
120121
@@ -442,7 +443,11 @@ private boolean eventLoopMatch(RedisConnectionAddr addr, EventLoop eventLoop) {
442443 return true ;
443444 } else if (channelType == ChannelType .uds ) {
444445 EventLoopGroup parent = eventLoop .parent ();
445- return (parent instanceof EpollEventLoopGroup ) || (parent instanceof KQueueEventLoopGroup );
446+ if (parent instanceof MultiThreadIoEventLoopGroup ioEventLoopGroup ) {
447+ return ioEventLoopGroup .isIoType (EpollIoHandler .class ) || ioEventLoopGroup .isIoType (KQueueIoHandler .class )
448+ || ioEventLoopGroup .isIoType (IoUringIoHandler .class );
449+ }
450+ return false ;
446451 }
447452 return false ;
448453 }
@@ -461,11 +466,12 @@ private EventLoop selectEventLoop(RedisConnectionAddr addr) {
461466 return loop ;
462467 } else if (channelType == ChannelType .uds ) {
463468 EventLoopGroup parent = loop .parent ();
464- if (parent instanceof EpollEventLoopGroup ) {
465- return loop ;
466- }
467- if (parent instanceof KQueueEventLoopGroup ) {
468- return loop ;
469+ if (parent instanceof MultiThreadIoEventLoopGroup ioEventLoopGroup ) {
470+ boolean match = ioEventLoopGroup .isIoType (EpollIoHandler .class ) || ioEventLoopGroup .isIoType (KQueueIoHandler .class )
471+ || ioEventLoopGroup .isIoType (IoUringIoHandler .class );
472+ if (match ) {
473+ return loop ;
474+ }
469475 }
470476 return udsEventLoopGroup .next ();
471477 }
0 commit comments