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

The following examples show how to use org.apache.hadoop.hbase.client.Scan#hasFilter() . 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 check out the related API usage on the sidebar.
Example 1
Source File: SnapshotFilterImpl.java    From phoenix-omid with Apache License 2.0 5 votes vote down vote up
TransactionalClientScanner(HBaseTransaction state, Scan scan, int maxVersions)
        throws IOException {
    if (scan.hasFilter()) {
        LOG.warn("Client scanner with filter will return un expected results. Use Coprocessor scanning");
    }
    this.state = state;
    this.innerScanner = tableAccessWrapper.getScanner(scan);
    this.maxVersions = maxVersions;
    this.familyDeletionCache = new HashMap<String, Long>();
    this.attributeMap = scan.getAttributesMap();
}
 
Example 2
Source File: ScanQueryMatcher.java    From hbase with Apache License 2.0 4 votes vote down vote up
protected static Pair<DeleteTracker, ColumnTracker> getTrackers(RegionCoprocessorHost host,
    NavigableSet<byte[]> columns, ScanInfo scanInfo, long oldestUnexpiredTS, Scan userScan)
    throws IOException {
  int resultMaxVersion = scanInfo.getMaxVersions();
  int maxVersionToCheck = resultMaxVersion;
  if (userScan != null) {
    if (userScan.isRaw()) {
      resultMaxVersion = userScan.getMaxVersions();
      maxVersionToCheck = userScan.hasFilter() ? Integer.MAX_VALUE : resultMaxVersion;
    } else {
      resultMaxVersion = Math.min(userScan.getMaxVersions(), scanInfo.getMaxVersions());
      maxVersionToCheck = userScan.hasFilter() ? scanInfo.getMaxVersions() : resultMaxVersion;
    }
  }

  DeleteTracker deleteTracker;
  if (scanInfo.isNewVersionBehavior() && (userScan == null || !userScan.isRaw())) {
    deleteTracker = new NewVersionBehaviorTracker(columns, scanInfo.getComparator(),
        scanInfo.getMinVersions(), scanInfo.getMaxVersions(), resultMaxVersion,
        oldestUnexpiredTS);
  } else {
    deleteTracker = new ScanDeleteTracker(scanInfo.getComparator());
  }
  if (host != null) {
    deleteTracker = host.postInstantiateDeleteTracker(deleteTracker);
    if (deleteTracker instanceof VisibilityScanDeleteTracker && scanInfo.isNewVersionBehavior()) {
      deleteTracker = new VisibilityNewVersionBehaivorTracker(columns, scanInfo.getComparator(),
          scanInfo.getMinVersions(), scanInfo.getMaxVersions(), resultMaxVersion,
          oldestUnexpiredTS);
    }
  }

  ColumnTracker columnTracker;

  if (deleteTracker instanceof NewVersionBehaviorTracker) {
    columnTracker = (NewVersionBehaviorTracker) deleteTracker;
  } else if (columns == null || columns.size() == 0) {
    columnTracker = new ScanWildcardColumnTracker(scanInfo.getMinVersions(), maxVersionToCheck,
        oldestUnexpiredTS, scanInfo.getComparator());
  } else {
    columnTracker = new ExplicitColumnTracker(columns, scanInfo.getMinVersions(),
      maxVersionToCheck, oldestUnexpiredTS);
  }
  return new Pair<>(deleteTracker, columnTracker);
}