Interface SegmentReader
-
- All Known Implementing Classes:
CachingSegmentReader
public interface SegmentReaderInstances ofSegmentReaderare 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 SegmentBlobreadBlob(@NotNull RecordId id)Read the blob identified byid.@NotNull SegmentNodeStatereadHeadState(@NotNull Revisions revisions)Read the current head state based on the head ofrevisions@NotNull MapRecordreadMap(@NotNull RecordId id)Read the map identified byid.@NotNull SegmentNodeStatereadNode(@NotNull RecordId id)Read the node identified byid.@NotNull SegmentPropertyStatereadProperty(@NotNull RecordId id, @NotNull PropertyTemplate template)Read the property identified byidandtemplate@NotNull StringreadString(@NotNull RecordId id)Read the string identified byid.@NotNull TemplatereadTemplate(@NotNull RecordId id)Read the template identified byid.
-
-
-
Method Detail
-
readString
@NotNull @NotNull 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 byidandtemplate- 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
-
-