Package org.apache.avro.ipc.generic

Examples of org.apache.avro.ipc.generic.GenericRequestor


        new URL("http://localhost:21005")); // recurse
    HttpTransceiver trans2 = new HttpTransceiver(
        new URL("http://localhost:21007")); // no recurse
   
   
    GenericRequestor r1 = new GenericRequestor(advancedProtocol, trans1);
    r1.addRPCPlugin(aPlugin);
   
    GenericRequestor r2 = new GenericRequestor(advancedProtocol, trans2);
    r2.addRPCPlugin(fPlugin);
   
    GenericRecord params = new GenericData.Record(
        advancedProtocol.getMessages().get("w").getRequest());
    params.put("req", 1);
   
    while (true){
      r1.request("w", params);
      r2.request("x", params);
      Thread.sleep(100);
    }
  }
View Full Code Here


      super(local);
      transC = new HttpTransceiver(
          new URL("http://localhost:21006"));
      transD = new HttpTransceiver(
          new URL("http://localhost:21007"));
      reqC = new GenericRequestor(local, transC);
      reqC.addRPCPlugin(plugin);
      reqD = new GenericRequestor(local, transD);
      reqD.addRPCPlugin(plugin);
     
      protocol = local;
    }
View Full Code Here

    } else {
      err.println("One of -data or -file must be specified.");
      return 1;
    }

    GenericRequestor client =
      new GenericRequestor(protocol, Ipc.createTransceiver(uri));
    Object response = client.request(message.getName(), datum);
    dumpJson(out, message.getResponse(), response);
    return 0;
  }
View Full Code Here

                             Schema.create(Schema.Type.STRING),
                             Schema.createUnion(new ArrayList<Schema>()));
    protocol.getMessages().put("hello", message);
    Transceiver t = createTransceiver();
    try {
      GenericRequestor r = new GenericRequestor(protocol, t);
      addRpcPlugins(r);
      GenericRecord params = new GenericData.Record(message.getRequest());
      params.put("extra", Boolean.TRUE);
      params.put("greeting", "bob");
      String response = r.request("hello", params).toString();
      assertEquals("goodbye", response);
    } finally {
      t.close();
      server.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.avro.ipc.generic.GenericRequestor

Copyright © 2018 www.massapicom. 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.