当前位置: 首页>>代码示例>>Java>>正文


Java HBaseClient类代码示例

本文整理汇总了Java中org.hbase.async.HBaseClient的典型用法代码示例。如果您正苦于以下问题:Java HBaseClient类的具体用法?Java HBaseClient怎么用?Java HBaseClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HBaseClient类属于org.hbase.async包,在下文中一共展示了HBaseClient类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.hbase.async.HBaseClient; //导入依赖的package包/类
@Override
public synchronized void start() {
  logger.info(String.format("Starting: %s:%s series:%s uids:%s batchSize:%d",
          zkquorum, zkpath, seriesTable, uidsTable, batchSize));
  hbaseClient = new HBaseClient(zkquorum, zkpath);
  try {
      Config config = new Config(false);
      config.overrideConfig("tsd.storage.hbase.data_table", "tsdb");
      config.overrideConfig("tsd.storage.hbase.uid_table", "tsdb-uid");
      config.overrideConfig("tsd.core.auto_create_metrics", "true");
      config.overrideConfig("tsd.storage.enable_compaction", "false");

      tsdb = new TSDB(hbaseClient, config);
  } catch (IOException e) {
      logger.error("tsdb initialization fail: ", e);
  }
  channelCounter.start();
  sinkCounter.start();
  super.start();
}
 
开发者ID:yandex,项目名称:opentsdb-flume,代码行数:21,代码来源:OpenTSDBSink.java

示例2: getOpt

import org.hbase.async.HBaseClient; //导入依赖的package包/类
static HBaseClient getOpt(final Class<?> klass, final String[] args) {
  if (args.length < 2) {
    System.err.println("Usage: " + klass.getSimpleName()
                       + " <table> <family> [zkquorum] [znode]");
    System.exit(1);
  }
  final String zkquorum;
  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
  }
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:20,代码来源:Common.java

示例3: main

import org.hbase.async.HBaseClient; //导入依赖的package包/类
public static void main(final String[] args) throws Exception {
  if (LOG.isDebugEnabled()) {
    LOG.warn("Debug logging enabled, this test will flood it pretty hard.");
  }
  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();
  }
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:20,代码来源:TestIncrementCoalescing.java

示例4: main

import org.hbase.async.HBaseClient; //导入依赖的package包/类
public static void main(final String[] args) throws Exception {
  ensureArguments(args, 3, -1);

  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...");
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:21,代码来源:Test.java

示例5: execute

import org.hbase.async.HBaseClient; //导入依赖的package包/类
public void execute(final HBaseClient client, String[] args) throws Exception {
  ensureArguments(args, 7, 7);
  RowLock lock = null;
  if (args[1].charAt(0) == 'l') {  // locked version of the command
    final RowLockRequest rlr = new RowLockRequest(args[2], args[3]);
    lock = client.lockRow(rlr).joinUninterruptibly();
    LOG.info("Acquired explicit row lock: " + lock);
  }
  final PutRequest put = lock == null
    ? new PutRequest(args[2], args[3], args[4], args[5], args[6])
    : new PutRequest(args[2], args[3], args[4], args[5], args[6], lock);
  args = null;
  try {
    final Object result = client.put(put).joinUninterruptibly();
    LOG.info("Put result=" + result);
  } catch (Exception e) {
    LOG.error("Put failed", e);
  } finally {
    if (lock != null) {
      client.unlockRow(lock).joinUninterruptibly();
      LOG.info("Released explicit row lock: " + lock);
    }
  }
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:25,代码来源:Test.java

示例6: preFlightTest

import org.hbase.async.HBaseClient; //导入依赖的package包/类
/** 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();
  }
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:11,代码来源:TestIntegration.java

示例7: createOrTruncateTable

import org.hbase.async.HBaseClient; //导入依赖的package包/类
/** Creates or truncates the given table name. */
private static void createOrTruncateTable(final HBaseClient client,
                                          final String table,
                                          final String family)
  throws Exception {
  try {
    client.ensureTableFamilyExists(table, family).join();
    truncateTable(table);
  } catch (TableNotFoundException e) {
    createTable(table, family);
    createOrTruncateTable(client, table, family);  // Check again.
  }
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:14,代码来源:TestIntegration.java

示例8: prefetchMeta

import org.hbase.async.HBaseClient; //导入依赖的package包/类
@Test
public void prefetchMeta() throws Exception {
  // Prefetch the metadata for a given table, then invasively probe the
  // region cache to demonstrate it is filled.
  client.prefetchMeta(table).join();

  Object region_info = Whitebox.invokeMethod(client, "getRegion",
                                             table.getBytes(),
                                             HBaseClient.EMPTY_ARRAY);
  assertNotNull(region_info);
}
 
开发者ID:OpenTSDB,项目名称:asyncbigtable,代码行数:12,代码来源:TestIntegration.java

示例9: providesHBaseClient

import org.hbase.async.HBaseClient; //导入依赖的package包/类
@Provides
@Singleton
private HBaseClient providesHBaseClient(
    @Named("zk.quorum_spec") final String quorumSpec,
    @Named("zk.base_path")   final String basePath) {
  return new HBaseClient(quorumSpec, basePath);
}
 
开发者ID:novabyte,项目名称:diver,代码行数:8,代码来源:AppModule.java

示例10: JavaServer

import org.hbase.async.HBaseClient; //导入依赖的package包/类
@Inject
public JavaServer(
    final OtpNode otpNode,
    final HBaseClient hbaseClient,
    @Named("erlang.registered_proc_name") final String registeredProcName) {
  this.otpNode = otpNode;
  this.hbaseClient = hbaseClient;
  this.registeredProcName = registeredProcName;
}
 
开发者ID:novabyte,项目名称:diver,代码行数:10,代码来源:JavaServer.java

示例11: client

import org.hbase.async.HBaseClient; //导入依赖的package包/类
/** Returns the client to use to send an RPC.  Call once per RPC.  */
protected final HBaseClient client() {
  try {
    sem.acquire();
  } catch (InterruptedException e) {
    LOG.error("Shouldn't happen!", e);
    return null;
  }
  return client;
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:11,代码来源:PerformanceEvaluation.java

示例12: getClient

import org.hbase.async.HBaseClient; //导入依赖的package包/类
/**
 * {@inheritDoc}
 * @see com.heliosapm.tsdbex.test.mocks.ITSDB#getClient()
 */
@Override
public HBaseClient getClient() {
	
	return null;
}
 
开发者ID:nickman,项目名称:HeliosStreams,代码行数:10,代码来源:EmptyTSDB.java

示例13: setHbaseClient

import org.hbase.async.HBaseClient; //导入依赖的package包/类
public void setHbaseClient(HBaseClient client) {
    this.hbaseClient = client;
}
 
开发者ID:Conductor,项目名称:tsquare,代码行数:4,代码来源:ProvidedTsdbManager.java

示例14: getClient

import org.hbase.async.HBaseClient; //导入依赖的package包/类
/** 
 * Returns the configured HBase client 
 * @return The HBase client
 * @since 2.0 
 */
public HBaseClient getClient();
 
开发者ID:nickman,项目名称:HeliosStreams,代码行数:7,代码来源:ITSDB.java


注:本文中的org.hbase.async.HBaseClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。