@Override public BolBuffer toRawEntry(byte[] key, long timestamp, boolean tombstoned, long version, byte[] payload, BolBuffer rawEntryBuffer) throws Exception { rawEntryBuffer.allocate(keyLength + payloadLength); System.arraycopy(key, 0, rawEntryBuffer.bytes, 0, keyLength); if (payloadLength > 0) { System.arraycopy(payload, 0, rawEntryBuffer.bytes, keyLength, payloadLength); } return rawEntryBuffer; }
public void set(BolBuffer bolBuffer) { allocate(bolBuffer.length); offset = 0; length = bolBuffer.length; if (bolBuffer.bb != null) { for (int i = 0; i < bolBuffer.length; i++) { bytes[i] = bolBuffer.bb.get(bolBuffer.offset + i); } } else { System.arraycopy(bolBuffer.bytes, bolBuffer.offset, bytes, 0, length); } }
@Override public BolBuffer toRawEntry(byte[] key, long timestamp, boolean tombstoned, long version, byte[] payload, BolBuffer rawEntryBuffer) throws Exception { rawEntryBuffer.allocate(LABUtils.rawArrayLength(key) + LABUtils.rawArrayLength(payload)); int o = 0; o = LABUtils.writeByteArray(key, rawEntryBuffer.bytes, o); LABUtils.writeByteArray(payload, rawEntryBuffer.bytes, o); return rawEntryBuffer; }
@Override public BolBuffer toRawEntry( byte[] key, long timestamp, boolean tombstoned, long version, byte[] value, BolBuffer rawEntryBuffer) throws IOException { rawEntryBuffer.allocate(keyLength + 8 + 1 + 8 + LABUtils.rawArrayLength(value)); int o = 0; o = LABUtils.writeFixedWidthByteArray(key, rawEntryBuffer.bytes, o); UIO.longBytes(timestamp, rawEntryBuffer.bytes, o); o += 8; rawEntryBuffer.bytes[o] = tombstoned ? (byte) 1 : (byte) 0; o++; UIO.longBytes(version, rawEntryBuffer.bytes, o); o += 8; LABUtils.writeByteArray(value, rawEntryBuffer.bytes, o); return rawEntryBuffer; }
@Override public BolBuffer toRawEntry( byte[] key, long timestamp, boolean tombstoned, long version, byte[] value, BolBuffer rawEntryBuffer) throws IOException { rawEntryBuffer.allocate(LABUtils.rawArrayLength(key) + 8 + 1 + 8 + LABUtils.rawArrayLength(value)); int o = 0; o = LABUtils.writeByteArray(key, rawEntryBuffer.bytes, o); UIO.longBytes(timestamp, rawEntryBuffer.bytes, o); o += 8; rawEntryBuffer.bytes[o] = tombstoned ? (byte) 1 : (byte) 0; o++; UIO.longBytes(version, rawEntryBuffer.bytes, o); o += 8; LABUtils.writeByteArray(value, rawEntryBuffer.bytes, o); return rawEntryBuffer; }