You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/12/25 06:41:02 UTC

[GitHub] [iotdb] Cpaulyz opened a new pull request, #8605: [IOTDB-5277] SchemaRegion throws NPE when loading snapshot

Cpaulyz opened a new pull request, #8605:
URL: https://github.com/apache/iotdb/pull/8605

   ## Description
   
   This problem is caused by loading empty storage group snaptshot. 
   
   When the `childrenNum` of root node is 0, it still needs to be added into `ancestors` and processed by `inorderDeserialize`. Otherwise the root node returned would be null.
   
   ```
     private static IMNode inorderDeserialize(
         InputStream inputStream, Consumer<IMeasurementMNode> measurementProcess) throws IOException {
       MNodeDeserializer deserializer = new MNodeDeserializer();
       Deque<IMNode> ancestors = new ArrayDeque<>();
       Deque<Integer> restChildrenNum = new ArrayDeque<>();
       deserializeMNode(ancestors, restChildrenNum, deserializer, inputStream, measurementProcess);
       int childrenNum;
       IMNode root = ancestors.peek();
       while (!ancestors.isEmpty()) {
         childrenNum = restChildrenNum.pop();
         if (childrenNum == 0) {
           ancestors.pop();
         } else {
           restChildrenNum.push(childrenNum - 1);
           deserializeMNode(ancestors, restChildrenNum, deserializer, inputStream, measurementProcess);
         }
       }
       return root;
     }
   ```


-- 
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: reviews-unsubscribe@iotdb.apache.org

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


[GitHub] [iotdb] MarcosZyk merged pull request #8605: [IOTDB-5277] SchemaRegion throws NPE when loading snapshot

Posted by GitBox <gi...@apache.org>.
MarcosZyk merged PR #8605:
URL: https://github.com/apache/iotdb/pull/8605


-- 
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: reviews-unsubscribe@iotdb.apache.org

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