Interface CacheLimitPolicy
-
- All Known Implementing Classes:
BundledCacheLimitPolicy
,SizeBasedCacheLimitPolicy
,SpaceBasedCacheLimitPolicy
public interface CacheLimitPolicy
Space checker.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
acquire(long toAddSize)
Acquire cache.boolean
isOverflow(long toAddSize)
Whether the cache usage is exceeded the upperbound.boolean
isSafeToAdd(long toAddSize)
Whether the cache usage is safe to add.void
release(long toReleaseSize)
Release cache.
-
-
-
Method Detail
-
isSafeToAdd
boolean isSafeToAdd(long toAddSize)
Whether the cache usage is safe to add.- Parameters:
toAddSize
-- Returns:
- false if the toAddSize is larger than max available capacity, true otherwise.
-
isOverflow
boolean isOverflow(long toAddSize)
Whether the cache usage is exceeded the upperbound.- Parameters:
toAddSize
-- Returns:
- true if the cache usage is overflow, false otherwise.
-
acquire
void acquire(long toAddSize)
Acquire cache.- Parameters:
toAddSize
-
-
release
void release(long toReleaseSize)
Release cache.- Parameters:
toReleaseSize
-
-
-