.findCommonPrefix(Bytes.toBytes(rLen1), 0, KeyValue.ROW_LENGTH_SIZE, Bytes.toBytes(rLen2), 0, KeyValue.ROW_LENGTH_SIZE); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { rkCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getRowByteBuffer(), ((ByteBufferExtendedCell) c1).getRowPosition(), rLen1, ((ByteBufferExtendedCell) c2).getRowByteBuffer(), .findCommonPrefix(c1.getRowArray(), c1.getRowOffset(), rLen1, c2.getRowArray(), c2.getRowOffset(), rLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { fCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getFamilyByteBuffer(), ((ByteBufferExtendedCell) c1).getFamilyPosition(), fLen1, ((ByteBufferExtendedCell) c2).getFamilyByteBuffer(), } else { fCommonPrefix = ByteBufferUtils .findCommonPrefix(c1.getFamilyArray(), c1.getFamilyOffset(), fLen1, c2.getFamilyArray(), c2.getFamilyOffset(), fLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { qCommon = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getQualifierByteBuffer(), ((ByteBufferExtendedCell) c1).getQualifierPosition(), qLen1, ((ByteBufferExtendedCell) c2).getQualifierByteBuffer(),
private int addKV(int prevKeyOffset, DataOutputStream out, ByteBuffer in, int prevKeyLength) throws IOException { int keyLength = in.getInt(); int valueLength = in.getInt(); if (prevKeyOffset == -1) { // copy the key, there is no common prefix with none ByteBufferUtils.putCompressedInt(out, keyLength); ByteBufferUtils.putCompressedInt(out, valueLength); ByteBufferUtils.putCompressedInt(out, 0); ByteBufferUtils.moveBufferToStream(out, in, keyLength + valueLength); } else { // find a common prefix and skip it int common = ByteBufferUtils.findCommonPrefix( in, prevKeyOffset + KeyValue.ROW_OFFSET, in.position(), Math.min(prevKeyLength, keyLength)); ByteBufferUtils.putCompressedInt(out, keyLength - common); ByteBufferUtils.putCompressedInt(out, valueLength); ByteBufferUtils.putCompressedInt(out, common); ByteBufferUtils.skip(in, common); ByteBufferUtils.moveBufferToStream(out, in, keyLength - common + valueLength); } return keyLength; }
if (rLen1 != rLen2) { return ByteBufferUtils.findCommonPrefix(Bytes.toBytes(rLen1), 0, KeyValue.ROW_LENGTH_SIZE, Bytes.toBytes(rLen2), 0, KeyValue.ROW_LENGTH_SIZE); int rkCommonPrefix = ByteBufferUtils.findCommonPrefix(c1.getRowArray(), c1.getRowOffset(), rLen1, c2.getRowArray(), c2.getRowOffset(), rLen2); commonPrefix += rkCommonPrefix; int fCommonPrefix = ByteBufferUtils.findCommonPrefix(c1.getFamilyArray(), c1.getFamilyOffset(), fLen1, c2.getFamilyArray(), c2.getFamilyOffset(), fLen2); commonPrefix += fCommonPrefix; int qCommon = ByteBufferUtils.findCommonPrefix(c1.getQualifierArray(), c1.getQualifierOffset(), qLen1, c2.getQualifierArray(), c2.getQualifierOffset(), qLen2); commonPrefix += qCommon; int tsCommonPrefix = ByteBufferUtils.findCommonPrefix(Bytes.toBytes(c1.getTimestamp()), 0, KeyValue.TIMESTAMP_SIZE, Bytes.toBytes(c2.getTimestamp()), 0, KeyValue.TIMESTAMP_SIZE); commonPrefix += tsCommonPrefix;
.findCommonPrefix(Bytes.toBytes(rLen1), 0, KeyValue.ROW_LENGTH_SIZE, Bytes.toBytes(rLen2), 0, KeyValue.ROW_LENGTH_SIZE); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { rkCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getRowByteBuffer(), ((ByteBufferExtendedCell) c1).getRowPosition(), rLen1, ((ByteBufferExtendedCell) c2).getRowByteBuffer(), .findCommonPrefix(c1.getRowArray(), c1.getRowOffset(), rLen1, c2.getRowArray(), c2.getRowOffset(), rLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { fCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getFamilyByteBuffer(), ((ByteBufferExtendedCell) c1).getFamilyPosition(), fLen1, ((ByteBufferExtendedCell) c2).getFamilyByteBuffer(), } else { fCommonPrefix = ByteBufferUtils .findCommonPrefix(c1.getFamilyArray(), c1.getFamilyOffset(), fLen1, c2.getFamilyArray(), c2.getFamilyOffset(), fLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { qCommon = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getQualifierByteBuffer(), ((ByteBufferExtendedCell) c1).getQualifierPosition(), qLen1, ((ByteBufferExtendedCell) c2).getQualifierByteBuffer(),
.findCommonPrefix(Bytes.toBytes(rLen1), 0, KeyValue.ROW_LENGTH_SIZE, Bytes.toBytes(rLen2), 0, KeyValue.ROW_LENGTH_SIZE); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { rkCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getRowByteBuffer(), ((ByteBufferExtendedCell) c1).getRowPosition(), rLen1, ((ByteBufferExtendedCell) c2).getRowByteBuffer(), .findCommonPrefix(c1.getRowArray(), c1.getRowOffset(), rLen1, c2.getRowArray(), c2.getRowOffset(), rLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { fCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getFamilyByteBuffer(), ((ByteBufferExtendedCell) c1).getFamilyPosition(), fLen1, ((ByteBufferExtendedCell) c2).getFamilyByteBuffer(), } else { fCommonPrefix = ByteBufferUtils .findCommonPrefix(c1.getFamilyArray(), c1.getFamilyOffset(), fLen1, c2.getFamilyArray(), c2.getFamilyOffset(), fLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { qCommon = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getQualifierByteBuffer(), ((ByteBufferExtendedCell) c1).getQualifierPosition(), qLen1, ((ByteBufferExtendedCell) c2).getQualifierByteBuffer(),
.findCommonPrefix(Bytes.toBytes(rLen1), 0, KeyValue.ROW_LENGTH_SIZE, Bytes.toBytes(rLen2), 0, KeyValue.ROW_LENGTH_SIZE); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { rkCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getRowByteBuffer(), ((ByteBufferExtendedCell) c1).getRowPosition(), rLen1, ((ByteBufferExtendedCell) c2).getRowByteBuffer(), .findCommonPrefix(c1.getRowArray(), c1.getRowOffset(), rLen1, c2.getRowArray(), c2.getRowOffset(), rLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { fCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getFamilyByteBuffer(), ((ByteBufferExtendedCell) c1).getFamilyPosition(), fLen1, ((ByteBufferExtendedCell) c2).getFamilyByteBuffer(), } else { fCommonPrefix = ByteBufferUtils .findCommonPrefix(c1.getFamilyArray(), c1.getFamilyOffset(), fLen1, c2.getFamilyArray(), c2.getFamilyOffset(), fLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { qCommon = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getQualifierByteBuffer(), ((ByteBufferExtendedCell) c1).getQualifierPosition(), qLen1, ((ByteBufferExtendedCell) c2).getQualifierByteBuffer(),
.findCommonPrefix(Bytes.toBytes(rLen1), 0, KeyValue.ROW_LENGTH_SIZE, Bytes.toBytes(rLen2), 0, KeyValue.ROW_LENGTH_SIZE); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { rkCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getRowByteBuffer(), ((ByteBufferExtendedCell) c1).getRowPosition(), rLen1, ((ByteBufferExtendedCell) c2).getRowByteBuffer(), .findCommonPrefix(c1.getRowArray(), c1.getRowOffset(), rLen1, c2.getRowArray(), c2.getRowOffset(), rLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { fCommonPrefix = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getFamilyByteBuffer(), ((ByteBufferExtendedCell) c1).getFamilyPosition(), fLen1, ((ByteBufferExtendedCell) c2).getFamilyByteBuffer(), } else { fCommonPrefix = ByteBufferUtils .findCommonPrefix(c1.getFamilyArray(), c1.getFamilyOffset(), fLen1, c2.getFamilyArray(), c2.getFamilyOffset(), fLen2); if (c1 instanceof ByteBufferExtendedCell && c2 instanceof ByteBufferExtendedCell) { qCommon = ByteBufferUtils .findCommonPrefix(((ByteBufferExtendedCell) c1).getQualifierByteBuffer(), ((ByteBufferExtendedCell) c1).getQualifierPosition(), qLen1, ((ByteBufferExtendedCell) c2).getQualifierByteBuffer(),
commonPrefix += ByteBufferUtils.findCommonPrefix( key, offset + commonPrefix, length - commonPrefix, current.keyBuffer, commonPrefix,
} else { int commonPrefix = ByteBufferUtils.findCommonPrefix(in, in.position(), previousState.prevOffset + KeyValue.ROW_OFFSET, Math.min(keyLength, previousState.keyLength) -
ByteBufferUtils.findCommonPrefix(in, in.position(), previousState.prevOffset + KeyValue.ROW_OFFSET, keyLength - KeyValue.TIMESTAMP_TYPE_SIZE);