This is an automated email from the ASF dual-hosted git repository.
amashenkov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new aa79d37 IGNITE-13670: Skip writing null-map and varlen table when
possible. (#106)
aa79d37 is described below
commit aa79d371be4d9427c8bd31a63770efc61cf6d328
Author: Andrew V. Mashenkov <[email protected]>
AuthorDate: Fri May 7 11:05:20 2021 +0300
IGNITE-13670: Skip writing null-map and varlen table when possible. (#106)
---
.../apache/ignite/internal/schema/BinaryRow.java | 17 ++-
.../ignite/internal/schema/ByteBufferRow.java | 2 +-
.../org/apache/ignite/internal/schema/Columns.java | 21 ++-
.../org/apache/ignite/internal/schema/Row.java | 137 +++++++++++-------
.../ignite/internal/schema/RowAssembler.java | 55 +++++---
.../marshaller/asm/AsmSerializerGenerator.java | 4 +-
.../marshaller/reflection/JavaSerializer.java | 22 +--
.../apache/ignite/internal/schema/ColumnsTest.java | 14 +-
.../ignite/internal/schema/RowAssemblerTest.java | 156 +++++++--------------
.../ignite/internal/table/TupleMarshallerImpl.java | 115 ++++++++++++++-
.../ignite/{ => internal}/table/Example.java | 9 +-
.../{ => internal}/table/KVViewOperationsTest.java | 9 +-
.../table/TableBinaryViewOperationsTest.java | 9 +-
.../table/impl/DummyInternalTableImpl.java | 2 +-
.../table/impl/DummySchemaManagerImpl.java | 2 +-
15 files changed, 361 insertions(+), 213 deletions(-)
diff --git
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryRow.java
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryRow.java
index 776504a..8088491 100644
---
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryRow.java
+++
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryRow.java
@@ -133,11 +133,20 @@ public interface BinaryRow {
* Row flags.
*/
final class RowFlags {
- /** Tombstone flag. */
- public static final int TOMBSTONE = 1;
+ /** Flag indicates row has no value chunk. */
+ public static final int NO_VALUE_FLAG = 1;
- /** Null-value flag. */
- public static final int NULL_VALUE = 1 << 1;
+ /** Flag indicates key chunk omits null map. */
+ public static final int OMIT_KEY_NULL_MAP_FLAG = 1 << 1;
+
+ /** Flag indicates value chunk omits null map. */
+ public static final int OMIT_VAL_NULL_MAP_FLAG = 1 << 2;
+
+ /** Flag indicates key chunk omits varlen table. */
+ public static final int OMIT_KEY_VARTBL_FLAG = 1 << 3;
+
+ /** Flag indicates value chunk omits varlen table. */
+ public static final int OMIT_VAL_VARTBL_FLAG = 1 << 4;
/** Stub. */
private RowFlags() {
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 92f4e10..6ae8889 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
@@ -59,7 +59,7 @@ public class ByteBufferRow implements BinaryRow {
@Override public boolean hasValue() {
short flags = readShort(FLAGS_FIELD_OFFSET);
- return (flags & (RowFlags.NULL_VALUE | RowFlags.TOMBSTONE)) == 0;
+ return (flags & RowFlags.NO_VALUE_FLAG) == 0;
}
/** {@inheritDoc} */
diff --git
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/Columns.java
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/Columns.java
index 28a7f9c..38b62e5 100644
---
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/Columns.java
+++
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/Columns.java
@@ -99,7 +99,7 @@ public class Columns {
firstVarlenColIdx = findFirstVarlenColumn();
- nullMapSize = (cols.length + 7) / 8;
+ nullMapSize = hasNullableColumn() ? (cols.length + 7) / 8 : 0;
buildFoldingTable();
}
@@ -176,6 +176,13 @@ public class Columns {
}
/**
+ * @return {@code True} if there is at least one varlength column.
+ */
+ public boolean hasVarlengthColumns() {
+ return firstVarlenColIdx != -1;
+ }
+
+ /**
* @param schemaBaseIdx Base index of this columns object in its schema.
* @param cols User columns.
* @return A copy of user columns array sorted in column order.
@@ -207,6 +214,18 @@ public class Columns {
}
/**
+ * @return {@code True} if there is one or more nullable columns, {@code
false} otherwise.
+ */
+ private boolean hasNullableColumn() {
+ for (int i = 0; i < cols.length; i++) {
+ if (cols[i].nullable())
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
*
*/
private void buildFoldingTable() {
diff --git
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
index 621b4b8..ce51467 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
@@ -25,7 +25,7 @@ import java.util.UUID;
/**
* Schema-aware row.
- *
+ * <p>
* The class contains non-generic methods to read boxed and unboxed primitives
based on the schema column types.
* Any type conversions and coercions should be implemented outside the row by
the key-value or query runtime.
* When a non-boxed primitive is read from a null column value, it is
converted to the primitive type default value.
@@ -38,6 +38,14 @@ public class Row implements BinaryRow {
private final BinaryRow row;
/**
+ * @param itemIdx Varlen table item index.
+ * @return Varlen item offset.
+ */
+ public static int varlenItemOffset(int itemIdx) {
+ return VARLEN_TABLE_SIZE_FIELD_SIZE + itemIdx *
VARLEN_COLUMN_OFFSET_FIELD_SIZE;
+ }
+
+ /**
* Constructor.
*
* @param schema Schema.
@@ -299,6 +307,13 @@ public class Row implements BinaryRow {
}
/**
+ * @return Row flags.
+ */
+ private boolean hasFlag(int flag) {
+ return ((readShort(FLAGS_FIELD_OFFSET) & flag)) != 0;
+ }
+
+ /**
* Gets the column offset and length encoded into a single 8-byte value (4
least significant bytes encoding the
* offset from the beginning of the row and 4 most significant bytes
encoding the field length for varlength
* columns). The offset and length should be extracted using {@link
#offset(long)} and {@link #length(long)}
@@ -316,11 +331,14 @@ public class Row implements BinaryRow {
protected long findColumn(int colIdx, NativeTypeSpec type) throws
InvalidTypeException {
// Get base offset (key start or value start) for the given column.
boolean keyCol = schema.isKeyColumn(colIdx);
- Columns cols = keyCol ? schema.keyColumns() : schema.valueColumns();
+
+ final short flags = readShort(FLAGS_FIELD_OFFSET);
int off = KEY_CHUNK_OFFSET;
if (!keyCol) {
+ assert (flags & RowFlags.NO_VALUE_FLAG) == 0;
+
// Jump to the next chunk, the size of the first chunk is written
at the chunk start.
off += readInteger(off);
@@ -328,18 +346,23 @@ public class Row implements BinaryRow {
colIdx -= schema.keyColumns().length();
}
- Column col = cols.column(colIdx);
+ Columns cols = keyCol ? schema.keyColumns() : schema.valueColumns();
- if (col.type().spec() != type)
+ if (cols.column(colIdx).type().spec() != type)
throw new InvalidTypeException("Invalid column type requested
[requested=" + type +
- ", column=" + col + ']');
+ ", column=" + cols.column(colIdx) + ']');
- if (isNull(off, colIdx))
+ boolean hasVarTable = ((keyCol ? RowFlags.OMIT_KEY_VARTBL_FLAG :
RowFlags.OMIT_VAL_VARTBL_FLAG) & flags) == 0;
+ boolean hasNullMap = ((keyCol ? RowFlags.OMIT_KEY_NULL_MAP_FLAG :
RowFlags.OMIT_VAL_NULL_MAP_FLAG) & flags) == 0;
+
+ if (hasNullMap && isNull(off, colIdx))
return -1;
+ assert hasVarTable || type.fixedLength();
+
return type.fixedLength() ?
- fixlenColumnOffset(cols, off, colIdx) :
- varlenColumnOffsetAndLength(cols, off, colIdx);
+ fixlenColumnOffset(cols, off, colIdx, hasVarTable, hasNullMap) :
+ varlenColumnOffsetAndLength(cols, off, colIdx, hasNullMap);
}
/**
@@ -402,44 +425,51 @@ public class Row implements BinaryRow {
* @param cols Columns chunk.
* @param baseOff Chunk base offset.
* @param idx Column index in the chunk.
+ * @param hasNullMap Has null map flag.
* @return Encoded offset (from the row start) and length of the column
with the given index.
*/
- private long varlenColumnOffsetAndLength(Columns cols, int baseOff, int
idx) {
- int nullMapOff = nullMapOffset(baseOff);
-
- int nullStartByte = cols.firstVarlengthColumn() / 8;
- int startBitInByte = cols.firstVarlengthColumn() % 8;
+ private long varlenColumnOffsetAndLength(Columns cols, int baseOff, int
idx, boolean hasNullMap) {
+ int vartableOff = baseOff + CHUNK_LEN_FIELD_SIZE;
- int nullEndByte = idx / 8;
- int endBitInByte = idx % 8;
int numNullsBefore = 0;
- for (int i = nullStartByte; i <= nullEndByte; i++) {
- byte nullmapByte = readByte(nullMapOff + i);
+ if (hasNullMap) {
+ vartableOff += cols.nullMapSize();
- if (i == nullStartByte)
- // We need to clear startBitInByte least significant bits
- nullmapByte &= (0xFF << startBitInByte);
+ int nullMapOff = nullMapOffset(baseOff);
- if (i == nullEndByte)
- // We need to clear 8-endBitInByte most significant bits
- nullmapByte &= (0xFF >> (8 - endBitInByte));
+ int nullStartByte = cols.firstVarlengthColumn() / 8;
+ int startBitInByte = cols.firstVarlengthColumn() % 8;
- numNullsBefore += Columns.numberOfNullColumns(nullmapByte);
+ int nullEndByte = idx / 8;
+ int endBitInByte = idx % 8;
+
+ for (int i = nullStartByte; i <= nullEndByte; i++) {
+ byte nullmapByte = readByte(nullMapOff + i);
+
+ if (i == nullStartByte)
+ // We need to clear startBitInByte least significant bits
+ nullmapByte &= (0xFF << startBitInByte);
+
+ if (i == nullEndByte)
+ // We need to clear 8-endBitInByte most significant bits
+ nullmapByte &= (0xFF >> (8 - endBitInByte));
+
+ numNullsBefore += Columns.numberOfNullColumns(nullmapByte);
+ }
}
idx -= cols.numberOfFixsizeColumns() + numNullsBefore;
- int vartableSize = readShort(vartableChunkOffset(baseOff, cols));
+ int vartableSize = readShort(vartableOff);
- int vartableOff = vartableChunkOffset(baseOff, cols) +
VARLEN_TABLE_SIZE_FIELD_SIZE;
// Offset of idx-th column is from base offset.
- int resOff = readShort(vartableOff + VARLEN_COLUMN_OFFSET_FIELD_SIZE *
idx);
+ int resOff = readShort(vartableOff + varlenItemOffset(idx));
- long len = idx == vartableSize - 1 ?
+ long len = (idx == vartableSize - 1) ?
// totalLength - columnStartOffset
readInteger(baseOff) - resOff :
// nextColumnStartOffset - columnStartOffset
- readShort(vartableOff + VARLEN_COLUMN_OFFSET_FIELD_SIZE * (idx +
1)) - resOff;
+ readShort(vartableOff + varlenItemOffset(idx + 1)) - resOff;
return (len << 32) | (resOff + baseOff);
}
@@ -451,30 +481,38 @@ public class Row implements BinaryRow {
* @param cols Columns chunk.
* @param baseOff Chunk base offset.
* @param idx Column index in the chunk.
+ * @param hasVarTbl Has varlen table flag.
+ * @param hasNullMap Has null map flag.
* @return Encoded offset (from the row start) of the requested fixlen
column.
*/
- int fixlenColumnOffset(Columns cols, int baseOff, int idx) {
- int nullMapOff = nullMapOffset(baseOff);
-
+ int fixlenColumnOffset(Columns cols, int baseOff, int idx, boolean
hasVarTbl, boolean hasNullMap) {
int off = 0;
- int nullMapIdx = idx / 8;
- // Fold offset based on the whole map bytes in the schema
- for (int i = 0; i < nullMapIdx; i++)
- off += cols.foldFixedLength(i, readByte(nullMapOff + i));
+ int payloadOff = baseOff + CHUNK_LEN_FIELD_SIZE;
+
+ if (hasNullMap) {
+ payloadOff += cols.nullMapSize();
+
+ int nullMapOff = nullMapOffset(baseOff);
- // Set bits starting from posInByte, inclusive, up to either the end
of the byte or the last column index, inclusive
- int startBit = idx % 8;
- int endBit = nullMapIdx == cols.nullMapSize() - 1 ?
((cols.numberOfFixsizeColumns() - 1) % 8) : 7;
- int mask = (0xFF >> (7 - endBit)) & (0xFF << startBit);
+ int nullMapIdx = idx / 8;
- off += cols.foldFixedLength(nullMapIdx, readByte(nullMapOff +
nullMapIdx) | mask);
+ // Fold offset based on the whole map bytes in the schema
+ for (int i = 0; i < nullMapIdx; i++)
+ off += cols.foldFixedLength(i, readByte(nullMapOff + i));
- final int vartableChunkOffset = vartableChunkOffset(baseOff, cols);
+ // Set bits starting from posInByte, inclusive, up to either the
end of the byte or the last column index, inclusive
+ int startBit = idx % 8;
+ int endBit = nullMapIdx == cols.nullMapSize() - 1 ?
((cols.numberOfFixsizeColumns() - 1) % 8) : 7;
+ int mask = (0xFF >> (7 - endBit)) & (0xFF << startBit);
- return vartableChunkOffset + VARLEN_TABLE_SIZE_FIELD_SIZE +
- readShort(vartableChunkOffset) * VARLEN_COLUMN_OFFSET_FIELD_SIZE
/* table size */ +
- off;
+ off += cols.foldFixedLength(nullMapIdx, readByte(nullMapOff +
nullMapIdx) | mask);
+ }
+
+ if (hasVarTbl)
+ payloadOff += varlenItemOffset(readShort(payloadOff));
+
+ return payloadOff + off;
}
/**
@@ -485,15 +523,6 @@ public class Row implements BinaryRow {
return baseOff + CHUNK_LEN_FIELD_SIZE;
}
- /**
- * @param baseOff Chunk base offset.
- * @param cols Columns.
- * @return Offset of the varlen table from the row start for the chunk
with the given base.
- */
- private int vartableChunkOffset(int baseOff, Columns cols) {
- return baseOff + CHUNK_LEN_FIELD_SIZE + cols.nullMapSize();
- }
-
/** {@inheritDoc} */
@Override public int schemaVersion() {
return row.schemaVersion();
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 8994ab1..9325566 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
@@ -22,6 +22,10 @@ import java.nio.charset.CharsetEncoder;
import java.nio.charset.StandardCharsets;
import java.util.BitSet;
import java.util.UUID;
+import org.apache.ignite.internal.schema.BinaryRow.RowFlags;
+
+import static
org.apache.ignite.internal.schema.BinaryRow.VARLEN_COLUMN_OFFSET_FIELD_SIZE;
+import static
org.apache.ignite.internal.schema.BinaryRow.VARLEN_TABLE_SIZE_FIELD_SIZE;
/**
* Utility class to build rows using column appending pattern. The external
user of this class must consult
@@ -63,7 +67,7 @@ public class RowAssembler {
private int nullMapOff;
/** Offset of the varlen table for current chunk. */
- private int varlenTblOff;
+ private int varlenTblChunkOff;
/** Flags. */
private short flags;
@@ -75,8 +79,9 @@ public class RowAssembler {
* @param nonNullVarlenCols Number of non-null varlen columns.
* @return Total size of the varlen table.
*/
- public static int varlenTableSize(int nonNullVarlenCols) {
- return nonNullVarlenCols * BinaryRow.VARLEN_COLUMN_OFFSET_FIELD_SIZE;
+ public static int varlenTableChunkSize(int nonNullVarlenCols) {
+ return nonNullVarlenCols == 0 ? 0 :
+ VARLEN_TABLE_SIZE_FIELD_SIZE + nonNullVarlenCols *
VARLEN_COLUMN_OFFSET_FIELD_SIZE;
}
/**
@@ -137,7 +142,7 @@ public class RowAssembler {
*/
static int rowChunkSize(Columns cols, int nonNullVarlenCols, int
nonNullVarlenSize) {
int size = BinaryRow.CHUNK_LEN_FIELD_SIZE + cols.nullMapSize() +
- BinaryRow.VARLEN_TABLE_SIZE_FIELD_SIZE +
varlenTableSize(nonNullVarlenCols);
+ varlenTableChunkSize(nonNullVarlenCols);
for (int i = 0; i < cols.numberOfFixsizeColumns(); i++)
size += cols.column(i).type().length();
@@ -167,10 +172,20 @@ public class RowAssembler {
initOffsets(BinaryRow.KEY_CHUNK_OFFSET, nonNullVarlenKeyCols);
+ if (schema.keyColumns().nullMapSize() == 0)
+ flags |= RowFlags.OMIT_KEY_NULL_MAP_FLAG;
+
+ if (schema.valueColumns().nullMapSize() == 0)
+ flags |= RowFlags.OMIT_VAL_NULL_MAP_FLAG;
+
buf = new ExpandableByteBuf(size);
buf.putShort(0, (short)schema.version());
- buf.putShort(nullMapOff + curCols.nullMapSize(),
(short)nonNullVarlenKeyCols);
+
+ if (nonNullVarlenKeyCols == 0)
+ flags |= RowFlags.OMIT_KEY_VARTBL_FLAG;
+ else
+ buf.putShort(varlenTblChunkOff, (short)nonNullVarlenKeyCols);
}
/**
@@ -349,9 +364,9 @@ public class RowAssembler {
throw new AssemblyException("Key column missed: colIdx=" + curCol);
else {
if (curCol == 0)
- flags |= BinaryRow.RowFlags.NULL_VALUE;
+ flags |= RowFlags.NO_VALUE_FLAG;
else if (schema.valueColumns().length() != curCol)
- throw new AssemblyException("Value column missed: colIdx=" +
curCol);
+ throw new AssemblyException("Value column missed: colIdx=" +
curCol);
}
buf.putShort(BinaryRow.FLAGS_FIELD_OFFSET, flags);
@@ -376,7 +391,9 @@ public class RowAssembler {
* @param off Offset to write.
*/
private void writeOffset(int tblEntryIdx, int off) {
- buf.putShort(varlenTblOff + BinaryRow.VARLEN_COLUMN_OFFSET_FIELD_SIZE
* tblEntryIdx, (short)off);
+ assert (flags & (baseOff == BinaryRow.KEY_CHUNK_OFFSET ?
RowFlags.OMIT_KEY_VARTBL_FLAG : RowFlags.OMIT_VAL_VARTBL_FLAG)) == 0;
+
+ buf.putShort(varlenTblChunkOff + Row.varlenItemOffset(tblEntryIdx),
(short)off);
}
/**
@@ -407,6 +424,8 @@ public class RowAssembler {
* @param colIdx Column index.
*/
private void setNull(int colIdx) {
+ assert (flags & (baseOff == BinaryRow.KEY_CHUNK_OFFSET ?
RowFlags.OMIT_KEY_NULL_MAP_FLAG : RowFlags.OMIT_VAL_NULL_MAP_FLAG)) == 0;
+
int byteInMap = colIdx / 8;
int bitInByte = colIdx % 8;
@@ -441,19 +460,21 @@ public class RowAssembler {
curVarlenTblEntry++;
if (curCol == curCols.length()) {
- int keyLen = curOff - baseOff;
-
- buf.putShort(baseOff, (short)keyLen);
+ int chunkLen = curOff - baseOff;
- if (schema.valueColumns() == curCols) {
- buf.putShort(nullMapOff + curCols.nullMapSize(),
(short)nonNullVarlenValCols);
+ buf.putInt(baseOff, chunkLen);
+ if (schema.valueColumns() == curCols)
return; // No more columns.
- }
curCols = schema.valueColumns(); // Switch key->value columns.
- initOffsets(baseOff + keyLen, nonNullVarlenValCols);
+ initOffsets(baseOff + chunkLen, nonNullVarlenValCols);
+
+ if (nonNullVarlenValCols == 0)
+ flags |= RowFlags.OMIT_VAL_VARTBL_FLAG;
+ else
+ buf.putShort(varlenTblChunkOff, (short)nonNullVarlenValCols);
}
}
@@ -468,8 +489,8 @@ public class RowAssembler {
curVarlenTblEntry = 0;
nullMapOff = baseOff + BinaryRow.CHUNK_LEN_FIELD_SIZE;
- varlenTblOff = nullMapOff + curCols.nullMapSize() +
BinaryRow.VARLEN_TABLE_SIZE_FIELD_SIZE;
+ varlenTblChunkOff = nullMapOff + curCols.nullMapSize();
- curOff = varlenTblOff + varlenTableSize(nonNullVarlenCols);
+ curOff = varlenTblChunkOff + varlenTableChunkSize(nonNullVarlenCols);
}
}
diff --git
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/marshaller/asm/AsmSerializerGenerator.java
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/marshaller/asm/AsmSerializerGenerator.java
index 20e9efd..14712b3 100644
---
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/marshaller/asm/AsmSerializerGenerator.java
+++
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/marshaller/asm/AsmSerializerGenerator.java
@@ -260,7 +260,7 @@ public class AsmSerializerGenerator implements
SerializerFactory {
.invoke("valueColumns", Columns.class)));
Columns columns = schema.keyColumns();
- if (columns.firstVarlengthColumn() >= 0) {
+ if (columns.hasVarlengthColumns()) {
final Variable tmp = scope.createTempVariable(Object.class);
for (int i = columns.firstVarlengthColumn(); i < columns.length();
i++) {
@@ -280,7 +280,7 @@ public class AsmSerializerGenerator implements
SerializerFactory {
}
columns = schema.valueColumns();
- if (columns.firstVarlengthColumn() >= 0) {
+ if (columns.hasVarlengthColumns()) {
final Variable tmp = scope.createTempVariable(Object.class);
for (int i = columns.firstVarlengthColumn(); i < columns.length();
i++) {
diff --git
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/marshaller/reflection/JavaSerializer.java
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/marshaller/reflection/JavaSerializer.java
index 4c0215e..31bad5e 100644
---
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/marshaller/reflection/JavaSerializer.java
+++
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/marshaller/reflection/JavaSerializer.java
@@ -86,10 +86,10 @@ public class JavaSerializer extends AbstractSerializer {
ObjectStatistic valStat = collectObjectStats(schema.valueColumns(),
valMarsh, val);
int size = RowAssembler.rowSize(
- schema.keyColumns(), keyStat.nonNullFields,
keyStat.nonNullFieldsSize,
- schema.valueColumns(), valStat.nonNullFields,
valStat.nonNullFieldsSize);
+ schema.keyColumns(), keyStat.nonNullCols, keyStat.nonNullColsSize,
+ schema.valueColumns(), valStat.nonNullCols,
valStat.nonNullColsSize);
- return new RowAssembler(schema, size, keyStat.nonNullFields,
valStat.nonNullFields);
+ return new RowAssembler(schema, size, keyStat.nonNullCols,
valStat.nonNullCols);
}
/**
@@ -101,7 +101,7 @@ public class JavaSerializer extends AbstractSerializer {
* @return Object statistic.
*/
private ObjectStatistic collectObjectStats(Columns cols, Marshaller marsh,
Object obj) {
- if (obj == null || cols.firstVarlengthColumn() < 0 /* No varlen
columns */)
+ if (obj == null || !cols.hasVarlengthColumns())
return new ObjectStatistic(0, 0);
int cnt = 0;
@@ -142,16 +142,16 @@ public class JavaSerializer extends AbstractSerializer {
* Object statistic.
*/
private static class ObjectStatistic {
- /** Non-null fields of varlen type. */
- int nonNullFields;
+ /** Non-null columns of varlen type. */
+ int nonNullCols;
- /** Length of all non-null fields of varlen types. */
- int nonNullFieldsSize;
+ /** Length of all non-null columns of varlen types. */
+ int nonNullColsSize;
/** Constructor. */
- ObjectStatistic(int nonNullFields, int nonNullFieldsSize) {
- this.nonNullFields = nonNullFields;
- this.nonNullFieldsSize = nonNullFieldsSize;
+ ObjectStatistic(int nonNullCols, int nonNullColsSize) {
+ this.nonNullCols = nonNullCols;
+ this.nonNullColsSize = nonNullColsSize;
}
}
}
diff --git
a/modules/schema/src/test/java/org/apache/ignite/internal/schema/ColumnsTest.java
b/modules/schema/src/test/java/org/apache/ignite/internal/schema/ColumnsTest.java
index 1823c63..90ed675 100644
---
a/modules/schema/src/test/java/org/apache/ignite/internal/schema/ColumnsTest.java
+++
b/modules/schema/src/test/java/org/apache/ignite/internal/schema/ColumnsTest.java
@@ -45,7 +45,7 @@ public class ColumnsTest {
for (int c = 0; c < cols.length(); c++)
assertTrue(cols.isFixedSize(c));
- assertEquals(1, cols.nullMapSize());
+ assertEquals(0, cols.nullMapSize());
assertEquals(3, cols.numberOfFixsizeColumns());
}
@@ -67,7 +67,7 @@ public class ColumnsTest {
for (int c = 0; c < cols.length(); c++)
assertFalse(cols.isFixedSize(c));
- assertEquals(1, cols.nullMapSize());
+ assertEquals(0, cols.nullMapSize());
assertEquals(0, cols.numberOfFixsizeColumns());
}
@@ -94,7 +94,7 @@ public class ColumnsTest {
assertFalse(cols.isFixedSize(c));
}
- assertEquals(1, cols.nullMapSize());
+ assertEquals(0, cols.nullMapSize());
assertEquals(3, cols.numberOfFixsizeColumns());
}
@@ -435,8 +435,12 @@ public class ColumnsTest {
private static Column[] columns(int size) {
Column[] ret = new Column[size];
- for (int i = 0; i < ret.length; i++)
- ret[i] = new Column("column-" + i, NativeType.STRING, true);
+ for (int i = 0; i < ret.length; i++) {
+ if (i % 3 == 0)
+ ret[i] = new Column("column-" + i, NativeType.LONG, true);
+ else
+ ret[i] = new Column("column-" + i, NativeType.STRING, true);
+ }
return ret;
}
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 032ab32..b2c56d5 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
@@ -36,9 +36,6 @@ public class RowAssemblerTest {
/** Uuid test value. */
public final java.util.UUID uuidVal = new UUID(-5204230847775358097L,
4916207022290092939L);
- /**
- * Validate row layout for schema of fix-len non-null key and fix-len
nullable value.
- */
@Test
public void testFixedKeyFixedNullableValue() {
Column[] keyCols = new Column[] {new Column("keyIntCol", INTEGER,
false)};
@@ -52,7 +49,7 @@ public class RowAssemblerTest {
asm.appendInt(33);
asm.appendInt(-71);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 0, 33, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, -71, -1, -1, -1},
asm.build());
+ 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());
}
{ // Null value.
@@ -61,7 +58,7 @@ public class RowAssemblerTest {
asm.appendInt(-33);
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 0, -33, -1, -1, -1, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ 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());
}
{ // No value.
@@ -69,13 +66,10 @@ public class RowAssemblerTest {
asm.appendInt(-33);
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 0, -33, -1, -1, -1}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 27, 0, 0, 0, 0, 0, 8, 0,
0, 0, -33, -1, -1, -1}, asm.build());
}
}
- /**
- * Validate row layout for schema of fix-len non-null key and fix-len
non-null value.
- */
@Test
public void testFixedKeyFixedValue() {
Column[] keyCols = new Column[] {new Column("keyShortCol", SHORT,
false)};
@@ -89,7 +83,7 @@ public class RowAssemblerTest {
asm.appendShort((short)33);
asm.appendShort((short)71L);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, 33, 0, 9, 0, 0, 0, 0, 0, 0, 71, 0}, asm.build());
+ 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());
}
{ // No value.
@@ -97,13 +91,10 @@ public class RowAssemblerTest {
asm.appendShort((short)-33);
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, -33, -1}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 31, 0, 0, 0, 0, 0, 6, 0,
0, 0, -33, -1}, asm.build());
}
}
- /**
- * Validate row layout for schema of fix-len non-null key and var-len
nullable value.
- */
@Test
public void testFixedKeyVarlenNullableValue() {
Column[] keyCols = new Column[] {new Column("keyShortCol", SHORT,
false)};
@@ -117,7 +108,7 @@ public class RowAssemblerTest {
asm.appendShort((short)-33);
asm.appendString("val");
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
0, 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, 0, 0, 0, 0, 6, 0,
0, 0, -33, -1, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build());
}
{ // Null value.
@@ -126,7 +117,7 @@ public class RowAssemblerTest {
asm.appendShort((short)33);
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, 33, 0, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 26, 0, 0, 0, 0, 0, 6, 0,
0, 0, 33, 0, 5, 0, 0, 0, 1}, asm.build());
}
{ // No value.
@@ -134,13 +125,10 @@ public class RowAssemblerTest {
asm.appendShort((short)33);
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, 33, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 27, 0, 0, 0, 0, 0, 6, 0,
0, 0, 33, 0}, asm.build());
}
}
- /**
- * Validate row layout for schema of fix-len non-null key and var-len
non-null value.
- */
@Test
public void testFixedKeyVarlenValue() {
Column[] keyCols = new Column[] {new Column("keyShortCol", SHORT,
false)};
@@ -154,7 +142,7 @@ public class RowAssemblerTest {
asm.appendShort((short)-33);
asm.appendString("val");
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, -33, -1, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build());
+ 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());
}
{ // No value.
@@ -162,13 +150,10 @@ public class RowAssemblerTest {
asm.appendShort((short)33);
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, 33, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 31, 0, 0, 0, 0, 0, 6, 0,
0, 0, 33, 0}, asm.build());
}
}
- /**
- * Validate row layout for schema of fix-len nullable key and fix-len
non-null value.
- */
@Test
public void testFixedNullableKeyFixedValue() {
Column[] keyCols = new Column[] {new Column("keyShortCol", SHORT,
true)};
@@ -182,7 +167,7 @@ public class RowAssemblerTest {
asm.appendShort((short)-33);
asm.appendByte((byte)71);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, -33, -1, 8, 0, 0, 0, 0, 0, 0, 71}, asm.build());
+ 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());
}
{ // Null key.
@@ -191,7 +176,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendByte((byte)-71);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 8, 0, 0, 0, 0, 0, 0, -71}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 28, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 5, 0, 0, 0, -71}, asm.build());
}
{ // No value.
@@ -199,13 +184,10 @@ public class RowAssemblerTest {
asm.appendShort((short)33);
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, 33, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 29, 0, 0, 0, 0, 0, 7, 0,
0, 0, 0, 33, 0}, asm.build());
}
}
- /**
- * Validate row layout for schema of fix-len nullable key and fix-len
nullable value.
- */
@Test
public void testFixedNullableKeyFixedNullableValue() {
Column[] keyCols = new Column[] {new Column("keyShortCol", SHORT,
true)};
@@ -219,7 +201,7 @@ public class RowAssemblerTest {
asm.appendShort((short)-1133);
asm.appendShort((short)-1071);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, -109, -5, 9, 0, 0, 0, 0, 0, 0, -47, -5}, asm.build());
+ 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());
}
{ // Null key.
@@ -228,7 +210,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendShort((short)1171);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 9, 0, 0, 0, 0, 0, 0, -109, 4}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 7, 0, 0, 0, 0, -109, 4}, asm.build());
}
{ // Null value.
@@ -237,7 +219,7 @@ public class RowAssemblerTest {
asm.appendShort((short)1133);
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, 109, 4, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ 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());
}
{ // Null both.
@@ -246,7 +228,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 5, 0, 0, 0, 1}, asm.build());
}
{ // No value.
@@ -254,13 +236,10 @@ public class RowAssemblerTest {
asm.appendShort((short)1133);
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 9, 0, 0,
0, 0, 0, 0, 109, 4}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 25, 0, 0, 0, 0, 0, 7, 0,
0, 0, 0, 109, 4}, asm.build());
}
}
- /**
- * Validate row layout for schema of fix-len nullable key and var-len
nullable value.
- */
@Test
public void testFixedNullableKeyVarlenNullableValue() {
Column[] keyCols = new Column[] {new Column("keyIntCol", INTEGER,
true)};
@@ -274,7 +253,7 @@ public class RowAssemblerTest {
asm.appendInt(-33);
asm.appendString("val");
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 11, 0,
0, 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, 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());
}
{ // Null key.
@@ -283,7 +262,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendString("val");
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 8, 0, 0, 0, 0, 0, 5, 0, 0,
0, 1, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build());
}
{ // Null value.
@@ -292,7 +271,7 @@ public class RowAssemblerTest {
asm.appendInt(33);
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 0, 33, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ 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());
}
{ // Null both.
@@ -301,7 +280,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 5, 0, 0, 0, 1}, asm.build());
}
{ // No value.
@@ -309,13 +288,10 @@ public class RowAssemblerTest {
asm.appendInt(33);
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 11, 0,
0, 0, 0, 0, 0, 33, 0, 0, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 25, 0, 0, 0, 0, 0, 9, 0,
0, 0, 0, 33, 0, 0, 0}, asm.build());
}
}
- /**
- * Validate row layout for schema of fix-len nullable key and var-len
non-null value.
- */
@Test
public void testFixedNullableKeyVarlenValue() {
Column[] keyCols = new Column[] {new Column("keyByteCol", BYTE, true)};
@@ -329,7 +305,7 @@ public class RowAssemblerTest {
asm.appendByte((byte)-33);
asm.appendString("val");
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0,
0, 0, 0, 0, -33, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build());
+ 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());
}
{ // Null key.
@@ -338,7 +314,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendString("val");
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 118, 97, 108}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 12, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 11, 0, 0, 0, 1, 0, 8, 0, 118, 97, 108}, asm.build());
}
{ // No value.
@@ -346,13 +322,10 @@ public class RowAssemblerTest {
asm.appendByte((byte)33);
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 8, 0, 0,
0, 0, 0, 0, 33}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 29, 0, 0, 0, 0, 0, 6, 0,
0, 0, 0, 33}, asm.build());
}
}
- /**
- * Validate row layout for schema of var-len non-null key and fix-len
nullable value.
- */
@Test
public void testVarlenKeyFixedNullableValue() {
Column[] keyCols = new Column[] {new Column("keyStrCol", STRING,
false)};
@@ -367,8 +340,8 @@ public class RowAssemblerTest {
asm.appendUuid(uuidVal);
assertRowBytesEquals(new byte[] {
- 42, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101,
121,
- 23, 0, 0, 0, 0, 0, 0, -117, -61, -31, 85, 61, -32, 57, 68,
111, 67, 56, -3, -99, -37, -58, -73}, asm.build());
+ 42, 0, 18, 0, 0, 0, 0, 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());
}
{ // Null value.
@@ -377,7 +350,7 @@ public class RowAssemblerTest {
asm.appendString("key");
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ 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());
}
{ // No value.
@@ -385,13 +358,10 @@ public class RowAssemblerTest {
asm.appendString("key");
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 19, 0, 0, 0, 0, 0, 11, 0,
0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build());
}
}
-
- /**
- * Validate row layout for schema of var-len non-null key and fix-len
non-null value.
- */
+
@Test
public void testVarlenKeyFixedValue() {
Column[] keyCols = new Column[] {new Column("keyStrCol", STRING,
false)};
@@ -406,8 +376,8 @@ public class RowAssemblerTest {
asm.appendUuid(uuidVal);
assertRowBytesEquals(new byte[] {
- 42, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 1, 0, 9, 0, 107, 101,
121,
- 23, 0, 0, 0, 0, 0, 0, -117, -61, -31, 85, 61, -32, 57, 68,
111, 67, 56, -3, -99, -37, -58, -73}, asm.build());
+ 42, 0, 22, 0, 0, 0, 0, 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());
}
{ // No value.
@@ -415,13 +385,10 @@ public class RowAssemblerTest {
asm.appendString("key");
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 23, 0, 0, 0, 0, 0, 11, 0,
0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build());
}
}
- /**
- * Validate row layout for schema of var-len non-null key and var-len
nullable value.
- */
@Test
public void testVarlenKeyVarlenNullableValue() {
Column[] keyCols = new Column[] {new Column("keyStrCol", STRING,
false)};
@@ -435,7 +402,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, 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());
}
{ // Null value.
@@ -444,7 +411,7 @@ public class RowAssemblerTest {
asm.appendString("key");
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ 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());
}
{ // No value.
@@ -452,13 +419,10 @@ public class RowAssemblerTest {
asm.appendString("key");
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 19, 0, 0, 0, 0, 0, 11, 0,
0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build());
}
}
- /**
- * Validate row layout for schema of var-len non-null key and var-len
non-null value.
- */
@Test
public void testVarlenKeyVarlenValue() {
Column[] keyCols = new Column[] {new Column("keyStrCol", STRING,
false)};
@@ -472,7 +436,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, 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());
}
{ // No value.
@@ -480,13 +444,10 @@ public class RowAssemblerTest {
asm.appendString("key");
- assertRowBytesEquals(new byte[] {42, 0, 2, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 23, 0, 0, 0, 0, 0, 11, 0,
0, 0, 1, 0, 8, 0, 107, 101, 121}, asm.build());
}
}
- /**
- * Validate row layout for schema of var-len nullable key and fix-len
nullable value.
- */
@Test
public void testVarlenNullableKeyFixedNullableValue() {
Column[] keyCols = new Column[] {new Column("keyStrCol", STRING,
true)};
@@ -500,7 +461,7 @@ public class RowAssemblerTest {
asm.appendString("key");
asm.appendShort((short)-71);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 9, 0, 0, 0, 0, 0, 0, -71, -1}, asm.build());
+ 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());
}
{ // Null key.
@@ -509,7 +470,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendShort((short)71);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 9, 0, 0, 0, 0, 0, 0, 71, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 7, 0, 0, 0, 0, 71, 0}, asm.build());
}
{ // Null value.
@@ -518,7 +479,7 @@ public class RowAssemblerTest {
asm.appendString("key");
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ 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());
}
{ // Null both.
@@ -527,7 +488,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 5, 0, 0, 0, 1}, asm.build());
}
{ // No value.
@@ -535,13 +496,10 @@ public class RowAssemblerTest {
asm.appendString("key");
- assertRowBytesEquals(new byte[] {42, 0, 2, 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, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build());
}
}
- /**
- * Validate row layout for schema of var-len nullable key and fix-len
non-null value.
- */
@Test
public void testVarlenNullableKeyFixedValue() {
Column[] keyCols = new Column[] {new Column("keyStrCol", STRING,
true)};
@@ -555,7 +513,7 @@ public class RowAssemblerTest {
asm.appendString("key");
asm.appendShort((short)-71L);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 9, 0, 0, 0, 0, 0, 0, -71, -1}, asm.build());
+ 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());
}
{ // Null key.
@@ -564,7 +522,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendShort((short)71);
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 9, 0, 0, 0, 0, 0, 0, 71, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 28, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 6, 0, 0, 0, 71, 0}, asm.build());
}
{ // No value.
@@ -572,13 +530,10 @@ public class RowAssemblerTest {
asm.appendString("key");
- assertRowBytesEquals(new byte[] {42, 0, 2, 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, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build());
}
}
- /**
- * Validate row layout for schema of var-len nullable key and var-len
nullable value.
- */
@Test
public void testVarlenNullableKeyVarlenNullableValue() {
Column[] keyCols = new Column[] {new Column("keyStrCol", STRING,
true)};
@@ -601,7 +556,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendBytes(new byte[] {-1, 1, 0, 120});
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 13, 0, 0, 0, 0, 1, 0, 9, 0, -1, 1, 0, 120}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 8, 0, 0, 0, 0, 0, 5, 0, 0,
0, 1, 13, 0, 0, 0, 0, 1, 0, 9, 0, -1, 1, 0, 120}, asm.build());
}
{ // Null value.
@@ -610,7 +565,7 @@ public class RowAssemblerTest {
asm.appendString("key");
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ 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());
}
{ // Null both.
@@ -619,7 +574,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendNull();
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 7, 0, 0, 0, 1, 0, 0}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 24, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 5, 0, 0, 0, 1}, asm.build());
}
{ // No value.
@@ -627,13 +582,10 @@ public class RowAssemblerTest {
asm.appendString("key");
- assertRowBytesEquals(new byte[] {42, 0, 2, 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, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build());
}
}
- /**
- * Validate row layout for schema of var-len nullable key and var-len
non-null value.
- */
@Test
public void testVarlenNullableKeyVarlenValue() {
Column[] keyCols = new Column[] {new Column("keyStrCol", STRING,
true)};
@@ -647,7 +599,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, 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());
}
{ // Null key.
@@ -656,7 +608,7 @@ public class RowAssemblerTest {
asm.appendNull();
asm.appendBytes(new byte[] {-1, 1, 0, 120});
- assertRowBytesEquals(new byte[] {42, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0,
0, 1, 0, 0, 13, 0, 0, 0, 0, 1, 0, 9, 0, -1, 1, 0, 120}, asm.build());
+ assertRowBytesEquals(new byte[] {42, 0, 12, 0, 0, 0, 0, 0, 5, 0,
0, 0, 1, 12, 0, 0, 0, 1, 0, 8, 0, -1, 1, 0, 120}, asm.build());
}
{ // No value.
@@ -664,7 +616,7 @@ public class RowAssemblerTest {
asm.appendString("key");
- assertRowBytesEquals(new byte[] {42, 0, 2, 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, 0, 0, 0, 0, 12, 0,
0, 0, 0, 1, 0, 9, 0, 107, 101, 121}, asm.build());
}
}
diff --git
a/modules/table/src/main/java/org/apache/ignite/internal/table/TupleMarshallerImpl.java
b/modules/table/src/main/java/org/apache/ignite/internal/table/TupleMarshallerImpl.java
index 9729a79..05c3ed7 100644
---
a/modules/table/src/main/java/org/apache/ignite/internal/table/TupleMarshallerImpl.java
+++
b/modules/table/src/main/java/org/apache/ignite/internal/table/TupleMarshallerImpl.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.table;
import org.apache.ignite.internal.schema.ByteBufferRow;
import org.apache.ignite.internal.schema.Column;
+import org.apache.ignite.internal.schema.Columns;
import org.apache.ignite.internal.schema.Row;
import org.apache.ignite.internal.schema.RowAssembler;
import org.apache.ignite.internal.schema.SchemaDescriptor;
@@ -26,10 +27,12 @@ import
org.apache.ignite.internal.schema.marshaller.TupleMarshaller;
import org.apache.ignite.table.Tuple;
import org.jetbrains.annotations.NotNull;
+import static
org.apache.ignite.internal.schema.marshaller.MarshallerUtil.getValueSize;
+
/**
* Marshaller implementation.
*/
-class TupleMarshallerImpl implements TupleMarshaller {
+public class TupleMarshallerImpl implements TupleMarshaller {
/** Schema manager. */
private final TableSchemaView schemaMgr;
@@ -38,7 +41,7 @@ class TupleMarshallerImpl implements TupleMarshaller {
*
* @param schemaMgr Schema manager.
*/
- TupleMarshallerImpl(TableSchemaView schemaMgr) {
+ public TupleMarshallerImpl(TableSchemaView schemaMgr) {
this.schemaMgr = schemaMgr;
}
@@ -53,7 +56,7 @@ class TupleMarshallerImpl implements TupleMarshaller {
assert keyTuple instanceof TupleBuilderImpl;
- final RowAssembler rowBuilder = new RowAssembler(schema, 4096, 0, 0);
+ final RowAssembler rowBuilder = createAssembler(schema, keyTuple,
valTuple);
for (int i = 0; i < schema.keyColumns().length(); i++) {
final Column col = schema.keyColumns().column(i);
@@ -73,6 +76,24 @@ class TupleMarshallerImpl implements TupleMarshaller {
}
/**
+ * Creates {@link RowAssembler} for key-value tuples.
+ *
+ * @param keyTuple Key tuple.
+ * @param valTuple Value tuple.
+ * @return Row assembler.
+ */
+ private RowAssembler createAssembler(SchemaDescriptor schema, Tuple
keyTuple, Tuple valTuple) {
+ final ObjectStatistic keyStat =
collectObjectStats(schema.keyColumns(), keyTuple);
+ final ObjectStatistic valStat =
collectObjectStats(schema.keyColumns(), valTuple);
+
+ int size = RowAssembler.rowSize(
+ schema.keyColumns(), keyStat.nonNullCols, keyStat.nonNullColsSize,
+ schema.valueColumns(), valStat.nonNullCols,
valStat.nonNullColsSize);
+
+ return new RowAssembler(schema, size, keyStat.nonNullCols,
valStat.nonNullCols);
+ }
+
+ /**
* @param tup Tuple.
* @param col Column.
* @param rowAsm Row assembler.
@@ -80,19 +101,107 @@ class TupleMarshallerImpl implements TupleMarshaller {
private void writeColumn(Tuple tup, Column col, RowAssembler rowAsm) {
if (tup.value(col.name()) == null) {
rowAsm.appendNull();
+
return;
}
switch (col.type().spec()) {
+ case BYTE: {
+ rowAsm.appendByte(tup.byteValue(col.name()));
+
+ break;
+ }
+ case SHORT: {
+ rowAsm.appendShort(tup.shortValue(col.name()));
+
+ break;
+ }
+ case INTEGER: {
+ rowAsm.appendInt(tup.intValue(col.name()));
+
+ break;
+ }
case LONG: {
rowAsm.appendLong(tup.longValue(col.name()));
break;
}
+ case FLOAT: {
+ rowAsm.appendFloat(tup.floatValue(col.name()));
+
+ break;
+ }
+ case DOUBLE: {
+ rowAsm.appendDouble(tup.doubleValue(col.name()));
+
+ break;
+ }
+ case UUID: {
+ rowAsm.appendUuid(tup.value(col.name()));
+
+ break;
+ }
+ case STRING: {
+ rowAsm.appendString(tup.stringValue(col.name()));
+ break;
+ }
+ case BYTES: {
+ rowAsm.appendBytes(tup.value(col.name()));
+
+ break;
+ }
+ case BITMASK: {
+ rowAsm.appendBitmask(tup.value(col.name()));
+
+ break;
+ }
default:
throw new IllegalStateException("Unexpected value: " +
col.type());
}
}
+ /**
+ * Reads object fields and gather statistic.
+ *
+ * @param cols Schema columns.
+ * @param tup Tuple.
+ * @return Object statistic.
+ */
+ private ObjectStatistic collectObjectStats(Columns cols, Tuple tup) {
+ if (tup == null || !cols.hasVarlengthColumns())
+ return new ObjectStatistic(0, 0);
+
+ int cnt = 0;
+ int size = 0;
+
+ for (int i = cols.firstVarlengthColumn(); i < cols.length(); i++) {
+ final Object val = tup.value(cols.column(i).name());
+
+ if (val == null || cols.column(i).type().spec().fixedLength())
+ continue;
+
+ size += getValueSize(val, cols.column(i).type());
+ cnt++;
+ }
+
+ return new ObjectStatistic(cnt, size);
+ }
+
+ /**
+ * Object statistic.
+ */
+ private static class ObjectStatistic {
+ /** Non-null fields of varlen type. */
+ int nonNullCols;
+
+ /** Length of all non-null fields of varlen types. */
+ int nonNullColsSize;
+
+ /** Constructor. */
+ ObjectStatistic(int nonNullCols, int nonNullColsSize) {
+ this.nonNullCols = nonNullCols;
+ this.nonNullColsSize = nonNullColsSize;
+ }
+ }
}
diff --git a/modules/table/src/test/java/org/apache/ignite/table/Example.java
b/modules/table/src/test/java/org/apache/ignite/internal/table/Example.java
similarity index 98%
rename from modules/table/src/test/java/org/apache/ignite/table/Example.java
rename to
modules/table/src/test/java/org/apache/ignite/internal/table/Example.java
index 242a185..d7f6feb 100644
--- a/modules/table/src/test/java/org/apache/ignite/table/Example.java
+++ b/modules/table/src/test/java/org/apache/ignite/internal/table/Example.java
@@ -15,15 +15,18 @@
* limitations under the License.
*/
-package org.apache.ignite.table;
+package org.apache.ignite.internal.table;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.binary.BinaryObjects;
-import org.apache.ignite.internal.table.TableImpl;
-import org.apache.ignite.table.impl.DummyInternalTableImpl;
+import org.apache.ignite.internal.table.impl.DummyInternalTableImpl;
+import org.apache.ignite.table.KeyValueView;
+import org.apache.ignite.table.RecordView;
+import org.apache.ignite.table.Table;
+import org.apache.ignite.table.Tuple;
import org.apache.ignite.table.mapper.Mappers;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.params.ParameterizedTest;
diff --git
a/modules/table/src/test/java/org/apache/ignite/table/KVViewOperationsTest.java
b/modules/table/src/test/java/org/apache/ignite/internal/table/KVViewOperationsTest.java
similarity index 98%
rename from
modules/table/src/test/java/org/apache/ignite/table/KVViewOperationsTest.java
rename to
modules/table/src/test/java/org/apache/ignite/internal/table/KVViewOperationsTest.java
index 33f1650..0c63515 100644
---
a/modules/table/src/test/java/org/apache/ignite/table/KVViewOperationsTest.java
+++
b/modules/table/src/test/java/org/apache/ignite/internal/table/KVViewOperationsTest.java
@@ -15,14 +15,15 @@
* limitations under the License.
*/
-package org.apache.ignite.table;
+package org.apache.ignite.internal.table;
import org.apache.ignite.internal.schema.Column;
import org.apache.ignite.internal.schema.NativeType;
import org.apache.ignite.internal.schema.SchemaDescriptor;
-import org.apache.ignite.internal.table.KVBinaryViewImpl;
-import org.apache.ignite.table.impl.DummyInternalTableImpl;
-import org.apache.ignite.table.impl.DummySchemaManagerImpl;
+import org.apache.ignite.internal.table.impl.DummyInternalTableImpl;
+import org.apache.ignite.internal.table.impl.DummySchemaManagerImpl;
+import org.apache.ignite.table.KeyValueBinaryView;
+import org.apache.ignite.table.Tuple;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git
a/modules/table/src/test/java/org/apache/ignite/table/TableBinaryViewOperationsTest.java
b/modules/table/src/test/java/org/apache/ignite/internal/table/TableBinaryViewOperationsTest.java
similarity index 97%
rename from
modules/table/src/test/java/org/apache/ignite/table/TableBinaryViewOperationsTest.java
rename to
modules/table/src/test/java/org/apache/ignite/internal/table/TableBinaryViewOperationsTest.java
index 6b011b0..9c38102 100644
---
a/modules/table/src/test/java/org/apache/ignite/table/TableBinaryViewOperationsTest.java
+++
b/modules/table/src/test/java/org/apache/ignite/internal/table/TableBinaryViewOperationsTest.java
@@ -15,14 +15,15 @@
* limitations under the License.
*/
-package org.apache.ignite.table;
+package org.apache.ignite.internal.table;
import org.apache.ignite.internal.schema.Column;
import org.apache.ignite.internal.schema.NativeType;
import org.apache.ignite.internal.schema.SchemaDescriptor;
-import org.apache.ignite.internal.table.TableImpl;
-import org.apache.ignite.table.impl.DummyInternalTableImpl;
-import org.apache.ignite.table.impl.DummySchemaManagerImpl;
+import org.apache.ignite.internal.table.impl.DummyInternalTableImpl;
+import org.apache.ignite.internal.table.impl.DummySchemaManagerImpl;
+import org.apache.ignite.table.Table;
+import org.apache.ignite.table.Tuple;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git
a/modules/table/src/test/java/org/apache/ignite/table/impl/DummyInternalTableImpl.java
b/modules/table/src/test/java/org/apache/ignite/internal/table/impl/DummyInternalTableImpl.java
similarity index 99%
rename from
modules/table/src/test/java/org/apache/ignite/table/impl/DummyInternalTableImpl.java
rename to
modules/table/src/test/java/org/apache/ignite/internal/table/impl/DummyInternalTableImpl.java
index 23d46c4..3821f26 100644
---
a/modules/table/src/test/java/org/apache/ignite/table/impl/DummyInternalTableImpl.java
+++
b/modules/table/src/test/java/org/apache/ignite/internal/table/impl/DummyInternalTableImpl.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.ignite.table.impl;
+package org.apache.ignite.internal.table.impl;
import java.util.Arrays;
import java.util.Collection;
diff --git
a/modules/table/src/test/java/org/apache/ignite/table/impl/DummySchemaManagerImpl.java
b/modules/table/src/test/java/org/apache/ignite/internal/table/impl/DummySchemaManagerImpl.java
similarity index 97%
rename from
modules/table/src/test/java/org/apache/ignite/table/impl/DummySchemaManagerImpl.java
rename to
modules/table/src/test/java/org/apache/ignite/internal/table/impl/DummySchemaManagerImpl.java
index 255c56d..3b015a3 100644
---
a/modules/table/src/test/java/org/apache/ignite/table/impl/DummySchemaManagerImpl.java
+++
b/modules/table/src/test/java/org/apache/ignite/internal/table/impl/DummySchemaManagerImpl.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.ignite.table.impl;
+package org.apache.ignite.internal.table.impl;
import org.apache.ignite.internal.schema.SchemaDescriptor;
import org.apache.ignite.internal.table.TableSchemaView;