Interface CacheBucket
-
- All Known Implementing Classes:
StandardCacheBucket
public interface CacheBucket
A cache bucket holds data for a certain range. Actually, it specifies the parameters of a range, but the data may or may not be present, depending on whether or not it's "provisional".
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
calculateRelevency()
Tell the bucket to re-evaluate its relevency.boolean
eject()
Request that the bucket release its data and mark itself as invalid.Dataset
getData(TagHistoryQueryProvider backingProvider)
Returns the cached data, or goes to the store and retrieves it.long
getEndTime()
int
getMemorySize()
A rough estimation, in bytes, of the weight of this bucket.double
getRelevencyScore()
The score of how "important" this bucket is, so that it can be ranked against other buckets.long
getStartTime()
boolean
isValid()
Indicates that the bucket is still valid and hasn't been ejected.
-
-
-
Method Detail
-
isValid
boolean isValid()
Indicates that the bucket is still valid and hasn't been ejected. Ejected buckets can still return good data, but they shouldn't be used much and should be removed when possible.
-
getStartTime
long getStartTime()
-
getEndTime
long getEndTime()
-
getMemorySize
int getMemorySize()
A rough estimation, in bytes, of the weight of this bucket.
-
calculateRelevency
void calculateRelevency()
Tell the bucket to re-evaluate its relevency.
-
getRelevencyScore
double getRelevencyScore()
The score of how "important" this bucket is, so that it can be ranked against other buckets.
-
getData
Dataset getData(TagHistoryQueryProvider backingProvider) throws java.lang.Exception
Returns the cached data, or goes to the store and retrieves it.- Throws:
java.lang.Exception
-
eject
boolean eject()
Request that the bucket release its data and mark itself as invalid.
-
-