本文整理匯總了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();
}
示例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();
}
示例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);
}
}