Class AbstractUrlPool
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.collect.UrlPool
public abstract class AbstractUrlPool implements UrlPool
The abstract url pool
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringidprivate final IntegertotalCountprivate final UrlCachelowestCacheprivate final UrlCachelower5Cacheprivate final UrlCachelower4Cacheprivate final UrlCachelower3Cacheprivate final UrlCachelower2Cacheprivate final UrlCachelowerCacheprivate final UrlCachenormalCacheprivate final UrlCachehigherCacheprivate final UrlCachehigher2Cacheprivate final UrlCachehigher3Cacheprivate final UrlCachehigher4Cacheprivate final UrlCachehigher5Cacheprivate final UrlCachehighestCacheprivate final ImmutableConfigconfprivate final UrlCacherealTimeCacheprivate final Queue<DelayUrl>delayCacheprivate final Map<Integer, UrlCache>orderedCachesprivate final List<UrlCache>unorderedCaches
-
Constructor Summary
Constructors Constructor Description AbstractUrlPool(ImmutableConfig conf)
-
Method Summary
Modifier and Type Method Description StringgetId()IntegergetTotalCount()Total number of items in all url caches. UrlCachegetLowestCache()A shortcut to the cache with the lowest priority in the ordered caches UrlCachegetLower5Cache()A shortcut to the cache that is 5 priority lower than the normal cache in the ordered caches. UrlCachegetLower4Cache()A shortcut to the cache that is 4 priority lower than the normal cache in the ordered caches. UrlCachegetLower3Cache()A shortcut to the cache that is 3 priority lower than the normal cache in the ordered caches. UrlCachegetLower2Cache()A shortcut to the cache that is 2 priority lower than the normal cache in the ordered caches. UrlCachegetLowerCache()A shortcut to the cache that is 1 priority lower than the normal cache in the ordered caches. UrlCachegetNormalCache()A shortcut to the cache has the default priority in the ordered caches. UrlCachegetHigherCache()A shortcut to the cache that is 1 priority higher than the normal cache in the ordered caches. UrlCachegetHigher2Cache()A shortcut to the cache that is 2 priority higher than the normal cache in the ordered caches. UrlCachegetHigher3Cache()A shortcut to the cache that is 3 priority higher than the normal cache in the ordered caches. UrlCachegetHigher4Cache()A shortcut to the cache that is 4 priority higher than the normal cache in the ordered caches. UrlCachegetHigher5Cache()A shortcut to the cache that is 5 priority higher than the normal cache in the ordered caches. UrlCachegetHighestCache()A shortcut to the cache with the highest priority in the ordered caches. final ImmutableConfiggetConf()Booleanadd(String url, Priority13 priority)Add a url to the pool Booleanadd(UrlAware url)Add a url to the pool BooleanaddAll(Iterable<String> urls, Priority13 priority)Add urls to the pool BooleanaddAll(Iterable<UrlAware> urls)Add urls to the pool UnitremoveDeceased()Remove deceased urls, such as URLs that are past the deadline. Unitclear()Clear the pool BooleanhasMore()Check if there is more items in the url pool -
-
Constructor Detail
-
AbstractUrlPool
AbstractUrlPool(ImmutableConfig conf)
-
-
Method Detail
-
getTotalCount
Integer getTotalCount()
Total number of items in all url caches.
-
getLowestCache
UrlCache getLowestCache()
A shortcut to the cache with the lowest priority in the ordered caches
-
getLower5Cache
UrlCache getLower5Cache()
A shortcut to the cache that is 5 priority lower than the normal cache in the ordered caches.
-
getLower4Cache
UrlCache getLower4Cache()
A shortcut to the cache that is 4 priority lower than the normal cache in the ordered caches.
-
getLower3Cache
UrlCache getLower3Cache()
A shortcut to the cache that is 3 priority lower than the normal cache in the ordered caches.
-
getLower2Cache
UrlCache getLower2Cache()
A shortcut to the cache that is 2 priority lower than the normal cache in the ordered caches.
-
getLowerCache
UrlCache getLowerCache()
A shortcut to the cache that is 1 priority lower than the normal cache in the ordered caches.
-
getNormalCache
UrlCache getNormalCache()
A shortcut to the cache has the default priority in the ordered caches.
-
getHigherCache
UrlCache getHigherCache()
A shortcut to the cache that is 1 priority higher than the normal cache in the ordered caches.
-
getHigher2Cache
UrlCache getHigher2Cache()
A shortcut to the cache that is 2 priority higher than the normal cache in the ordered caches.
-
getHigher3Cache
UrlCache getHigher3Cache()
A shortcut to the cache that is 3 priority higher than the normal cache in the ordered caches.
-
getHigher4Cache
UrlCache getHigher4Cache()
A shortcut to the cache that is 4 priority higher than the normal cache in the ordered caches.
-
getHigher5Cache
UrlCache getHigher5Cache()
A shortcut to the cache that is 5 priority higher than the normal cache in the ordered caches.
-
getHighestCache
UrlCache getHighestCache()
A shortcut to the cache with the highest priority in the ordered caches.
-
getConf
final ImmutableConfig getConf()
-
add
Boolean add(String url, Priority13 priority)
Add a url to the pool
-
addAll
Boolean addAll(Iterable<String> urls, Priority13 priority)
Add urls to the pool
-
removeDeceased
Unit removeDeceased()
Remove deceased urls, such as URLs that are past the deadline.
-
-
-
-