org.apache.hadoop.hbase.regionserver.HStore.getScanner()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中org.apache.hadoop.hbase.regionserver.HStore.getScanner()方法的一些代码示例,展示了HStore.getScanner()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HStore.getScanner()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.regionserver.HStore
类名称:HStore
方法名:getScanner

HStore.getScanner介绍

[英]Return a scanner for both the memstore and the HStore files. Assumes we are not in a compaction.
[中]返回memstore和HStore文件的扫描程序。假设我们没有处于压缩状态。

代码示例

代码示例来源:origin: apache/hbase

protected void initializeScanners(Scan scan, List<KeyValueScanner> additionalScanners)
  throws IOException {
 // Here we separate all scanners into two lists - scanner that provide data required
 // by the filter to operate (scanners list) and all others (joinedScanners list).
 List<KeyValueScanner> scanners = new ArrayList<>(scan.getFamilyMap().size());
 List<KeyValueScanner> joinedScanners = new ArrayList<>(scan.getFamilyMap().size());
 // Store all already instantiated scanners for exception handling
 List<KeyValueScanner> instantiatedScanners = new ArrayList<>();
 // handle additionalScanners
 if (additionalScanners != null && !additionalScanners.isEmpty()) {
  scanners.addAll(additionalScanners);
  instantiatedScanners.addAll(additionalScanners);
 }
 try {
  for (Map.Entry<byte[], NavigableSet<byte[]>> entry : scan.getFamilyMap().entrySet()) {
   HStore store = stores.get(entry.getKey());
   KeyValueScanner scanner = store.getScanner(scan, entry.getValue(), this.readPt);
   instantiatedScanners.add(scanner);
   if (this.filter == null || !scan.doLoadColumnFamiliesOnDemand()
     || this.filter.isFamilyEssential(entry.getKey())) {
    scanners.add(scanner);
   } else {
    joinedScanners.add(scanner);
   }
  }
  initializeKVHeap(scanners, joinedScanners, region);
 } catch (Throwable t) {
  throw handleException(instantiatedScanners, t);
 }
}

代码示例来源:origin: apache/hbase

/**
 * Do a small get/scan against one store. This is required because store
 * has no actual methods of querying itself, and relies on StoreScanner.
 */
public static List<Cell> getFromStoreFile(HStore store,
                       Get get) throws IOException {
 Scan scan = new Scan(get);
 InternalScanner scanner = (InternalScanner) store.getScanner(scan,
   scan.getFamilyMap().get(store.getColumnFamilyDescriptor().getName()),
   // originally MultiVersionConcurrencyControl.resetThreadReadPoint() was called to set
   // readpoint 0.
   0);
 List<Cell> result = new ArrayList<>();
 scanner.next(result);
 if (!result.isEmpty()) {
  // verify that we are on the row we want:
  Cell kv = result.get(0);
  if (!CellUtil.matchingRows(kv, get.getRow())) {
   result.clear();
  }
 }
 scanner.close();
 return result;
}

代码示例来源:origin: apache/hbase

inputCellsAfterSnapshot.forEach(c -> store.add(c, null));
int numberOfMemScannersBeforeFlush = inputCellsAfterSnapshot.isEmpty() ? 1 : 2;
try (StoreScanner s = (StoreScanner) store.getScanner(new Scan(), quals, seqId)) {

代码示例来源:origin: apache/hbase

InternalScanner scanner = (InternalScanner) store.getScanner(
   new Scan(new Get(row)), quals, seqId + 1);
service.shutdown();

代码示例来源:origin: apache/hbase

quals.add(qf2);
quals.add(qf3);
try (InternalScanner scanner = (InternalScanner) store.getScanner(
  new Scan(new Get(row)), quals, seqId)) {
 List<Cell> results = new MyList<>(size -> {

代码示例来源:origin: apache/hbase

.withStartRow(r1)
    .setFilter(filter);
try (InternalScanner scanner = (InternalScanner) store.getScanner(
   scan, null, seqId + 3)){

代码示例来源:origin: org.apache.hbase/hbase-server

/**
 * Do a small get/scan against one store. This is required because store
 * has no actual methods of querying itself, and relies on StoreScanner.
 */
public static List<Cell> getFromStoreFile(HStore store,
                       Get get) throws IOException {
 Scan scan = new Scan(get);
 InternalScanner scanner = (InternalScanner) store.getScanner(scan,
   scan.getFamilyMap().get(store.getColumnFamilyDescriptor().getName()),
   // originally MultiVersionConcurrencyControl.resetThreadReadPoint() was called to set
   // readpoint 0.
   0);
 List<Cell> result = new ArrayList<>();
 scanner.next(result);
 if (!result.isEmpty()) {
  // verify that we are on the row we want:
  Cell kv = result.get(0);
  if (!CellUtil.matchingRows(kv, get.getRow())) {
   result.clear();
  }
 }
 scanner.close();
 return result;
}

代码示例来源:origin: org.apache.hbase/hbase-server

inputCellsAfterSnapshot.forEach(c -> store.add(c, null));
int numberOfMemScannersBeforeFlush = inputCellsAfterSnapshot.isEmpty() ? 1 : 2;
try (StoreScanner s = (StoreScanner) store.getScanner(new Scan(), quals, seqId)) {

代码示例来源:origin: org.apache.hbase/hbase-server

InternalScanner scanner = (InternalScanner) store.getScanner(
   new Scan(new Get(row)), quals, seqId + 1);
service.shutdown();

代码示例来源:origin: org.apache.hbase/hbase-server

quals.add(qf2);
quals.add(qf3);
try (InternalScanner scanner = (InternalScanner) store.getScanner(
  new Scan(new Get(row)), quals, seqId)) {
 List<Cell> results = new MyList<>(size -> {

代码示例来源:origin: org.apache.hbase/hbase-server

.withStartRow(r1)
    .setFilter(filter);
try (InternalScanner scanner = (InternalScanner) store.getScanner(
   scan, null, seqId + 3)){

相关文章

HStore类方法