} else {
regions = Iterables.filter(allTableRegions,
new Predicate<HRegionLocation>() {
@Override
public boolean apply(HRegionLocation region) {
KeyRange minMaxRange = context.getMinMaxRange();
if (minMaxRange != null) {
KeyRange range = KeyRange.getKeyRange(region.getRegionInfo().getStartKey(), region.getRegionInfo().getEndKey());
if (tableRef.getTable().getBucketNum() != null) {
// Add salt byte, as minMaxRange won't have it
minMaxRange = SaltingUtil.addSaltByte(region.getRegionInfo().getStartKey(), minMaxRange);
}
range = range.intersect(minMaxRange);
return ranges.intersect(range.getLowerRange(), range.getUpperRange());
}
return ranges.intersect(region.getRegionInfo().getStartKey(), region.getRegionInfo().getEndKey());
}
});
}