Interface SegmentReader
- All Known Implementing Classes:
CachingSegmentReader
public interface SegmentReader
Instances of
SegmentReader
are responsible for reading records from segments.
Passing a record id that cannot be resolved to any of the read methods will eventually
result in a SegmentNotFoundException
. Implementations are however free to choose
to defer such an exception. For example by returning cached data or a thunk to a specific
record such that the exception is only thrown when actually accessing the returned record.
The behaviour of the read methods is implementation specific when passing a record id that does not match the type of the expected record.
-
Method Summary
Modifier and TypeMethodDescription@NotNull SegmentBlob
Read the blob identified byid
.@NotNull SegmentNodeState
readHeadState
(@NotNull Revisions revisions) Read the current head state based on the head ofrevisions
@NotNull MapRecord
Read the map identified byid
.@NotNull SegmentNodeState
Read the node identified byid
.@NotNull SegmentPropertyState
readProperty
(@NotNull RecordId id, @NotNull PropertyTemplate template) Read the property identified byid
andtemplate
@NotNull String
readString
(@NotNull RecordId id) Read the string identified byid
.@NotNull Template
readTemplate
(@NotNull RecordId id) Read the template identified byid
.
-
Method Details
-
readString
Read the string identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readMap
Read the map identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readTemplate
Read the template identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readNode
Read the node identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readHeadState
Read the current head state based on the head ofrevisions
- Parameters:
revisions
-- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readProperty
@NotNull @NotNull SegmentPropertyState readProperty(@NotNull @NotNull RecordId id, @NotNull @NotNull PropertyTemplate template) Read the property identified byid
andtemplate
- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readBlob
Read the blob identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-