private void appendKeyRanges(StringBuilder buf) { ScanRanges scanRanges = context.getScanRanges(); if (scanRanges.isDegenerate() || scanRanges.isEverything()) { return; } buf.append(" ["); StringBuilder buf1 = new StringBuilder(); appendScanRow(buf1, Bound.LOWER); buf.append(buf1); buf.setCharAt(buf.length()-1, ']'); StringBuilder buf2 = new StringBuilder(); appendScanRow(buf2, Bound.UPPER); if (!StringUtil.equals(buf1, buf2)) { buf.append( " - ["); buf.append(buf2); } buf.setCharAt(buf.length()-1, ']'); } }
/** * Return true if the region with the start and end key * intersects with the scan ranges and false otherwise. * @param regionStartKey lower inclusive key * @param regionEndKey upper exclusive key * @param isLocalIndex true if the table being scanned is a local index * @return true if the scan range intersects with the specified lower/upper key * range */ public boolean intersectRegion(byte[] regionStartKey, byte[] regionEndKey, boolean isLocalIndex) { if (isEverything()) { return true; } if (isDegenerate()) { return false; } // Every range intersects all regions of a local index table if (isLocalIndex) { return true; } boolean crossesSaltBoundary = isSalted && ScanUtil.crossesPrefixBoundary(regionEndKey, ScanUtil.getPrefix(regionStartKey, SaltingUtil.NUM_SALTING_BYTES), SaltingUtil.NUM_SALTING_BYTES); return intersectScan(null, regionStartKey, regionEndKey, 0, crossesSaltBoundary) == HAS_INTERSECTION; }
private void appendKeyRanges(StringBuilder buf) { ScanRanges scanRanges = context.getScanRanges(); if (scanRanges.isDegenerate() || scanRanges.isEverything()) { return; } buf.append(" ["); StringBuilder buf1 = new StringBuilder(); appendScanRow(buf1, Bound.LOWER); buf.append(buf1); buf.setCharAt(buf.length()-1, ']'); StringBuilder buf2 = new StringBuilder(); appendScanRow(buf2, Bound.UPPER); if (!StringUtil.equals(buf1, buf2)) { buf.append( " - ["); buf.append(buf2); } buf.setCharAt(buf.length()-1, ']'); } }
private void appendKeyRanges(StringBuilder buf) { ScanRanges scanRanges = context.getScanRanges(); if (scanRanges.isDegenerate() || scanRanges.isEverything()) { return; } buf.append(" ["); StringBuilder buf1 = new StringBuilder(); appendScanRow(buf1, Bound.LOWER); buf.append(buf1); buf.setCharAt(buf.length()-1, ']'); StringBuilder buf2 = new StringBuilder(); appendScanRow(buf2, Bound.UPPER); if (!StringUtil.equals(buf1, buf2)) { buf.append( " - ["); buf.append(buf2); } buf.setCharAt(buf.length()-1, ']'); } }
/** * Return true if the region with the start and end key * intersects with the scan ranges and false otherwise. * @param regionStartKey lower inclusive key * @param regionEndKey upper exclusive key * @param isLocalIndex true if the table being scanned is a local index * @return true if the scan range intersects with the specified lower/upper key * range */ public boolean intersectRegion(byte[] regionStartKey, byte[] regionEndKey, boolean isLocalIndex) { if (isEverything()) { return true; } if (isDegenerate()) { return false; } // Every range intersects all regions of a local index table if (isLocalIndex) { return true; } boolean crossesSaltBoundary = isSalted && ScanUtil.crossesPrefixBoundary(regionEndKey, ScanUtil.getPrefix(regionStartKey, SaltingUtil.NUM_SALTING_BYTES), SaltingUtil.NUM_SALTING_BYTES); return intersectScan(null, regionStartKey, regionEndKey, 0, crossesSaltBoundary) == HAS_INTERSECTION; }
/** * Return true if the region with the start and end key * intersects with the scan ranges and false otherwise. * @param regionStartKey lower inclusive key * @param regionEndKey upper exclusive key * @param isLocalIndex true if the table being scanned is a local index * @return true if the scan range intersects with the specified lower/upper key * range */ public boolean intersectRegion(byte[] regionStartKey, byte[] regionEndKey, boolean isLocalIndex) { if (isEverything()) { return true; } if (isDegenerate()) { return false; } // Every range intersects all regions of a local index table if (isLocalIndex) { return true; } boolean crossesSaltBoundary = isSalted && ScanUtil.crossesPrefixBoundary(regionEndKey, ScanUtil.getPrefix(regionStartKey, SaltingUtil.NUM_SALTING_BYTES), SaltingUtil.NUM_SALTING_BYTES); return intersectScan(null, regionStartKey, regionEndKey, 0, crossesSaltBoundary) == HAS_INTERSECTION; }