From 9682b2721c75fce1890df379adeb0639793c84ee Mon Sep 17 00:00:00 2001 From: Brian Harrington Date: Fri, 27 Sep 2024 17:08:13 -0500 Subject: [PATCH] core: make CacheValue helper class static Avoid reference to outer class. --- .../com/netflix/atlas/core/norm/NormalizationCache.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/atlas-core/src/main/scala/com/netflix/atlas/core/norm/NormalizationCache.scala b/atlas-core/src/main/scala/com/netflix/atlas/core/norm/NormalizationCache.scala index 92673a44d..ec216fdd0 100644 --- a/atlas-core/src/main/scala/com/netflix/atlas/core/norm/NormalizationCache.scala +++ b/atlas-core/src/main/scala/com/netflix/atlas/core/norm/NormalizationCache.scala @@ -21,6 +21,8 @@ import com.netflix.spectator.api.Clock class NormalizationCache(step: Long, updateF: UpdateFunction, clock: Clock = Clock.SYSTEM) { + import NormalizationCache.* + /** * For small step sizes use a fixed two minute heartbeat as reporting can be irregular, for * larger step size allow one sample to be missed. @@ -105,5 +107,9 @@ class NormalizationCache(step: Long, updateF: UpdateFunction, clock: Clock = Clo cacheValue.f(timestamp, value) } +} + +object NormalizationCache { + class CacheValue(var lastAccessTime: Long, val f: ValueFunction) }