public List<List<KeyRange>> getBoundRanges() { return ranges.subList(0, getBoundSlotCount()); }
private ScanRanges (RowKeySchema schema, int[] slotSpan, List<List<KeyRange>> ranges, KeyRange scanRange, boolean useSkipScanFilter, boolean isPointLookup, Integer bucketNum, TimeRange rowTimestampRange) { this.isPointLookup = isPointLookup; this.isSalted = bucketNum != null; this.useSkipScanFilter = useSkipScanFilter; this.scanRange = scanRange; this.rowTimestampRange = rowTimestampRange; if (isSalted && !isPointLookup) { ranges.set(0, SaltingUtil.generateAllSaltingRanges(bucketNum)); } this.ranges = ImmutableList.copyOf(ranges); this.slotSpan = slotSpan; this.schema = schema; if (schema != null && !ranges.isEmpty()) { if (!this.useSkipScanFilter) { int boundSlotCount = this.getBoundSlotCount(); ranges = ranges.subList(0, boundSlotCount); slotSpan = Arrays.copyOf(slotSpan, boundSlotCount); } this.filter = new SkipScanFilter(ranges, slotSpan, this.schema); } }
private boolean explainSkipScan(StringBuilder buf) { ScanRanges scanRanges = context.getScanRanges(); if (scanRanges.isPointLookup()) { int keyCount = scanRanges.getPointLookupCount(); buf.append("POINT LOOKUP ON " + keyCount + " KEY" + (keyCount > 1 ? "S " : " ")); } else if (scanRanges.useSkipScanFilter()) { buf.append("SKIP SCAN "); int count = 1; boolean hasRanges = false; int nSlots = scanRanges.getBoundSlotCount(); for (int i = 0; i < nSlots; i++) { List<KeyRange> ranges = scanRanges.getRanges().get(i); count *= ranges.size(); for (KeyRange range : ranges) { hasRanges |= !range.isSingleKey(); } } buf.append("ON "); buf.append(count); buf.append(hasRanges ? " RANGE" : " KEY"); buf.append(count > 1 ? "S " : " "); } else { buf.append("RANGE SCAN "); } return scanRanges.useSkipScanFilter(); }
boolean isLocalIndex = ScanUtil.isLocalIndex(context.getScan()); boolean forceSkipScan = this.hint.hasHint(Hint.SKIP_SCAN); int nRanges = forceSkipScan ? scanRanges.getRanges().size() : scanRanges.getBoundSlotCount(); for (int i = 0, minPos = 0; minPos < nRanges || minMaxIterator.hasNext(); i++) { List<KeyRange> ranges = minPos >= nRanges ? EVERYTHING : scanRanges.getRanges().get(minPos++);
public List<List<KeyRange>> getBoundRanges() { return ranges.subList(0, getBoundSlotCount()); }
public List<List<KeyRange>> getBoundRanges() { return ranges.subList(0, getBoundSlotCount()); }
private ScanRanges (RowKeySchema schema, int[] slotSpan, List<List<KeyRange>> ranges, KeyRange scanRange, KeyRange minMaxRange, boolean useSkipScanFilter, boolean isPointLookup, Integer bucketNum, TimeRange rowTimestampRange) { this.isPointLookup = isPointLookup; this.isSalted = bucketNum != null; this.useSkipScanFilter = useSkipScanFilter; this.scanRange = scanRange; this.minMaxRange = minMaxRange; this.rowTimestampRange = rowTimestampRange; if (isSalted && !isPointLookup) { ranges.set(0, SaltingUtil.generateAllSaltingRanges(bucketNum)); } this.ranges = ImmutableList.copyOf(ranges); this.slotSpan = slotSpan; this.schema = schema; if (schema != null && !ranges.isEmpty()) { if (!this.useSkipScanFilter) { int boundSlotCount = this.getBoundSlotCount(); ranges = ranges.subList(0, boundSlotCount); slotSpan = Arrays.copyOf(slotSpan, boundSlotCount); } this.filter = new SkipScanFilter(ranges, slotSpan, this.schema); } }
private ScanRanges (RowKeySchema schema, int[] slotSpan, List<List<KeyRange>> ranges, KeyRange scanRange, boolean useSkipScanFilter, boolean isPointLookup, Integer bucketNum, TimeRange rowTimestampRange) { this.isPointLookup = isPointLookup; this.isSalted = bucketNum != null; this.useSkipScanFilter = useSkipScanFilter; this.scanRange = scanRange; this.rowTimestampRange = rowTimestampRange; if (isSalted && !isPointLookup) { ranges.set(0, SaltingUtil.generateAllSaltingRanges(bucketNum)); } this.ranges = ImmutableList.copyOf(ranges); this.slotSpan = slotSpan; this.schema = schema; if (schema != null && !ranges.isEmpty()) { if (!this.useSkipScanFilter) { int boundSlotCount = this.getBoundSlotCount(); ranges = ranges.subList(0, boundSlotCount); slotSpan = Arrays.copyOf(slotSpan, boundSlotCount); } this.filter = new SkipScanFilter(ranges, slotSpan, this.schema); } }
private boolean explainSkipScan(StringBuilder buf) { ScanRanges scanRanges = context.getScanRanges(); if (scanRanges.isPointLookup()) { int keyCount = scanRanges.getPointLookupCount(); buf.append("POINT LOOKUP ON " + keyCount + " KEY" + (keyCount > 1 ? "S " : " ")); } else if (scanRanges.useSkipScanFilter()) { buf.append("SKIP SCAN "); int count = 1; boolean hasRanges = false; int nSlots = scanRanges.getBoundSlotCount(); for (int i = 0; i < nSlots; i++) { List<KeyRange> ranges = scanRanges.getRanges().get(i); count *= ranges.size(); for (KeyRange range : ranges) { hasRanges |= !range.isSingleKey(); } } buf.append("ON "); buf.append(count); buf.append(hasRanges ? " RANGE" : " KEY"); buf.append(count > 1 ? "S " : " "); } else { buf.append("RANGE SCAN "); } return scanRanges.useSkipScanFilter(); }
private boolean explainSkipScan(StringBuilder buf) { ScanRanges scanRanges = context.getScanRanges(); if (scanRanges.isPointLookup()) { int keyCount = scanRanges.getPointLookupCount(); buf.append("POINT LOOKUP ON " + keyCount + " KEY" + (keyCount > 1 ? "S " : " ")); } else if (scanRanges.useSkipScanFilter()) { buf.append("SKIP SCAN "); int count = 1; boolean hasRanges = false; int nSlots = scanRanges.getBoundSlotCount(); for (int i = 0; i < nSlots; i++) { List<KeyRange> ranges = scanRanges.getRanges().get(i); count *= ranges.size(); for (KeyRange range : ranges) { hasRanges |= !range.isSingleKey(); } } buf.append("ON "); buf.append(count); buf.append(hasRanges ? " RANGE" : " KEY"); buf.append(count > 1 ? "S " : " "); } else { buf.append("RANGE SCAN "); } return scanRanges.useSkipScanFilter(); }
boolean isLocalIndex = ScanUtil.isLocalIndex(context.getScan()); boolean forceSkipScan = this.hint.hasHint(Hint.SKIP_SCAN); int nRanges = forceSkipScan ? scanRanges.getRanges().size() : scanRanges.getBoundSlotCount(); for (int i = 0, minPos = 0; minPos < nRanges || minMaxIterator.hasNext(); i++) { List<KeyRange> ranges = minPos >= nRanges ? EVERYTHING : scanRanges.getRanges().get(minPos++);
int nRanges = forceSkipScan ? scanRanges.getRanges().size() : scanRanges.getBoundSlotCount(); for (int i = 0, minPos = 0; minPos < nRanges || minMaxIterator.hasNext(); i++) { List<KeyRange> ranges = minPos >= nRanges ? EVERYTHING : scanRanges.getRanges().get(minPos++);