Class SegmentNodeState
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.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).
-
-
Constructor Summary
Constructors Constructor Description SegmentNodeState(@NotNull SegmentReader reader, @NotNull SegmentWriter writer, @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore, @NotNull RecordId id)
SegmentNodeState(@NotNull SegmentReader reader, @NotNull SegmentWriter writer, @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore, @NotNull RecordId id, org.apache.jackrabbit.oak.stats.MeterStats readStats)
-
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 twoNodeState
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()
-
-
-
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 interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getPropertyCount
public long getPropertyCount()
- Specified by:
getPropertyCount
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
hasProperty
public boolean hasProperty(@NotNull @NotNull java.lang.String name)
- Specified by:
hasProperty
in interfaceorg.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 interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getProperties
@NotNull public @NotNull java.lang.Iterable<org.apache.jackrabbit.oak.api.PropertyState> getProperties()
- Specified by:
getProperties
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getBoolean
public boolean getBoolean(@NotNull @NotNull java.lang.String name)
- Specified by:
getBoolean
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getLong
public long getLong(java.lang.String name)
- Specified by:
getLong
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getString
@Nullable public @Nullable java.lang.String getString(java.lang.String name)
- Specified by:
getString
in interfaceorg.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 interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getName
@Nullable public @Nullable java.lang.String getName(@NotNull @NotNull java.lang.String name)
- Specified by:
getName
in interfaceorg.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 interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getChildNodeCount
public long getChildNodeCount(long max)
- Specified by:
getChildNodeCount
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
hasChildNode
public boolean hasChildNode(@NotNull @NotNull java.lang.String name)
- Specified by:
hasChildNode
in interfaceorg.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 interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getChildNodeNames
@NotNull public @NotNull java.lang.Iterable<java.lang.String> getChildNodeNames()
- Specified by:
getChildNodeNames
in interfaceorg.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 interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
builder
@NotNull public @NotNull SegmentNodeBuilder builder()
- Specified by:
builder
in interfaceorg.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 interfaceorg.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 twoNodeState
instances are equal to each other. A return value oftrue
clearly means that the instances are equal, while a return value offalse
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 firstNodeState
instanceb
- the secondNodeState
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
-
-