當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。