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 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(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 String name)
@NotNull org.apache.jackrabbit.oak.spi.state.NodeState
getChildNode(@NotNull String name)
long
getChildNodeCount(long max)
@NotNull Iterable<? extends org.apache.jackrabbit.oak.spi.state.ChildNodeEntry>
getChildNodeEntries()
@NotNull Iterable<String>
getChildNodeNames()
@NotNull GCGeneration
getGcGeneration()
Get the underlying segment's gc generation.long
getLong(String name)
@Nullable String
getName(@NotNull String name)
@NotNull Iterable<String>
getNames(@NotNull String name)
@NotNull Iterable<org.apache.jackrabbit.oak.api.PropertyState>
getProperties()
@Nullable org.apache.jackrabbit.oak.api.PropertyState
getProperty(@NotNull 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.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 String
getString(String name)
@NotNull Iterable<String>
getStrings(@NotNull String name)
boolean
hasChildNode(@NotNull String name)
int
hashCode()
boolean
hasProperty(@NotNull String name)
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 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 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 String name)
- Specified by:
getProperty
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getProperties
@NotNull public @NotNull 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 String name)
- Specified by:
getBoolean
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getLong
public long getLong(String name)
- Specified by:
getLong
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getString
@Nullable public @Nullable String getString(String name)
- Specified by:
getString
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getStrings
@NotNull public @NotNull Iterable<String> getStrings(@NotNull @NotNull String name)
- Specified by:
getStrings
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getName
@Nullable public @Nullable String getName(@NotNull @NotNull String name)
- Specified by:
getName
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getNames
@NotNull public @NotNull Iterable<String> getNames(@NotNull @NotNull 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 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 String name)
- Specified by:
getChildNode
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getChildNodeNames
@NotNull public @NotNull Iterable<String> getChildNodeNames()
- Specified by:
getChildNodeNames
in interfaceorg.apache.jackrabbit.oak.spi.state.NodeState
-
getChildNodeEntries
@NotNull public @NotNull 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(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
-
-