Package org.apache.hadoop.ipc

Examples of org.apache.hadoop.ipc.Client


    throws IOException {

    Invocation[] invocations = new Invocation[params.length];
    for (int i = 0; i < params.length; i++)
      invocations[i] = new Invocation(method, params[i]);
    Client client = CLIENTS.getClient(conf);
    try {
    Writable[] wrappedValues = client.call(invocations, addrs);
   
    if (method.getReturnType() == Void.TYPE) {
      return null;
    }
View Full Code Here


      // Construct & cache client.  The configuration is only used for timeout,
      // and Clients have connection pools.  So we can either (a) lose some
      // connection pooling and leak sockets, or (b) use the same timeout for all
      // configurations.  Since the IPC is usually intended globally, not
      // per-job, we choose (a).
      Client client = clients.get(factory);
      if (client == null) {
        client = new HBaseClient(ObjectWritable.class, conf, factory);
        clients.put(factory, client);
      } else {
        ((HBaseClient)client).incCount();
View Full Code Here

  /**
   * test the recoverBlock does not leak clients when creating
   * InterDatanodeProtocol RPC instances
   */
  public void testForClientLeak() throws Exception {
      Client client = ClientAdapter.getClient(
        conf, NetUtils.getSocketFactory(conf, InterDatanodeProtocol.class)
      );

      DistributedFileSystem fileSystem = (DistributedFileSystem) cluster.getFileSystem();
      int initialRefCount = ClientAdapter.getRefCount(client);
View Full Code Here

    // Construct & cache client.  The configuration is only used for timeout,
    // and Clients have connection pools.  So we can either (a) lose some
    // connection pooling and leak sockets, or (b) use the same timeout for all
    // configurations.  Since the IPC is usually intended globally, not
    // per-job, we choose (a).
    Client client = CLIENTS.get(factory);
    if (client == null) {
      client = new Client(HbaseObjectWritable.class, conf, factory);
      CLIENTS.put(factory, client);
    }
    return client;
  }
View Full Code Here

    InetSocketAddress addr = NetUtils.getConnectAddress(server);
    server.start();

    Client[] clients = new Client[clientCount];
    for (int i = 0; i < clientCount; i++) {
      clients[i] = new Client(LongWritable.class, conf);
    }

    SerialCaller[] callers = new SerialCaller[callerCount];
    for (int i = 0; i < callerCount; i++) {
      callers[i] = new SerialCaller(clients[i % clientCount], addr, callCount);
View Full Code Here

      addresses[i] = NetUtils.getConnectAddress(servers[i % serverCount]);
    }

    Client[] clients = new Client[clientCount];
    for (int i = 0; i < clientCount; i++) {
      clients[i] = new Client(LongWritable.class, conf);
    }

    ParallelCaller[] callers = new ParallelCaller[callerCount];
    for (int i = 0; i < callerCount; i++) {
      callers[i] = new ParallelCaller(clients[i % clientCount], addresses,
View Full Code Here

    }
  }

  public void testStandAloneClient() throws Exception {
    testParallel(10, false, 2, 4, 2, 4, 100);
    Client client = new Client(LongWritable.class, conf);
    InetSocketAddress address = new InetSocketAddress("127.0.0.1", 10);
    try {
      client.call(new LongWritable(RANDOM.nextLong()), address, null, null);
      fail("Expected an exception to have been thrown");
    } catch (IOException e) {
      String message = e.getMessage();
      String addressText = address.toString();
      assertTrue("Did not find " + addressText + " in " + message, message
View Full Code Here

    InetSocketAddress addr = NetUtils.getConnectAddress(server);
    server.start();

    Client[] clients = new Client[clientCount];
    for (int i = 0; i < clientCount; i++) {
      clients[i] = new Client(LongWritable.class, conf);
    }

    SerialCaller[] callers = new SerialCaller[callerCount];
    for (int i = 0; i < callerCount; i++) {
      callers[i] = new SerialCaller(clients[i % clientCount], addr, callCount);
View Full Code Here

      addresses[i] = NetUtils.getConnectAddress(servers[i % serverCount]);
    }

    Client[] clients = new Client[clientCount];
    for (int i = 0; i < clientCount; i++) {
      clients[i] = new Client(LongWritable.class, conf);
    }

    ParallelCaller[] callers = new ParallelCaller[callerCount];
    for (int i = 0; i < callerCount; i++) {
      callers[i] = new ParallelCaller(clients[i % clientCount], addresses,
View Full Code Here

  }

  @SuppressWarnings("deprecation")
  public void testStandAloneClient() throws Exception {
    testParallel(10, false, 2, 4, 2, 4, 100);
    Client client = new Client(LongWritable.class, conf);
    InetSocketAddress address = new InetSocketAddress("127.0.0.1", 10);
    try {
      client.call(new LongWritable(RANDOM.nextLong()), address);
      fail("Expected an exception to have been thrown");
    } catch (IOException e) {
      String message = e.getMessage();
      String addressText = address.toString();
      assertTrue("Did not find " + addressText + " in " + message, message
View Full Code Here

TOP

Related Classes of org.apache.hadoop.ipc.Client

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.