Class WriterCacheManager
java.lang.Object
org.apache.jackrabbit.oak.segment.WriterCacheManager
- Direct Known Subclasses:
- WriterCacheManager.Default,- WriterCacheManager.Empty
Instances of this class manage the deduplication caches used by the 
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.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classThis implementation ofWriterCacheManagerreturnsRecordCacheinstances for the string and template cache andCacheinstance for the node cache.static classThis implementation ofWriterCacheManagerreturns empty caches of size 0.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefault size of the node deduplication cache.static final intDefault size of the string cache.static final intDefault size of the template cache.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetNodeCache(int generation) @Nullable StringGet occupancy information for the node deduplication cache indicating occupancy and evictions per priority.@Nullable CacheStatsMBeangetStringCache(int generation) @Nullable CacheStatsMBeangetTemplateCache(int generation) @Nullable CacheStatsMBean@NotNull WriterCacheManagerwithAccessTracking(@NotNull String name, @NotNull StatisticsProvider statisticsProvider) Enable access statistics for this cache.
- 
Field Details- 
DEFAULT_STRING_CACHE_SIZEpublic static final int DEFAULT_STRING_CACHE_SIZEDefault size of the string cache.- See Also:
 
- 
DEFAULT_TEMPLATE_CACHE_SIZEpublic static final int DEFAULT_TEMPLATE_CACHE_SIZEDefault size of the template cache.- See Also:
 
- 
DEFAULT_NODE_CACHE_SIZEpublic static final int DEFAULT_NODE_CACHE_SIZEDefault size of the node deduplication cache.- See Also:
 
 
- 
- 
Constructor Details- 
WriterCacheManagerpublic WriterCacheManager()
 
- 
- 
Method Details- 
getStringCache- Returns:
- cache for string records of the given generationandoperation.
 
- 
getTemplateCache- Parameters:
- generation-
- Returns:
- cache for template records of the given generationandoperation.
 
- 
getNodeCache- Returns:
- cache for node records of the given generationandoperation.
 
- 
withAccessTracking@NotNull public @NotNull WriterCacheManager withAccessTracking(@NotNull @NotNull String name, @NotNull @NotNull StatisticsProvider statisticsProvider) Enable access statistics for this cache. The instance returned by from this method delegates back to this instance and adds access statistics via the passedstatisticsProvider.- Parameters:
- name-
- statisticsProvider-
- Returns:
- an instance of this cache with access statistics enabled.
 
- 
getStringCacheStats- Returns:
- statistics for the string cache or nullif not available.
 
- 
getTemplateCacheStats- Returns:
- statistics for the template cache or nullif not available.
 
- 
getNodeCacheStats- Returns:
- statistics for the node cache or nullif not available.
 
- 
getNodeCacheOccupancyInfoGet occupancy information for the node deduplication cache indicating occupancy and evictions per priority.- Returns:
- occupancy information for the node deduplication cache.
 
 
-