Berkof commented on a change in pull request #409:
URL: https://github.com/apache/ignite-3/pull/409#discussion_r738117092



##########
File path: 
modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java
##########
@@ -169,26 +170,21 @@ int vartableEntryOffset(int idx) {
          * Creates chunk format.
          */
         TinyFormat() {
-            super(Byte.BYTES, Byte.BYTES, (byte)1);
+            super(Byte.BYTES, (byte)1);

Review comment:
       MAGIC_NUMBERS (flags)

##########
File path: 
modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java
##########
@@ -208,7 +204,7 @@ int vartableEntryOffset(int idx) {
          * Creates chunk format.
          */
         MediumFormat() {
-            super(Short.BYTES, Short.BYTES, (byte)2);
+            super(Short.BYTES, (byte)2);

Review comment:
       MAGIC_NUMBER (flags)

##########
File path: 
modules/schema/src/main/java/org/apache/ignite/internal/schema/row/VarTableFormat.java
##########
@@ -169,26 +170,21 @@ int vartableEntryOffset(int idx) {
          * Creates chunk format.
          */
         TinyFormat() {
-            super(Byte.BYTES, Byte.BYTES, (byte)1);
+            super(Byte.BYTES, (byte)1);
         }
 
         /** {@inheritDoc} */
         @Override int readVarlenOffset(BinaryRow row, int vartblOff, int 
entryIdx) {
             return Byte.toUnsignedInt(row.readByte(vartblOff + 
vartableEntryOffset(entryIdx)));
         }
 
-        /** {@inheritDoc} */
-        @Override int readVartableSize(BinaryRow row, int vartblOff) {
-            return Byte.toUnsignedInt(row.readByte(vartblOff));
-        }
-
         /** {@inheritDoc} */
         @Override public int compactVarTable(ExpandableByteBuf buf, int 
vartblOff, int entres) {
-            assert entres > 0;
+            assert entres > 0 && entres < 0xFFFF;
 
-            buf.put(vartblOff, (byte)entres);
+            buf.putShort(vartblOff, (short)entres);
 
-            int dstOff = vartblOff + 1;
+            int dstOff = vartblOff + 2;

Review comment:
       MAGIC_NUMBERS




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to