public static class WriterCacheManager.Default extends WriterCacheManager
WriterCacheManager
returns
RecordCache
instances for the string and template cache
and NodeCache
instance for the node cache.WriterCacheManager.Default, WriterCacheManager.Empty
DEFAULT_NODE_CACHE_SIZE, DEFAULT_STRING_CACHE_SIZE, DEFAULT_TEMPLATE_CACHE_SIZE
Constructor and Description |
---|
WriterCacheManager.Default()
New instance using the default factories
RecordCache.factory(int)
and PriorityCache.factory(int) with the sizes
WriterCacheManager.DEFAULT_STRING_CACHE_SIZE , WriterCacheManager.DEFAULT_TEMPLATE_CACHE_SIZE
and WriterCacheManager.DEFAULT_NODE_CACHE_SIZE . |
WriterCacheManager.Default(com.google.common.base.Supplier<RecordCache<String>> stringCacheFactory,
com.google.common.base.Supplier<RecordCache<Template>> templateCacheFactory,
com.google.common.base.Supplier<PriorityCache<String,RecordId>> nodeCacheFactory)
New instance using the passed factories for creating cache instances.
|
Modifier and Type | Method and Description |
---|---|
static <T> com.google.common.base.Supplier<Long> |
accumulateRecordCacheSizes(Iterable<RecordCache<T>> caches) |
static <T> com.google.common.base.Supplier<Long> |
accumulateRecordCacheWeights(Iterable<RecordCache<T>> caches) |
protected void |
evictCaches(com.google.common.base.Predicate<Integer> generations)
Remove all cache generations matching the passed
generations predicate. |
NodeCache |
getNodeCache(int generation) |
String |
getNodeCacheOccupancyInfo()
Get occupancy information for the node deduplication cache indicating occupancy and
evictions per priority.
|
org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean |
getNodeCacheStats() |
RecordCache<String> |
getStringCache(int generation) |
org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean |
getStringCacheStats() |
RecordCache<Template> |
getTemplateCache(int generation) |
org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean |
getTemplateCacheStats() |
public WriterCacheManager.Default(@Nonnull com.google.common.base.Supplier<RecordCache<String>> stringCacheFactory, @Nonnull com.google.common.base.Supplier<RecordCache<Template>> templateCacheFactory, @Nonnull com.google.common.base.Supplier<PriorityCache<String,RecordId>> nodeCacheFactory)
stringCacheFactory
- factory for the string cachetemplateCacheFactory
- factory for the template cachenodeCacheFactory
- factory for the node cachepublic WriterCacheManager.Default()
RecordCache.factory(int)
and PriorityCache.factory(int)
with the sizes
WriterCacheManager.DEFAULT_STRING_CACHE_SIZE
, WriterCacheManager.DEFAULT_TEMPLATE_CACHE_SIZE
and WriterCacheManager.DEFAULT_NODE_CACHE_SIZE
.@Nonnull public RecordCache<String> getStringCache(int generation)
getStringCache
in class WriterCacheManager
generation
.@Nonnull public RecordCache<Template> getTemplateCache(int generation)
getTemplateCache
in class WriterCacheManager
generation
.@Nonnull public NodeCache getNodeCache(int generation)
getNodeCache
in class WriterCacheManager
generation
.@CheckForNull public org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean getStringCacheStats()
getStringCacheStats
in class WriterCacheManager
null
if not available.@CheckForNull public org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean getTemplateCacheStats()
getTemplateCacheStats
in class WriterCacheManager
null
if not available.@Nonnull public static <T> com.google.common.base.Supplier<Long> accumulateRecordCacheSizes(Iterable<RecordCache<T>> caches)
@Nonnull public static <T> com.google.common.base.Supplier<Long> accumulateRecordCacheWeights(Iterable<RecordCache<T>> caches)
@CheckForNull public org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean getNodeCacheStats()
getNodeCacheStats
in class WriterCacheManager
null
if not available.public String getNodeCacheOccupancyInfo()
WriterCacheManager
getNodeCacheOccupancyInfo
in class WriterCacheManager
protected final void evictCaches(com.google.common.base.Predicate<Integer> generations)
generations
predicate.generations
- Copyright © 2012-2019 The Apache Software Foundation. All Rights Reserved.