Package org.apache.avro.ipc.specific

Examples of org.apache.avro.ipc.specific.SpecificResponder


    }

    @Override
    protected void initializeServer() {
        if (server == null) {
            server = new NettyServer(new SpecificResponder(KeyValueProtocol.PROTOCOL, keyValue), new InetSocketAddress("localhost", avroPort));
            server.start();
        }
    }
View Full Code Here


    static int avroPort = setupFreePort("avroport");

    @Override
    protected void initializeServer() throws IOException {
        if (server == null) {
            server = new HttpServer(new SpecificResponder(KeyValueProtocol.PROTOCOL, keyValue), avroPort);
            server.start();
        }
    }
View Full Code Here

  }

  @Override
  public void start() {
    // setup http server to receive OG events
    res = new SpecificResponder(FlumeOGEventAvroServer.class, this);
    try {
      http = new HttpServer(res, host, port);
    } catch (IOException eI) {
      LOG.warn("Failed to start server", eI);
      return;
View Full Code Here

  /**
   * Start a NettyServer, wait a moment for it to spin up, and return it.
   */
  public static Server startServer(AvroSourceProtocol handler) {
    Responder responder = new SpecificResponder(AvroSourceProtocol.class,
        handler);
    Server server = new NettyServer(responder,
        new InetSocketAddress(localhost, 0));
    server.start();
    logger.log(Level.INFO, "Server started on hostname: {0}, port: {1}",
View Full Code Here

  @Override
  public void start() {
    logger.info("Avro source starting:{}", this);

    Responder responder = new SpecificResponder(AvroSourceProtocol.class, this);
    server = new NettyServer(responder,
        new InetSocketAddress(bindAddress, port));

    server.start();
View Full Code Here

        LifecycleState.STOP_OR_ERROR, 5000));
    server.close();
  }

  private Server createServer() {
    Server server = new NettyServer(new SpecificResponder(
        AvroSourceProtocol.class, new MockAvroServer()), new InetSocketAddress(
        hostname, port));

    return server;
  }
View Full Code Here

  @Override
  public void init(TaskAttemptID attemptId, BSPPeer<?, ?, ?, ?, M> peer,
      Configuration conf, InetSocketAddress addr) {
    super.init(attemptId, peer, conf, addr);
    super.initCompression(conf);
    server = new NettyServer(new SpecificResponder(Sender.class, this), addr);
    peersLRUCache = new LRUCache<InetSocketAddress, NettyTransceiver>(
        maxCachedConnections) {
      @Override
      protected final boolean removeEldestEntry(
          Map.Entry<InetSocketAddress, NettyTransceiver> eldest) {
View Full Code Here

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

  protected static HandshakeMonitor monitor;

  @Before
  public void testStartServer() throws Exception {
    if (server != null) return;
    responder = new SpecificResponder(Simple.class, new TestImpl());
    server = createServer(responder);
    server.start();
   
    client = createTransceiver();
    SpecificRequestor req = new SpecificRequestor(Simple.class, client);
View Full Code Here

    /**
     * Starts the RPC server.
     */
    public static void main(String[] args) throws Exception {
      SocketServer server = new SocketServer(
          new SpecificResponder(Simple.class, new TestImpl()),
          new InetSocketAddress(0));
      server.start();
      File portFile = new File(SERVER_PORTS_DIR, "java-port");
      FileWriter w = new FileWriter(portFile);
      w.write(Integer.toString(server.getPort()));
View Full Code Here

TOP

Related Classes of org.apache.avro.ipc.specific.SpecificResponder

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.