KeyOnlyCell keyOnlyCell = new KeyOnlyCell(kv, lenAsVal); KeyOnlyByteBufferExtendedCell keyOnlyByteBufferedCell = new KeyOnlyByteBufferExtendedCell( bbCell, lenAsVal); .getValueLength()); assertEquals(8 + keyLen + (lenAsVal ? 4 : 0), KeyOnlyKeyValue.getSerializedSize()); assertEquals(8 + keyLen + (lenAsVal ? 4 : 0), keyOnlyCell.getSerializedSize()); if (keyOnlyByteBufferedCell.getValueLength() > 0) { assertTrue(CellUtil.matchingValue(KeyOnlyKeyValue, assertTrue(KeyOnlyKeyValue.getTimestamp() == keyOnlyCell.getTimestamp()); assertTrue(KeyOnlyKeyValue.getTimestamp() == keyOnlyByteBufferedCell .getTimestamp()); assertTrue(KeyOnlyKeyValue.getTypeByte() == keyOnlyCell.getTypeByte()); assertTrue(KeyOnlyKeyValue.getTypeByte() == keyOnlyByteBufferedCell .getTypeByte()); assertTrue(KeyOnlyKeyValue.getTagsLength() == keyOnlyCell.getTagsLength()); assertTrue(KeyOnlyKeyValue.getTagsLength() == keyOnlyByteBufferedCell .getTagsLength());
private Cell createKeyOnlyCell(Cell c) { if (c instanceof ByteBufferExtendedCell) { return new KeyOnlyByteBufferExtendedCell((ByteBufferExtendedCell) c, lenAsVal); } else { return new KeyOnlyCell(c, lenAsVal); } }
KeyOnlyCell keyOnlyCell = new KeyOnlyCell(kv, lenAsVal); KeyOnlyByteBufferExtendedCell keyOnlyByteBufferedCell = new KeyOnlyByteBufferExtendedCell( bbCell, lenAsVal); assertTrue(KeyOnlyKeyValue.getTimestamp() == keyOnlyCell.getTimestamp()); assertTrue(KeyOnlyKeyValue.getTimestamp() == keyOnlyByteBufferedCell .getTimestamp()); assertTrue(KeyOnlyKeyValue.getTypeByte() == keyOnlyCell.getTypeByte()); assertTrue(KeyOnlyKeyValue.getTypeByte() == keyOnlyByteBufferedCell .getTypeByte()); assertTrue(KeyOnlyKeyValue.getTagsLength() == keyOnlyCell.getTagsLength()); assertTrue(KeyOnlyKeyValue.getTagsLength() == keyOnlyByteBufferedCell .getTagsLength());
private Cell createKeyOnlyCell(Cell c) { if (c instanceof ByteBufferExtendedCell) { return new KeyOnlyByteBufferExtendedCell((ByteBufferExtendedCell) c, lenAsVal); } else { return new KeyOnlyCell(c, lenAsVal); } }
@Override public int getSerializedSize() { return KeyValue.KEYVALUE_INFRASTRUCTURE_SIZE + keyLen + getValueLength(); }
private Cell createKeyOnlyCell(Cell c) { if (c instanceof ByteBufferExtendedCell) { return new KeyOnlyByteBufferExtendedCell((ByteBufferExtendedCell) c, lenAsVal); } else { return new KeyOnlyCell(c, lenAsVal); } }