Class WriterCacheManager.Default
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.WriterCacheManager
-
- org.apache.jackrabbit.oak.segment.WriterCacheManager.Default
-
- Enclosing class:
- WriterCacheManager
public static class WriterCacheManager.Default extends WriterCacheManager
This implementation ofWriterCacheManagerreturnsRecordCacheinstances for the string and template cache andCacheinstance for the node cache.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.oak.segment.WriterCacheManager
WriterCacheManager.Default, WriterCacheManager.Empty
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.segment.WriterCacheManager
DEFAULT_NODE_CACHE_SIZE, DEFAULT_STRING_CACHE_SIZE, DEFAULT_TEMPLATE_CACHE_SIZE
-
-
Constructor Summary
Constructors Constructor Description Default()New instance using the default factoriesRecordCache.factory(int)andPriorityCache.factory(int)with the sizesWriterCacheManager.DEFAULT_STRING_CACHE_SIZE,WriterCacheManager.DEFAULT_TEMPLATE_CACHE_SIZEandWriterCacheManager.DEFAULT_NODE_CACHE_SIZE.Default(@NotNull Supplier<RecordCache<String>> stringCacheFactory, @NotNull Supplier<RecordCache<Template>> templateCacheFactory, @NotNull Supplier<PriorityCache<String,RecordId>> nodeCacheFactory)New instance using the passed factories for creating cache instances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> @NotNull Supplier<Long>accumulateRecordCacheSizes(Iterable<RecordCache<T>> caches)static <T> @NotNull Supplier<Long>accumulateRecordCacheWeights(Iterable<RecordCache<T>> caches)protected voidevictCaches(Predicate<Integer> generations)Remove all cache generations matching the passedgenerationspredicate.@NotNull Cache<String,RecordId>getNodeCache(int generation)@Nullable CacheStatsMBeangetNodeCacheStats()@NotNull Cache<String,RecordId>getStringCache(int generation)@Nullable CacheStatsMBeangetStringCacheStats()@NotNull Cache<Template,RecordId>getTemplateCache(int generation)@Nullable CacheStatsMBeangetTemplateCacheStats()-
Methods inherited from class org.apache.jackrabbit.oak.segment.WriterCacheManager
getNodeCacheOccupancyInfo, withAccessTracking
-
-
-
-
Constructor Detail
-
Default
public Default(@NotNull @NotNull Supplier<RecordCache<String>> stringCacheFactory, @NotNull @NotNull Supplier<RecordCache<Template>> templateCacheFactory, @NotNull @NotNull Supplier<PriorityCache<String,RecordId>> nodeCacheFactory)New instance using the passed factories for creating cache instances. The factories will be invoked exactly once when a generation of a cache is requested that has not been requested before.- Parameters:
stringCacheFactory- factory for the string cachetemplateCacheFactory- factory for the template cachenodeCacheFactory- factory for the node cache
-
Default
public Default()
New instance using the default factoriesRecordCache.factory(int)andPriorityCache.factory(int)with the sizesWriterCacheManager.DEFAULT_STRING_CACHE_SIZE,WriterCacheManager.DEFAULT_TEMPLATE_CACHE_SIZEandWriterCacheManager.DEFAULT_NODE_CACHE_SIZE.
-
-
Method Detail
-
getStringCache
@NotNull public @NotNull Cache<String,RecordId> getStringCache(int generation)
- Specified by:
getStringCachein classWriterCacheManager- Returns:
- cache for string records of the given
generationandoperation.
-
getTemplateCache
@NotNull public @NotNull Cache<Template,RecordId> getTemplateCache(int generation)
- Specified by:
getTemplateCachein classWriterCacheManager- Returns:
- cache for template records of the given
generationandoperation.
-
getNodeCache
@NotNull public @NotNull Cache<String,RecordId> getNodeCache(int generation)
- Specified by:
getNodeCachein classWriterCacheManager- Returns:
- cache for node records of the given
generationandoperation.
-
getStringCacheStats
@Nullable public @Nullable CacheStatsMBean getStringCacheStats()
- Overrides:
getStringCacheStatsin classWriterCacheManager- Returns:
- statistics for the string cache or
nullif not available.
-
getTemplateCacheStats
@Nullable public @Nullable CacheStatsMBean getTemplateCacheStats()
- Overrides:
getTemplateCacheStatsin classWriterCacheManager- Returns:
- statistics for the template cache or
nullif not available.
-
accumulateRecordCacheSizes
@NotNull public static <T> @NotNull Supplier<Long> accumulateRecordCacheSizes(Iterable<RecordCache<T>> caches)
-
accumulateRecordCacheWeights
@NotNull public static <T> @NotNull Supplier<Long> accumulateRecordCacheWeights(Iterable<RecordCache<T>> caches)
-
getNodeCacheStats
@Nullable public @Nullable CacheStatsMBean getNodeCacheStats()
- Overrides:
getNodeCacheStatsin classWriterCacheManager- Returns:
- statistics for the node cache or
nullif not available.
-
-