Examples of NettyTransceiver


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.headers = new HashMap<CharSequence, CharSequence>();
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

    }

    private AvroSourceProtocol connect(String hostname, int port) {
        try {
            if (transceiver == null) {
                transceiver = new NettyTransceiver(new InetSocketAddress(hostname, port));
            }
        } catch (IOException ioe) {
            LOGGER.error("Unable to create transceiver", ioe);
            return null;
        }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

public class AvroNettyConsumerTest extends AvroConsumerTestSupport {

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

        transceiverMessageInRoute = new NettyTransceiver(new InetSocketAddress("localhost", avroPortMessageInRoute));
        requestorMessageInRoute = new SpecificRequestor(KeyValueProtocol.class, transceiverMessageInRoute);

        transceiverForWrongMessages = new NettyTransceiver(new InetSocketAddress("localhost", avroPortForWrongMessages));
        requestorForWrongMessages = new SpecificRequestor(KeyValueProtocol.class, transceiverForWrongMessages);

        reflectTransceiver = new NettyTransceiver(new InetSocketAddress("localhost", avroPortReflection));
        reflectRequestor = new ReflectRequestor(TestReflection.class, reflectTransceiver);
    }
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(this.address, tu.toMillis(timeout));
      avroClient =
          SpecificRequestor.getClient(AvroSourceProtocol.Callback.class,
          transceiver);
    } catch (IOException ex) {
      logger.error("RPC connection error :" , ex);
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

        Map<String, Object> options = new HashMap<String, Object>(3);
        options.put(NettyTransceiver.NETTY_TCP_NODELAY_OPTION, NettyTransceiver.DEFAULT_TCP_NODELAY_VALUE);
        options.put("keepAlive", keepAlive);
        options.put(NettyTransceiver.NETTY_CONNECT_TIMEOUT_OPTION, NettyTransceiver.DEFAULT_CONNECTION_TIMEOUT_MILLIS);

        return new NettyTransceiver(address, new NioClientSocketChannelFactory(
                Executors.newCachedThreadPool(new DaemonThreadFactory(new CustomThreadFactory("avro-client-boss"))),
                Executors.newCachedThreadPool(new DaemonThreadFactory(new CustomThreadFactory("avro-client-worker")))),
                options);
    }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

    return 0;
  }

  private boolean initializeService() {
    try {
      nettyTransceiver = new NettyTransceiver(masterAddr);
      masterService = SpecificRequestor.getClient(IterativeReduceService.class,
          nettyTransceiver);

      LOG.info("Connected to master via NettyTranseiver at " + masterAddr);
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

    ExecutorService pool = Executors.newSingleThreadExecutor();
    Future<Integer> master = pool.submit(masterService);

    IterativeReduceService masterPrc = SpecificRequestor.getClient(
        IterativeReduceService.class, new NettyTransceiver(masterAddress));

    // Test
    WorkerId workerOne = Utils.createWorkerId("worker1");
    WorkerId workerTwo = Utils.createWorkerId("worker2");
   
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

  public synchronized void start() throws IOException {
    if (log.isInfoEnabled()) {
      log.info("Starting Simple Ordering Netty client on '{}'", endpointAddress);
    }
    transceiver = new NettyTransceiver(endpointAddress);
    service = SpecificRequestor.getClient(OrderProcessingService.class, transceiver);
  }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

    }

    private AvroSourceProtocol connect(String hostname, int port) {
        try {
            if (transceiver == null) {
                transceiver = new NettyTransceiver(new InetSocketAddress(hostname, port));
            }
        } catch (IOException ioe) {
            LOGGER.error("Unable to create transceiver", ioe);
            return null;
        }
View Full Code Here

Examples of org.apache.avro.ipc.NettyTransceiver

public class AvroNettyConsumerTest extends AvroConsumerTestSupport {

    @Override
    protected void initializeTranceiver() throws IOException {
        transceiver = new NettyTransceiver(new InetSocketAddress("localhost", avroPort));
        requestor = new SpecificRequestor(KeyValueProtocol.class, transceiver);
    }
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.