Class CachingSegmentReader
java.lang.Object
org.apache.jackrabbit.oak.segment.CachingSegmentReader
- All Implemented Interfaces:
SegmentReader
This
SegmentReader
implementation implements caching for
strings and templates. It can also optionally rely on a BlobStore
for resolving blobs.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionCachingSegmentReader
(@NotNull Supplier<SegmentWriter> writer, @Nullable BlobStore blobStore, long stringCacheMB, long templateCacheMB, MeterStats readStats) Create a new instance based on the supplied arguments. -
Method Summary
Modifier and TypeMethodDescription@NotNull CacheStats
@NotNull CacheStats
@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) Cached reading of a string.@NotNull Template
readTemplate
(@NotNull RecordId id) Cached reading of a template.
-
Field Details
-
DEFAULT_STRING_CACHE_MB
public static final int DEFAULT_STRING_CACHE_MB- See Also:
-
DEFAULT_TEMPLATE_CACHE_MB
public static final int DEFAULT_TEMPLATE_CACHE_MB- See Also:
-
-
Constructor Details
-
CachingSegmentReader
public CachingSegmentReader(@NotNull @NotNull Supplier<SegmentWriter> writer, @Nullable @Nullable BlobStore blobStore, long stringCacheMB, long templateCacheMB, MeterStats readStats) Create a new instance based on the supplied arguments.- Parameters:
writer
- ASupplier
for a theSegmentWriter
used by the segment builders returned fromNodeState.builder()
to write ahead changes.writer.get()
must not returnnull
.blobStore
-BlobStore
instance of the underlyingSegmentStore
, ornull
if none.stringCacheMB
- the size of the string cache in MBs or0
for no cache.templateCacheMB
- the size of the template cache in MBs or0
for no cache.
-
-
Method Details
-
readString
Cached reading of a string.- Specified by:
readString
in interfaceSegmentReader
-
readMap
Description copied from interface:SegmentReader
Read the map identified byid
.- Specified by:
readMap
in interfaceSegmentReader
-
readTemplate
Cached reading of a template.- Specified by:
readTemplate
in interfaceSegmentReader
-
readNode
Description copied from interface:SegmentReader
Read the node identified byid
.- Specified by:
readNode
in interfaceSegmentReader
-
readHeadState
Description copied from interface:SegmentReader
Read the current head state based on the head ofrevisions
- Specified by:
readHeadState
in interfaceSegmentReader
-
readProperty
@NotNull public @NotNull SegmentPropertyState readProperty(@NotNull @NotNull RecordId id, @NotNull @NotNull PropertyTemplate template) Description copied from interface:SegmentReader
Read the property identified byid
andtemplate
- Specified by:
readProperty
in interfaceSegmentReader
-
readBlob
Description copied from interface:SegmentReader
Read the blob identified byid
.- Specified by:
readBlob
in interfaceSegmentReader
-
getStringCacheStats
-
getTemplateCacheStats
-