Github user PepperJo commented on a diff in the pull request:

    https://github.com/apache/incubator-crail/pull/6#discussion_r170299288
  
    --- Diff: namenode/src/main/java/org/apache/crail/namenode/TableBlocks.java 
---
    @@ -34,6 +35,10 @@ public AbstractNode putChild(AbstractNode child) throws 
Exception {
                        throw new Exception("Attempt to create key/value pair 
in container other than a table");
                }
                
    -           return children.put(child.getComponent(), child);
    +           AbstractNode oldNode = children.put(child.getComponent(), 
child);
    +           if (child.isEnumerable()) {
    +                   
child.setDirOffset(dirOffsetCounter.getAndAdd(CrailConstants.DIRECTORY_RECORD));
    --- End diff --
    
    Can we have a setDirOffset method in DirectoryBlocks that takes the child 
as an argument and sets the dir offset accordingly, e.g. something like:
    ```
    void setChildDirOffset(AbstractNode child) {
    if (child.isEnumerable()) {
        
child.setDirOffset(dirOffsetCounter.getAndAdd(CrailConstants.DIRECTORY_RECORD));
    }
    }
    ```


---

Reply via email to