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

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

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

Store.getComparator介绍

暂无

代码示例

代码示例来源:origin: harbby/presto-connectors

/**
 * Run a Get against passed in <code>store</code> on passed <code>row</code>, etc.
 * @param store
 * @param row
 * @param family
 * @param tr
 * @return Get result.
 * @throws IOException
 */
private List<Cell> doGet(final Store store, final byte [] row,
  final Map.Entry<byte[], List<Cell>> family, final TimeRange tr)
throws IOException {
 // Sort the cells so that they match the order that they
 // appear in the Get results. Otherwise, we won't be able to
 // find the existing values if the cells are not specified
 // in order by the client since cells are in an array list.
 Collections.sort(family.getValue(), store.getComparator());
 // Get previous values for all columns in this family
 Get get = new Get(row);
 for (Cell cell : family.getValue()) {
  get.addColumn(family.getKey(), CellUtil.cloneQualifier(cell));
 }
 if (tr != null) get.setTimeRange(tr.getMin(), tr.getMax());
 return get(get, false);
}

代码示例来源:origin: harbby/presto-connectors

/**
 * @return true if top of heap has changed (and KeyValueHeap has to try the
 *         next KV)
 * @throws IOException
 */
protected boolean checkReseek() throws IOException {
 if (this.heap == null && this.lastTop != null) {
  resetScannerStack(this.lastTop);
  if (this.heap.peek() == null
    || store.getComparator().compareRows(this.lastTop, this.heap.peek()) != 0) {
   LOG.debug("Storescanner.peek() is changed where before = "
     + this.lastTop.toString() + ",and after = " + this.heap.peek());
   this.lastTop = null;
   return true;
  }
  this.lastTop = null; // gone!
 }
 // else dont need to reseek
 return false;
}

代码示例来源:origin: harbby/presto-connectors

protected void resetScannerStack(Cell lastTopKey) throws IOException {
 if (heap != null) {
  throw new RuntimeException("StoreScanner.reseek run on an existing heap!");
 }
 /* When we have the scan object, should we not pass it to getScanners()
  * to get a limited set of scanners? We did so in the constructor and we
  * could have done it now by storing the scan object from the constructor */
 List<KeyValueScanner> scanners = getScannersNoCompaction();
 // Seek all scanners to the initial key
 seekScanners(scanners, lastTopKey, false, parallelSeekEnabled);
 // Combine all seeked scanners with a heap
 resetKVHeap(scanners, store.getComparator());
 // Reset the state of the Query Matcher and set to top row.
 // Only reset and call setRow if the row changes; avoids confusing the
 // query matcher if scanning intra-row.
 Cell kv = heap.peek();
 if (kv == null) {
  kv = lastTopKey;
 }
 byte[] row = kv.getRowArray();
 int offset = kv.getRowOffset();
 short length = kv.getRowLength();
 if ((matcher.row == null) || !Bytes.equals(row, offset, length, matcher.row,
   matcher.rowOffset, matcher.rowLength)) {
  this.countPerRow = 0;
  matcher.reset();
  matcher.setRow(row, offset, length);
 }
}

代码示例来源:origin: harbby/presto-connectors

private StoreScanner(Store store, ScanInfo scanInfo, Scan scan,
  List<? extends KeyValueScanner> scanners, ScanType scanType, long smallestReadPoint,
  long earliestPutTs, byte[] dropDeletesFromRow, byte[] dropDeletesToRow) throws IOException {
 this(store, scan, scanInfo, null,
  ((HStore)store).getHRegion().getReadpoint(IsolationLevel.READ_COMMITTED), false);
 if (dropDeletesFromRow == null) {
  matcher = new ScanQueryMatcher(scan, scanInfo, null, scanType, smallestReadPoint,
    earliestPutTs, oldestUnexpiredTS, now, store.getCoprocessorHost());
 } else {
  matcher = new ScanQueryMatcher(scan, scanInfo, null, smallestReadPoint, earliestPutTs,
    oldestUnexpiredTS, now, dropDeletesFromRow, dropDeletesToRow, store.getCoprocessorHost());
 }
 // Filter the list of scanners using Bloom filters, time range, TTL, etc.
 scanners = selectScannersFrom(scanners);
 // Seek all scanners to the initial key
 seekScanners(scanners, matcher.getStartKey(), false, parallelSeekEnabled);
 // Combine all seeked scanners with a heap
 resetKVHeap(scanners, store.getComparator());
}

代码示例来源:origin: harbby/presto-connectors

sort(increments, store.getComparator()), now,
  MultiVersionConcurrencyControl.NO_WRITE_NUMBER, allKVs, null);
if (!results.isEmpty()) {

代码示例来源:origin: harbby/presto-connectors

snapshot.getTimeRangeTracker(), cellsCount);
StoreScanner storeScanner = (scanner instanceof StoreScanner) ? (StoreScanner)scanner : null;
mw.init(storeScanner, factory, store.getComparator());

代码示例来源:origin: harbby/presto-connectors

mw.init(storeScanner, factory, store.getComparator());
finished =
  performCompaction(scanner, mw, smallestReadPoint, cleanSeqId, throughputController);

代码示例来源:origin: harbby/presto-connectors

resetKVHeap(scanners, store.getComparator());

代码示例来源:origin: co.cask.hbase/hbase

store != null ? store.getComparator() : null;

代码示例来源:origin: harbby/presto-connectors

store != null ? store.getComparator() : null;

相关文章