public class CachingSegmentReader extends Object implements SegmentReader
SegmentReader
implementation implements caching for
strings and templates. It can also optionally rely on a BlobStore
for resolving blobs.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_STRING_CACHE_MB |
static int |
DEFAULT_TEMPLATE_CACHE_MB |
Constructor and Description |
---|
CachingSegmentReader(@NotNull Supplier<SegmentWriter> writer,
@Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore,
long stringCacheMB,
long templateCacheMB,
org.apache.jackrabbit.oak.stats.MeterStats readStats)
Create a new instance based on the supplied arguments.
|
Modifier and Type | Method and Description |
---|---|
@NotNull org.apache.jackrabbit.oak.cache.CacheStats |
getStringCacheStats() |
@NotNull org.apache.jackrabbit.oak.cache.CacheStats |
getTemplateCacheStats() |
@NotNull SegmentBlob |
readBlob(@NotNull RecordId id)
Read the blob identified by
id . |
@NotNull SegmentNodeState |
readHeadState(@NotNull Revisions revisions)
Read the current head state based on the head of
revisions |
@NotNull MapRecord |
readMap(@NotNull RecordId id)
Read the map identified by
id . |
@NotNull SegmentNodeState |
readNode(@NotNull RecordId id)
Read the node identified by
id . |
@NotNull SegmentPropertyState |
readProperty(@NotNull RecordId id,
@NotNull PropertyTemplate template)
Read the property identified by
id and template |
@NotNull String |
readString(@NotNull RecordId id)
Cached reading of a string.
|
@NotNull Template |
readTemplate(@NotNull RecordId id)
Cached reading of a template.
|
public static final int DEFAULT_STRING_CACHE_MB
public static final int DEFAULT_TEMPLATE_CACHE_MB
public CachingSegmentReader(@NotNull @NotNull Supplier<SegmentWriter> writer, @Nullable @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore, long stringCacheMB, long templateCacheMB, org.apache.jackrabbit.oak.stats.MeterStats readStats)
writer
- A Supplier
for a the SegmentWriter
used by the segment
builders returned from NodeState.builder()
to write ahead changes.
writer.get()
must not return null
.blobStore
- BlobStore
instance of the underlying SegmentStore
, or
null
if none.stringCacheMB
- the size of the string cache in MBs or 0
for no cache.templateCacheMB
- the size of the template cache in MBs or 0
for no cache.@NotNull public @NotNull String readString(@NotNull @NotNull RecordId id)
readString
in interface SegmentReader
@NotNull public @NotNull MapRecord readMap(@NotNull @NotNull RecordId id)
SegmentReader
id
.readMap
in interface SegmentReader
@NotNull public @NotNull Template readTemplate(@NotNull @NotNull RecordId id)
readTemplate
in interface SegmentReader
@NotNull public @NotNull SegmentNodeState readNode(@NotNull @NotNull RecordId id)
SegmentReader
id
.readNode
in interface SegmentReader
@NotNull public @NotNull SegmentNodeState readHeadState(@NotNull @NotNull Revisions revisions)
SegmentReader
revisions
readHeadState
in interface SegmentReader
@NotNull public @NotNull SegmentPropertyState readProperty(@NotNull @NotNull RecordId id, @NotNull @NotNull PropertyTemplate template)
SegmentReader
id
and template
readProperty
in interface SegmentReader
@NotNull public @NotNull SegmentBlob readBlob(@NotNull @NotNull RecordId id)
SegmentReader
id
.readBlob
in interface SegmentReader
@NotNull public @NotNull org.apache.jackrabbit.oak.cache.CacheStats getStringCacheStats()
@NotNull public @NotNull org.apache.jackrabbit.oak.cache.CacheStats getTemplateCacheStats()
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.