public interface CacheUsage extends CacheUsageView
snapshot()
to obtain
an immutable view of the cache usage.Modifier and Type | Interface and Description |
---|---|
static class |
CacheUsage.DirPartition
Partition on a particular cache directory.
|
static class |
CacheUsage.FilePartition
Partition on a particular file.
|
static interface |
CacheUsage.PartitionDescriptor<T>
Partition descriptor.
|
static class |
CacheUsage.ScopePartition
Partition on a cache scope.
|
CacheUsageView.ImmutableCacheUsageView
Modifier and Type | Method and Description |
---|---|
Optional<CacheUsage> |
partitionedBy(CacheUsage.PartitionDescriptor<?> partition)
Gets a finer-grained view of cache usage.
|
default CacheUsageView |
snapshot()
Creates an immutable snapshot of the current cache usage.
|
available, capacity, used
default CacheUsageView snapshot()
Optional<CacheUsage> partitionedBy(CacheUsage.PartitionDescriptor<?> partition)
cacheManager.getUsage()
.flatMap(usage -> usage.partitionedBy(PartitionDescriptor.file(fileId))
.map(CacheUsage::used)
.orElse(0)
partition
- how to partition the cacheCopyright © 2023. All Rights Reserved.