@Test public void testOverlappingKeys() { byte[] empty = HConstants.EMPTY_BYTE_ARRAY; byte[] a = Bytes.toBytes("a"); byte[] b = Bytes.toBytes("b"); byte[] c = Bytes.toBytes("c"); byte[] d = Bytes.toBytes("d"); Assert.assertTrue(CellUtil.overlappingKeys(a, b, a, b)); Assert.assertTrue(CellUtil.overlappingKeys(a, c, a, b)); Assert.assertTrue(CellUtil.overlappingKeys(a, b, a, c)); Assert.assertTrue(CellUtil.overlappingKeys(b, c, a, c)); Assert.assertTrue(CellUtil.overlappingKeys(a, c, b, c)); Assert.assertTrue(CellUtil.overlappingKeys(a, d, b, c)); Assert.assertTrue(CellUtil.overlappingKeys(b, c, a, d)); Assert.assertTrue(CellUtil.overlappingKeys(empty, b, a, b)); Assert.assertTrue(CellUtil.overlappingKeys(empty, b, a, c)); Assert.assertTrue(CellUtil.overlappingKeys(a, b, empty, b)); Assert.assertTrue(CellUtil.overlappingKeys(a, b, empty, c)); Assert.assertTrue(CellUtil.overlappingKeys(a, empty, a, b)); Assert.assertTrue(CellUtil.overlappingKeys(a, empty, a, c)); Assert.assertTrue(CellUtil.overlappingKeys(a, b, empty, empty)); Assert.assertTrue(CellUtil.overlappingKeys(empty, empty, a, b)); Assert.assertFalse(CellUtil.overlappingKeys(a, b, c, d)); Assert.assertFalse(CellUtil.overlappingKeys(c, d, a, b)); Assert.assertFalse(CellUtil.overlappingKeys(b, c, c, d)); Assert.assertFalse(CellUtil.overlappingKeys(b, c, c, empty)); Assert.assertFalse(CellUtil.overlappingKeys(b, c, d, empty)); Assert.assertFalse(CellUtil.overlappingKeys(c, d, b, c)); Assert.assertFalse(CellUtil.overlappingKeys(c, empty, b, c)); Assert.assertFalse(CellUtil.overlappingKeys(d, empty, b, c)); Assert.assertFalse(CellUtil.overlappingKeys(b, c, a, b)); Assert.assertFalse(CellUtil.overlappingKeys(b, c, empty, b)); Assert.assertFalse(CellUtil.overlappingKeys(b, c, empty, a)); Assert.assertFalse(CellUtil.overlappingKeys(a,b, b, c)); Assert.assertFalse(CellUtil.overlappingKeys(empty, b, b, c)); Assert.assertFalse(CellUtil.overlappingKeys(empty, a, b, c)); }
public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); }
CellUtil { public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); } }
CellUtil { public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); }  }
CellUtil { public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); }  static ByteRange fillRowRange(Cell cell, ByteRange range); static ByteRange fillFamilyRange(Cell cell, ByteRange range); static ByteRange fillQualifierRange(Cell cell, ByteRange range); static ByteRange fillTagRange(Cell cell, ByteRange range); static byte[] cloneRow(Cell cell); static byte[] cloneFamily(Cell cell); static byte[] cloneQualifier(Cell cell); static byte[] cloneValue(Cell cell); static byte[] getTagArray(Cell cell); static int copyRowTo(Cell cell, byte[] destination, int destinationOffset); static int copyFamilyTo(Cell cell, byte[] destination, int destinationOffset); static int copyQualifierTo(Cell cell, byte[] destination, int destinationOffset); static int copyValueTo(Cell cell, byte[] destination, int destinationOffset); static int copyTagTo(Cell cell, byte[] destination, int destinationOffset); static byte getRowByte(Cell cell, int index); static ByteBuffer getValueBufferShallowCopy(Cell cell); static ByteBuffer getQualifierBufferShallowCopy(Cell cell); static Cell createCell(final byte [] row, final byte [] family, final byte [] qualifier,
      final long timestamp, final byte type, final byte [] value); static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier,
      final long timestamp, final byte type, final byte[] value, final long memstoreTS); static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier,
      final long timestamp, final byte type, final byte[] value, byte[] tags, final long memstoreTS); static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier,
      final long timestamp, Type type, final byte[] value, byte[] tags); static CellScanner createCellScanner(final List<? extends CellScannable> cellScannerables); static CellScanner createCellScanner(final Iterable<Cell> cellIterable); static CellScanner createCellScanner(final Iterator<Cell> cells); static CellScanner createCellScanner(final Cell[] cellArray); static CellScanner createCellScanner(final NavigableMap<byte [],
      List<Cell>> map); static boolean matchingRow(final Cell left, final Cell right); static boolean matchingRow(final Cell left, final byte[] buf); static boolean matchingRow(final Cell left, final byte[] buf, final int offset,
      final int length); static boolean matchingFamily(final Cell left, final Cell right); static boolean matchingFamily(final Cell left, final byte[] buf); static boolean matchingFamily(final Cell left, final byte[] buf, final int offset,
      final int length); static boolean matchingQualifier(final Cell left, final Cell right); static boolean matchingQualifier(final Cell left, final byte[] buf); static boolean matchingQualifier(final Cell left, final byte[] buf, final int offset,
      final int length); static boolean matchingColumn(final Cell left, final byte[] fam, final byte[] qual); static boolean matchingColumn(final Cell left, final byte[] fam, final int foffset,
      final int flength, final byte[] qual, final int qoffset, final int qlength); static boolean matchingColumn(final Cell left, final Cell right); static boolean matchingValue(final Cell left, final Cell right); static boolean matchingValue(final Cell left, final byte[] buf); static boolean isDelete(final Cell cell); static boolean isDeleteFamily(final Cell cell); static boolean isDeleteFamilyVersion(final Cell cell); static int estimatedSizeOf(final Cell cell); static Iterator<Tag> tagsIterator(final byte[] tags, final int offset, final int length); static boolean overlappingKeys(final byte[] start1, final byte[] end1,
      final byte[] start2, final byte[] end2); }
CellUtil { public static boolean overlappingKeys(final byte[] start1, final byte[] end1, final byte[] start2, final byte[] end2) { return (end2.length == 0 || start1.length == 0 || Bytes.compareTo(start1, end2) < 0) && (end1.length == 0 || start2.length == 0 || Bytes.compareTo(start2, end1) < 0); }  static ByteRange fillRowRange(Cell cell, ByteRange range); static ByteRange fillFamilyRange(Cell cell, ByteRange range); static ByteRange fillQualifierRange(Cell cell, ByteRange range); static ByteRange fillTagRange(Cell cell, ByteRange range); static byte[] cloneRow(Cell cell); static byte[] cloneFamily(Cell cell); static byte[] cloneQualifier(Cell cell); static byte[] cloneValue(Cell cell); static byte[] getTagArray(Cell cell); static int copyRowTo(Cell cell, byte[] destination, int destinationOffset); static int copyFamilyTo(Cell cell, byte[] destination, int destinationOffset); static int copyQualifierTo(Cell cell, byte[] destination, int destinationOffset); static int copyValueTo(Cell cell, byte[] destination, int destinationOffset); static int copyTagTo(Cell cell, byte[] destination, int destinationOffset); static byte getRowByte(Cell cell, int index); static ByteBuffer getValueBufferShallowCopy(Cell cell); static ByteBuffer getQualifierBufferShallowCopy(Cell cell); static Cell createCell(final byte [] row, final byte [] family, final byte [] qualifier,
      final long timestamp, final byte type, final byte [] value); static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier,
      final long timestamp, final byte type, final byte[] value, final long memstoreTS); static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier,
      final long timestamp, final byte type, final byte[] value, byte[] tags, final long memstoreTS); static Cell createCell(final byte[] row, final byte[] family, final byte[] qualifier,
      final long timestamp, Type type, final byte[] value, byte[] tags); static CellScanner createCellScanner(final List<? extends CellScannable> cellScannerables); static CellScanner createCellScanner(final Iterable<Cell> cellIterable); static CellScanner createCellScanner(final Iterator<Cell> cells); static CellScanner createCellScanner(final Cell[] cellArray); static CellScanner createCellScanner(final NavigableMap<byte [],
      List<Cell>> map); static boolean matchingRow(final Cell left, final Cell right); static boolean matchingRow(final Cell left, final byte[] buf); static boolean matchingRow(final Cell left, final byte[] buf, final int offset,
      final int length); static boolean matchingFamily(final Cell left, final Cell right); static boolean matchingFamily(final Cell left, final byte[] buf); static boolean matchingFamily(final Cell left, final byte[] buf, final int offset,
      final int length); static boolean matchingQualifier(final Cell left, final Cell right); static boolean matchingQualifier(final Cell left, final byte[] buf); static boolean matchingQualifier(final Cell left, final byte[] buf, final int offset,
      final int length); static boolean matchingColumn(final Cell left, final byte[] fam, final byte[] qual); static boolean matchingColumn(final Cell left, final byte[] fam, final int foffset,
      final int flength, final byte[] qual, final int qoffset, final int qlength); static boolean matchingColumn(final Cell left, final Cell right); static boolean matchingValue(final Cell left, final Cell right); static boolean matchingValue(final Cell left, final byte[] buf); static boolean isDelete(final Cell cell); static boolean isDeleteFamily(final Cell cell); static boolean isDeleteFamilyVersion(final Cell cell); static int estimatedSizeOf(final Cell cell); static Iterator<Tag> tagsIterator(final byte[] tags, final int offset, final int length); static boolean overlappingKeys(final byte[] start1, final byte[] end1,
      final byte[] start2, final byte[] end2);  }