Package com.google.gerrit.server.cache
Class PerThreadProjectCache
- java.lang.Object
-
- com.google.gerrit.server.cache.PerThreadProjectCache
-
public class PerThreadProjectCache extends Object
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. AllcomputeIfAbsentWithinLimit
calls are served by invoking theSupplier
after that.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> T
computeIfAbsentWithinLimit(PerThreadCache.Key<Project.NameKey> key, Supplier<T> loader)
static <T> T
getOrCompute(PerThreadCache.Key<Project.NameKey> key, Supplier<T> loader)
-
-
-
Method Detail
-
getOrCompute
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)
-
-