// If the scan is using skip scan filter, intersect and replace the filter.
if (mayHaveRows && useSkipScan) {
Filter filter = scan.getFilter();
if (filter instanceof SkipScanFilter) {
SkipScanFilter oldFilter = (SkipScanFilter)filter;
SkipScanFilter newFilter = oldFilter.intersect(startKey, stopKey);
if (newFilter == null) {
return false;
}
// Intersect found: replace skip scan with intersected one
scan.setFilter(newFilter);
} else if (filter instanceof FilterList) {
FilterList filterList = (FilterList)filter;
Filter firstFilter = filterList.getFilters().get(0);
if (firstFilter instanceof SkipScanFilter) {
SkipScanFilter oldFilter = (SkipScanFilter)firstFilter;
SkipScanFilter newFilter = oldFilter.intersect(startKey, stopKey);
if (newFilter == null) {
return false;
}
// Intersect found: replace skip scan with intersected one
List<Filter> allFilters = new ArrayList<Filter>(filterList.getFilters().size());