类org.apache.hadoop.hbase.RegionException源码实例Demo

下面列出了怎么用org.apache.hadoop.hbase.RegionException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: hbase-tools   文件: Merge.java
/**
 * @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;
}
 
源代码2 项目: hbase-tools   文件: Merge.java
/**
 * @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;
}
 
源代码3 项目: hbase-tools   文件: Merge.java
/**
 * @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;
}
 
源代码4 项目: hbase-tools   文件: Merge.java
/**
 * @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;
}
 
源代码5 项目: hbase-tools   文件: Merge.java
/**
 * @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;
}
 
 类所在包
 类方法
 同包方法