This is an automated email from the ASF dual-hosted git repository. amashenkov pushed a commit to branch ignite-14743-compaction in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/ignite-14743-compaction by this push: new d789c59 Add compaction. d789c59 is described below commit d789c595d7ddcfb3ff13a42aa14cdc858a1b0f0a Author: Andrew Mashenkov <andrey.mashen...@gmail.com> AuthorDate: Thu Jun 24 19:32:05 2021 +0300 Add compaction. --- .../ignite/internal/schema/ByteBufferRow.java | 4 +- .../internal/schema/row/ExpandableByteBuf.java | 28 ++++++ .../org/apache/ignite/internal/schema/row/Row.java | 26 ++--- .../ignite/internal/schema/row/RowAssembler.java | 77 ++++++++++---- .../ignite/internal/schema/row/VarTableFormat.java | 87 ++-------------- .../schema/RowAssemblerAdvancedSchemaTest.java | 17 ++-- .../schema/RowAssemblerSimpleSchemaTest.java | 111 +++++++++++---------- 7 files changed, 167 insertions(+), 183 deletions(-) diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/ByteBufferRow.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/ByteBufferRow.java index 6ae8889..6041aa3 100644 --- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/ByteBufferRow.java +++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/ByteBufferRow.java @@ -78,12 +78,12 @@ public class ByteBufferRow implements BinaryRow { /** {@inheritDoc} */ @Override public byte readByte(int off) { - return (byte)(buf.get(off) & 0xFF); + return buf.get(off); } /** {@inheritDoc} */ @Override public short readShort(int off) { - return (short)(buf.getShort(off) & 0xFFFF); + return buf.getShort(off); } /** {@inheritDoc} */ diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/ExpandableByteBuf.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/ExpandableByteBuf.java index 159153e..19d9f44 100644 --- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/ExpandableByteBuf.java +++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/ExpandableByteBuf.java @@ -235,6 +235,16 @@ public class ExpandableByteBuf { } /** + * Reads {@code short} value from buffer. + * + * @param off Buffer offset. + * @return Value. + */ + public short getShort(int off) { + return buf.getShort(off); + } + + /** * @return The byte array of all bytes written to this array, including gaps. */ public byte[] toArray() { @@ -280,4 +290,22 @@ public class ExpandableByteBuf { buf.position(oldPos); buf.order(ByteOrder.LITTLE_ENDIAN); } + + /** + * Compact array. + * + * @param srcOff Source offset. + * @param dstOff Destination offset. + * @param len Length. + */ + void shift(int srcOff, int dstOff, int len) { + assert srcOff > dstOff; + + System.arraycopy(arr, srcOff, arr, dstOff, len); + Arrays.fill(arr, dstOff + len, srcOff + len, (byte)0); + + this.len -= (srcOff - dstOff); + buf = ByteBuffer.wrap(arr); + buf.order(ByteOrder.LITTLE_ENDIAN); + } } diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/Row.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/Row.java index 8e2553e..8a9b5d7 100644 --- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/Row.java +++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/Row.java @@ -370,7 +370,7 @@ public class Row implements BinaryRow { int nullMapLen = (flags & VarTableFormat.OMIT_NULL_MAP_FLAG) == 0 ? cols.nullMapSize() : 0; VarTableFormat format = (flags & VarTableFormat.OMIT_VARTBL_FLAG) == 0 ? VarTableFormat.fromFlags(flags) : null; - if (nullMapLen > 0 && isNull(chunkBaseOff + BinaryRow.CHUNK_LEN_FLD_SIZE, colIdx)) + if (nullMapLen > 0 && isNull(chunkBaseOff, colIdx)) return -1; int dataOffset = varTableOffset(chunkBaseOff, nullMapLen); @@ -409,9 +409,9 @@ public class Row implements BinaryRow { if (hasNullmap) { // Fold offset based on the whole map bytes in the schema for (int i = 0; i < colByteIdx; i++) - colOff += cols.foldFixedLength(i, row.readByte(nullMapOffset(chunkBaseOff) + i)); + colOff += cols.foldFixedLength(i, Byte.toUnsignedInt(row.readByte(nullMapOffset(chunkBaseOff) + i))); - colOff += cols.foldFixedLength(colByteIdx, row.readByte(nullMapOffset(chunkBaseOff) + colByteIdx) | mask); + colOff += cols.foldFixedLength(colByteIdx, Byte.toUnsignedInt(row.readByte(nullMapOffset(chunkBaseOff) + colByteIdx)) | mask); } else { for (int i = 0; i < colByteIdx; i++) @@ -525,31 +525,17 @@ public class Row implements BinaryRow { } /** - * @param baseOff Chunk base offset. - * @param nullMapLen Null-map length. - * @param format Vartable format helper. - * @return Data offset. - */ - private int dataOffset(int baseOff, int nullMapLen, VarTableFormat format) { - int varTableOffset = varTableOffset(baseOff, nullMapLen); - - int varTableLen = format == null ? 0 : format.vartableLength(readShort(varTableOffset)); - - return varTableOffset + varTableLen; - } - - /** * Checks the row's null-map for the given column index in the chunk. * - * @param nullMapOff Null-map offset. + * @param baseOff Chunk base offset. * @param idx Offset of the column in the chunk. * @return {@code true} if the column value is {@code null}, {@code false} otherwise. */ - protected boolean isNull(int nullMapOff, int idx) { + protected boolean isNull(int baseOff, int idx) { int nullByte = idx >> 3; // Equivalent expression for: idx / 8 int posInByte = idx & 7; // Equivalent expression for: idx % 8 - int map = row.readByte(nullMapOff + nullByte); + int map = row.readByte(baseOff + BinaryRow.CHUNK_LEN_FLD_SIZE + nullByte) & 0xFF; return (map & (1 << posInByte)) != 0; } diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/RowAssembler.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/RowAssembler.java index 76ded31..55b7ae2 100644 --- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/RowAssembler.java +++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/RowAssembler.java @@ -50,7 +50,7 @@ public class RowAssembler { private final SchemaDescriptor schema; /** The number of non-null varlen columns in values chunk. */ - private final int varVartblLen; + private final int valVartblLen; /** Target byte buffer to write to. */ private final ExpandableByteBuf buf; @@ -171,7 +171,7 @@ public class RowAssembler { strEncoder = null; int keyVartblLen = varTableChunkLength(keyVarlenCols, Integer.BYTES); - varVartblLen = varTableChunkLength(valVarlenCols, Integer.BYTES); + valVartblLen = varTableChunkLength(valVarlenCols, Integer.BYTES); initChunk(BinaryRow.KEY_CHUNK_OFFSET, curCols.nullMapSize(), keyVartblLen); @@ -179,7 +179,7 @@ public class RowAssembler { int size = BinaryRow.HEADER_SIZE + 2 * BinaryRow.CHUNK_LEN_FLD_SIZE + keyVarlenSize + valVarlenSize + - keyVartblLen + varVartblLen + + keyVartblLen + valVartblLen + curCols.fixsizeMaxLen() + valCols.fixsizeMaxLen() + curCols.nullMapSize() + valCols.nullMapSize(); @@ -354,11 +354,11 @@ public class RowAssembler { writeVarlenOffset(curVartblEntry, curOff - dataOff); + curVartblEntry++; + if (isKeyColumn()) keyHash = 31 * keyHash + val.hashCode(); - curVartblEntry++; - shiftColumn(written); return this; @@ -431,7 +431,7 @@ public class RowAssembler { throw new AssemblyException("Key column missed: colIdx=" + curCol); else { if (curCol == 0) { -// flags &= ~(RowFlags.CHUNK_FLAGS_MASK << VAL_FLAGS_OFFSET); + flags &= ~(RowFlags.CHUNK_FLAGS_MASK << VAL_FLAGS_OFFSET); flags |= RowFlags.NO_VALUE_FLAG; } else if (schema.valueColumns().length() != curCol) @@ -495,14 +495,14 @@ public class RowAssembler { * @param colIdx Column index. */ private void setNull(int colIdx) { -// assert nullMapOff < varTblOff : "Null-map is omitted."; + assert nullMapOff < varTblOff : "Null-map is omitted."; - int byteInMap = colIdx / 8;// >> 3; // Equivalent expression for: colIidx / 8 - int bitInByte = colIdx % 8; //& 7; // Equivalent expression for: colIdx % 8 + int byteInMap = colIdx >> 3; // Equivalent expression for: colIidx / 8 + int bitInByte = colIdx & 7; // Equivalent expression for: colIdx % 8 buf.ensureCapacity(nullMapOff + byteInMap + 1); - buf.put(nullMapOff + byteInMap, (byte)(buf.get(nullMapOff + byteInMap) | (1 << bitInByte))); + buf.put(nullMapOff + byteInMap, (byte)((Byte.toUnsignedInt(buf.get(nullMapOff + byteInMap))) | (1 << bitInByte))); } /** @@ -514,19 +514,18 @@ public class RowAssembler { curOff += size; if (curCol == curCols.length()) { + if (curVartblEntry > 1) { + assert varTblOff < dataOff : "Illegal writing of varlen when 'omit vartable' flag is set for a chunk."; + assert varTblOff + varTableChunkLength(curVartblEntry, Integer.BYTES) == dataOff : "Vartable overlow: size=" + curVartblEntry; + + compactVarTable(); + } + // Write sizes. final int chunkLen = curOff - baseOff; buf.putInt(baseOff, chunkLen); - if (curVartblEntry > 1) { -// assert varTblOff < dataOff : "Illegal writing of varlen when 'omit vartable' flag is set for a chunk."; -// -// assert varTblOff + varTableLength(curVartblEntry, Integer.BYTES) == dataOff : "Vartable overlow: size=" + curVartblEntry; - - buf.putShort(varTblOff, (short)(curVartblEntry - 1)); - } - if (schema.valueColumns() == curCols) return; // No more columns. @@ -534,7 +533,47 @@ public class RowAssembler { curCols = schema.valueColumns(); // Create value chunk writer. - initChunk(BinaryRow.HEADER_SIZE + chunkLen/* Key chunk size */, curCols.nullMapSize(), varVartblLen); + initChunk(BinaryRow.HEADER_SIZE + chunkLen/* Key chunk size */, curCols.nullMapSize(), valVartblLen); + } + } + + private void compactVarTable() { + assert curVartblEntry > 1; + + int dataLen = curOff - dataOff; + + final int vartblSize = curVartblEntry - 1; + + if (dataLen < 256) { + buf.put(varTblOff, (byte)vartblSize); + + int dstOff = varTblOff + 1; + int srcOff = varTblOff + 2; + + for (int i = 0; i < vartblSize; i++, srcOff += Integer.BYTES, dstOff++) + buf.put(dstOff, buf.get(srcOff)); + + buf.shift(srcOff, dstOff, dataLen); + curOff -= srcOff - dstOff; + + flags |= (VarTableFormat.TINY.formatFlags() << (isKeyColumn() ? KEY_FLAGS_OFFSET : VAL_FLAGS_OFFSET)); + + return; + } + + buf.putShort(varTblOff, (short)vartblSize); + + if (dataLen < 64 * 1024) { + int dstOff = varTblOff + 2; + int srcOff = varTblOff + 2; + + for (int i = 0; i < vartblSize; i++, srcOff += Integer.BYTES, dstOff += Short.BYTES) + buf.putShort(dstOff, buf.getShort(srcOff)); + + buf.shift(srcOff, dstOff, dataLen); + curOff -= srcOff - dstOff; + + flags |= (VarTableFormat.MEDIUM.formatFlags() << (isKeyColumn() ? KEY_FLAGS_OFFSET : VAL_FLAGS_OFFSET)); } } diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java index 121f138..b76c0a8 100644 --- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java +++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java @@ -33,13 +33,13 @@ abstract class VarTableFormat { public static final int OMIT_VARTBL_FLAG = 1 << 3; /** Writer factory for tiny-sized chunks. */ - private static final VarTableFormat TINY = new TinyFormat(); + static final VarTableFormat TINY = new TinyFormat(); /** Writer factory for med-sized chunks. */ - private static final VarTableFormat MEDIUM = new MediumFormat(); + static final VarTableFormat MEDIUM = new MediumFormat(); /** Writer factory for large-sized chunks. */ - private static final VarTableFormat LARGE = new LargeFormat(); + static final VarTableFormat LARGE = new LargeFormat(); /** * Return chunk formatter. @@ -104,18 +104,6 @@ abstract class VarTableFormat { } /** - * Calculates chunk size for the format. - * - * @param payloadLen Row payload length in bytes. - * @param nullMapLen Null-map length in bytes. - * @param vartblEntries Number of vartable entries. - * @return Total chunk size. - */ - int chunkSize(int payloadLen, int nullMapLen, int vartblEntries) { - return BinaryRow.CHUNK_LEN_FLD_SIZE /* Chunk len. */ + nullMapLen + vartableLength(vartblEntries - 1) + payloadLen; - } - - /** * Calculates vartable size in bytes. * * @param entries Vartable entries. @@ -136,16 +124,6 @@ abstract class VarTableFormat { } /** - * Writes varlen offset to vartable. - * - * @param buf Row buffer. - * @param vartblOff Vartable offset. - * @param entryIdx Vartable entry index. - * @param off Varlen offset to be written. - */ - abstract void writeVarlenOffset(ExpandableByteBuf buf, int vartblOff, int entryIdx, int off); - - /** * Readss varlen offset from vartable. * * @param row Row. @@ -156,15 +134,6 @@ abstract class VarTableFormat { abstract int readVarlenOffset(BinaryRow row, int vartblOff, int entryIdx); /** - * Writes vartable size. - * - * @param buf Row buffer. - * @param vartblOff Vartable offset. - * @param size Number of entries in the vartable. - */ - abstract void writeVartableSize(ExpandableByteBuf buf, int vartblOff, int size); - - /** * Reads vartable size. * * @param row Row. @@ -185,27 +154,13 @@ abstract class VarTableFormat { } /** {@inheritDoc} */ - @Override void writeVarlenOffset(ExpandableByteBuf buf, int vartblOff, int entryIdx, int off) { - assert off < (1 << 8) && off >= 0 : "Varlen offset overflow: offset=" + off; - - buf.put(vartblOff + vartableEntryOffset(entryIdx), (byte)off); - } - - /** {@inheritDoc} */ @Override int readVarlenOffset(BinaryRow row, int vartblOff, int entryIdx) { - return row.readByte(vartblOff + vartableEntryOffset(entryIdx)) & 0xFF; - } - - /** {@inheritDoc} */ - @Override void writeVartableSize(ExpandableByteBuf buf, int vartblOff, int size) { - assert size < (1 << 8) && size >= 0 : "Vartable size overflow: size=" + size; - - buf.put(vartblOff, (byte)size); + return Byte.toUnsignedInt(row.readByte(vartblOff + vartableEntryOffset(entryIdx))); } /** {@inheritDoc} */ @Override int readVartableSize(BinaryRow row, int vartblOff) { - return row.readByte(vartblOff) & 0xFF; + return Byte.toUnsignedInt(row.readByte(vartblOff)); } } @@ -221,27 +176,13 @@ abstract class VarTableFormat { } /** {@inheritDoc} */ - @Override void writeVarlenOffset(ExpandableByteBuf buf, int vartblOff, int entryIdx, int off) { - assert off < (1 << 16) && off >= 0 : "Varlen offset overflow: offset=" + off; - - buf.putShort(vartblOff + vartableEntryOffset(entryIdx), (short)off); - } - - /** {@inheritDoc} */ @Override int readVarlenOffset(BinaryRow row, int vartblOff, int entryIdx) { - return row.readShort(vartblOff + vartableEntryOffset(entryIdx)) & 0xFFFF; - } - - /** {@inheritDoc} */ - @Override void writeVartableSize(ExpandableByteBuf buf, int vartblOff, int size) { - assert size < (1 << 16) && size >= 0 : "Vartable size overflow: size=" + size; - - buf.putShort(vartblOff, (short)size); + return Short.toUnsignedInt(row.readShort(vartblOff + vartableEntryOffset(entryIdx))); } /** {@inheritDoc} */ @Override int readVartableSize(BinaryRow row, int vartblOff) { - return row.readShort(vartblOff) & 0xFFFF; + return Short.toUnsignedInt(row.readShort(vartblOff)); } } @@ -257,25 +198,13 @@ abstract class VarTableFormat { } /** {@inheritDoc} */ - @Override void writeVarlenOffset(ExpandableByteBuf buf, int vartblOff, int entryIdx, int off) { - buf.putInt(vartblOff + vartableEntryOffset(entryIdx), off); - } - - /** {@inheritDoc} */ @Override int readVarlenOffset(BinaryRow row, int vartblOff, int entryIdx) { return row.readInteger(vartblOff + vartableEntryOffset(entryIdx)); } /** {@inheritDoc} */ - @Override void writeVartableSize(ExpandableByteBuf buf, int vartblOff, int size) { - assert size < (1 << 16) && size >= 0 : "Vartable size overflow: size=" + size; - - buf.putShort(vartblOff, (short)size); - } - - /** {@inheritDoc} */ @Override int readVartableSize(BinaryRow row, int vartblOff) { - return row.readShort(vartblOff) & 0xFFFF; + return Short.toUnsignedInt(row.readShort(vartblOff)); } } } diff --git a/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerAdvancedSchemaTest.java b/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerAdvancedSchemaTest.java index f2f8be9..1668bcb 100644 --- a/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerAdvancedSchemaTest.java +++ b/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerAdvancedSchemaTest.java @@ -55,7 +55,7 @@ public class RowAssemblerAdvancedSchemaTest { // Last col null assertRowBytesEquals( - new byte[] {42, 0, 0, -103, -11, 43, 0, 0, 8, 0, 0, 0, 4, 11, 22, 0, 8, 0, 0, 0, 4, -44, -66, -1}, + new byte[] {42, 0, 0, -120, -11, 43, 0, 0, 8, 0, 0, 0, 4, 11, 22, 0, 8, 0, 0, 0, 4, -44, -66, -1}, new RowAssembler(schema, 128, 0, 128, 0) .appendByte((byte)11) .appendShort((short)22) @@ -67,7 +67,7 @@ public class RowAssemblerAdvancedSchemaTest { // First col null. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, -53, 2, 0, 0, 11, 0, 0, 0, 1, 22, 0, 33, 0, 0, 0, 11, 0, 0, 0, 1, -55, -1, -66, -1, -1, -1}, + new byte[] {42, 0, 0, -120, -53, 2, 0, 0, 11, 0, 0, 0, 1, 22, 0, 33, 0, 0, 0, 11, 0, 0, 0, 1, -55, -1, -66, -1, -1, -1}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendShort((byte)22) @@ -78,7 +78,7 @@ public class RowAssemblerAdvancedSchemaTest { .build()); // Middle col null. - assertRowBytesEquals(new byte[] {42, 0, 0, -103, 108, 41, 0, 0, 10, 0, 0, 0, 2, 11, 33, 0, 0, 0, 10, 0, 0, 0, 2, -44, -66, -1, -1, -1}, + assertRowBytesEquals(new byte[] {42, 0, 0, -120, 108, 41, 0, 0, 10, 0, 0, 0, 2, 11, 33, 0, 0, 0, 10, 0, 0, 0, 2, -44, -66, -1, -1, -1}, new RowAssembler(schema, 128, 0, 128, 0) .appendByte((byte)11) .appendNull() @@ -89,7 +89,7 @@ public class RowAssemblerAdvancedSchemaTest { .build()); // Null both. - assertRowBytesEquals(new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 7, 5, 0, 0, 0, 7}, + assertRowBytesEquals(new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 7, 5, 0, 0, 0, 7}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendNull() @@ -100,7 +100,7 @@ public class RowAssemblerAdvancedSchemaTest { .build()); // No value. - assertRowBytesEquals(new byte[] {42, 0, 1, 9, 22, 44, 0, 0, 12, 0, 0, 0, 0, 11, 22, 0, 33, 0, 0, 0}, + assertRowBytesEquals(new byte[] {42, 0, 1, 8, 22, 44, 0, 0, 12, 0, 0, 0, 0, 11, 22, 0, 33, 0, 0, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendByte((byte)11) .appendShort((short)22) @@ -172,7 +172,7 @@ public class RowAssemblerAdvancedSchemaTest { // Null both. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 7, 5, 0, 0, 0, 7}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 7, 5, 0, 0, 0, 7}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendNull() @@ -216,8 +216,7 @@ public class RowAssemblerAdvancedSchemaTest { // Check null/non-null all fixlen/varlen. assertRowBytesEquals( new byte[] { - 42, 0, 0, 25, -85, 82, 5, 0, - 8, 0, 0, 0, 12, 11, 22, 0, + 42, 0, 0, 24, -85, 82, 5, 0, 8, 0, 0, 0, 12, 11, 22, 0, 14, 0, 0, 0, 3, 1, 2, 77, -88, 97, 115, 99, 105, 105}, new RowAssembler(schema, 128, 0, 128, 2) .appendByte((byte)11) @@ -284,7 +283,7 @@ public class RowAssemblerAdvancedSchemaTest { // Check all null/non-null. assertRowBytesEquals( new byte[] { - 42, 0, 0, -111, 3, -8, 124, -80, + 42, 0, 0, -127, 3, -8, 124, -80, 22, 0, 0, 0, 0, 1, 5, 11, 22, 0, 33, -44, -26, -120, -111, -26, -124, -101, 74, 97, 118, 97, 5, 0, 0, 0, 15}, new RowAssembler(schema, 128, 2, 128, 0) diff --git a/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerSimpleSchemaTest.java b/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerSimpleSchemaTest.java index aa02135..6aa5015 100644 --- a/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerSimpleSchemaTest.java +++ b/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerSimpleSchemaTest.java @@ -50,7 +50,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valIntCol", INTEGER, true)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -99, 33, 0, 0, 0, 8, 0, 0, 0, 33, 0, 0, 0, 9, 0, 0, 0, 0, -71, -1, -1, -1}, + new byte[] {42, 0, 0, -116, 33, 0, 0, 0, 8, 0, 0, 0, 33, 0, 0, 0, 9, 0, 0, 0, 0, -71, -1, -1, -1}, new RowAssembler(schema, 128, 0, 128, 0) .appendInt(33) .appendInt(-71) @@ -58,7 +58,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals( - new byte[] {42, 0, 0, -99, 33, 0, 0, 0, 8, 0, 0, 0, 33, 0, 0, 0, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -116, 33, 0, 0, 0, 8, 0, 0, 0, 33, 0, 0, 0, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 0, 128, 0) .appendInt(33) .appendNull() @@ -66,7 +66,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 13, 33, 0, 0, 0, 8, 0, 0, 0, 33, 0, 0, 0}, + new byte[] {42, 0, 1, 12, 33, 0, 0, 0, 8, 0, 0, 0, 33, 0, 0, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendInt(33) .build()); @@ -83,7 +83,7 @@ public class RowAssemblerSimpleSchemaTest { // With value. assertRowBytesEquals( - new byte[] {42, 0, 0, -35, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0, 6, 0, 0, 0, -71, -1}, + new byte[] {42, 0, 0, -52, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0, 6, 0, 0, 0, -71, -1}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .appendShort((short)-71) @@ -91,7 +91,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 13, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0}, + new byte[] {42, 0, 1, 12, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .build()); @@ -107,7 +107,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valStrCol", STRING, true)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -99, -33, -1, -1, -1, 6, 0, 0, 0, -33, -1, 8, 0, 0, 0, 0, 118, 97, 108}, + new byte[] {42, 0, 0, -116, -33, -1, -1, -1, 6, 0, 0, 0, -33, -1, 8, 0, 0, 0, 0, 118, 97, 108}, new RowAssembler(schema, 128, 0, 128, 1) .appendShort((short)-33) .appendString("val") @@ -115,7 +115,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals( - new byte[] {42, 0, 0, -99, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -116, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .appendNull() @@ -123,7 +123,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 13, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0}, + new byte[] {42, 0, 1, 12, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .build()); @@ -139,7 +139,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valStrCol", STRING, false)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -35, -33, -1, -1, -1, 6, 0, 0, 0, -33, -1, 7, 0, 0, 0, 118, 97, 108}, + new byte[] {42, 0, 0, -52, -33, -1, -1, -1, 6, 0, 0, 0, -33, -1, 7, 0, 0, 0, 118, 97, 108}, new RowAssembler(schema, 128, 0, 128, 1) .appendShort((short)-33) .appendString("val") @@ -147,7 +147,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 13, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0}, + new byte[] {42, 0, 1, 12, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .build()); @@ -163,7 +163,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valByteCol", BYTE, false)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -39, -33, -1, -1, -1, 7, 0, 0, 0, 0, -33, -1, 5, 0, 0, 0, 71}, + new byte[] {42, 0, 0, -56, -33, -1, -1, -1, 7, 0, 0, 0, 0, -33, -1, 5, 0, 0, 0, 71}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)-33) .appendByte((byte)71) @@ -171,7 +171,7 @@ public class RowAssemblerSimpleSchemaTest { // Null key. assertRowBytesEquals( - new byte[] {42, 0, 0, -39, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, -71}, + new byte[] {42, 0, 0, -56, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, -71}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendByte((byte)-71) @@ -179,7 +179,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 9, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0}, + new byte[] {42, 0, 1, 8, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .build()); @@ -196,7 +196,7 @@ public class RowAssemblerSimpleSchemaTest { // Null key. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 1, 7, 0, 0, 0, 0, 33, 0}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 1, 7, 0, 0, 0, 0, 33, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendShort((short)33) @@ -204,7 +204,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -120, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .appendNull() @@ -212,7 +212,7 @@ public class RowAssemblerSimpleSchemaTest { // Null both. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendNull() @@ -220,7 +220,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 9, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0}, + new byte[] {42, 0, 1, 8, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .build()); @@ -237,7 +237,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valStrCol", STRING, true)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0, 8, 0, 0, 0, 0, 118, 97, 108}, + new byte[] {42, 0, 0, -120, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0, 8, 0, 0, 0, 0, 118, 97, 108}, new RowAssembler(schema, 128, 0, 128, 1) .appendShort((short)33) .appendString("val") @@ -245,7 +245,7 @@ public class RowAssemblerSimpleSchemaTest { // Null key. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 1, 8, 0, 0, 0, 0, 118, 97, 108}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 1, 8, 0, 0, 0, 0, 118, 97, 108}, new RowAssembler(schema, 128, 0, 128, 1) .appendNull() .appendString("val") @@ -253,7 +253,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -120, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .appendNull() @@ -261,7 +261,7 @@ public class RowAssemblerSimpleSchemaTest { // Null both. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendNull() @@ -269,7 +269,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 9, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0}, + new byte[] {42, 0, 1, 8, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendShort((short)33) .build()); @@ -285,21 +285,21 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valStrCol", STRING, false)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -39, 33, 0, 0, 0, 6, 0, 0, 0, 0, 33, 7, 0, 0, 0, 118, 97, 108}, + new byte[] {42, 0, 0, -56, 33, 0, 0, 0, 6, 0, 0, 0, 0, 33, 7, 0, 0, 0, 118, 97, 108}, new RowAssembler(schema, 128, 0, 128, 1) .appendByte((byte)33) .appendString("val").build()); // Null key. assertRowBytesEquals( - new byte[] {42, 0, 0, -39, 0, 0, 0, 0, 5, 0, 0, 0, 1, 7, 0, 0, 0, 118, 97, 108}, + new byte[] {42, 0, 0, -56, 0, 0, 0, 0, 5, 0, 0, 0, 1, 7, 0, 0, 0, 118, 97, 108}, new RowAssembler(schema, 128, 0, 128, 1) .appendNull() .appendString("val").build()); // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 9, 33, 0, 0, 0, 6, 0, 0, 0, 0, 33}, + new byte[] {42, 0, 1, 8, 33, 0, 0, 0, 6, 0, 0, 0, 0, 33}, new RowAssembler(schema, 128, 0, 128, 0) .appendByte((byte)33) .build()); @@ -316,7 +316,7 @@ public class RowAssemblerSimpleSchemaTest { assertRowBytesEquals( new byte[] { - 42, 0, 0, -99, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, + 42, 0, 0, -116, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 21, 0, 0, 0, 0, -117, -61, -31, 85, 61, -32, 57, 68, 111, 67, 56, -3, -99, -37, -58, -73}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") @@ -325,7 +325,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals( - new byte[] {42, 0, 0, -99, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -116, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .appendNull() @@ -333,7 +333,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 13, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121}, + new byte[] {42, 0, 1, 12, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .build()); @@ -351,7 +351,7 @@ public class RowAssemblerSimpleSchemaTest { assertRowBytesEquals( new byte[] { - 42, 0, 0, -35, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, + 42, 0, 0, -52, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 20, 0, 0, 0, -117, -61, -31, 85, 61, -32, 57, 68, 111, 67, 56, -3, -99, -37, -58, -73}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") @@ -360,7 +360,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 13, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121}, + new byte[] {42, 0, 1, 12, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .build()); @@ -376,8 +376,11 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("keyStrCol", STRING, false)}, new Column[] {new Column("valBytesCol", BYTES, true)}); + System.out.println(Integer.toHexString(((byte)-116) & 0xFF)); + System.out.println(Integer.toHexString(((byte)-99) & 0xFF)); + assertRowBytesEquals( - new byte[] {42, 0, 0, -99, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 9, 0, 0, 0, 0, -1, 1, 0, 120}, + new byte[] {42, 0, 0, -116, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 9, 0, 0, 0, 0, -1, 1, 0, 120}, new RowAssembler(schema, 128, 1, 128, 1) .appendString("key") .appendBytes(new byte[] {-1, 1, 0, 120}) @@ -385,7 +388,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals( - new byte[] {42, 0, 0, -99, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -116, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .appendNull() @@ -393,7 +396,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 13, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121}, + new byte[] {42, 0, 1, 12, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .build()); @@ -410,7 +413,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valBytesCol", BYTES, false)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -35, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 8, 0, 0, 0, -1, 1, 0, 120}, + new byte[] {42, 0, 0, -52, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121, 8, 0, 0, 0, -1, 1, 0, 120}, new RowAssembler(schema, 128, 1, 128, 1) .appendString("key") .appendBytes(new byte[] {-1, 1, 0, 120}) @@ -418,7 +421,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 13, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121}, + new byte[] {42, 0, 1, 12, 95, -98, 1, 0, 7, 0, 0, 0, 107, 101, 121}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .build()); @@ -434,7 +437,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valShortCol", SHORT, true)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 7, 0, 0, 0, 0, -71, -1}, + new byte[] {42, 0, 0, -120, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 7, 0, 0, 0, 0, -71, -1}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .appendShort((short)-71) @@ -442,7 +445,7 @@ public class RowAssemblerSimpleSchemaTest { // Null key. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 1, 7, 0, 0, 0, 0, 71, 0}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 1, 7, 0, 0, 0, 0, 71, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendShort((short)71) @@ -450,7 +453,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -120, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .appendNull() @@ -458,7 +461,7 @@ public class RowAssemblerSimpleSchemaTest { // Null both. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendNull() @@ -466,7 +469,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 9, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121}, + new byte[] {42, 0, 1, 8, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .build()); @@ -483,7 +486,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valShortCol", SHORT, false)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -39, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 6, 0, 0, 0, -71, -1}, + new byte[] {42, 0, 0, -56, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 6, 0, 0, 0, -71, -1}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .appendShort((short)-71L) @@ -491,7 +494,7 @@ public class RowAssemblerSimpleSchemaTest { // Null key. assertRowBytesEquals( - new byte[] {42, 0, 0, -39, 0, 0, 0, 0, 5, 0, 0, 0, 1, 6, 0, 0, 0, 71, 0}, + new byte[] {42, 0, 0, -56, 0, 0, 0, 0, 5, 0, 0, 0, 1, 6, 0, 0, 0, 71, 0}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendShort((short)71) @@ -499,7 +502,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 9, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121}, + new byte[] {42, 0, 1, 8, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .build()); @@ -515,7 +518,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valBytesCol", BYTES, true)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 9, 0, 0, 0, 0, -1, 1, 0, 120}, + new byte[] {42, 0, 0, -120, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 9, 0, 0, 0, 0, -1, 1, 0, 120}, new RowAssembler(schema, 128, 1, 128, 1) .appendString("key") .appendBytes(new byte[] {-1, 1, 0, 120}) @@ -523,7 +526,7 @@ public class RowAssemblerSimpleSchemaTest { // Null key. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 1, 9, 0, 0, 0, 0, -1, 1, 0, 120}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 1, 9, 0, 0, 0, 0, -1, 1, 0, 120}, new RowAssembler(schema, 128, 0, 128, 1) .appendNull() .appendBytes(new byte[] {-1, 1, 0, 120}) @@ -531,7 +534,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -120, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .appendNull() @@ -539,7 +542,7 @@ public class RowAssemblerSimpleSchemaTest { // Null both. assertRowBytesEquals( - new byte[] {42, 0, 0, -103, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, 1}, + new byte[] {42, 0, 0, -120, 0, 0, 0, 0, 5, 0, 0, 0, 1, 5, 0, 0, 0, 1}, new RowAssembler(schema, 128, 0, 128, 0) .appendNull() .appendNull() @@ -547,7 +550,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 9, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121}, + new byte[] {42, 0, 1, 8, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .build()); @@ -563,7 +566,7 @@ public class RowAssemblerSimpleSchemaTest { new Column[] {new Column("valBytesCol", BYTES, false)}); assertRowBytesEquals( - new byte[] {42, 0, 0, -39, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 8, 0, 0, 0, -1, 1, 0, 120}, + new byte[] {42, 0, 0, -56, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121, 8, 0, 0, 0, -1, 1, 0, 120}, new RowAssembler(schema, 128, 1, 128, 1) .appendString("key") .appendBytes(new byte[] {-1, 1, 0, 120}) @@ -571,7 +574,7 @@ public class RowAssemblerSimpleSchemaTest { // Null key. assertRowBytesEquals( - new byte[] {42, 0, 0, -39, 0, 0, 0, 0, 5, 0, 0, 0, 1, 8, 0, 0, 0, -1, 1, 0, 120}, + new byte[] {42, 0, 0, -56, 0, 0, 0, 0, 5, 0, 0, 0, 1, 8, 0, 0, 0, -1, 1, 0, 120}, new RowAssembler(schema, 128, 0, 128, 1) .appendNull() .appendBytes(new byte[] {-1, 1, 0, 120}) @@ -579,7 +582,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals( - new byte[] {42, 0, 1, 9, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121}, + new byte[] {42, 0, 1, 8, 95, -98, 1, 0, 8, 0, 0, 0, 0, 107, 101, 121}, new RowAssembler(schema, 128, 1, 128, 0) .appendString("key") .build()); @@ -601,7 +604,7 @@ public class RowAssemblerSimpleSchemaTest { }); assertRowBytesEquals(new byte[] { - 42, 0, 0, -99, 113, -109, 94, -68, + 42, 0, 0, -116, 113, -109, 94, -68, 12, 0, 0, 0, 33, 0, 107, 101, 121, 115, 116, 114, 15, 0, 0, 0, 0, 73, 0, 0, 0, 118, 97, 108, 115, 116, 114}, new RowAssembler(schema, 128, 1, 128, 1) @@ -613,7 +616,7 @@ public class RowAssemblerSimpleSchemaTest { // Null value. assertRowBytesEquals(new byte[] { - 42, 0, 0, -99, -1, 98, 115, -49, + 42, 0, 0, -116, -1, 98, 115, -49, 13, 0, 0, 0, 33, 0, 107, 101, 121, 115, 116, 114, 50, 5, 0, 0, 0, 3}, new RowAssembler(schema, 128, 1, 128, 0) @@ -625,7 +628,7 @@ public class RowAssemblerSimpleSchemaTest { // No value. assertRowBytesEquals(new byte[] { - 42, 0, 1, 13, 113, -109, 94, -68, + 42, 0, 1, 12, 113, -109, 94, -68, 12, 0, 0, 0, 33, 0, 107, 101, 121, 115, 116, 114}, new RowAssembler(schema, 128, 1, 128, 0) .appendShort((short)33)