當前位置: 首頁>>代碼示例>>Java>>正文


Java CellUtil.overlappingKeys方法代碼示例

本文整理匯總了Java中org.apache.hadoop.hbase.CellUtil.overlappingKeys方法的典型用法代碼示例。如果您正苦於以下問題:Java CellUtil.overlappingKeys方法的具體用法?Java CellUtil.overlappingKeys怎麽用?Java CellUtil.overlappingKeys使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.hbase.CellUtil的用法示例。


在下文中一共展示了CellUtil.overlappingKeys方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
private void init() throws IOException {
  final RestoreSnapshotHelper.RestoreMetaChanges meta =
    RestoreSnapshotHelper.copySnapshotForScanner(
      conf, fs, rootDir, restoreDir, snapshotName);
  final List<HRegionInfo> restoredRegions = meta.getRegionsToAdd();

  htd = meta.getTableDescriptor();
  regions = new ArrayList<HRegionInfo>(restoredRegions.size());
  for (HRegionInfo hri: restoredRegions) {
    if (CellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(),
        hri.getStartKey(), hri.getEndKey())) {
      regions.add(hri);
    }
  }

  // sort for regions according to startKey.
  Collections.sort(regions);
  initScanMetrics(scan);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:20,代碼來源:TableSnapshotScanner.java

示例2: getSplits

import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
public static List<InputSplit> getSplits(Scan scan, SnapshotManifest manifest,
    List<HRegionInfo> regionManifests, Path restoreDir, Configuration conf) throws IOException {
  // load table descriptor
  HTableDescriptor htd = manifest.getTableDescriptor();

  Path tableDir = FSUtils.getTableDir(restoreDir, htd.getTableName());

  List<InputSplit> splits = new ArrayList<InputSplit>();
  for (HRegionInfo hri : regionManifests) {
    // load region descriptor

    if (CellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), hri.getStartKey(),
        hri.getEndKey())) {
      // compute HDFS locations from snapshot files (which will get the locations for
      // referred hfiles)
      List<String> hosts = getBestLocations(conf,
          HRegion.computeHDFSBlocksDistribution(conf, htd, hri, tableDir));

      int len = Math.min(3, hosts.size());
      hosts = hosts.subList(0, len);
      splits.add(new InputSplit(htd, hri, hosts, scan, restoreDir));
    }
  }

  return splits;

}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:28,代碼來源:TableSnapshotInputFormatImpl.java


注:本文中的org.apache.hadoop.hbase.CellUtil.overlappingKeys方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。