|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.egothor.cache.CachedRider
public class CachedRider
Represents a cache that stores pages of inverted lists for different barrels and terms.
Field Summary | |
---|---|
static int |
DEFAULT_PAGE_SIZE
Default maximum number of items an inverted list page should store. |
Constructor Summary | |
---|---|
CachedRider(Cache<CachedTerm,CachedIListPage> cache)
Constructor for the CachedRider object. |
|
CachedRider(Cache<CachedTerm,CachedIListPage> cache,
int pageSize)
Constructor for the CachedRider object. |
Method Summary | |
---|---|
boolean |
containsKey(CachedTerm term)
Checks whether the specified term is cached. |
CachedIListPage |
get(CachedTerm term)
Gets the inverted list page associated with the specified term from the cache if the term is cached, or the inverted list page returned by the resolver. |
Cache<CachedTerm,CachedIListPage> |
getCache()
Gets the actual cache used for storing inverted list pages. |
long |
getCachedPostings()
Returns the actual number of cached postings. |
long |
getPostings()
Returns the number of postings that the cached pages occupy. |
float |
hitRatio()
Returns the hits/requests ratio in percents. |
long |
hits()
Returns the number of all hits. |
long |
misses()
Returns the number of all misses. |
IListReader |
openIList(Barrel barrel,
java.lang.String term)
Gets a cached inverted list reader for the specified barrel and term. |
CachedIListPage |
put(CachedTerm term,
CachedIListPage page)
Adds a new inverted list page for the specified term to the cache. |
CachedIListPage |
remove(CachedTerm term)
Removes the specified term and its page from the cache. |
long |
requests()
Returns the number of all submitted requests. |
void |
resetCounters()
Sets hits and misses counters to zero. |
CachedIListPage |
resolve(CachedTerm term)
Return a new cached inverted list page of the specified term. |
int |
size()
Returns the number of cached inverted list pages. |
CachedIListPage |
update(CachedTerm term,
CachedIListPage page)
Updates the inverted list page associated with the specified term in the cache if a cached page exists for the term. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int DEFAULT_PAGE_SIZE
Constructor Detail |
---|
public CachedRider(Cache<CachedTerm,CachedIListPage> cache)
cache
- actual cache used for storing inverted list pagespublic CachedRider(Cache<CachedTerm,CachedIListPage> cache, int pageSize)
cache
- actual cache used for storing inverted list pagespageSize
- maximum size of an inverted list pageMethod Detail |
---|
public CachedIListPage resolve(CachedTerm term)
resolve
in interface Resolver<CachedTerm,CachedIListPage>
term
- term to create the inverted list page for
public CachedIListPage put(CachedTerm term, CachedIListPage page)
term
- term to add to the cachepage
- inverted list page to map the term to
public CachedIListPage get(CachedTerm term)
term
- term to get the result for
public CachedIListPage remove(CachedTerm term)
term
- term to remove from the cache.
public CachedIListPage update(CachedTerm term, CachedIListPage page)
term
- term to change the result forpage
- new inverted list page associated with the key
public boolean containsKey(CachedTerm term)
term
- term to check
public IListReader openIList(Barrel barrel, java.lang.String term)
barrel
- barrel to get the inverted list fromterm
- term owning the requested inverted list
public Cache<CachedTerm,CachedIListPage> getCache()
public long hits()
public long misses()
public float hitRatio()
public long requests()
public void resetCounters()
public int size()
public long getPostings()
public long getCachedPostings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |