Interface SegmentReader
-
- All Known Implementing Classes:
CachingSegmentReader
public interface SegmentReader
Instances ofSegmentReader
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull SegmentBlob
readBlob(@NotNull RecordId id)
Read the blob identified byid
.@NotNull SegmentNodeState
readHeadState(@NotNull Revisions revisions)
Read the current head state based on the head ofrevisions
@NotNull MapRecord
readMap(@NotNull RecordId id)
Read the map identified byid
.@NotNull SegmentNodeState
readNode(@NotNull RecordId id)
Read the node identified byid
.@NotNull SegmentPropertyState
readProperty(@NotNull RecordId id, @NotNull PropertyTemplate template)
Read the property identified byid
andtemplate
@NotNull java.lang.String
readString(@NotNull RecordId id)
Read the string identified byid
.@NotNull Template
readTemplate(@NotNull RecordId id)
Read the template identified byid
.
-
-
-
Method Detail
-
readString
@NotNull @NotNull java.lang.String readString(@NotNull @NotNull RecordId id)
Read the string identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readMap
@NotNull @NotNull MapRecord readMap(@NotNull @NotNull RecordId id)
Read the map identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readTemplate
@NotNull @NotNull Template readTemplate(@NotNull @NotNull RecordId id)
Read the template identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readNode
@NotNull @NotNull SegmentNodeState readNode(@NotNull @NotNull RecordId id)
Read the node identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
readHeadState
@NotNull @NotNull SegmentNodeState readHeadState(@NotNull @NotNull Revisions revisions)
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
@NotNull @NotNull SegmentBlob readBlob(@NotNull @NotNull RecordId id)
Read the blob identified byid
.- Throws:
SegmentNotFoundException
- see class comment for exception semantics
-
-