public interface SegmentReader
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.
Modifier and Type | Method and Description |
---|---|
SegmentBlob |
readBlob(RecordId id)
Read the blob identified by
id . |
SegmentNodeState |
readHeadState(Revisions revisions)
Read the current head state based on the head of
revisions |
MapRecord |
readMap(RecordId id)
Read the map identified by
id . |
SegmentNodeState |
readNode(RecordId id)
Read the node identified by
id . |
SegmentPropertyState |
readProperty(RecordId id,
PropertyTemplate template)
Read the property identified by
id and template |
String |
readString(RecordId id)
Read the string identified by
id . |
Template |
readTemplate(RecordId id)
Read the template identified by
id . |
@Nonnull String readString(@Nonnull RecordId id)
id
.SegmentNotFoundException
- see class comment for exception semantics@Nonnull MapRecord readMap(@Nonnull RecordId id)
id
.SegmentNotFoundException
- see class comment for exception semantics@Nonnull Template readTemplate(@Nonnull RecordId id)
id
.SegmentNotFoundException
- see class comment for exception semantics@Nonnull SegmentNodeState readNode(@Nonnull RecordId id)
id
.SegmentNotFoundException
- see class comment for exception semantics@Nonnull SegmentNodeState readHeadState(@Nonnull Revisions revisions)
revisions
revisions
- SegmentNotFoundException
- see class comment for exception semantics@Nonnull SegmentPropertyState readProperty(@Nonnull RecordId id, @Nonnull PropertyTemplate template)
id
and template
SegmentNotFoundException
- see class comment for exception semantics@Nonnull SegmentBlob readBlob(@Nonnull RecordId id)
id
.SegmentNotFoundException
- see class comment for exception semanticsCopyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.