Examples of NioEventLoopGroup


Examples of io.netty.channel.nio.NioEventLoopGroup

    public void start(int port) throws IOException {
        try {
            bootstrap = new ServerBootstrap();
            bootstrap.option(ChannelOption.SO_RCVBUF, 128 * 1024);
            bootstrap.option(ChannelOption.TCP_NODELAY, true);
            bootstrap.group(new NioEventLoopGroup(), new NioEventLoopGroup());
            bootstrap.channel(NioServerSocketChannel.class);
            bootstrap.localAddress(port);
            bootstrap.childHandler(new ChannelInitializer<SocketChannel>() {
                @Override
                public void initChannel(SocketChannel channel) throws Exception {
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

    /**
     * {@inheritDoc}
     */
    public void start(int port) throws IOException {
        bootstrap = new Bootstrap();
        bootstrap.group(new NioEventLoopGroup());
        bootstrap.channel(NioDatagramChannel.class);
        bootstrap.option(ChannelOption.SO_RCVBUF, 65536);
        bootstrap.handler(new ChannelInitializer<DatagramChannel>() {

            @Override
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

   * Starts message handling server, creates client bootstrap, and bootstraps partition routing
   * table.
   */
  public void start() throws Exception {
    if (isShutdown.getAndSet(false)) {
      eventLoopGroup = new NioEventLoopGroup();

      statTxMsg = metricRegistry.meter(MetricRegistry.name(NettyHelixIPCService.class, "txMsg"));
      statRxMsg = metricRegistry.meter(MetricRegistry.name(NettyHelixIPCService.class, "rxMsg"));
      statTxBytes =
          metricRegistry.meter(MetricRegistry.name(NettyHelixIPCService.class, "txBytes"));
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

  private final BitCom bitCom;
  private final DrillConfig config;
  boolean useIP = false;
 
  public ServiceEngine(BitComHandler bitComWorker, UserWorker userWorker, BootStrapContext context){
    this.userServer = new UserServer(context.getAllocator().getUnderlyingAllocator(), new NioEventLoopGroup(1, new NamedThreadFactory("UserServer-")), userWorker);
    this.bitCom = new BitComImpl(context, bitComWorker);
    this.config = context.getConfig();
  }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

  private final BufferAllocator allocator;
 
  public BootStrapContext(DrillConfig config) {
    super();
    this.config = config;
    this.loop = new NioEventLoopGroup(1, new NamedThreadFactory("BitServer-"));
    this.metrics = new MetricRegistry(config.getString(ExecConstants.METRICS_CONTEXT_NAME));
    this.allocator = BufferAllocator.getAllocator(config);
  }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

    Collection<DrillbitEndpoint> endpoints = clusterCoordinator.getAvailableEndpoints();
    checkState(!endpoints.isEmpty(), "No DrillbitEndpoint can be found");
    // just use the first endpoint for now
    DrillbitEndpoint endpoint = endpoints.iterator().next();
    this.client = new UserClient(allocator.getUnderlyingAllocator(), new NioEventLoopGroup(1, new NamedThreadFactory("Client-")));
    logger.debug("Connecting to server {}:{}", endpoint.getAddress(), endpoint.getUserPort());
    connect(endpoint);
    connected = true;
  }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

    protected void initGroups() {
        if (configCopy.isUseLinuxNativeEpoll()) {
            bossGroup = new EpollEventLoopGroup(configCopy.getBossThreads());
            workerGroup = new EpollEventLoopGroup(configCopy.getWorkerThreads());
        } else {
            bossGroup = new NioEventLoopGroup(configCopy.getBossThreads());
            workerGroup = new NioEventLoopGroup(configCopy.getWorkerThreads());
        }
    }
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

    // Configure the server.
    ServerBootstrap b = new ServerBootstrap();
    final DefaultEventExecutorGroup group = new DefaultEventExecutorGroup(1);
    try {
        b.group(new NioEventLoopGroup(), new NioEventLoopGroup())
         .channel(NioServerSocketChannel.class)
         .option(ChannelOption.SO_BACKLOG, 100)
         .localAddress(port)
         .childOption(ChannelOption.TCP_NODELAY, true)
         .childHandler(new ChannelInitializer<SocketChannel>() {
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

    ch.write(new Command(set, numToBytes(i, false), VALUE));
  }

  public static void main(String[] args) throws Exception {
    final SocketChannel ch = new NioSocketChannel();
    new NioEventLoopGroup().register(ch);
    final long start = System.currentTimeMillis();
    ch.pipeline().addLast(new RedisCommandEncoder(), new RedisReplyDecoder());
    ch.connect(new InetSocketAddress("localhost", 6379)).addListener(new ChannelFutureListener() {
      @Override
      public void operationComplete(ChannelFuture channelFuture) throws Exception {
View Full Code Here

Examples of io.netty.channel.nio.NioEventLoopGroup

        }
        return 0;
    }

    public CubeServer start() {
        workerGroup = new NioEventLoopGroup(8);

        try {
            final ServerBootstrap bootstrap = new ServerBootstrap();
            bootstrap
                .option(ChannelOption.SO_REUSEADDR, true)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.