Examples of NettyTransceiver


Examples of org.apache.avro.ipc.NettyTransceiver

    }

    @Override
    public Transceiver createTransceiver() throws Exception {
        AvroConfiguration configuration = getEndpoint().getConfiguration();
        return transceiver = new NettyTransceiver(new InetSocketAddress(configuration.getHost(), configuration.getPort()));
    }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

    static int avroPort = setupFreePort("avroport");

    @Override
    protected void initializeTranceiver() throws IOException {
        transceiver = new NettyTransceiver(new InetSocketAddress("localhost", avroPort));
        requestor = new SpecificRequestor(KeyValueProtocol.class, transceiver);
    }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

   * @param tu
   * @throws FlumeException
   */
  private void connect(long timeout, TimeUnit tu) throws FlumeException {
    try {
      transceiver = new NettyTransceiver(new InetSocketAddress(hostname, port),
          tu.toMillis(timeout));
      avroClient =
          SpecificRequestor.getClient(AvroSourceProtocol.Callback.class,
          transceiver);

View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

            source, LifecycleState.START_OR_ERROR));
    Assert.assertEquals("Server is started", LifecycleState.START,
        source.getLifecycleState());

    AvroSourceProtocol client = SpecificRequestor.getClient(
        AvroSourceProtocol.class, new NettyTransceiver(new InetSocketAddress(
            selectedPort)));

    AvroFlumeEvent avroEvent = new AvroFlumeEvent();

    avroEvent.setHeaders(new HashMap<CharSequence, CharSequence>());
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

        maxCachedConnections) {
      @Override
      protected final boolean removeEldestEntry(
          Map.Entry<InetSocketAddress, NettyTransceiver> eldest) {
        if (size() > this.capacity) {
          NettyTransceiver client = eldest.getValue();
          client.close();
          peers.remove(eldest.getKey());
          return true;
        }
        return false;
      }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

   *         returns a new connection and caches it
   * @throws IOException
   */
  @SuppressWarnings("unchecked")
  private final Sender<M> getSender(InetSocketAddress addr) throws IOException {
    NettyTransceiver client = peersLRUCache.get(addr);
    if (client == null) {
      client = new NettyTransceiver(addr);
      Sender<M> sender = SpecificRequestor.getClient(Sender.class, client);
      peersLRUCache.put(addr, client);
      peers.put(addr, sender);
    }
    return peers.get(addr);
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

    return new NettyServer(responder, new InetSocketAddress(0));
  }
 
  @Override
  public Transceiver createTransceiver() throws Exception{
    return new NettyTransceiver(new InetSocketAddress(server.getPort()));
  }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

   */
  private void connect(long timeout, TimeUnit tu) throws FlumeException {
    callTimeoutPool = Executors.newCachedThreadPool(
        new TransceiverThreadFactory("Flume Avro RPC Client Call Invoker"));
    try {
      transceiver = new NettyTransceiver(this.address,
          new NioClientSocketChannelFactory(
        Executors.newCachedThreadPool(new TransceiverThreadFactory(
            "Avro " + NettyTransceiver.class.getSimpleName() + " Boss")),
        Executors.newCachedThreadPool(new TransceiverThreadFactory(
            "Avro " + NettyTransceiver.class.getSimpleName() + " I/O Worker"))),
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

    Transceiver transceiver = null;
    BufferedReader reader = null;

    try {
      transceiver = new NettyTransceiver(new InetSocketAddress(hostname, port));
      AvroSourceProtocol client = SpecificRequestor.getClient(
          AvroSourceProtocol.class, transceiver);
      List<AvroFlumeEvent> eventBuffer = new ArrayList<AvroFlumeEvent>();

      if (fileName != null) {
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

  private void createConnection() throws IOException {
    if (transceiver == null) {
      logger.debug("Creating new tranceiver connection to hostname:{} port:{}",
          hostname, port);
      transceiver = new NettyTransceiver(new InetSocketAddress(hostname, port));
    }

    if (client == null) {
      logger.debug("Creating Avro client with tranceiver:{}", transceiver);
      client = SpecificRequestor.getClient(AvroSourceProtocol.class,
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.