RegionSplitCalculator.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:LCIndex-HBase-0.94.16 作者:
/**
 * Generates a coverage multimap from split key to Regions that start with the
 * split key.
 * 
 * @return coverage multimap
 */
public Multimap<byte[], R> calcCoverage() {
  // This needs to be sorted to force the use of the comparator on the values,
  // otherwise byte array comparison isn't used
  Multimap<byte[], R> regions = TreeMultimap.create(BYTES_COMPARATOR,
      rangeCmp);

  // march through all splits from the start points
  for (Entry<byte[], Collection<R>> start : starts.asMap().entrySet()) {
    byte[] key = start.getKey();
    for (R r : start.getValue()) {
      regions.put(key, r);

      for (byte[] coveredSplit : splits.subSet(r.getStartKey(),
          specialEndKey(r))) {
        regions.put(coveredSplit, r);
      }
    }
  }
  return regions;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号