Class NettyEventLoopUtil
- java.lang.Object
-
- org.apache.hugegraph.computer.core.network.netty.NettyEventLoopUtil
-
public class NettyEventLoopUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description NettyEventLoopUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<? extends io.netty.channel.Channel>clientChannelClass(IOMode mode)Returns the correct (client) SocketChannel class based on IOMode.static io.netty.channel.EventLoopGroupcreateEventLoop(IOMode mode, int numThreads, java.lang.String prefix)Create a Netty EventLoopGroup based on the IOMode.static voidenableTriggeredMode(IOMode ioMode, boolean enableLt, io.netty.bootstrap.ServerBootstrap serverBootstrap)UseEpollMode.LEVEL_TRIGGEREDfor server bootstrap if level trigger enabled by system properties, otherwise useEpollMode.EDGE_TRIGGERED.static java.lang.Class<? extends io.netty.channel.ServerChannel>serverChannelClass(IOMode mode)Returns the correct ServerSocketChannel class based on IOMode.
-
-
-
Method Detail
-
createEventLoop
public static io.netty.channel.EventLoopGroup createEventLoop(IOMode mode, int numThreads, java.lang.String prefix)
Create a Netty EventLoopGroup based on the IOMode.
-
clientChannelClass
public static java.lang.Class<? extends io.netty.channel.Channel> clientChannelClass(IOMode mode)
Returns the correct (client) SocketChannel class based on IOMode.
-
serverChannelClass
public static java.lang.Class<? extends io.netty.channel.ServerChannel> serverChannelClass(IOMode mode)
Returns the correct ServerSocketChannel class based on IOMode.
-
enableTriggeredMode
public static void enableTriggeredMode(IOMode ioMode, boolean enableLt, io.netty.bootstrap.ServerBootstrap serverBootstrap)
UseEpollMode.LEVEL_TRIGGEREDfor server bootstrap if level trigger enabled by system properties, otherwise useEpollMode.EDGE_TRIGGERED.
-
-