Examples of NettyDataPack


Examples of org.apache.avro.ipc.NettyTransportCodec.NettyDataPack

  public void transceive(List<ByteBuffer> request,
      Callback<List<ByteBuffer>> callback) throws IOException {
    stateLock.readLock().lock();
    try {
      int serial = serialGenerator.incrementAndGet();
      NettyDataPack dataPack = new NettyDataPack(serial, request);
      requests.put(serial, callback);
      writeDataPack(dataPack);
    } finally {
      stateLock.readLock().unlock();
    }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransportCodec.NettyDataPack

    }
  }
 
  @Override
  public void writeBuffers(List<ByteBuffer> buffers) throws IOException {
    writeDataPack(new NettyDataPack(serialGenerator.incrementAndGet(), buffers));
  }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransportCodec.NettyDataPack

      super.channelOpen(ctx, e);
    }

    @Override
    public void messageReceived(ChannelHandlerContext ctx, final MessageEvent e) {
      NettyDataPack dataPack = (NettyDataPack)e.getMessage();
      Callback<List<ByteBuffer>> callback = requests.get(dataPack.getSerial());
      if (callback==null) {
        throw new RuntimeException("Missing previous call info");
      }
      try {
        callback.handleResult(dataPack.getDatas());
      } finally {
        requests.remove(dataPack.getSerial());
      }
    }
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.