You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/04/20 15:18:51 UTC

[GitHub] [ignite-3] AMashenkov opened a new pull request #100: IGNITE-14557: Improve row layout.

AMashenkov opened a new pull request #100:
URL: https://github.com/apache/ignite-3/pull/100


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] korlov42 commented on a change in pull request #100: IGNITE-14557: Improve row layout.

Posted by GitBox <gi...@apache.org>.
korlov42 commented on a change in pull request #100:
URL: https://github.com/apache/ignite-3/pull/100#discussion_r626619542



##########
File path: modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
##########
@@ -470,25 +470,28 @@ int fixlenColumnOffset(Columns cols, int baseOff, int idx) {
 
         off += cols.foldFixedLength(nullMapIdx, readByte(nullMapOff + nullMapIdx) | mask);
 
-        return nullMapOff + cols.nullMapSize() + off;
+        final int vartableOffset = vartableOffset(baseOff, cols);

Review comment:
       ```suggestion
           final int vartableSizeOffset = vartableOffset(baseOff, cols);
   ```

##########
File path: modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
##########
@@ -470,25 +470,28 @@ int fixlenColumnOffset(Columns cols, int baseOff, int idx) {
 
         off += cols.foldFixedLength(nullMapIdx, readByte(nullMapOff + nullMapIdx) | mask);
 
-        return nullMapOff + cols.nullMapSize() + off;
+        final int vartableOffset = vartableOffset(baseOff, cols);
+
+        int vartableLen = VARLEN_TABLE_SIZE_FIELD_SIZE + readShort(vartableOffset) * VARLEN_COLUMN_OFFSET_FIELD_SIZE;
+
+        return vartableOffset + vartableLen + off;
     }
 
     /**
      * @param baseOff Chunk base offset.
      * @return Null map offset from the row start for the chunk with the given base.
      */
     private int nullMapOffset(int baseOff) {
-        int varlenTblSize = readShort(baseOff + TOTAL_LEN_FIELD_SIZE);
-
-        return vartableOffset(baseOff) + varlenTblSize * VARLEN_COLUMN_OFFSET_FIELD_SIZE;
+        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 vartableOffset(int baseOff) {
-        return baseOff + TOTAL_LEN_FIELD_SIZE + VARLEN_TABLE_SIZE_FIELD_SIZE;
+    private int vartableOffset(int baseOff, Columns cols) {

Review comment:
       seems it's offset to the size of the vartable now

##########
File path: modules/schema/src/test/java/org/apache/ignite/internal/schema/RowAssemblerTest.java
##########
@@ -0,0 +1,630 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.schema;
+
+import java.util.Arrays;
+import java.util.UUID;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.ignite.internal.schema.NativeType.BYTE;
+import static org.apache.ignite.internal.schema.NativeType.BYTES;
+import static org.apache.ignite.internal.schema.NativeType.INTEGER;
+import static org.apache.ignite.internal.schema.NativeType.SHORT;
+import static org.apache.ignite.internal.schema.NativeType.STRING;
+import static org.apache.ignite.internal.schema.NativeType.UUID;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+
+/**
+ * Validate row layout for different schema configurations.
+ */
+public class RowAssemblerTest {
+    /** Uuid test value. */
+    public final java.util.UUID uuidVal = new UUID(-5204230847775358097L, 4916207022290092939L);
+
+    @Test
+    public void testFixedKeyFixedNullableValue() {

Review comment:
       please provide a description for an every test in this class




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite-3] AMashenkov merged pull request #100: IGNITE-14557: Improve row layout.

Posted by GitBox <gi...@apache.org>.
AMashenkov merged pull request #100:
URL: https://github.com/apache/ignite-3/pull/100


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org