Class SegmentNodeState

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

    public class SegmentNodeState
    extends 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).
    • 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 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 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 String name)
        Specified by:
        getProperty in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getProperties

        @NotNull
        public @NotNull 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 String name)
        Specified by:
        getBoolean in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getLong

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

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

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

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

        @NotNull
        public @NotNull Iterable<String> getNames​(@NotNull
                                                  @NotNull 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 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 String name)
        Specified by:
        getChildNode in interface org.apache.jackrabbit.oak.spi.state.NodeState
      • getChildNodeNames

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

        @NotNull
        public @NotNull 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​(Object object)
      • toString

        public 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