Class SegmentNodeState

  • All Implemented Interfaces:
    org.apache.jackrabbit.oak.spi.state.NodeState

    public class SegmentNodeState
    extends java.lang.Object
    implements org.apache.jackrabbit.oak.spi.state.NodeState
    A record of type "NODE". This class can read a node record from a segment. It currently doesn't cache data (but the template is fully loaded).
    • Field Summary

      • Fields inherited from interface org.apache.jackrabbit.oak.spi.state.NodeState

        EXISTS
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull SegmentNodeBuilder builder()  
      boolean compareAgainstBaseState​(org.apache.jackrabbit.oak.spi.state.NodeState base, org.apache.jackrabbit.oak.spi.state.NodeStateDiff diff)  
      boolean equals​(java.lang.Object object)  
      boolean exists()  
      static boolean fastEquals​(org.apache.jackrabbit.oak.spi.state.NodeState a, org.apache.jackrabbit.oak.spi.state.NodeState b)
      Indicates whether two NodeState instances are equal to each other.
      boolean getBoolean​(@NotNull java.lang.String name)  
      @NotNull org.apache.jackrabbit.oak.spi.state.NodeState getChildNode​(@NotNull java.lang.String name)  
      long getChildNodeCount​(long max)  
      @NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry> getChildNodeEntries()  
      @NotNull java.lang.Iterable<java.lang.String> getChildNodeNames()  
      @NotNull GCGeneration getGcGeneration()
      Get the underlying segment's gc generation.
      long getLong​(java.lang.String name)  
      @Nullable java.lang.String getName​(@NotNull java.lang.String name)  
      @NotNull java.lang.Iterable<java.lang.String> getNames​(@NotNull java.lang.String name)  
      @NotNull java.lang.Iterable<org.apache.jackrabbit.oak.api.PropertyState> getProperties()  
      @Nullable org.apache.jackrabbit.oak.api.PropertyState getProperty​(@NotNull java.lang.String name)  
      long getPropertyCount()  
      RecordId getRecordId()
      Returns the identifier of this record.
      protected int getRecordNumber()  
      protected Segment getSegment()
      Returns the segment that contains this record.
      java.lang.String getStableId()
      Returns the stable id of this node.
      org.apache.jackrabbit.oak.commons.Buffer getStableIdBytes()
      Returns the stable ID of this node, non parsed.
      @Nullable java.lang.String getString​(java.lang.String name)  
      @NotNull java.lang.Iterable<java.lang.String> getStrings​(@NotNull java.lang.String name)  
      boolean hasChildNode​(@NotNull java.lang.String name)  
      int hashCode()  
      boolean hasProperty​(@NotNull java.lang.String name)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SegmentNodeState

        public SegmentNodeState​(@NotNull
                                @NotNull SegmentReader reader,
                                @NotNull
                                @NotNull SegmentWriter writer,
                                @Nullable
                                @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore,
                                @NotNull
                                @NotNull RecordId id)
      • SegmentNodeState

        public SegmentNodeState​(@NotNull
                                @NotNull SegmentReader reader,
                                @NotNull
                                @NotNull SegmentWriter writer,
                                @Nullable
                                @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore,
                                @NotNull
                                @NotNull RecordId id,
                                org.apache.jackrabbit.oak.stats.MeterStats readStats)
    • Method Detail

      • getStableId

        public java.lang.String getStableId()
        Returns the stable id of this node. In contrast to the node's record id (which is technically the node's address) the stable id doesn't change after an online gc cycle. It might though change after an offline gc cycle.
        Returns:
        stable id
      • getStableIdBytes

        public org.apache.jackrabbit.oak.commons.Buffer getStableIdBytes()
        Returns the stable ID of this node, non parsed. In contrast to the node's record id (which is technically the node's address) the stable id doesn't change after an online gc cycle. It might though change after an offline gc cycle.
        Returns:
        the stable ID of this node.
      • exists

        public boolean exists()
        Specified by:
        exists in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getPropertyCount

        public long getPropertyCount()
        Specified by:
        getPropertyCount in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • hasProperty

        public boolean hasProperty​(@NotNull
                                   @NotNull java.lang.String name)
        Specified by:
        hasProperty in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getProperty

        @Nullable
        public @Nullable org.apache.jackrabbit.oak.api.PropertyState getProperty​(@NotNull
                                                                                 @NotNull java.lang.String name)
        Specified by:
        getProperty in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getProperties

        @NotNull
        public @NotNull java.lang.Iterable<org.apache.jackrabbit.oak.api.PropertyState> getProperties()
        Specified by:
        getProperties in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getBoolean

        public boolean getBoolean​(@NotNull
                                  @NotNull java.lang.String name)
        Specified by:
        getBoolean in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getLong

        public long getLong​(java.lang.String name)
        Specified by:
        getLong in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getString

        @Nullable
        public @Nullable java.lang.String getString​(java.lang.String name)
        Specified by:
        getString in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getStrings

        @NotNull
        public @NotNull java.lang.Iterable<java.lang.String> getStrings​(@NotNull
                                                                        @NotNull java.lang.String name)
        Specified by:
        getStrings in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getName

        @Nullable
        public @Nullable java.lang.String getName​(@NotNull
                                                  @NotNull java.lang.String name)
        Specified by:
        getName in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getNames

        @NotNull
        public @NotNull java.lang.Iterable<java.lang.String> getNames​(@NotNull
                                                                      @NotNull java.lang.String name)
        Specified by:
        getNames in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getChildNodeCount

        public long getChildNodeCount​(long max)
        Specified by:
        getChildNodeCount in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • hasChildNode

        public boolean hasChildNode​(@NotNull
                                    @NotNull java.lang.String name)
        Specified by:
        hasChildNode in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getChildNode

        @NotNull
        public @NotNull org.apache.jackrabbit.oak.spi.state.NodeState getChildNode​(@NotNull
                                                                                   @NotNull java.lang.String name)
        Specified by:
        getChildNode in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getChildNodeNames

        @NotNull
        public @NotNull java.lang.Iterable<java.lang.String> getChildNodeNames()
        Specified by:
        getChildNodeNames in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getChildNodeEntries

        @NotNull
        public @NotNull java.lang.Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry> getChildNodeEntries()
        Specified by:
        getChildNodeEntries in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • builder

        @NotNull
        public @NotNull SegmentNodeBuilder builder()
        Specified by:
        builder in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • compareAgainstBaseState

        public boolean compareAgainstBaseState​(org.apache.jackrabbit.oak.spi.state.NodeState base,
                                               org.apache.jackrabbit.oak.spi.state.NodeStateDiff diff)
        Specified by:
        compareAgainstBaseState in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • fastEquals

        public static boolean fastEquals​(org.apache.jackrabbit.oak.spi.state.NodeState a,
                                         org.apache.jackrabbit.oak.spi.state.NodeState b)
        Indicates whether two NodeState instances are equal to each other. A return value of true clearly means that the instances are equal, while a return value of false doesn't necessarily mean the instances are not equal. These "false negatives" are an implementation detail and callers cannot rely on them being stable.
        Parameters:
        a - the first NodeState instance
        b - the second NodeState instance
        Returns:
        true, if these two instances are equal.
      • hashCode

        public int hashCode()
      • equals

        public boolean equals​(java.lang.Object object)
      • toString

        public java.lang.String toString()
      • getSegment

        protected Segment getSegment()
        Returns the segment that contains this record.
        Returns:
        segment that contains this record
      • getRecordNumber

        protected int getRecordNumber()
      • getRecordId

        public RecordId getRecordId()
        Returns the identifier of this record.
        Returns:
        record identifier
      • getGcGeneration

        @NotNull
        public @NotNull GCGeneration getGcGeneration()
        Get the underlying segment's gc generation. Might cause the segment to get loaded if the generation info is missing
        Returns:
        the segment's gc generation