zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From enixon <...@git.apache.org>
Subject [GitHub] zookeeper pull request #619: ZOOKEEPER-3142: Extend SnapshotFormatter to dum...
Date Thu, 13 Sep 2018 23:09:21 GMT
Github user enixon commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/619#discussion_r217561012
  
    --- Diff: src/java/main/org/apache/zookeeper/server/SnapshotFormatter.java ---
    @@ -34,79 +36,133 @@
     import org.apache.yetus.audience.InterfaceAudience;
     import org.apache.zookeeper.data.StatPersisted;
     import org.apache.zookeeper.server.persistence.FileSnap;
    +import org.apache.zookeeper.server.persistence.Util;
    +import org.json.simple.JSONValue;
    +
    +import static org.apache.zookeeper.server.persistence.FileSnap.SNAPSHOT_FILE_PREFIX;
     
     /**
      * Dump a snapshot file to stdout.
    + *
    + * For JSON format, followed https://dev.yorhel.nl/ncdu/jsonfmt
      */
     @InterfaceAudience.Public
     public class SnapshotFormatter {
     
    +    private static Integer INODE_IDX = 1000;
    --- End diff --
    
    Per https://dev.yorhel.nl/ncdu/jsonfmt:
    
    "Inode number as reported by lstat().st_ino. Together with the Device ID this uniquely
identifies a file in this dump. In the case of hard links, two objects may appear with the
same (dev,ino) combination. A value of 0 is assumed if this field is absent. This is currently
(ncdu 1.9-1.13) not a problem as long as the hlnkc field is false, otherwise it will consider
everything with the same dev and empty ino values as a single hardlinked file. Accepted values
are in the range of 0 <= ino < 2^64."
    
    For us, it's just an arbitrary counter to mark each znode as a unique entity.


---

Mime
View raw message