Package org.apache.avro.generic

Examples of org.apache.avro.generic.GenericRequestor.request()


    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


    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

    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

        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

    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

      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

      (new InetSocketAddress(server.getPort()), saslClient);
    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

    Transceiver t = new LocalTransceiver(new TestResponder(protocol));
    GenericRecord params = new GenericData.Record(protocol.getMessages().get(
        "m").getRequest());
    params.put("x", new Utf8("hello"));
    GenericRequestor r = new GenericRequestor(protocol, t);
    assertEquals(new Utf8("there"), r.request("m", params));
  }

}
View Full Code Here

      new HttpTransceiver(new URL("http://127.0.0.1:"+server.getPort()+"/"));
    GenericRequestor requestor = new GenericRequestor(NULL_PROTOCOL, t);

    long now = System.nanoTime();
    for (int i = 0; i < COUNT; ++i) {
      requestor.request("null", null);
    }
    long elapsed = System.nanoTime() - now;
    t.close();
    server.close();
    return elapsed;
View Full Code Here

  private void makeRequest(Transceiver t) throws IOException {
    GenericRecord params = new GenericData.Record(protocol.getMessages().get(
        "m").getRequest());
    params.put("x", 0);
    GenericRequestor r = new GenericRequestor(protocol, t);
    assertEquals(1, r.request("m", params));
  }

  @Test
  public void testFullServerPath() throws IOException {
    Responder r = new TestResponder(protocol);
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.