public static class WriterCacheManager.Default extends WriterCacheManager
WriterCacheManager
returns
RecordCache
instances for the string and template cache
and Cache
instance for the node cache.WriterCacheManager.Default, WriterCacheManager.Empty
DEFAULT_NODE_CACHE_SIZE, DEFAULT_STRING_CACHE_SIZE, DEFAULT_TEMPLATE_CACHE_SIZE
Constructor and Description |
---|
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 . |
Default(@NotNull Supplier<RecordCache<java.lang.String>> stringCacheFactory,
@NotNull Supplier<RecordCache<Template>> templateCacheFactory,
@NotNull Supplier<PriorityCache<java.lang.String,RecordId>> nodeCacheFactory)
New instance using the passed factories for creating cache instances.
|
Modifier and Type | Method and Description |
---|---|
static <T> @NotNull Supplier<java.lang.Long> |
accumulateRecordCacheSizes(java.lang.Iterable<RecordCache<T>> caches) |
static <T> @NotNull Supplier<java.lang.Long> |
accumulateRecordCacheWeights(java.lang.Iterable<RecordCache<T>> caches) |
protected void |
evictCaches(Predicate<java.lang.Integer> generations)
Remove all cache generations matching the passed
generations predicate. |
@NotNull Cache<java.lang.String,RecordId> |
getNodeCache(int generation) |
@Nullable CacheStatsMBean |
getNodeCacheStats() |
@NotNull Cache<java.lang.String,RecordId> |
getStringCache(int generation) |
@Nullable CacheStatsMBean |
getStringCacheStats() |
@NotNull Cache<Template,RecordId> |
getTemplateCache(int generation) |
@Nullable CacheStatsMBean |
getTemplateCacheStats() |
getNodeCacheOccupancyInfo, withAccessTracking
public Default(@NotNull @NotNull Supplier<RecordCache<java.lang.String>> stringCacheFactory, @NotNull @NotNull Supplier<RecordCache<Template>> templateCacheFactory, @NotNull @NotNull Supplier<PriorityCache<java.lang.String,RecordId>> nodeCacheFactory)
stringCacheFactory
- factory for the string cachetemplateCacheFactory
- factory for the template cachenodeCacheFactory
- factory for the node cachepublic 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
.@NotNull public @NotNull Cache<java.lang.String,RecordId> getStringCache(int generation)
getStringCache
in class WriterCacheManager
generation
and operation
.@NotNull public @NotNull Cache<Template,RecordId> getTemplateCache(int generation)
getTemplateCache
in class WriterCacheManager
generation
and operation
.@NotNull public @NotNull Cache<java.lang.String,RecordId> getNodeCache(int generation)
getNodeCache
in class WriterCacheManager
generation
and operation
.@Nullable public @Nullable CacheStatsMBean getStringCacheStats()
getStringCacheStats
in class WriterCacheManager
null
if not available.@Nullable public @Nullable CacheStatsMBean getTemplateCacheStats()
getTemplateCacheStats
in class WriterCacheManager
null
if not available.@NotNull public static <T> @NotNull Supplier<java.lang.Long> accumulateRecordCacheSizes(java.lang.Iterable<RecordCache<T>> caches)
@NotNull public static <T> @NotNull Supplier<java.lang.Long> accumulateRecordCacheWeights(java.lang.Iterable<RecordCache<T>> caches)
@Nullable public @Nullable CacheStatsMBean getNodeCacheStats()
getNodeCacheStats
in class WriterCacheManager
null
if not available.protected final void evictCaches(Predicate<java.lang.Integer> generations)
generations
predicate.generations
- Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.