Examples of NioClientSocketChannelFactory


Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

     * @throws InterruptedException
     * @throws KeeperException
     */
    public BookKeeper(ClientConfiguration conf, ZooKeeper zk)
        throws IOException, InterruptedException, KeeperException {
        this(conf, zk, new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool()));
        ownChannelFactory = true;
    }
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

    ClientSocketChannelFactory channelFactory;
    OrderedSafeExecutor executor = new OrderedSafeExecutor(1);


    public BookieBenchmark(String bookieHostPortthrows Exception {
        channelFactory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
        bkc = new BookieClient(new ClientConfiguration(), channelFactory, executor);
        String[] hostPort = bookieHostPort.split(":");
        addr = new InetSocketAddress(hostPort[0], Integer.parseInt(hostPort[1]));

    }
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

                    // Since zk is needed by almost everyone,try to see if we
                    // need that first
                    scheduler = Executors.newSingleThreadScheduledExecutor();
                    serverChannelFactory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors
                            .newCachedThreadPool());
                    clientChannelFactory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors
                            .newCachedThreadPool());

                    instantiateZookeeperClient();
                    tm = instantiateTopicManager();
                    pm = instantiatePersistenceManager(tm);
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

        conf.setZkServers(null).setBookiePort(port)
            .setJournalDirName(tmpDir.getPath())
            .setLedgerDirNames(new String[] { tmpDir.getPath() });
        bs = new BookieServer(conf);
        bs.start();
        channelFactory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors
                .newCachedThreadPool());
        executor = new OrderedSafeExecutor(2);
    }
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

   * {@link #DEFAULT_CONNECTION_TIMEOUT_MILLIS}.
   * @throws IOException if an error occurs connecting to the given address.
   */
  public NettyTransceiver(InetSocketAddress addr,
      Long connectTimeoutMillis) throws IOException {
    this(addr, new NioClientSocketChannelFactory(
        Executors.newCachedThreadPool(new NettyTransceiverThreadFactory(
            "Avro " + NettyTransceiver.class.getSimpleName() + " Boss")),
        Executors.newCachedThreadPool(new NettyTransceiverThreadFactory(
            "Avro " + NettyTransceiver.class.getSimpleName() + " I/O Worker"))),
        connectTimeoutMillis);
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

    protected void setupTCPCommunication() throws Exception {
        if (channelFactory == null) {
            bossExecutor = context.getExecutorServiceManager().newCachedThreadPool(this, "NettyTCPBoss");
            workerExecutor = context.getExecutorServiceManager().newCachedThreadPool(this, "NettyTCPWorker");
            channelFactory = new NioClientSocketChannelFactory(bossExecutor, workerExecutor);
        }
    }
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

                        .withWorkerCount(configuration.getWorkerCount())
                        .withName("NettyClientTCPWorker")
                        .build();
                wp = workerPool;
            }
            channelFactory = new NioClientSocketChannelFactory(bp, wp);
        }
    }
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

        // TODO: handle session disconnects and expires
        if (LOG.isDebugEnabled()) {
          LOG.debug("Process: " + event.getType() + " " + event.getPath());
        }
      }
    }), new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
        Executors.newCachedThreadPool()));

    ownZKHandle = true;
    ownChannelFactory = true;
  }
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

   *          the bookies have registered
   * @throws InterruptedException
   * @throws KeeperException
   */
  public BookKeeper(ZooKeeper zk) throws InterruptedException, KeeperException {
    this(zk, new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
        Executors.newCachedThreadPool()));
    ownChannelFactory = true;
  }
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory

        int clusterSize = this.topology.getPhysicalCluster().getNodes().size();
        partitionChannelMap = Maps.synchronizedBiMap(HashBiMap.<Integer, Channel> create(clusterSize));
        partitionNodeMap = HashBiMap.create(clusterSize);

        // Initialize netty related structures
        ChannelFactory factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());
        bootstrap = new ClientBootstrap(factory);
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            @Override
            public ChannelPipeline getPipeline() {
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.