Examples of GenericRequestor


Examples of org.apache.avro.generic.GenericRequestor

   
    // Root requestor
    HttpTransceiver trans = new HttpTransceiver(
        new URL("http://localhost:21005"));
   
    GenericRequestor r = new GenericRequestor(TestBasicTracing.advancedProtocol, trans);
    r.addRPCPlugin(aPlugin);
   
    GenericRecord params = new GenericData.Record(
        TestBasicTracing.advancedProtocol.getMessages().get("w").getRequest());
    params.put("req", 1);
   
    for (int i = 0; i < 40; i++) {
      r.request("w", params)
    }
   
    List<Span> allSpans = new ArrayList<Span>();
    allSpans.addAll(aPlugin.storage.getAllSpans());
    allSpans.addAll(bPlugin.storage.getAllSpans());
View Full Code Here

Examples of org.apache.avro.generic.GenericRequestor

    server.start();
   
    HttpTransceiver trans = new HttpTransceiver(
        new URL("http://localhost:50000"));
   
    GenericRequestor r = new GenericRequestor(protocol, trans);
    r.addRPCPlugin(requestorPlugin);
   
    GenericRecord params = new GenericData.Record(protocol.getMessages().get(
    "m").getRequest());
    params.put("x", 0);
    r.request("m", params);
   
    List<Span> responderSpans = responderPlugin.storage.getAllSpans();
    assertEquals(1, responderSpans.size());
   
    List<Span> requestorSpans = requestorPlugin.storage.getAllSpans();
View Full Code Here

Examples of org.apache.avro.generic.GenericRequestor

   
    // Root requestor
    HttpTransceiver trans = new HttpTransceiver(
        new URL("http://localhost:21005"));
   
    GenericRequestor r = new GenericRequestor(advancedProtocol, trans);
    r.addRPCPlugin(aPlugin);
   
    GenericRecord params = new GenericData.Record(
        advancedProtocol.getMessages().get("w").getRequest());
    params.put("req", 1);
    r.request("w", params);
   
    // Verify counts
    assertEquals(1, aPlugin.storage.getAllSpans().size());
    assertEquals(3, bPlugin.storage.getAllSpans().size());
    assertEquals(1, cPlugin.storage.getAllSpans().size());
View Full Code Here

Examples of org.apache.avro.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

Examples of org.apache.avro.generic.GenericRequestor

      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

Examples of org.apache.avro.generic.GenericRequestor

   
    // Root requestor
    HttpTransceiver trans = new HttpTransceiver(
        new URL("http://localhost:21005"));
   
    GenericRequestor r = new GenericRequestor(advancedProtocol, trans);
    r.addRPCPlugin(aPlugin);
   
    GenericRecord params = new GenericData.Record(
        advancedProtocol.getMessages().get("w").getRequest());
    params.put("req", 1);
    r.request("w", params);
    Thread.sleep(1000);
    ArrayList<Span> allSpans = new ArrayList<Span>();
   
    allSpans.addAll(aPlugin.storage.getAllSpans());
    allSpans.addAll(bPlugin.storage.getAllSpans());
View Full Code Here

Examples of org.apache.avro.generic.GenericRequestor

      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

Examples of org.apache.avro.generic.GenericRequestor

    responder.addRPCPlugin(new RPCMetaTestPlugin("key2"));
    server = new SocketServer(responder, new InetSocketAddress(0));
    server.start();
   
    client = new SocketTransceiver(new InetSocketAddress(server.getPort()));
    requestor = new GenericRequestor(PROTOCOL, client);
    requestor.addRPCPlugin(new RPCMetaTestPlugin("key1"));
    requestor.addRPCPlugin(new RPCMetaTestPlugin("key2"));
  }
View Full Code Here

Examples of org.apache.avro.generic.GenericRequestor

    SaslClient saslClient = Sasl.createSaslClient
      (new String[]{DIGEST_MD5_MECHANISM}, PRINCIPAL, SERVICE, HOST,
       DIGEST_MD5_PROPS, new TestSaslCallbackHandler());
    client = new SaslSocketTransceiver(new InetSocketAddress(server.getPort()),
                                       saslClient);
    requestor = new GenericRequestor(PROTOCOL, client);
  }
View Full Code Here

Examples of org.apache.avro.generic.GenericRequestor

      (new TestResponder(), new InetSocketAddress(0), DIGEST_MD5_MECHANISM,
       SERVICE, HOST, DIGEST_MD5_PROPS, new TestSaslCallbackHandler());
    s.start();
    Transceiver c =
      new SaslSocketTransceiver(new InetSocketAddress(s.getPort()));
    GenericRequestor requestor = new GenericRequestor(PROTOCOL, c);
    GenericRecord params =
      new GenericData.Record(PROTOCOL.getMessages().get("hello").getRequest());
    params.put("greeting", "bob");
    Utf8 response = (Utf8)requestor.request("hello", params);
    assertEquals(new Utf8("goodbye"), response);
    s.close();
    c.close();
  }
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.