-
public class GlobalCacheThe global cache
-
-
Field Summary
Fields Modifier and Type Field Description private UrlPoolurlPoolprivate final FetchingCachefetchingCacheprivate final ConcurrentExpiringLRUCache<String, WebPage>pageCacheprivate final ConcurrentExpiringLRUCache<String, FeaturedDocument>documentCacheprivate final ImmutableConfigconf
-
Constructor Summary
Constructors Constructor Description GlobalCache(ImmutableConfig conf)
-
Method Summary
Modifier and Type Method Description UrlPoolgetUrlPool()The url pool, hold on queues of urls to fetch UnitsetUrlPool(UrlPool urlPool)The url pool, hold on queues of urls to fetch FetchingCachegetFetchingCache()The fetching cache, an url is added to the cache before fetching and removed from it after fetching ConcurrentExpiringLRUCache<String, WebPage>getPageCache()The global page cache, a page will be removed if it's expired or the cache is full ConcurrentExpiringLRUCache<String, FeaturedDocument>getDocumentCache()The global document cache, a document will be removed if it's expired or the cache is full final ImmutableConfiggetConf()final UnitresetCaches()final UnitclearCaches()final UnitputPDCache(WebPage page, FeaturedDocument document)Put page and document to cache final UnitremovePDCache(String url)Remove item from page cache and document cache -
-
Method Detail
-
getUrlPool
UrlPool getUrlPool()
The url pool, hold on queues of urls to fetch
-
setUrlPool
Unit setUrlPool(UrlPool urlPool)
The url pool, hold on queues of urls to fetch
-
getFetchingCache
FetchingCache getFetchingCache()
The fetching cache, an url is added to the cache before fetching and removed from it after fetching
-
getPageCache
ConcurrentExpiringLRUCache<String, WebPage> getPageCache()
The global page cache, a page will be removed if it's expired or the cache is full
-
getDocumentCache
ConcurrentExpiringLRUCache<String, FeaturedDocument> getDocumentCache()
The global document cache, a document will be removed if it's expired or the cache is full
-
getConf
final ImmutableConfig getConf()
-
resetCaches
final Unit resetCaches()
-
clearCaches
final Unit clearCaches()
-
putPDCache
final Unit putPDCache(WebPage page, FeaturedDocument document)
Put page and document to cache
-
removePDCache
final Unit removePDCache(String url)
Remove item from page cache and document cache
-
-
-
-