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


Java HTable.getConfiguration方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.client.HTable.getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java HTable.getConfiguration方法的具体用法?Java HTable.getConfiguration怎么用?Java HTable.getConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.client.HTable的用法示例。


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

示例1: RegionSizeCalculator

import org.apache.hadoop.hbase.client.HTable; //导入方法依赖的package包/类
/**
 * Computes size of each region for table and given column families.
 * 
 * @deprecated Use {@link #RegionSizeCalculator(RegionLocator, Admin)} instead.
 */
@Deprecated
public RegionSizeCalculator(HTable table) throws IOException {
  HBaseAdmin admin = new HBaseAdmin(table.getConfiguration());
  try {
    init(table.getRegionLocator(), admin);
  } finally {
    admin.close();
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:RegionSizeCalculator.java

示例2: testMasterRestartAtRegionSplitPendingCatalogJanitor

import org.apache.hadoop.hbase.client.HTable; //导入方法依赖的package包/类
/**
 * Verifies HBASE-5806.  Here the case is that splitting is completed but before the
 * CJ could remove the parent region the master is killed and restarted.
 * @throws IOException
 * @throws InterruptedException
 * @throws NodeExistsException
 * @throws KeeperException
 */
@Test (timeout = 300000)
public void testMasterRestartAtRegionSplitPendingCatalogJanitor()
    throws IOException, InterruptedException, NodeExistsException,
    KeeperException, ServiceException {
  final TableName tableName = TableName
      .valueOf("testMasterRestartAtRegionSplitPendingCatalogJanitor");

  // Create table then get the single region for our new table.
  HTable t = createTableAndWait(tableName, HConstants.CATALOG_FAMILY);
  List<HRegion> regions = cluster.getRegions(tableName);
  HRegionInfo hri = getAndCheckSingleTableRegion(regions);

  int tableRegionIndex = ensureTableRegionNotOnSameServerAsMeta(admin, hri);

  // Turn off balancer so it doesn't cut in and mess up our placements.
  this.admin.setBalancerRunning(false, true);
  // Turn off the meta scanner so it don't remove parent on us.
  cluster.getMaster().setCatalogJanitorEnabled(false);
  ZooKeeperWatcher zkw = new ZooKeeperWatcher(t.getConfiguration(),
    "testMasterRestartAtRegionSplitPendingCatalogJanitor", new UselessTestAbortable());
  try {
    // Add a bit of load up into the table so splittable.
    TESTING_UTIL.loadTable(t, HConstants.CATALOG_FAMILY, false);
    // Get region pre-split.
    HRegionServer server = cluster.getRegionServer(tableRegionIndex);
    printOutRegions(server, "Initial regions: ");

    this.admin.split(hri.getRegionNameAsString());
    checkAndGetDaughters(tableName);
    // Assert the ephemeral node is up in zk.
    String path = ZKAssign.getNodeName(zkw, hri.getEncodedName());
    Stat stats = zkw.getRecoverableZooKeeper().exists(path, false);
    LOG.info("EPHEMERAL NODE BEFORE SERVER ABORT, path=" + path + ", stats="
        + stats);
    String node = ZKAssign.getNodeName(zkw, hri.getEncodedName());
    Stat stat = new Stat();
    byte[] data = ZKUtil.getDataNoWatch(zkw, node, stat);
    // ZKUtil.create
    for (int i=0; data != null && i<60; i++) {
      Thread.sleep(1000);
      data = ZKUtil.getDataNoWatch(zkw, node, stat);
    }
    assertNull("Waited too long for ZK node to be removed: "+node, data);

    MockMasterWithoutCatalogJanitor master = abortAndWaitForMaster();

    this.admin = new HBaseAdmin(TESTING_UTIL.getConfiguration());

    // Update the region to be offline and split, so that HRegionInfo#equals
    // returns true in checking rebuilt region states map.
    hri.setOffline(true);
    hri.setSplit(true);
    RegionStates regionStates = master.getAssignmentManager().getRegionStates();
    assertTrue("Split parent should be in SPLIT state",
      regionStates.isRegionInState(hri, State.SPLIT));
    ServerName regionServerOfRegion = regionStates.getRegionServerOfRegion(hri);
    assertTrue(regionServerOfRegion == null);
  } finally {
    this.admin.setBalancerRunning(true, false);
    cluster.getMaster().setCatalogJanitorEnabled(true);
    t.close();
    zkw.close();
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:73,代码来源:TestSplitTransactionOnCluster.java


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