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(com.google.common.base.Supplier<SegmentWriter> writer,
org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore,
long stringCacheMB,
long templateCacheMB)
Create a new instance based on the supplied arguments.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.jackrabbit.oak.cache.CacheStats |
getStringCacheStats() |
org.apache.jackrabbit.oak.cache.CacheStats |
getTemplateCacheStats() |
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)
Cached reading of a string.
|
Template |
readTemplate(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(@Nonnull com.google.common.base.Supplier<SegmentWriter> writer, @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore, long stringCacheMB, long templateCacheMB)
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.@Nonnull public String readString(@Nonnull RecordId id)
readString in interface SegmentReader@Nonnull public MapRecord readMap(@Nonnull RecordId id)
SegmentReaderid.readMap in interface SegmentReader@Nonnull public Template readTemplate(@Nonnull RecordId id)
readTemplate in interface SegmentReader@Nonnull public SegmentNodeState readNode(@Nonnull RecordId id)
SegmentReaderid.readNode in interface SegmentReader@Nonnull public SegmentNodeState readHeadState(@Nonnull Revisions revisions)
SegmentReaderrevisionsreadHeadState in interface SegmentReader@Nonnull public SegmentPropertyState readProperty(@Nonnull RecordId id, @Nonnull PropertyTemplate template)
SegmentReaderid and templatereadProperty in interface SegmentReader@Nonnull public SegmentBlob readBlob(@Nonnull RecordId id)
SegmentReaderid.readBlob in interface SegmentReader@Nonnull public org.apache.jackrabbit.oak.cache.CacheStats getStringCacheStats()
@Nonnull public org.apache.jackrabbit.oak.cache.CacheStats getTemplateCacheStats()
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.