Java Code Examples for org.apache.hadoop.hbase.client.Scan#getMaxResultsPerColumnFamily()

The following examples show how to use org.apache.hadoop.hbase.client.Scan#getMaxResultsPerColumnFamily() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: hbase   File:    License: Apache License 2.0 4 votes vote down vote up
 * Opens a scanner across memstore, snapshot, and all StoreFiles. Assumes we
 * are not in a compaction.
 * @param store who we scan
 * @param scan the spec
 * @param columns which columns we are scanning
 * @throws IOException
public StoreScanner(HStore store, ScanInfo scanInfo, Scan scan, NavigableSet<byte[]> columns,
    long readPt) throws IOException {
  this(store, scan, scanInfo, columns != null ? columns.size() : 0, readPt,
      scan.getCacheBlocks(), ScanType.USER_SCAN);
  if (columns != null && scan.isRaw()) {
    throw new DoNotRetryIOException("Cannot specify any column for a raw scan");
  matcher = UserScanQueryMatcher.create(scan, scanInfo, columns, oldestUnexpiredTS, now,


  List<KeyValueScanner> scanners = null;
  try {
    // Pass columns to try to filter out unnecessary StoreFiles.
    scanners = selectScannersFrom(store,
      store.getScanners(cacheBlocks, scanUsePread, false, matcher, scan.getStartRow(),
        scan.includeStartRow(), scan.getStopRow(), scan.includeStopRow(), this.readPt));

    // Seek all scanners to the start of the Row (or if the exact matching row
    // key does not exist, then to the start of the next matching Row).
    // Always check bloom filter to optimize the top row seek for delete
    // family marker.
    seekScanners(scanners, matcher.getStartKey(), explicitColumnQuery && lazySeekEnabledGlobally,

    // set storeLimit
    this.storeLimit = scan.getMaxResultsPerColumnFamily();

    // set rowOffset
    this.storeOffset = scan.getRowOffsetPerColumnFamily();
    // Combine all seeked scanners with a heap
    resetKVHeap(scanners, comparator);
  } catch (IOException e) {
    // remove us from the HStore#changedReaderObservers here or we'll have no chance to
    // and might cause memory leak
    throw e;