Package one.microstream.reference
Interface Lazy.Checker
- All Known Implementing Classes:
Lazy.Checker.Default
,LazyReferenceManager.Clearer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface Lazy.Checker
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Lazy.Checker.Default
This implementation uses two dimensions to evaluate if a lazy reference will be cleared:
- time: a ref's "age" in terms ofLazy.lastTouched()
compared toSystem.currentTimeMillis()
- memory: the amount of used memory compared to the permitted quota of total available memory.static interface
Lazy.Checker.Defaults
-
Method Summary
Modifier and Type Method Description default void
beginCheckCycle()
boolean
check(Lazy<?> lazyReference)
default void
endCheckCycle()
static boolean
isValidMemoryQuota(double memoryQuota)
static boolean
isValidTimeout(long millisecondTimeout)
static double
validateMemoryQuota(double memoryQuota)
static long
validateTimeout(long millisecondTimeout)
-
Method Details
-
beginCheckCycle
default void beginCheckCycle() -
check
- Parameters:
lazyReference
- the lazy reference to check against- Returns:
- if additional checks should be prevented
-
endCheckCycle
default void endCheckCycle() -
isValidTimeout
static boolean isValidTimeout(long millisecondTimeout) -
isValidMemoryQuota
static boolean isValidMemoryQuota(double memoryQuota) -
validateTimeout
static long validateTimeout(long millisecondTimeout) -
validateMemoryQuota
static double validateMemoryQuota(double memoryQuota)
-