Class CachingSegmentReader

  • All Implemented Interfaces:
    SegmentReader

    public class CachingSegmentReader
    extends Object
    implements SegmentReader
    This SegmentReader implementation implements caching for strings and templates. It can also optionally rely on a BlobStore for resolving blobs.
    • Field Detail

      • DEFAULT_STRING_CACHE_MB

        public static final int DEFAULT_STRING_CACHE_MB
        See Also:
        Constant Field Values
      • DEFAULT_TEMPLATE_CACHE_MB

        public static final int DEFAULT_TEMPLATE_CACHE_MB
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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 - 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.