/** * Returns true if the first range start1...end1 overlaps with the second range * start2...end2, assuming the byte arrays represent row keys * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. */ @Deprecated public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return PrivateCellUtil.overlappingKeys(start1, end1, start2, end2); }
Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, c, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(b, c, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, c, b, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, d, b, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(b, c, a, d)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, b, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, b, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, empty, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, empty, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, empty)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, empty, a, b)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(a, b, c, d)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, d, a, b)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, c, d)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, c, empty)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, d, empty)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, d, b, c)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, empty, b, c)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(d, empty, b, c));
private boolean isValidRegion(RegionInfo hri) { // An offline split parent region should be excluded. if (hri.isOffline() && (hri.isSplit() || hri.isSplitParent())) { return false; } return PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), hri.getStartKey(), hri.getEndKey()); }
byte[][] sp = sa.split(hri.getStartKey(), hri.getEndKey(), numSplits, true); for (int i = 0; i < sp.length - 1; i++) { if (PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), sp[i], sp[i + 1])) { List<String> hosts = if (PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), hri.getStartKey(), hri.getEndKey())) { List<String> hosts =
/** * Exclude offline split parent regions and * regions that don't intersect with provided scan */ private boolean isValidRegion(RegionInfo hri) { if (hri.isOffline() && (hri.isSplit() || hri.isSplitParent())) { return false; } return PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), hri.getStartKey(), hri.getEndKey()); }
Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, c, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(b, c, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, c, b, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, d, b, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(b, c, a, d)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, b, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, b, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, empty, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, empty, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, empty)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, empty, a, b)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(a, b, c, d)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, d, a, b)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, c, d)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, c, empty)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, d, empty)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, d, b, c)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, empty, b, c)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(d, empty, b, c));
Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, c, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(b, c, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, c, b, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, d, b, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(b, c, a, d)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, b, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, b, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, empty, a, b)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, empty, a, c)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(a, b, empty, empty)); Assert.assertTrue(PrivateCellUtil.overlappingKeys(empty, empty, a, b)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(a, b, c, d)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, d, a, b)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, c, d)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, c, empty)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(b, c, d, empty)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, d, b, c)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(c, empty, b, c)); Assert.assertFalse(PrivateCellUtil.overlappingKeys(d, empty, b, c));
/** * Exclude offline split parent regions and * regions that don't intersect with provided scan */ private boolean isValidRegion(RegionInfo hri) { if (hri.isOffline() && (hri.isSplit() || hri.isSplitParent())) { return false; } return PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), hri.getStartKey(), hri.getEndKey()); }
byte[][] sp = sa.split(hri.getStartKey(), hri.getEndKey(), numSplits, true); for (int i = 0; i < sp.length - 1; i++) { if (PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), sp[i], sp[i + 1])) { List<String> hosts = if (PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), hri.getStartKey(), hri.getEndKey())) { List<String> hosts =
byte[][] sp = sa.split(hri.getStartKey(), hri.getEndKey(), numSplits, true); for (int i = 0; i < sp.length - 1; i++) { if (PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), sp[i], sp[i + 1])) { List<String> hosts = if (PrivateCellUtil.overlappingKeys(scan.getStartRow(), scan.getStopRow(), hri.getStartKey(), hri.getEndKey())) { List<String> hosts =