下面列出了怎么用org.apache.hadoop.hbase.RegionException的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* @param tableInfo
* @return true: stop iteration, false: continue iteration
* @throws Exception
*/
private boolean emptyInternal(TableInfo tableInfo) throws Exception {
tableInfo.refresh();
Set<HRegionInfo> mergedRegions = new HashSet<>();
List<HRegionInfo> allTableRegions = new ArrayList<>(tableInfo.getRegionInfoSet());
for (int i = 0; i < allTableRegions.size(); i++) {
HRegionInfo region = allTableRegions.get(i);
if (mergedRegions.contains(region)) continue;
RegionLoadDelegator regionLoad = tableInfo.getRegionLoad(region);
if (regionLoad == null) throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
HRegionInfo targetRegion = getTargetRegion(tableInfo, allTableRegions, i, mergedRegions);
if (mergedRegions.contains(targetRegion)) continue;
if (regionLoad.getStorefileSizeMB() == 0 && regionLoad.getMemStoreSizeMB() == 0) {
if (CommandAdapter.isReallyEmptyRegion(connection, tableInfo.getTableName(), region)) {
try {
if (targetRegion != null) {
printMergeInfo(region, targetRegion);
mergedRegions.add(region);
mergedRegions.add(targetRegion);
CommandAdapter.mergeRegions(args, admin, region, targetRegion);
i++;
}
} catch (RegionException e) {
throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
}
}
}
}
System.out.println();
return mergedRegions.size() <= 1;
}
/**
* @param tableInfo
* @return true: stop iteration, false: continue iteration
* @throws Exception
*/
private boolean emptyInternal(TableInfo tableInfo) throws Exception {
tableInfo.refresh();
Set<HRegionInfo> mergedRegions = new HashSet<>();
List<HRegionInfo> allTableRegions = new ArrayList<>(tableInfo.getRegionInfoSet());
for (int i = 0; i < allTableRegions.size(); i++) {
HRegionInfo region = allTableRegions.get(i);
if (mergedRegions.contains(region)) continue;
RegionLoadDelegator regionLoad = tableInfo.getRegionLoad(region);
if (regionLoad == null) throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
HRegionInfo targetRegion = getTargetRegion(tableInfo, allTableRegions, i, mergedRegions);
if (mergedRegions.contains(targetRegion)) continue;
if (regionLoad.getStorefileSizeMB() == 0 && regionLoad.getMemStoreSizeMB() == 0) {
if (CommandAdapter.isReallyEmptyRegion(connection, tableInfo.getTableName(), region)) {
try {
if (targetRegion != null) {
printMergeInfo(region, targetRegion);
mergedRegions.add(region);
mergedRegions.add(targetRegion);
CommandAdapter.mergeRegions(args, admin, region, targetRegion);
i++;
}
} catch (RegionException e) {
throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
}
}
}
}
System.out.println();
return mergedRegions.size() <= 1;
}
/**
* @param tableInfo
* @return true: stop iteration, false: continue iteration
* @throws Exception
*/
private boolean emptyInternal(TableInfo tableInfo) throws Exception {
tableInfo.refresh();
Set<HRegionInfo> mergedRegions = new HashSet<>();
List<HRegionInfo> allTableRegions = new ArrayList<>(tableInfo.getRegionInfoSet());
for (int i = 0; i < allTableRegions.size(); i++) {
HRegionInfo region = allTableRegions.get(i);
if (mergedRegions.contains(region)) continue;
RegionLoadDelegator regionLoad = tableInfo.getRegionLoad(region);
if (regionLoad == null) throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
HRegionInfo targetRegion = getTargetRegion(tableInfo, allTableRegions, i, mergedRegions);
if (mergedRegions.contains(targetRegion)) continue;
if (regionLoad.getStorefileSizeMB() == 0 && regionLoad.getMemStoreSizeMB() == 0) {
if (CommandAdapter.isReallyEmptyRegion(connection, tableInfo.getTableName(), region)) {
try {
if (targetRegion != null) {
printMergeInfo(region, targetRegion);
mergedRegions.add(region);
mergedRegions.add(targetRegion);
CommandAdapter.mergeRegions(args, admin, region, targetRegion);
i++;
}
} catch (RegionException e) {
throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
}
}
}
}
System.out.println();
return mergedRegions.size() <= 1;
}
/**
* @param tableInfo
* @return true: stop iteration, false: continue iteration
* @throws Exception
*/
private boolean emptyInternal(TableInfo tableInfo) throws Exception {
tableInfo.refresh();
Set<HRegionInfo> mergedRegions = new HashSet<>();
List<HRegionInfo> allTableRegions = new ArrayList<>(tableInfo.getRegionInfoSet());
for (int i = 0; i < allTableRegions.size(); i++) {
HRegionInfo region = allTableRegions.get(i);
if (mergedRegions.contains(region)) continue;
RegionLoadDelegator regionLoad = tableInfo.getRegionLoad(region);
if (regionLoad == null) throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
HRegionInfo targetRegion = getTargetRegion(tableInfo, allTableRegions, i, mergedRegions);
if (mergedRegions.contains(targetRegion)) continue;
if (regionLoad.getStorefileSizeMB() == 0 && regionLoad.getMemStoreSizeMB() == 0) {
if (CommandAdapter.isReallyEmptyRegion(connection, tableInfo.getTableName(), region)) {
try {
if (targetRegion != null) {
printMergeInfo(region, targetRegion);
mergedRegions.add(region);
mergedRegions.add(targetRegion);
CommandAdapter.mergeRegions(args, admin, region, targetRegion);
i++;
}
} catch (RegionException e) {
throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
}
}
}
}
System.out.println();
return mergedRegions.size() <= 1;
}
/**
* @param tableInfo
* @return true: stop iteration, false: continue iteration
* @throws Exception
*/
private boolean emptyInternal(TableInfo tableInfo) throws Exception {
tableInfo.refresh();
Set<HRegionInfo> mergedRegions = new HashSet<>();
List<HRegionInfo> allTableRegions = new ArrayList<>(tableInfo.getRegionInfoSet());
for (int i = 0; i < allTableRegions.size(); i++) {
HRegionInfo region = allTableRegions.get(i);
if (mergedRegions.contains(region)) continue;
RegionLoadDelegator regionLoad = tableInfo.getRegionLoad(region);
if (regionLoad == null) throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
HRegionInfo targetRegion = getTargetRegion(tableInfo, allTableRegions, i, mergedRegions);
if (mergedRegions.contains(targetRegion)) continue;
if (regionLoad.getStorefileSizeMB() == 0 && regionLoad.getMemStoreSizeMB() == 0) {
if (CommandAdapter.isReallyEmptyRegion(connection, tableInfo.getTableName(), region)) {
try {
if (targetRegion != null) {
printMergeInfo(region, targetRegion);
mergedRegions.add(region);
mergedRegions.add(targetRegion);
CommandAdapter.mergeRegions(args, admin, region, targetRegion);
i++;
}
} catch (RegionException e) {
throw new IllegalStateException(Constant.MESSAGE_NEED_REFRESH);
}
}
}
}
System.out.println();
return mergedRegions.size() <= 1;
}