Package com.google.gerrit.server.cache
Class PerThreadProjectCache
java.lang.Object
com.google.gerrit.server.cache.PerThreadProjectCache
To prevent OOM errors on requests that would cache a lot of objects, this class enforces an
internal limit after which no new elements are cached. All
computeIfAbsentWithinLimit
calls are served by invoking the Supplier
after that.-
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
computeIfAbsentWithinLimit
(PerThreadCache.Key<Project.NameKey> key, Supplier<T> loader) static <T> T
getOrCompute
(PerThreadCache.Key<Project.NameKey> key, Supplier<T> loader)
-
Method Details
-
getOrCompute
@CanIgnoreReturnValue public static <T> T getOrCompute(PerThreadCache.Key<Project.NameKey> key, Supplier<T> loader) -
computeIfAbsentWithinLimit
protected <T> T computeIfAbsentWithinLimit(PerThreadCache.Key<Project.NameKey> key, Supplier<T> loader)
-