Search in sources :

Example 1 with ThreadPoolBuilder

use of io.dingodb.common.concurrent.ThreadPoolBuilder in project dingo by dingodb.

the class NettyServer method init.

@Override
public void init() {
    server = new ServerBootstrap();
    eventLoopGroup = new NioEventLoopGroup(2, new ThreadPoolBuilder().name("Netty server " + port).build());
    server.localAddress(port).channel(NioServerSocketChannel.class).group(eventLoopGroup).childHandler(channelInitializer());
}
Also used : ThreadPoolBuilder(io.dingodb.common.concurrent.ThreadPoolBuilder) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Example 2 with ThreadPoolBuilder

use of io.dingodb.common.concurrent.ThreadPoolBuilder in project dingo by dingodb.

the class AbstractNettyConnection method open.

@Override
public void open() throws InterruptedException {
    ThreadPoolExecutor executor = new ThreadPoolBuilder().name("Netty connection " + remoteAddress).build();
    bootstrap = new Bootstrap();
    eventLoopGroup = new NioEventLoopGroup(0, executor);
    bootstrap.channel(NioSocketChannel.class).group(eventLoopGroup).remoteAddress(remoteAddress).handler(channelInitializer());
    bootstrap.connect().sync().await();
    localAddress = nettyChannel.localAddress();
    handshake();
}
Also used : NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) ThreadPoolBuilder(io.dingodb.common.concurrent.ThreadPoolBuilder) Bootstrap(io.netty.bootstrap.Bootstrap) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Aggregations

ThreadPoolBuilder (io.dingodb.common.concurrent.ThreadPoolBuilder)2 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)2 Bootstrap (io.netty.bootstrap.Bootstrap)1 ServerBootstrap (io.netty.bootstrap.ServerBootstrap)1 NioSocketChannel (io.netty.channel.socket.nio.NioSocketChannel)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1