当前位置: 首页>>代码示例>>Java>>正文


Java RegionScanner.nextRaw方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.regionserver.RegionScanner.nextRaw方法的典型用法代码示例。如果您正苦于以下问题:Java RegionScanner.nextRaw方法的具体用法?Java RegionScanner.nextRaw怎么用?Java RegionScanner.nextRaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.regionserver.RegionScanner的用法示例。


在下文中一共展示了RegionScanner.nextRaw方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.apache.hadoop.hbase.regionserver.RegionScanner; //导入方法依赖的package包/类
private ArrayList<Cell> init(RegionScanner regionScanner, ScanRange primaryRange,
    IndexPutParser parse) throws IOException {
  ArrayList<Cell> ret = new ArrayList<>();
  while (true) {
    List<Cell> oneRow = new ArrayList<>();
    if (!regionScanner.nextRaw(oneRow)) break;
    processOneRow(ret, oneRow, parse);
    //      processOneRow(ret, oneRow, primaryRange, relation);
  }
  Collections.sort(ret, KeyValue.COMPARATOR);
  return ret;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:LCIndexMemStoreScanner2.java

示例2: InnerScannerAsIterator

import org.apache.hadoop.hbase.regionserver.RegionScanner; //导入方法依赖的package包/类
public InnerScannerAsIterator(RegionScanner regionScanner) {
    this.regionScanner = regionScanner;

    try {
        hasMore = regionScanner.nextRaw(nextOne);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:10,代码来源:CubeVisitService.java

示例3: buildAggrCache

import org.apache.hadoop.hbase.regionserver.RegionScanner; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
ObserverAggregationCache buildAggrCache(final RegionScanner innerScanner, CoprocessorRowType type, CoprocessorProjector projector, ObserverAggregators aggregators, CoprocessorFilter filter, Stats stats) throws IOException {

    ObserverAggregationCache aggCache = new ObserverAggregationCache(aggregators);

    ObserverTuple tuple = new ObserverTuple(type);
    boolean hasMore = true;
    List<Cell> results = new ArrayList<Cell>();
    while (hasMore) {
        results.clear();
        hasMore = innerScanner.nextRaw(results);
        if (results.isEmpty())
            continue;

        if (stats != null)
            stats.countInputRow(results);

        Cell cell = results.get(0);
        tuple.setUnderlying(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
        if (filter != null && filter.evaluate(tuple) == false)
            continue;

        CoprocessorProjector.AggrKey aggKey = projector.getAggrKey(results);
        MeasureAggregator[] bufs = aggCache.getBuffer(aggKey);
        aggregators.aggregate(bufs, results);

        aggCache.checkMemoryUsage();
    }
    return aggCache;
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:31,代码来源:AggregationScanner.java

示例4: processData

import org.apache.hadoop.hbase.regionserver.RegionScanner; //导入方法依赖的package包/类
private static ExportProtos.ExportResponse processData(final Region region, final Configuration conf,
  final UserProvider userProvider, final Scan scan, final Token userToken,
  final List<SequenceFile.Writer.Option> opts) throws IOException {
  ScanCoprocessor cp = new ScanCoprocessor(region);
  RegionScanner scanner = null;
  try (RegionOp regionOp = new RegionOp(region);
          SecureWriter out = new SecureWriter(conf, userProvider, userToken, opts)) {
    scanner = cp.checkScannerOpen(scan);
    ImmutableBytesWritable key = new ImmutableBytesWritable();
    long rowCount = 0;
    long cellCount = 0;
    List<Result> results = new ArrayList<>();
    List<Cell> cells = new ArrayList<>();
    boolean hasMore;
    do {
      boolean bypass = cp.preScannerNext(scanner, results, scan.getBatch());
      if (bypass) {
        hasMore = false;
      } else {
        hasMore = scanner.nextRaw(cells);
        if (cells.isEmpty()) {
          continue;
        }
        Cell firstCell = cells.get(0);
        for (Cell cell : cells) {
          if (Bytes.compareTo(firstCell.getRowArray(), firstCell.getRowOffset(), firstCell.getRowLength(),
                  cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()) != 0) {
            throw new IOException("Why the RegionScanner#nextRaw returns the data of different rows??"
                    + " first row=" + Bytes.toHex(firstCell.getRowArray(), firstCell.getRowOffset(), firstCell.getRowLength())
                    + ", current row=" + Bytes.toHex(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength()));
          }
        }
        results.add(Result.create(cells));
        cells.clear();
        cp.postScannerNext(scanner, results, scan.getBatch(), hasMore);
      }
      for (Result r : results) {
        key.set(r.getRow());
        out.append(key, r);
        ++rowCount;
        cellCount += r.size();
      }
      results.clear();
    } while (hasMore);
    return ExportProtos.ExportResponse.newBuilder()
            .setRowCount(rowCount)
            .setCellCount(cellCount)
            .build();
  } finally {
    cp.checkScannerClose(scanner);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:53,代码来源:Export.java


注:本文中的org.apache.hadoop.hbase.regionserver.RegionScanner.nextRaw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。