@Override public short getRowLength() { return this.cell.getRowLength(); }
@Override public short getRowLength() { return cell.getRowLength(); }
@Override public short getRowLength() { return cell.getRowLength(); }
private int calculateHashForKey(ByteBufferExtendedCell cell) { int rowHash = ByteBufferUtils.hashCode(cell.getRowByteBuffer(), cell.getRowPosition(), cell.getRowLength()); int familyHash = ByteBufferUtils.hashCode(cell.getFamilyByteBuffer(), cell.getFamilyPosition(), cell.getFamilyLength()); int qualifierHash = ByteBufferUtils.hashCode(cell.getQualifierByteBuffer(), cell.getQualifierPosition(), cell.getQualifierLength()); int hash = 31 * rowHash + familyHash; hash = 31 * hash + qualifierHash; hash = 31 * hash + (int) cell.getTimestamp(); hash = 31 * hash + cell.getTypeByte(); return hash; } }
@Test public void testGetKeyMethods() throws Exception { KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0L, Type.Put, row1, tags); ByteBuffer buf = ByteBuffer.allocateDirect(kvCell.getKeyLength()); ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), kvCell.getKeyOffset(), kvCell.getKeyLength()); ByteBufferExtendedCell offheapKeyOnlyKV = new ByteBufferKeyOnlyKeyValue(buf, 0, buf.capacity()); assertEquals( ROW1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getRowByteBuffer(), offheapKeyOnlyKV.getRowPosition(), offheapKeyOnlyKV.getRowLength())); assertEquals( FAM1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getFamilyByteBuffer(), offheapKeyOnlyKV.getFamilyPosition(), offheapKeyOnlyKV.getFamilyLength())); assertEquals( QUAL1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getQualifierByteBuffer(), offheapKeyOnlyKV.getQualifierPosition(), offheapKeyOnlyKV.getQualifierLength())); assertEquals(0L, offheapKeyOnlyKV.getTimestamp()); assertEquals(Type.Put.getCode(), offheapKeyOnlyKV.getTypeByte()); } }
ROW1, ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(), offheapKV.getRowPosition(), offheapKV.getRowLength())); assertEquals( FAM1, ROW1, Bytes.toStringBinary(offheapKV.getRowArray(), offheapKV.getRowOffset(), offheapKV.getRowLength())); assertEquals( FAM1, ROW1, ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(), offheapKV.getRowPosition(), offheapKV.getRowLength())); assertEquals( FAM1,
@Override public short getRowLength() { return cell.getRowLength(); }
@Override public short getRowLength() { return this.cell.getRowLength(); }
@Override public short getRowLength() { return this.cell.getRowLength(); }
private int calculateHashForKey(ByteBufferExtendedCell cell) { int rowHash = ByteBufferUtils.hashCode(cell.getRowByteBuffer(), cell.getRowPosition(), cell.getRowLength()); int familyHash = ByteBufferUtils.hashCode(cell.getFamilyByteBuffer(), cell.getFamilyPosition(), cell.getFamilyLength()); int qualifierHash = ByteBufferUtils.hashCode(cell.getQualifierByteBuffer(), cell.getQualifierPosition(), cell.getQualifierLength()); int hash = 31 * rowHash + familyHash; hash = 31 * hash + qualifierHash; hash = 31 * hash + (int) cell.getTimestamp(); hash = 31 * hash + cell.getTypeByte(); return hash; } }
private int calculateHashForKey(ByteBufferExtendedCell cell) { int rowHash = ByteBufferUtils.hashCode(cell.getRowByteBuffer(), cell.getRowPosition(), cell.getRowLength()); int familyHash = ByteBufferUtils.hashCode(cell.getFamilyByteBuffer(), cell.getFamilyPosition(), cell.getFamilyLength()); int qualifierHash = ByteBufferUtils.hashCode(cell.getQualifierByteBuffer(), cell.getQualifierPosition(), cell.getQualifierLength()); int hash = 31 * rowHash + familyHash; hash = 31 * hash + qualifierHash; hash = 31 * hash + (int) cell.getTimestamp(); hash = 31 * hash + cell.getTypeByte(); return hash; } }
@Test public void testGetKeyMethods() throws Exception { KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0L, Type.Put, row1, tags); ByteBuffer buf = ByteBuffer.allocateDirect(kvCell.getKeyLength()); ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), kvCell.getKeyOffset(), kvCell.getKeyLength()); ByteBufferExtendedCell offheapKeyOnlyKV = new ByteBufferKeyOnlyKeyValue(buf, 0, buf.capacity()); assertEquals( ROW1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getRowByteBuffer(), offheapKeyOnlyKV.getRowPosition(), offheapKeyOnlyKV.getRowLength())); assertEquals( FAM1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getFamilyByteBuffer(), offheapKeyOnlyKV.getFamilyPosition(), offheapKeyOnlyKV.getFamilyLength())); assertEquals( QUAL1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getQualifierByteBuffer(), offheapKeyOnlyKV.getQualifierPosition(), offheapKeyOnlyKV.getQualifierLength())); assertEquals(0L, offheapKeyOnlyKV.getTimestamp()); assertEquals(Type.Put.getCode(), offheapKeyOnlyKV.getTypeByte()); } }
@Test public void testGetKeyMethods() throws Exception { KeyValue kvCell = new KeyValue(row1, fam1, qual1, 0L, Type.Put, row1, tags); ByteBuffer buf = ByteBuffer.allocateDirect(kvCell.getKeyLength()); ByteBufferUtils.copyFromArrayToBuffer(buf, kvCell.getBuffer(), kvCell.getKeyOffset(), kvCell.getKeyLength()); ByteBufferExtendedCell offheapKeyOnlyKV = new ByteBufferKeyOnlyKeyValue(buf, 0, buf.capacity()); assertEquals( ROW1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getRowByteBuffer(), offheapKeyOnlyKV.getRowPosition(), offheapKeyOnlyKV.getRowLength())); assertEquals( FAM1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getFamilyByteBuffer(), offheapKeyOnlyKV.getFamilyPosition(), offheapKeyOnlyKV.getFamilyLength())); assertEquals( QUAL1, ByteBufferUtils.toStringBinary(offheapKeyOnlyKV.getQualifierByteBuffer(), offheapKeyOnlyKV.getQualifierPosition(), offheapKeyOnlyKV.getQualifierLength())); assertEquals(0L, offheapKeyOnlyKV.getTimestamp()); assertEquals(Type.Put.getCode(), offheapKeyOnlyKV.getTypeByte()); } }
ROW1, ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(), offheapKV.getRowPosition(), offheapKV.getRowLength())); assertEquals( FAM1, ROW1, Bytes.toStringBinary(offheapKV.getRowArray(), offheapKV.getRowOffset(), offheapKV.getRowLength())); assertEquals( FAM1, ROW1, ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(), offheapKV.getRowPosition(), offheapKV.getRowLength())); assertEquals( FAM1,
ROW1, ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(), offheapKV.getRowPosition(), offheapKV.getRowLength())); assertEquals( FAM1, ROW1, Bytes.toStringBinary(offheapKV.getRowArray(), offheapKV.getRowOffset(), offheapKV.getRowLength())); assertEquals( FAM1, ROW1, ByteBufferUtils.toStringBinary(offheapKV.getRowByteBuffer(), offheapKV.getRowPosition(), offheapKV.getRowLength())); assertEquals( FAM1,