Package org.hbase.async

Examples of org.hbase.async.HBaseClient


    sinkCounter.start();
    sinkCounter.incrementConnectionCreatedCount();
    String zkQuorum = conf.get(HConstants.ZOOKEEPER_QUORUM);
    String zkBaseDir = conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT);
    if(zkBaseDir != null){
      client = new HBaseClient(zkQuorum, zkBaseDir);
    } else {
      client = new HBaseClient(zkQuorum);
    }
    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicBoolean fail = new AtomicBoolean(false);
    client.ensureTableFamilyExists(
            tableName.getBytes(Charsets.UTF_8), columnFamily).addCallbacks(
View Full Code Here


    sinkCounter.incrementConnectionCreatedCount();
      sinkCallbackPool = Executors.newCachedThreadPool(new ThreadFactoryBuilder()
        .setNameFormat(this.getName() + " HBase Call Pool").build());
    logger.info("Callback pool created");
    if(!isTimeoutTest) {
      client = new HBaseClient(zkQuorum, zkBaseDir, sinkCallbackPool);
    } else {
      client = new HBaseClient(zkQuorum, zkBaseDir,
        new NioClientSocketChannelFactory(Executors
          .newSingleThreadExecutor(),
          Executors.newSingleThreadExecutor()));
    }
    final CountDownLatch latch = new CountDownLatch(1);
View Full Code Here

    Preconditions.checkArgument(client == null, "Please call stop " +
        "before calling start on an old instance.");
    String zkQuorum = conf.get(HConstants.ZOOKEEPER_QUORUM);
    String zkBaseDir = conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT);
    if(zkBaseDir != null){
      client = new HBaseClient(zkQuorum, zkBaseDir);
    } else {
      client = new HBaseClient(zkQuorum);
    }
    CountDownLatch latch = new CountDownLatch(1);
    AtomicBoolean fail = new AtomicBoolean(false);
    client.ensureTableFamilyExists(
        tableName.getBytes(Charsets.UTF_8), columnFamily).addCallbacks(
View Full Code Here

      sinkCallbackPool = Executors.newCachedThreadPool(new ThreadFactoryBuilder()
        .setNameFormat(this.getName() + " HBase Call Pool").build());
    } else {
      sinkCallbackPool = Executors.newSingleThreadExecutor();
    }
    client = new HBaseClient(zkQuorum, zkBaseDir, sinkCallbackPool);
    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicBoolean fail = new AtomicBoolean(false);
    client.ensureTableFamilyExists(
            tableName.getBytes(Charsets.UTF_8), columnFamily).addCallbacks(
            new Callback<Object, Object>() {
View Full Code Here

      final String zkquorum = conf.get(HConstants.ZOOKEEPER_QUORUM);
      final String znode = conf.get(HConstants.ZOOKEEPER_ZNODE_PARENT,
                                    HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);
      synchronized (AsyncTest.class) {
        if (client == null) {
          client = new HBaseClient(zkquorum, znode);
          // Sanity check.
          try {
            client.ensureTableFamilyExists(tableName, FAMILY_NAME).joinUninterruptibly();
          } catch (Exception e) {
            throw new RuntimeException("Missing test table/family?", e);
View Full Code Here

      sinkCallbackPool = Executors.newCachedThreadPool(new ThreadFactoryBuilder()
        .setNameFormat(this.getName() + " HBase Call Pool").build());
    } else {
      sinkCallbackPool = Executors.newSingleThreadExecutor();
    }
    client = new HBaseClient(zkQuorum, zkBaseDir, sinkCallbackPool);
    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicBoolean fail = new AtomicBoolean(false);
    client.ensureTableFamilyExists(
            tableName.getBytes(Charsets.UTF_8), columnFamily).addCallbacks(
            new Callback<Object, Object>() {
View Full Code Here

    client.shutdown().join();
  }

  /** Ensures the table/family we use for our test exists. */
  private static void preFlightTest(final String[] args) throws Exception {
    final HBaseClient client = Common.getOpt(TestIncrementCoalescing.class,
                                             args);
    try {
      createOrTruncateTable(client, args[0], args[1]);
    } finally {
      client.shutdown().join();
    }
  }
View Full Code Here

    if (Runtime.getRuntime().maxMemory() < 1992294400L) {
      LOG.error("This test requires at least 2GB of RAM to run.");
      LOG.error("Use JVM_ARGS='-Xmx2g -Xms2g'.");
      System.exit(3);
    }
    final HBaseClient client = Common.getOpt(TestIncrementCoalescing.class,
                                             args);
    final byte[] table = args[0].getBytes();
    final byte[] family = args[1].getBytes();
    try {
      test(client, table, family);
    } finally {
      client.shutdown().join();
    }
  }
View Full Code Here

    if (args.length > 2) {
      zkquorum = args[2];
    } else {
      zkquorum = "localhost";
    }
    final HBaseClient client;
    if (args.length > 3) {
      return new HBaseClient(zkquorum, args[3]);
    } else {
      return new HBaseClient(zkquorum)// Default znode
    }
  }
View Full Code Here

    final Cmd cmd = commands.get(args[1]);
    if (cmd == null) {
      fatalUsage("Unknown command: " + args[1], 2);
    }

    final HBaseClient client = new HBaseClient(args[0]);

    try {
      cmd.execute(client, args);
    } catch (Exception e) {
      LOG.error("Unexpected exception caught in main", e);
    }

    System.out.println("Starting shutdown...");
    LOG.debug("Shutdown returned " + client.shutdown().joinUninterruptibly());
    System.out.println("Exiting...");
  }
View Full Code Here

TOP

Related Classes of org.hbase.async.HBaseClient

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.