Package org.apache.avro.ipc

Examples of org.apache.avro.ipc.HttpTransceiver


  @Before
  public void testStartServer() throws Exception {
    server =
      new HttpServer(new SpecificResponder(Simple.class, new TestImpl()), 0);
    client =
      new HttpTransceiver(new URL("http://127.0.0.1:"+server.getPort()+"/"));
    proxy = (Simple)SpecificRequestor.getClient(Simple.class, client);
  }
View Full Code Here


  /** Sends RPCs and returns nanos elapsed. */
  private static long sendRpcs(boolean withPlugin) throws IOException {
    HttpServer server = createServer(withPlugin);
    Transceiver t =
      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

  public void startServer() throws Exception {
    server =
      new HttpServer(new SpecificResponder(BulkData.class, new BulkDataImpl()),
                     0);
    client =
      new HttpTransceiver(new URL("http://127.0.0.1:"+server.getPort()+"/"));
    proxy = (BulkData)SpecificRequestor.getClient(BulkData.class, client);
  }
View Full Code Here

  }
 
  protected List<Span> collectAllSpans(List<URL> hosts) {
    List<Span> out = new ArrayList<Span>();
    for (URL url: hosts) {
      HttpTransceiver trans = new HttpTransceiver(url);
      try {
        AvroTrace client = (AvroTrace)
          SpecificRequestor.getClient(AvroTrace.class, trans);
        for (Span s: client.getAllSpans()) {
          out.add(s);
View Full Code Here

  }
 
  protected List<Span> collectRangedSpans(List<URL> hosts, long start, long end) {
    List<Span> out = new ArrayList<Span>();
    for (URL url: hosts) {
      HttpTransceiver trans = new HttpTransceiver(url);
      try {
        AvroTrace client = (AvroTrace)
          SpecificRequestor.getClient(AvroTrace.class, trans);
        for (Span s: client.getSpansInRange(start, end)) {
          out.add(s);
View Full Code Here

    out.flush();
  }

  private GenericRequestor makeClient(Protocol protocol, URI uri)
  throws IOException {
    HttpTransceiver transceiver =
      new HttpTransceiver(uri.toURL());
    GenericRequestor requestor = new GenericRequestor(protocol, transceiver);
    return requestor;
  }
View Full Code Here

  }
 
  protected List<Span> collectAllSpans(List<URL> hosts) {
    List<Span> out = new ArrayList<Span>();
    for (URL url: hosts) {
      HttpTransceiver trans = new HttpTransceiver(url);
      try {
        AvroTrace client = (AvroTrace)
          SpecificRequestor.getClient(AvroTrace.class, trans);
        for (Span s: client.getAllSpans()) {
          out.add(s);
View Full Code Here

  }
 
  protected List<Span> collectRangedSpans(List<URL> hosts, long start, long end) {
    List<Span> out = new ArrayList<Span>();
    for (URL url: hosts) {
      HttpTransceiver trans = new HttpTransceiver(url);
      try {
        AvroTrace client = (AvroTrace)
          SpecificRequestor.getClient(AvroTrace.class, trans);
        for (Span s: client.getSpansInRange(start, end)) {
          out.add(s);
View Full Code Here

public class AvroHttpConsumerTest extends AvroConsumerTestSupport {

    @Override
    protected void initializeTranceiver() throws IOException {
        transceiver = new HttpTransceiver(new URL("http://localhost:" + avroPort));
        requestor = new SpecificRequestor(KeyValueProtocol.class, transceiver);
    }
View Full Code Here

    res.addRPCPlugin(responderPlugin);
   
    HttpServer server = new HttpServer(res, 50000);
    server.start();
   
    HttpTransceiver trans = new HttpTransceiver(
        new URL("http://localhost:50000"));
   
    GenericRequestor r = new GenericRequestor(protocol, trans);
    r.addRPCPlugin(requestorPlugin);
   
View Full Code Here

TOP

Related Classes of org.apache.avro.ipc.HttpTransceiver

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.