Search in sources :

Example 26 with EpollEventLoopGroup

use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.epoll.EpollEventLoopGroup in project aerospike-client-java by aerospike.

the class Main method runBenchmarks.

public void runBenchmarks() throws Exception {
    if (this.asyncEnabled) {
        EventPolicy eventPolicy = new EventPolicy();
        if (args.readPolicy.socketTimeout > 0 && args.readPolicy.socketTimeout < eventPolicy.minTimeout) {
            eventPolicy.minTimeout = args.readPolicy.socketTimeout;
        }
        if (args.writePolicy.socketTimeout > 0 && args.writePolicy.socketTimeout < eventPolicy.minTimeout) {
            eventPolicy.minTimeout = args.writePolicy.socketTimeout;
        }
        switch(this.eventLoopType) {
            default:
            case DIRECT_NIO:
                {
                    eventLoops = new NioEventLoops(eventPolicy, this.eventLoopSize);
                    break;
                }
            case NETTY_NIO:
                {
                    EventLoopGroup group = new NioEventLoopGroup(this.eventLoopSize);
                    eventLoops = new NettyEventLoops(eventPolicy, group, this.eventLoopType);
                    break;
                }
            case NETTY_EPOLL:
                {
                    EventLoopGroup group = new EpollEventLoopGroup(this.eventLoopSize);
                    eventLoops = new NettyEventLoops(eventPolicy, group, this.eventLoopType);
                    break;
                }
            case NETTY_KQUEUE:
                {
                    EventLoopGroup group = new KQueueEventLoopGroup(this.eventLoopSize);
                    eventLoops = new NettyEventLoops(eventPolicy, group, this.eventLoopType);
                    break;
                }
            case NETTY_IOURING:
                {
                    EventLoopGroup group = new IOUringEventLoopGroup(this.eventLoopSize);
                    eventLoops = new NettyEventLoops(eventPolicy, group, this.eventLoopType);
                    break;
                }
        }
        try {
            clientPolicy.eventLoops = eventLoops;
            if (clientPolicy.asyncMaxConnsPerNode < this.asyncMaxCommands) {
                clientPolicy.asyncMaxConnsPerNode = this.asyncMaxCommands;
            }
            AerospikeClient client = new AerospikeClient(clientPolicy, hosts);
            try {
                if (initialize) {
                    doAsyncInserts(client);
                } else {
                    doAsyncRWTest(client);
                }
            } finally {
                client.close();
            }
        } finally {
            eventLoops.close();
        }
    } else {
        AerospikeClient client = new AerospikeClient(clientPolicy, hosts);
        try {
            if (initialize) {
                doInserts(client);
            } else {
                doRWTest(client);
            }
        } finally {
            client.close();
        }
    }
}
Also used : AerospikeClient(com.aerospike.client.AerospikeClient) IOUringEventLoopGroup(io.netty.incubator.channel.uring.IOUringEventLoopGroup) EpollEventLoopGroup(io.netty.channel.epoll.EpollEventLoopGroup) KQueueEventLoopGroup(io.netty.channel.kqueue.KQueueEventLoopGroup) EventLoopGroup(io.netty.channel.EventLoopGroup) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) NettyEventLoops(com.aerospike.client.async.NettyEventLoops) EpollEventLoopGroup(io.netty.channel.epoll.EpollEventLoopGroup) KQueueEventLoopGroup(io.netty.channel.kqueue.KQueueEventLoopGroup) EventPolicy(com.aerospike.client.async.EventPolicy) NioEventLoops(com.aerospike.client.async.NioEventLoops) IOUringEventLoopGroup(io.netty.incubator.channel.uring.IOUringEventLoopGroup) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Example 27 with EpollEventLoopGroup

use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.epoll.EpollEventLoopGroup in project aerospike-client-java by aerospike.

the class AsyncExample method runExamples.

/**
 * Connect and run one or more asynchronous client examples.
 */
public static void runExamples(Console console, Parameters params, List<String> examples) throws Exception {
    EventPolicy eventPolicy = new EventPolicy();
    eventPolicy.maxCommandsInProcess = params.maxCommandsInProcess;
    eventPolicy.maxCommandsInQueue = params.maxCommandsInQueue;
    EventLoops eventLoops;
    switch(params.eventLoopType) {
        default:
        case DIRECT_NIO:
            {
                eventLoops = new NioEventLoops(eventPolicy, 1);
                break;
            }
        case NETTY_NIO:
            {
                EventLoopGroup group = new NioEventLoopGroup(1);
                eventLoops = new NettyEventLoops(eventPolicy, group, params.eventLoopType);
                break;
            }
        case NETTY_EPOLL:
            {
                EventLoopGroup group = new EpollEventLoopGroup(1);
                eventLoops = new NettyEventLoops(eventPolicy, group, params.eventLoopType);
                break;
            }
        case NETTY_KQUEUE:
            {
                EventLoopGroup group = new KQueueEventLoopGroup(1);
                eventLoops = new NettyEventLoops(eventPolicy, group, params.eventLoopType);
                break;
            }
        case NETTY_IOURING:
            {
                EventLoopGroup group = new IOUringEventLoopGroup(1);
                eventLoops = new NettyEventLoops(eventPolicy, group, params.eventLoopType);
                break;
            }
    }
    try {
        ClientPolicy policy = new ClientPolicy();
        policy.eventLoops = eventLoops;
        policy.user = params.user;
        policy.password = params.password;
        policy.authMode = params.authMode;
        policy.tlsPolicy = params.tlsPolicy;
        params.policy = policy.readPolicyDefault;
        params.writePolicy = policy.writePolicyDefault;
        Host[] hosts = Host.parseHosts(params.host, params.port);
        AerospikeClient client = new AerospikeClient(policy, hosts);
        try {
            EventLoop eventLoop = eventLoops.get(0);
            params.setServerSpecific(client);
            for (String exampleName : examples) {
                runExample(exampleName, client, eventLoop, params, console);
            }
        } finally {
            client.close();
        }
    } finally {
        eventLoops.close();
    }
}
Also used : AerospikeClient(com.aerospike.client.AerospikeClient) ClientPolicy(com.aerospike.client.policy.ClientPolicy) NioEventLoops(com.aerospike.client.async.NioEventLoops) EventLoops(com.aerospike.client.async.EventLoops) NettyEventLoops(com.aerospike.client.async.NettyEventLoops) EventPolicy(com.aerospike.client.async.EventPolicy) Host(com.aerospike.client.Host) NioEventLoops(com.aerospike.client.async.NioEventLoops) IOUringEventLoopGroup(io.netty.incubator.channel.uring.IOUringEventLoopGroup) EventLoopGroup(io.netty.channel.EventLoopGroup) IOUringEventLoopGroup(io.netty.incubator.channel.uring.IOUringEventLoopGroup) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) EpollEventLoopGroup(io.netty.channel.epoll.EpollEventLoopGroup) KQueueEventLoopGroup(io.netty.channel.kqueue.KQueueEventLoopGroup) EventLoop(com.aerospike.client.async.EventLoop) NettyEventLoops(com.aerospike.client.async.NettyEventLoops) EpollEventLoopGroup(io.netty.channel.epoll.EpollEventLoopGroup) KQueueEventLoopGroup(io.netty.channel.kqueue.KQueueEventLoopGroup) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Example 28 with EpollEventLoopGroup

use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.epoll.EpollEventLoopGroup in project riposte by Nike-Inc.

the class Server method startup.

public void startup() throws CertificateException, IOException, InterruptedException {
    if (startedUp) {
        throw new IllegalArgumentException("This Server instance has already started. " + "You can only call startup() once");
    }
    // Figure out what port to bind to.
    int port = Integer.parseInt(System.getProperty("endpointsPort", serverConfig.isEndpointsUseSsl() ? String.valueOf(serverConfig.endpointsSslPort()) : String.valueOf(serverConfig.endpointsPort())));
    // Configure SSL if desired.
    final SslContext sslCtx;
    if (serverConfig.isEndpointsUseSsl()) {
        sslCtx = serverConfig.createSslContext();
    } else {
        sslCtx = null;
    }
    // Configure the server
    EventLoopGroup bossGroup;
    EventLoopGroup workerGroup;
    Class<? extends ServerChannel> channelClass;
    // NIO event loop group.
    if (Epoll.isAvailable()) {
        logger.info("The epoll native transport is available. Using epoll instead of NIO. " + "riposte_server_using_native_epoll_transport=true");
        bossGroup = (serverConfig.bossThreadFactory() == null) ? new EpollEventLoopGroup(serverConfig.numBossThreads()) : new EpollEventLoopGroup(serverConfig.numBossThreads(), serverConfig.bossThreadFactory());
        workerGroup = (serverConfig.workerThreadFactory() == null) ? new EpollEventLoopGroup(serverConfig.numWorkerThreads()) : new EpollEventLoopGroup(serverConfig.numWorkerThreads(), serverConfig.workerThreadFactory());
        channelClass = EpollServerSocketChannel.class;
    } else {
        logger.info("The epoll native transport is NOT available or you are not running on a compatible " + "OS/architecture. Using NIO. riposte_server_using_native_epoll_transport=false");
        bossGroup = (serverConfig.bossThreadFactory() == null) ? new NioEventLoopGroup(serverConfig.numBossThreads()) : new NioEventLoopGroup(serverConfig.numBossThreads(), serverConfig.bossThreadFactory());
        workerGroup = (serverConfig.workerThreadFactory() == null) ? new NioEventLoopGroup(serverConfig.numWorkerThreads()) : new NioEventLoopGroup(serverConfig.numWorkerThreads(), serverConfig.workerThreadFactory());
        channelClass = NioServerSocketChannel.class;
    }
    eventLoopGroups.add(bossGroup);
    eventLoopGroups.add(workerGroup);
    // Figure out which channel initializer should set up the channel pipelines for new channels.
    ChannelInitializer<SocketChannel> channelInitializer = serverConfig.customChannelInitializer();
    if (channelInitializer == null) {
        DistributedTracingConfig<Span> wingtipsDistributedTracingConfig = getOrGenerateWingtipsDistributedTracingConfig(serverConfig);
        // No custom channel initializer, so use the default
        channelInitializer = new HttpChannelInitializer(sslCtx, serverConfig.maxRequestSizeInBytes(), serverConfig.appEndpoints(), serverConfig.requestAndResponseFilters(), serverConfig.longRunningTaskExecutor(), serverConfig.riposteErrorHandler(), serverConfig.riposteUnhandledErrorHandler(), serverConfig.requestContentValidationService(), serverConfig.defaultRequestContentDeserializer(), new ResponseSender(serverConfig.defaultResponseContentSerializer(), serverConfig.errorResponseBodySerializer(), wingtipsDistributedTracingConfig), serverConfig.metricsListener(), serverConfig.defaultCompletableFutureTimeoutInMillisForNonblockingEndpoints(), serverConfig.accessLogger(), serverConfig.pipelineCreateHooks(), serverConfig.requestSecurityValidator(), serverConfig.workerChannelIdleTimeoutMillis(), serverConfig.proxyRouterConnectTimeoutMillis(), serverConfig.incompleteHttpCallTimeoutMillis(), serverConfig.maxOpenIncomingServerChannels(), serverConfig.isDebugChannelLifecycleLoggingEnabled(), serverConfig.userIdHeaderKeys(), serverConfig.responseCompressionThresholdBytes(), serverConfig.httpRequestDecoderConfig(), wingtipsDistributedTracingConfig);
    }
    // Create the server bootstrap
    ServerBootstrap b = new ServerBootstrap();
    b.group(bossGroup, workerGroup).channel(channelClass).childHandler(channelInitializer);
    // execute pre startup hooks
    List<@NotNull PreServerStartupHook> preServerStartupHooks = serverConfig.preServerStartupHooks();
    if (preServerStartupHooks != null) {
        for (PreServerStartupHook hook : preServerStartupHooks) {
            hook.executePreServerStartupHook(b);
        }
    }
    if (serverConfig.isDebugChannelLifecycleLoggingEnabled())
        b.handler(new LoggingHandler(SERVER_BOSS_CHANNEL_DEBUG_LOGGER_NAME, LogLevel.DEBUG));
    // Bind the server to the desired port and start it up so it is ready to receive requests
    Channel ch = b.bind(port).sync().channel();
    // execute post startup hooks
    List<@NotNull PostServerStartupHook> postServerStartupHooks = serverConfig.postServerStartupHooks();
    if (postServerStartupHooks != null) {
        for (PostServerStartupHook hook : postServerStartupHooks) {
            hook.executePostServerStartupHook(serverConfig, ch);
        }
    }
    channels.add(ch);
    logger.info("Server channel open and accepting " + (serverConfig.isEndpointsUseSsl() ? "https" : "http") + " requests on port " + port);
    startedUp = true;
    // Add a shutdown hook so we can gracefully stop the server when the JVM is going down
    Runtime.getRuntime().addShutdownHook(new Thread(() -> {
        try {
            shutdown();
        } catch (Exception e) {
            logger.warn("Error shutting down Riposte", e);
            throw new RuntimeException(e);
        }
    }));
}
Also used : EpollServerSocketChannel(io.netty.channel.epoll.EpollServerSocketChannel) SocketChannel(io.netty.channel.socket.SocketChannel) NioServerSocketChannel(io.netty.channel.socket.nio.NioServerSocketChannel) LoggingHandler(io.netty.handler.logging.LoggingHandler) EpollServerSocketChannel(io.netty.channel.epoll.EpollServerSocketChannel) SocketChannel(io.netty.channel.socket.SocketChannel) NioServerSocketChannel(io.netty.channel.socket.nio.NioServerSocketChannel) ServerChannel(io.netty.channel.ServerChannel) Channel(io.netty.channel.Channel) Span(com.nike.wingtips.Span) ResponseSender(com.nike.riposte.server.http.ResponseSender) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException) EpollEventLoopGroup(io.netty.channel.epoll.EpollEventLoopGroup) EventLoopGroup(io.netty.channel.EventLoopGroup) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) EpollEventLoopGroup(io.netty.channel.epoll.EpollEventLoopGroup) HttpChannelInitializer(com.nike.riposte.server.channelpipeline.HttpChannelInitializer) PostServerStartupHook(com.nike.riposte.server.hooks.PostServerStartupHook) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) SslContext(io.netty.handler.ssl.SslContext) PreServerStartupHook(com.nike.riposte.server.hooks.PreServerStartupHook)

Example 29 with EpollEventLoopGroup

use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.epoll.EpollEventLoopGroup in project angel by Tencent.

the class MatrixTransportServer method start.

public void start() {
    Configuration conf = context.getConf();
    int workerNum = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_SERVER_EVENTGROUP_THREADNUM, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_SERVER_EVENTGROUP_THREADNUM);
    int sendBuffSize = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_SERVER_SNDBUF, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_SERVER_SNDBUF);
    int recvBuffSize = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_SERVER_RCVBUF, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_SERVER_RCVBUF);
    final int maxMessageSize = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_MAX_MESSAGE_SIZE, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_MAX_MESSAGE_SIZE);
    int ioRatio = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_SERVER_IORATIO, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_SERVER_IORATIO);
    String channelType = conf.get(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_SERVER_CHANNEL_TYPE, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_SERVER_CHANNEL_TYPE);
    // Use Epoll for linux
    Class channelClass;
    String os = System.getProperty("os.name");
    if (os != null && os.toLowerCase().startsWith("linux") && channelType.equals("epoll")) {
        LOG.info("Use epoll channel");
        channelClass = EpollServerSocketChannel.class;
        bossGroup = new EpollEventLoopGroup(1);
        workerGroup = new EpollEventLoopGroup(workerNum);
        ((EpollEventLoopGroup) workerGroup).setIoRatio(ioRatio);
    } else {
        LOG.info("Use nio channel");
        channelClass = NioServerSocketChannel.class;
        bossGroup = new NioEventLoopGroup(1);
        workerGroup = new NioEventLoopGroup(workerNum);
        ((NioEventLoopGroup) workerGroup).setIoRatio(70);
    }
    LOG.info("Server port = " + port);
    ServerBootstrap b = new ServerBootstrap();
    b.group(bossGroup, workerGroup).channel(channelClass).option(ChannelOption.SO_SNDBUF, sendBuffSize).option(ChannelOption.SO_RCVBUF, recvBuffSize).option(ChannelOption.SO_KEEPALIVE, true).childHandler(new ChannelInitializer<SocketChannel>() {

        @Override
        public void initChannel(SocketChannel ch) throws Exception {
            ChannelPipeline p = ch.pipeline();
            p.addLast(new LengthFieldBasedFrameDecoder(maxMessageSize, 0, 4, 0, 4));
            p.addLast(new LengthFieldPrepender(4));
            p.addLast(new MatrixTransportServerHandler(context));
        }
    });
    channelFuture = b.bind(port);
}
Also used : NioServerSocketChannel(io.netty.channel.socket.nio.NioServerSocketChannel) EpollServerSocketChannel(io.netty.channel.epoll.EpollServerSocketChannel) SocketChannel(io.netty.channel.socket.SocketChannel) Configuration(org.apache.hadoop.conf.Configuration) LengthFieldPrepender(io.netty.handler.codec.LengthFieldPrepender) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) EpollEventLoopGroup(io.netty.channel.epoll.EpollEventLoopGroup) LengthFieldBasedFrameDecoder(io.netty.handler.codec.LengthFieldBasedFrameDecoder) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Example 30 with EpollEventLoopGroup

use of org.apache.beam.vendor.grpc.v1p43p2.io.netty.channel.epoll.EpollEventLoopGroup in project angel by Tencent.

the class MatrixTransportClient method init.

private void init() {
    Configuration conf = PSAgentContext.get().getConf();
    rpcContext.init(conf, PSAgentContext.get().getLocationManager().getPsIds());
    // Init response handler
    registeHandler();
    // Init network parameters
    int nettyWorkerNum = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_EVENTGROUP_THREADNUM, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_EVENTGROUP_THREADNUM);
    int sendBuffSize = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_SNDBUF, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_SNDBUF);
    int recvBuffSize = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_RCVBUF, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_RCVBUF);
    final int maxMessageSize = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_MAX_MESSAGE_SIZE, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_MAX_MESSAGE_SIZE);
    requestThreadPool = Executors.newFixedThreadPool(conf.getInt(AngelConf.ANGEL_MATRIXTRANSFER_CLIENT_REQUESTER_POOL_SIZE, AngelConf.DEFAULT_ANGEL_MATRIXTRANSFER_CLIENT_REQUESTER_POOL_SIZE), new AngelThreadFactory("RPCRequest"));
    responseThreadPool = Executors.newFixedThreadPool(conf.getInt(AngelConf.ANGEL_MATRIXTRANSFER_CLIENT_RESPONSER_POOL_SIZE, AngelConf.DEFAULT_ANGEL_MATRIXTRANSFER_CLIENT_RESPONSER_POOL_SIZE), new AngelThreadFactory("RPCResponser"));
    ChannelPoolParam poolParam = new ChannelPoolParam();
    poolParam.maxActive = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_MAX_CONN_PERSERVER, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_MAX_CONN_PERSERVER);
    poolParam.minActive = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_MIN_CONN_PERSERVER, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_MIN_CONN_PERSERVER);
    poolParam.maxIdleTimeMs = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_MAX_CONN_IDLETIME_MS, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_MAX_CONN_IDLETIME_MS);
    poolParam.getChannelTimeoutMs = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_GET_CONN_TIMEOUT_MS, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_GET_CONN_TIMEOUT_MS);
    int ioRatio = conf.getInt(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_IORATIO, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_IORATIO);
    String channelType = conf.get(AngelConf.ANGEL_NETTY_MATRIXTRANSFER_CLIENT_CHANNEL_TYPE, AngelConf.DEFAULT_ANGEL_NETTY_MATRIXTRANSFER_CLIENT_CHANNEL_TYPE);
    hbThreadPool = Executors.newFixedThreadPool(8, new AngelThreadFactory("Heartbeat"));
    bootstrap = new Bootstrap();
    channelManager = new ChannelManager2(bootstrap, poolParam);
    channelManager.initAndStart();
    // Use Epoll for linux
    Class channelClass;
    String os = System.getProperty("os.name");
    if (os != null && os.toLowerCase().startsWith("linux") && channelType.equals("epoll")) {
        LOG.info("Use epoll channel");
        channelClass = EpollSocketChannel.class;
        eventGroup = new EpollEventLoopGroup(nettyWorkerNum);
        ((EpollEventLoopGroup) eventGroup).setIoRatio(ioRatio);
    } else {
        LOG.info("Use nio channel");
        channelClass = NioSocketChannel.class;
        eventGroup = new NioEventLoopGroup(nettyWorkerNum);
        ((NioEventLoopGroup) eventGroup).setIoRatio(ioRatio);
    }
    MatrixTransportClient client = this;
    bootstrap.group(eventGroup).channel(channelClass).option(ChannelOption.SO_SNDBUF, sendBuffSize).option(ChannelOption.SO_RCVBUF, recvBuffSize).option(ChannelOption.SO_KEEPALIVE, true).handler(new ChannelInitializer<SocketChannel>() {

        @Override
        protected void initChannel(SocketChannel ch) throws Exception {
            ChannelPipeline pipeLine = ch.pipeline();
            pipeLine.addLast(new LengthFieldBasedFrameDecoder(maxMessageSize, 0, 4, 0, 4));
            pipeLine.addLast(new LengthFieldPrepender(4));
            pipeLine.addLast(new MatrixTransportClientHandler(client, dispatchMessageQueue, rpcContext));
        }
    });
}
Also used : SocketChannel(io.netty.channel.socket.SocketChannel) NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) EpollSocketChannel(io.netty.channel.epoll.EpollSocketChannel) Configuration(org.apache.hadoop.conf.Configuration) AngelThreadFactory(com.tencent.angel.common.AngelThreadFactory) ChannelPoolParam(com.tencent.angel.common.transport.ChannelPoolParam) LengthFieldPrepender(io.netty.handler.codec.LengthFieldPrepender) ServiceException(com.google.protobuf.ServiceException) AngelException(com.tencent.angel.exception.AngelException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) ChannelPipeline(io.netty.channel.ChannelPipeline) EpollEventLoopGroup(io.netty.channel.epoll.EpollEventLoopGroup) Bootstrap(io.netty.bootstrap.Bootstrap) ChannelManager2(com.tencent.angel.common.transport.ChannelManager2) LengthFieldBasedFrameDecoder(io.netty.handler.codec.LengthFieldBasedFrameDecoder) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)

Aggregations

EpollEventLoopGroup (io.netty.channel.epoll.EpollEventLoopGroup)55 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)46 ServerBootstrap (io.netty.bootstrap.ServerBootstrap)20 EventLoopGroup (io.netty.channel.EventLoopGroup)19 EpollServerSocketChannel (io.netty.channel.epoll.EpollServerSocketChannel)14 NioServerSocketChannel (io.netty.channel.socket.nio.NioServerSocketChannel)14 SocketChannel (io.netty.channel.socket.SocketChannel)13 ChannelPipeline (io.netty.channel.ChannelPipeline)12 Channel (io.netty.channel.Channel)10 InetSocketAddress (java.net.InetSocketAddress)10 LengthFieldBasedFrameDecoder (io.netty.handler.codec.LengthFieldBasedFrameDecoder)9 IOException (java.io.IOException)9 Bootstrap (io.netty.bootstrap.Bootstrap)8 ChannelFuture (io.netty.channel.ChannelFuture)8 EpollSocketChannel (io.netty.channel.epoll.EpollSocketChannel)8 SslContext (io.netty.handler.ssl.SslContext)8 NioSocketChannel (io.netty.channel.socket.nio.NioSocketChannel)7 DefaultThreadFactory (io.netty.util.concurrent.DefaultThreadFactory)7 LoggingHandler (io.netty.handler.logging.LoggingHandler)6 SslHandler (io.netty.handler.ssl.SslHandler)6