本文整理汇总了Java中org.apache.hadoop.hbase.regionserver.HRegion.merge方法的典型用法代码示例。如果您正苦于以下问题:Java HRegion.merge方法的具体用法?Java HRegion.merge怎么用?Java HRegion.merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.regionserver.HRegion
的用法示例。
在下文中一共展示了HRegion.merge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: merge
import org.apache.hadoop.hbase.regionserver.HRegion; //导入方法依赖的package包/类
private HRegion merge(final HTableDescriptor htd, HRegion meta,
HRegionInfo info1, HRegionInfo info2)
throws IOException {
if (info1 == null) {
throw new IOException("Could not find " + Bytes.toStringBinary(region1) + " in " +
Bytes.toStringBinary(meta.getRegionInfo().getRegionName()));
}
if (info2 == null) {
throw new IOException("Could not find " + Bytes.toStringBinary(region2) + " in " +
Bytes.toStringBinary(meta.getRegionInfo().getRegionName()));
}
HRegion merged = null;
HRegion r1 = HRegion.openHRegion(info1, htd, utils.getLog(info1), getConf());
try {
HRegion r2 = HRegion.openHRegion(info2, htd, utils.getLog(info2), getConf());
try {
merged = HRegion.merge(r1, r2);
} finally {
if (!r2.isClosed()) {
r2.close();
}
}
} finally {
if (!r1.isClosed()) {
r1.close();
}
}
// Remove the old regions from meta.
// HRegion.merge has already deleted their files
removeRegionFromMeta(meta, info1);
removeRegionFromMeta(meta, info2);
this.mergeInfo = merged.getRegionInfo();
return merged;
}