public abstract class WriterCacheManager
extends java.lang.Object
SegmentWriter
to avoid writing multiple copies of the same record. The
caches are striped into generations with one generation per gc cycle. This
avoids records old generations being reused.Modifier and Type | Class and Description |
---|---|
static class |
WriterCacheManager.Default
This implementation of
WriterCacheManager returns
RecordCache instances for the string and template cache
and Cache instance for the node cache. |
static class |
WriterCacheManager.Empty
This implementation of
WriterCacheManager returns empty caches
of size 0. |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NODE_CACHE_SIZE
Default size of the node deduplication cache.
|
static int |
DEFAULT_STRING_CACHE_SIZE
Default size of the string cache.
|
static int |
DEFAULT_TEMPLATE_CACHE_SIZE
Default size of the template cache.
|
Constructor and Description |
---|
WriterCacheManager() |
Modifier and Type | Method and Description |
---|---|
abstract @NotNull Cache<java.lang.String,RecordId> |
getNodeCache(int generation) |
@Nullable java.lang.String |
getNodeCacheOccupancyInfo()
Get occupancy information for the node deduplication cache indicating occupancy and
evictions per priority.
|
@Nullable CacheStatsMBean |
getNodeCacheStats() |
abstract @NotNull Cache<java.lang.String,RecordId> |
getStringCache(int generation) |
@Nullable CacheStatsMBean |
getStringCacheStats() |
abstract @NotNull Cache<Template,RecordId> |
getTemplateCache(int generation) |
@Nullable CacheStatsMBean |
getTemplateCacheStats() |
@NotNull WriterCacheManager |
withAccessTracking(@NotNull java.lang.String name,
@NotNull StatisticsProvider statisticsProvider)
Enable access statistics for this cache.
|
public static final int DEFAULT_STRING_CACHE_SIZE
getStringCache(int)
public static final int DEFAULT_TEMPLATE_CACHE_SIZE
getTemplateCache(int)
public static final int DEFAULT_NODE_CACHE_SIZE
getNodeCache(int)
@NotNull public abstract @NotNull Cache<java.lang.String,RecordId> getStringCache(int generation)
generation
and operation
.@NotNull public abstract @NotNull Cache<Template,RecordId> getTemplateCache(int generation)
generation
- generation
and operation
.@NotNull public abstract @NotNull Cache<java.lang.String,RecordId> getNodeCache(int generation)
generation
and operation
.@NotNull public @NotNull WriterCacheManager withAccessTracking(@NotNull @NotNull java.lang.String name, @NotNull @NotNull StatisticsProvider statisticsProvider)
statisticsProvider
.name
- statisticsProvider
- @Nullable public @Nullable CacheStatsMBean getStringCacheStats()
null
if not available.@Nullable public @Nullable CacheStatsMBean getTemplateCacheStats()
null
if not available.@Nullable public @Nullable CacheStatsMBean getNodeCacheStats()
null
if not available.@Nullable public @Nullable java.lang.String getNodeCacheOccupancyInfo()
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.