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


Java HBaseTestingUtility.waitUntilAllRegionsAssigned方法代码示例

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


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

示例1: createTable

import org.apache.hadoop.hbase.HBaseTestingUtility; //导入方法依赖的package包/类
public static void createTable(HBaseTestingUtility testUtil, Admin admin, HTableDescriptor htd,
    byte[][] splitKeys) throws Exception {
  // NOTE: We need a latch because admin is not sync,
  // so the postOp coprocessor method may be called after the admin operation returned.
  MasterSyncObserver observer = (MasterSyncObserver)testUtil.getHBaseCluster().getMaster()
    .getMasterCoprocessorHost().findCoprocessor(MasterSyncObserver.class.getName());
  observer.tableCreationLatch = new CountDownLatch(1);
  if (splitKeys != null) {
    admin.createTable(htd, splitKeys);
  } else {
    admin.createTable(htd);
  }
  observer.tableCreationLatch.await();
  observer.tableCreationLatch = null;
  testUtil.waitUntilAllRegionsAssigned(htd.getTableName());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:SecureTestUtil.java

示例2: setUpBeforeClass

import org.apache.hadoop.hbase.HBaseTestingUtility; //导入方法依赖的package包/类
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  conf1.setBoolean(HConstants.REPLICATION_ENABLE_KEY, HConstants.REPLICATION_ENABLE_DEFAULT);
  utility1 = new HBaseTestingUtility(conf1);
  utility1.startMiniCluster();
  admin = new ReplicationAdmin(conf1);

  conf2 = HBaseConfiguration.create(conf1);
  conf2.set(HConstants.ZOOKEEPER_ZNODE_PARENT, "/2");
  conf2.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, 2182);

  utility2 = new HBaseTestingUtility(conf2);
  utility2.startMiniCluster();

  ReplicationPeerConfig config = new ReplicationPeerConfig();
  config.setClusterKey(utility2.getClusterKey());
  admin.addPeer(peerId, config, null);

  HTableDescriptor table = new HTableDescriptor(tableName);
  HColumnDescriptor fam = new HColumnDescriptor(famName);
  fam.setScope(HConstants.REPLICATION_SCOPE_GLOBAL);
  table.addFamily(fam);

  utility1.getHBaseAdmin().createTable(table, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE);
  utility1.waitUntilAllRegionsAssigned(tableName);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:27,代码来源:TestReplicationAdminWithTwoDifferentZKClusters.java

示例3: createTable

import org.apache.hadoop.hbase.HBaseTestingUtility; //导入方法依赖的package包/类
public static void createTable(HBaseTestingUtility testUtil, HBaseAdmin admin,
  HTableDescriptor htd, byte [][] splitKeys)
throws Exception {
  // NOTE: We need a latch because admin is not sync,
  // so the postOp coprocessor method may be called after the admin operation returned.
  MasterSyncObserver observer = (MasterSyncObserver)testUtil.getHBaseCluster().getMaster()
    .getMasterCoprocessorHost().findCoprocessor(MasterSyncObserver.class.getName());
  observer.tableCreationLatch = new CountDownLatch(1);
  if (splitKeys != null) {
    admin.createTable(htd, splitKeys);
  } else {
    admin.createTable(htd);
  }
  observer.tableCreationLatch.await();
  observer.tableCreationLatch = null;
  testUtil.waitUntilAllRegionsAssigned(htd.getTableName());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:TestEnableTableHandler.java

示例4: createTable

import org.apache.hadoop.hbase.HBaseTestingUtility; //导入方法依赖的package包/类
public static void createTable(HBaseTestingUtility testUtil, HTableDescriptor htd,
  byte [][] splitKeys) throws Exception {
  // NOTE: We need a latch because admin is not sync,
  // so the postOp coprocessor method may be called after the admin operation returned.
  MasterSyncObserver observer = (MasterSyncObserver)testUtil.getHBaseCluster().getMaster()
    .getMasterCoprocessorHost().findCoprocessor(MasterSyncObserver.class.getName());
  observer.tableCreationLatch = new CountDownLatch(1);
  if (splitKeys != null) {
    admin.createTable(htd, splitKeys);
  } else {
    admin.createTable(htd);
  }
  observer.tableCreationLatch.await();
  observer.tableCreationLatch = null;
  testUtil.waitUntilAllRegionsAssigned(htd.getTableName());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:TestHBaseFsck.java


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