This is an automated email from the ASF dual-hosted git repository. amashenkov pushed a commit to branch ignite-14388 in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 47b07f16e4458253737c029096e48d05287009da Author: Andrew Mashenkov <[email protected]> AuthorDate: Wed May 12 18:20:08 2021 +0300 Calc hashcode for row. --- .../ignite/internal/schema/RowAssembler.java | 46 +++++++++++++ .../ignite/internal/schema/SchemaDescriptor.java | 12 +++- .../ignite/internal/schema/RowAssemblerTest.java | 80 +++++++++++----------- 3 files changed, 96 insertions(+), 42 deletions(-) diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/RowAssembler.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/RowAssembler.java index 9325566..fb7ab43 100644 --- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/RowAssembler.java +++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/RowAssembler.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal.schema; import java.nio.charset.CharacterCodingException; import java.nio.charset.CharsetEncoder; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.BitSet; import java.util.UUID; import org.apache.ignite.internal.schema.BinaryRow.RowFlags; @@ -69,6 +70,9 @@ public class RowAssembler { /** Offset of the varlen table for current chunk. */ private int varlenTblChunkOff; + /** Row hashcode. */ + private int keyHash; + /** Flags. */ private short flags; @@ -200,6 +204,9 @@ public class RowAssembler { setNull(curCol); + if (isAffinityCol()) + keyHash *= 31; + shiftColumn(0, false); } @@ -213,6 +220,9 @@ public class RowAssembler { buf.put(curOff, val); + if (isAffinityCol()) + keyHash = 31 * keyHash + Byte.hashCode(val); + shiftColumn(NativeType.BYTE); } @@ -226,6 +236,9 @@ public class RowAssembler { buf.putShort(curOff, val); + if (isAffinityCol()) + keyHash = 31 * keyHash + Short.hashCode(val); + shiftColumn(NativeType.SHORT); } @@ -239,6 +252,9 @@ public class RowAssembler { buf.putInt(curOff, val); + if (isAffinityCol()) + keyHash = 31 * keyHash + Integer.hashCode(val); + shiftColumn(NativeType.INTEGER); } @@ -252,6 +268,9 @@ public class RowAssembler { buf.putLong(curOff, val); + if (isAffinityCol()) + keyHash += 31 * keyHash + Long.hashCode(val); + shiftColumn(NativeType.LONG); } @@ -265,6 +284,9 @@ public class RowAssembler { buf.putFloat(curOff, val); + if (isAffinityCol()) + keyHash += 31 * keyHash + Float.hashCode(val); + shiftColumn(NativeType.FLOAT); } @@ -278,6 +300,9 @@ public class RowAssembler { buf.putDouble(curOff, val); + if (isAffinityCol()) + keyHash += 31 * keyHash + Double.hashCode(val); + shiftColumn(NativeType.DOUBLE); } @@ -292,6 +317,9 @@ public class RowAssembler { buf.putLong(curOff, uuid.getLeastSignificantBits()); buf.putLong(curOff + 8, uuid.getMostSignificantBits()); + if (isAffinityCol()) + keyHash += 31 * keyHash + uuid.hashCode(); + shiftColumn(NativeType.UUID); } @@ -308,6 +336,9 @@ public class RowAssembler { writeOffset(curVarlenTblEntry, curOff - baseOff); + if (isAffinityCol()) + keyHash += 31 * keyHash + val.hashCode(); + shiftColumn(written, true); } catch (CharacterCodingException e) { @@ -325,6 +356,9 @@ public class RowAssembler { buf.putBytes(curOff, val); + if (isAffinityCol()) + keyHash += 31 * keyHash + Arrays.hashCode(val); + writeOffset(curVarlenTblEntry, curOff - baseOff); shiftColumn(val.length, true); @@ -353,6 +387,9 @@ public class RowAssembler { for (int i = 0; i < maskType.length() - arr.length; i++) buf.put(curOff + arr.length + i, (byte)0); + if (isAffinityCol()) + keyHash += 31 * keyHash + Arrays.hashCode(arr); + shiftColumn(maskType); } @@ -370,6 +407,7 @@ public class RowAssembler { } buf.putShort(BinaryRow.FLAGS_FIELD_OFFSET, flags); + buf.putInt(BinaryRow.KEY_HASH_FIELD_OFFSET, keyHash); return buf.toArray(); } @@ -493,4 +531,12 @@ public class RowAssembler { curOff = varlenTblChunkOff + varlenTableChunkSize(nonNullVarlenCols); } + + /** + * @return {@code true} if current column is affinity columns, {@code false} otherwise. + */ + private boolean isAffinityCol() { + return (schema.keyColumns() == curCols) && /* Is key column */ + schema.isAffinityColumn(curCol); /* currCol equals to absolute column schema index */ + } } diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaDescriptor.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaDescriptor.java index e0e0dfb..2064068 100644 --- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaDescriptor.java +++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaDescriptor.java @@ -64,14 +64,22 @@ public class SchemaDescriptor { } /** - * @param idx Index to check. - * @return {@code true} if the column belongs to the key chunk. + * @param idx Column index to check. + * @return {@code true} if the column belongs to the key chunk, {@code false} otherwise. */ public boolean isKeyColumn(int idx) { return idx < keyCols.length(); } /** + * @param idx Column index to check. + * @return {@code true} if the columns if key affinity column, {@code false} otherwise. + */ + public boolean isAffinityColumn(int idx) { + return isKeyColumn(idx); + } + + /** * @param colIdx Column index. * @return Column instance. */ diff --git a/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerTest.java b/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerTest.java index b2c56d5..cdf7df4 100644 --- a/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerTest.java +++ b/modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerTest.java @@ -49,7 +49,7 @@ public class RowAssemblerTest { asm.appendInt(33); asm.appendInt(-71); - assertRowBytesEquals(new byte[] {42, 0, 26, 0, 0, 0, 0, 0, 8, 0, 0, 0, 33, 0, 0, 0, 9, 0, 0, 0, 0, -71, -1, -1, -1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 26, 0, 33, 0, 0, 0, 8, 0, 0, 0, 33, 0, 0, 0, 9, 0, 0, 0, 0, -71, -1, -1, -1}, asm.build()); } { // Null value. @@ -58,7 +58,7 @@ public class RowAssemblerTest { asm.appendInt(-33); asm.appendNull(); - assertRowBytesEquals(new byte[] {42, 0, 26, 0, 0, 0, 0, 0, 8, 0, 0, 0, -33, -1, -1, -1, 5, 0, 0, 0, 1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 26, 0, -33, -1, -1, -1, 8, 0, 0, 0, -33, -1, -1, -1, 5, 0, 0, 0, 1}, asm.build()); } { // No value. @@ -66,7 +66,7 @@ public class RowAssemblerTest { asm.appendInt(-33); - assertRowBytesEquals(new byte[] {42, 0, 27, 0, 0, 0, 0, 0, 8, 0, 0, 0, -33, -1, -1, -1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 27, 0, -33, -1, -1, -1, 8, 0, 0, 0, -33, -1, -1, -1}, asm.build()); } } @@ -83,7 +83,7 @@ public class RowAssemblerTest { asm.appendShort((short)33); asm.appendShort((short)71L); - assertRowBytesEquals(new byte[] {42, 0, 30, 0, 0, 0, 0, 0, 6, 0, 0, 0, 33, 0, 6, 0, 0, 0, 71, 0}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 30, 0, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0, 6, 0, 0, 0, 71, 0}, asm.build()); } { // No value. @@ -91,7 +91,7 @@ public class RowAssemblerTest { asm.appendShort((short)-33); - assertRowBytesEquals(new byte[] {42, 0, 31, 0, 0, 0, 0, 0, 6, 0, 0, 0, -33, -1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 31, 0, -33, -1, -1, -1, 6, 0, 0, 0, -33, -1}, asm.build()); } } @@ -108,7 +108,7 @@ public class RowAssemblerTest { asm.appendShort((short)-33); asm.appendString("val"); - assertRowBytesEquals(new byte[] {42, 0, 10, 0, 0, 0, 0, 0, 6, 0, 0, 0, -33, -1, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 10, 0, -33, -1, -1, -1, 6, 0, 0, 0, -33, -1, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build()); } { // Null value. @@ -117,7 +117,7 @@ public class RowAssemblerTest { asm.appendShort((short)33); asm.appendNull(); - assertRowBytesEquals(new byte[] {42, 0, 26, 0, 0, 0, 0, 0, 6, 0, 0, 0, 33, 0, 5, 0, 0, 0, 1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 26, 0, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0, 5, 0, 0, 0, 1}, asm.build()); } { // No value. @@ -125,7 +125,7 @@ public class RowAssemblerTest { asm.appendShort((short)33); - assertRowBytesEquals(new byte[] {42, 0, 27, 0, 0, 0, 0, 0, 6, 0, 0, 0, 33, 0}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 27, 0, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0}, asm.build()); } } @@ -142,7 +142,7 @@ public class RowAssemblerTest { asm.appendShort((short)-33); asm.appendString("val"); - assertRowBytesEquals(new byte[] {42, 0, 14, 0, 0, 0, 0, 0, 6, 0, 0, 0, -33, -1, 11, 0, 0, 0, 1, 0, 8, 0, 118, 97, 108}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 14, 0, -33, -1, -1, -1, 6, 0, 0, 0, -33, -1, 11, 0, 0, 0, 1, 0, 8, 0, 118, 97, 108}, asm.build()); } { // No value. @@ -150,7 +150,7 @@ public class RowAssemblerTest { asm.appendShort((short)33); - assertRowBytesEquals(new byte[] {42, 0, 31, 0, 0, 0, 0, 0, 6, 0, 0, 0, 33, 0}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 31, 0, 33, 0, 0, 0, 6, 0, 0, 0, 33, 0}, asm.build()); } } @@ -167,7 +167,7 @@ public class RowAssemblerTest { asm.appendShort((short)-33); asm.appendByte((byte)71); - assertRowBytesEquals(new byte[] {42, 0, 28, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, -33, -1, 5, 0, 0, 0, 71}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 28, 0, -33, -1, -1, -1, 7, 0, 0, 0, 0, -33, -1, 5, 0, 0, 0, 71}, asm.build()); } { // Null key. @@ -184,7 +184,7 @@ public class RowAssemblerTest { asm.appendShort((short)33); - assertRowBytesEquals(new byte[] {42, 0, 29, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 29, 0, 33, 0, 0, 0, 7, 0, 0, 0, 0, 33, 0}, asm.build()); } } @@ -201,7 +201,7 @@ public class RowAssemblerTest { asm.appendShort((short)-1133); asm.appendShort((short)-1071); - assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, -109, -5, 7, 0, 0, 0, 0, -47, -5}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 24, 0, -109, -5, -1, -1, 7, 0, 0, 0, 0, -109, -5, 7, 0, 0, 0, 0, -47, -5}, asm.build()); } { // Null key. @@ -219,7 +219,7 @@ public class RowAssemblerTest { asm.appendShort((short)1133); asm.appendNull(); - assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 109, 4, 5, 0, 0, 0, 1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 24, 0, 109, 4, 0, 0, 7, 0, 0, 0, 0, 109, 4, 5, 0, 0, 0, 1}, asm.build()); } { // Null both. @@ -236,7 +236,7 @@ public class RowAssemblerTest { asm.appendShort((short)1133); - assertRowBytesEquals(new byte[] {42, 0, 25, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 109, 4}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 25, 0, 109, 4, 0, 0, 7, 0, 0, 0, 0, 109, 4}, asm.build()); } } @@ -253,7 +253,7 @@ public class RowAssemblerTest { asm.appendInt(-33); asm.appendString("val"); - assertRowBytesEquals(new byte[] {42, 0, 8, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, -33, -1, -1, -1, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 8, 0, -33, -1, -1, -1, 9, 0, 0, 0, 0, -33, -1, -1, -1, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build()); } { // Null key. @@ -271,7 +271,7 @@ public class RowAssemblerTest { asm.appendInt(33); asm.appendNull(); - assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 33, 0, 0, 0, 5, 0, 0, 0, 1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 24, 0, 33, 0, 0, 0, 9, 0, 0, 0, 0, 33, 0, 0, 0, 5, 0, 0, 0, 1}, asm.build()); } { // Null both. @@ -288,7 +288,7 @@ public class RowAssemblerTest { asm.appendInt(33); - assertRowBytesEquals(new byte[] {42, 0, 25, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 33, 0, 0, 0}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 25, 0, 33, 0, 0, 0, 9, 0, 0, 0, 0, 33, 0, 0, 0}, asm.build()); } } @@ -305,7 +305,7 @@ public class RowAssemblerTest { asm.appendByte((byte)-33); asm.appendString("val"); - assertRowBytesEquals(new byte[] {42, 0, 12, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, -33, 11, 0, 0, 0, 1, 0, 8, 0, 118, 97, 108}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 12, 0, -33, -1, -1, -1, 6, 0, 0, 0, 0, -33, 11, 0, 0, 0, 1, 0, 8, 0, 118, 97, 108}, asm.build()); } { // Null key. @@ -322,7 +322,7 @@ public class RowAssemblerTest { asm.appendByte((byte)33); - assertRowBytesEquals(new byte[] {42, 0, 29, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 33}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 29, 0, 33, 0, 0, 0, 6, 0, 0, 0, 0, 33}, asm.build()); } } @@ -340,7 +340,7 @@ public class RowAssemblerTest { asm.appendUuid(uuidVal); assertRowBytesEquals(new byte[] { - 42, 0, 18, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, + 42, 0, 18, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 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}, asm.build()); } @@ -350,7 +350,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendNull(); - assertRowBytesEquals(new byte[] {42, 0, 18, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 5, 0, 0, 0, 1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 18, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 5, 0, 0, 0, 1}, asm.build()); } { // No value. @@ -358,7 +358,7 @@ public class RowAssemblerTest { asm.appendString("key"); - assertRowBytesEquals(new byte[] {42, 0, 19, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 19, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build()); } } @@ -376,7 +376,7 @@ public class RowAssemblerTest { asm.appendUuid(uuidVal); assertRowBytesEquals(new byte[] { - 42, 0, 22, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, + 42, 0, 22, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 20, 0, 0, 0, -117, -61, -31, 85, 61, -32, 57, 68, 111, 67, 56, -3, -99, -37, -58, -73}, asm.build()); } @@ -385,7 +385,7 @@ public class RowAssemblerTest { asm.appendString("key"); - assertRowBytesEquals(new byte[] {42, 0, 23, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 23, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build()); } } @@ -402,7 +402,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendBytes(new byte[] {-1, 1, 0, 120}); - assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 13, 0, 0, 0, 0, 1, 0, 9, 0, -1, 1, 0, 120}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 2, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 13, 0, 0, 0, 0, 1, 0, 9, 0, -1, 1, 0, 120}, asm.build()); } { // Null value. @@ -411,7 +411,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendNull(); - assertRowBytesEquals(new byte[] {42, 0, 18, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 5, 0, 0, 0, 1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 18, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 5, 0, 0, 0, 1}, asm.build()); } { // No value. @@ -419,7 +419,7 @@ public class RowAssemblerTest { asm.appendString("key"); - assertRowBytesEquals(new byte[] {42, 0, 19, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 19, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build()); } } @@ -436,7 +436,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendBytes(new byte[] {-1, 1, 0, 120}); - assertRowBytesEquals(new byte[] {42, 0, 6, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 12, 0, 0, 0, 1, 0, 8, 0, -1, 1, 0, 120}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 6, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121, 12, 0, 0, 0, 1, 0, 8, 0, -1, 1, 0, 120}, asm.build()); } { // No value. @@ -444,7 +444,7 @@ public class RowAssemblerTest { asm.appendString("key"); - assertRowBytesEquals(new byte[] {42, 0, 23, 0, 0, 0, 0, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 23, 0, 95, -98, 1, 0, 11, 0, 0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build()); } } @@ -461,7 +461,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendShort((short)-71); - assertRowBytesEquals(new byte[] {42, 0, 16, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 7, 0, 0, 0, 0, -71, -1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 16, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 7, 0, 0, 0, 0, -71, -1}, asm.build()); } { // Null key. @@ -479,7 +479,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendNull(); - assertRowBytesEquals(new byte[] {42, 0, 16, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 5, 0, 0, 0, 1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 16, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 5, 0, 0, 0, 1}, asm.build()); } { // Null both. @@ -496,7 +496,7 @@ public class RowAssemblerTest { asm.appendString("key"); - assertRowBytesEquals(new byte[] {42, 0, 17, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 17, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build()); } } @@ -513,7 +513,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendShort((short)-71L); - assertRowBytesEquals(new byte[] {42, 0, 20, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 6, 0, 0, 0, -71, -1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 20, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 6, 0, 0, 0, -71, -1}, asm.build()); } { // Null key. @@ -530,7 +530,7 @@ public class RowAssemblerTest { asm.appendString("key"); - assertRowBytesEquals(new byte[] {42, 0, 21, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 21, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build()); } } @@ -547,7 +547,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendBytes(new byte[] {-1, 1, 0, 120}); - assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 13, 0, 0, 0, 0, 1, 0, 9, 0, -1, 1, 0, 120}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 0, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 13, 0, 0, 0, 0, 1, 0, 9, 0, -1, 1, 0, 120}, asm.build()); } { // Null key. @@ -565,7 +565,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendNull(); - assertRowBytesEquals(new byte[] {42, 0, 16, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 5, 0, 0, 0, 1}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 16, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 5, 0, 0, 0, 1}, asm.build()); } { // Null both. @@ -582,7 +582,7 @@ public class RowAssemblerTest { asm.appendString("key"); - assertRowBytesEquals(new byte[] {42, 0, 17, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 17, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build()); } } @@ -599,7 +599,7 @@ public class RowAssemblerTest { asm.appendString("key"); asm.appendBytes(new byte[] {-1, 1, 0, 120}); - assertRowBytesEquals(new byte[] {42, 0, 4, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 12, 0, 0, 0, 1, 0, 8, 0, -1, 1, 0, 120}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 4, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 12, 0, 0, 0, 1, 0, 8, 0, -1, 1, 0, 120}, asm.build()); } { // Null key. @@ -616,7 +616,7 @@ public class RowAssemblerTest { asm.appendString("key"); - assertRowBytesEquals(new byte[] {42, 0, 21, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build()); + assertRowBytesEquals(new byte[] {42, 0, 21, 0, 95, -98, 1, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build()); } }
