Enum RecordType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<RecordType>

    public enum RecordType
    extends java.lang.Enum<RecordType>
    The type of a record in a segment.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BLOB_ID
      A reference to an external binary object.
      BLOCK
      A block of bytes (a binary value, or a part of a binary value, or part of large strings).
      BRANCH
      A branch of a map (which is a HAMT tree).
      BUCKET
      A bucket (a list of references).
      LEAF
      A leaf of a map (which is a HAMT tree).
      LIST
      A list including the size (an int).
      NODE
      A JCR node, which contains a list of record ids: the record id of the template depending on the template, the record id of the map of the ids of the child node name(s) and child node record id(s), or if there is just one child node, the child node record id the record ids of the property values (for multi-valued property a pointer to the list record)
      TEMPLATE
      A template (the "hidden class" of a node; inspired by the Chrome V8 Javascript engine).
      VALUE
      A value (for example a string, or a long, or a blob).
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static RecordType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static RecordType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LEAF

        public static final RecordType LEAF
        A leaf of a map (which is a HAMT tree). This contains
        • the size (int)
        • for each entry, the hash code of the key (4 bytes), then the record id of the key and the record id of the value
      • BRANCH

        public static final RecordType BRANCH
        A branch of a map (which is a HAMT tree). This contains
        • level within the HAMT structure (4 most significant bits), plus size of the that branch of the map
        • bitmap (4 bytes)
        • record ids of the buckets of the next level of the map
        There is a special case: if the first int (level/size) is -1, then it's a diff record, to handle the common case of when exactly one existing child node was modified. This is common because whenever one node was changed, we need to propagate that up to the root.
        • -1 (int)
        • hash code of the key that was changed (4 bytes)
        • the record id of the key
        • the record id of the value
        • the record id of the (base version of the) modified map
        There is only ever one single diff record for a map.
      • BUCKET

        public static final RecordType BUCKET
        A bucket (a list of references). It always includes at least 2 elements, up to 255 entries (because each entry could in theory point to a different segment, in which case this couldn't be stored in a segment). This contains just the record ids. The size of the list is not stored, as it is stored along with the reference to this record.
      • LIST

        public static final RecordType LIST
        A list including the size (an int). This could be 0, in which case there is no reference. If the size is 1, then reference points to the value of the list. If the size is larger, then a record id follows, which points to a bucket with the actual record ids. If there are more than 255 entries in the list, then the list is partitioned into sub-lists of 255 entries each, which are stored kind of recursively.
      • VALUE

        public static final RecordType VALUE
        A value (for example a string, or a long, or a blob). The format is: length (variable length encoding, one byte if shorter than 128, else more bytes), then the data as a byte array, or, for large values, a record id of the top level bucket that contains the list of block record ids of the actual binary data.

        Therefore, a value can reference other records.

      • BLOCK

        public static final RecordType BLOCK
        A block of bytes (a binary value, or a part of a binary value, or part of large strings). It only contains the raw data.
      • TEMPLATE

        public static final RecordType TEMPLATE
        A template (the "hidden class" of a node; inspired by the Chrome V8 Javascript engine). This includes a list of property templates. Format:
        • head (int), which is: 1 bit (most significant one) whether the node has a single valued jcr:primaryType property. 1 bit whether it has mixins, in which case 10 bits (27 to 18) are used for the number of mixins. 1 bit whether the node has no child nodes. 1 bit whether the node has more than one child nodes. 18 bits (0 to 17) the number of properties (0 to 262143).
        • The record ids of: if needed, record id of the primary type (a value), record ids of the mixin names (value records), for single child node: the name of the child node
        • The list of record ids of property names (which are stored before the template in separate value records), and the property type (negative values for multi-value properties).
      • NODE

        public static final RecordType NODE
        A JCR node, which contains a list of record ids:
        • the record id of the template
        • depending on the template, the record id of the map of the ids of the child node name(s) and child node record id(s), or if there is just one child node, the child node record id
        • the record ids of the property values (for multi-valued property a pointer to the list record)
      • BLOB_ID

        public static final RecordType BLOB_ID
        A reference to an external binary object.
    • Method Detail

      • values

        public static RecordType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (RecordType c : RecordType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RecordType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null