當前位置: 首頁>>代碼示例>>Java>>正文


Java HBaseAdmin.unassign方法代碼示例

本文整理匯總了Java中org.apache.hadoop.hbase.client.HBaseAdmin.unassign方法的典型用法代碼示例。如果您正苦於以下問題:Java HBaseAdmin.unassign方法的具體用法?Java HBaseAdmin.unassign怎麽用?Java HBaseAdmin.unassign使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.hbase.client.HBaseAdmin的用法示例。


在下文中一共展示了HBaseAdmin.unassign方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: wipeOutMeta

import org.apache.hadoop.hbase.client.HBaseAdmin; //導入方法依賴的package包/類
protected void wipeOutMeta() throws IOException {
  // Mess it up by blowing up meta.
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  Scan s = new Scan();
  HTable meta = new HTable(conf, HConstants.META_TABLE_NAME);
  ResultScanner scanner = meta.getScanner(s);
  List<Delete> dels = new ArrayList<Delete>();
  for (Result r : scanner) {
    Delete d = new Delete(r.getRow());
    dels.add(d);
    admin.unassign(r.getRow(), true);
  }
  meta.delete(dels);
  meta.flushCommits();
  scanner.close();
  meta.close();
}
 
開發者ID:fengchen8086,項目名稱:LCIndex-HBase-0.94.16,代碼行數:18,代碼來源:OfflineMetaRebuildTestCore.java

示例2: wipeOutMeta

import org.apache.hadoop.hbase.client.HBaseAdmin; //導入方法依賴的package包/類
protected void wipeOutMeta() throws IOException {
  // Mess it up by blowing up meta.
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  Scan s = new Scan();
  HTable meta = new HTable(conf, TableName.META_TABLE_NAME);
  ResultScanner scanner = meta.getScanner(s);
  List<Delete> dels = new ArrayList<Delete>();
  for (Result r : scanner) {
    HRegionInfo info =
        HRegionInfo.getHRegionInfo(r);
    if(info != null && !info.getTable().getNamespaceAsString()
        .equals(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR)) {
      Delete d = new Delete(r.getRow());
      dels.add(d);
      admin.unassign(r.getRow(), true);
    }
  }
  meta.delete(dels);
  meta.flushCommits();
  scanner.close();
  meta.close();
}
 
開發者ID:tenggyut,項目名稱:HIndex,代碼行數:23,代碼來源:OfflineMetaRebuildTestCore.java

示例3: perform

import org.apache.hadoop.hbase.client.HBaseAdmin; //導入方法依賴的package包/類
@Override
public void perform() throws Exception {
  if (sleepTime > 0) {
    Thread.sleep(sleepTime);
  }

  HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility();
  HBaseAdmin admin = util.getHBaseAdmin();

  LOG.info("Performing action: Move random region of table " + tableName);
  List<HRegionInfo> regions = admin.getTableRegions(tableNameBytes);
  if (regions == null || regions.isEmpty()) {
    LOG.info("Table " + tableName + " doesn't have regions to move");
    return;
  }

  HRegionInfo region = PolicyBasedChaosMonkey.selectRandomItem(
    regions.toArray(new HRegionInfo[regions.size()]));
  LOG.debug("Unassigning region " + region.getRegionNameAsString());
  admin.unassign(region.getRegionName(), false);
  if (sleepTime > 0) {
    Thread.sleep(sleepTime);
  }
}
 
開發者ID:tenggyut,項目名稱:HIndex,代碼行數:25,代碼來源:MoveRandomRegionOfTableAction.java


注:本文中的org.apache.hadoop.hbase.client.HBaseAdmin.unassign方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。