Package ai.platon.pulsar.common.collect
Class ConcurrentUrlPool
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.collect.UrlPool
public class ConcurrentUrlPool extends AbstractUrlPool
The concurrent url pool
-
-
Field Summary
Fields Modifier and Type Field Description private final UrlCacherealTimeCacheprivate final Queue<DelayUrl>delayCacheprivate final ConcurrentSkipListMap<Integer, UrlCache>orderedCachesprivate final List<UrlCache>unorderedCachesprivate 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 ImmutableConfigconf
-
Constructor Summary
Constructors Constructor Description ConcurrentUrlPool(ImmutableConfig conf)
-
Method Summary
Modifier and Type Method Description UrlCachegetRealTimeCache()The real time url cache in which urls have the highest priority of all. Queue<DelayUrl>getDelayCache()An unbounded queue of Delayed urls, in which an element can only be taken when its delay has expired. ConcurrentSkipListMap<Integer, UrlCache>getOrderedCaches()The ordered url caches. List<UrlCache>getUnorderedCaches()The unordered url caches, tasks in unordered caches have the lowest priority. Unitinitialize()Initialize the url pool -
Methods inherited from class ai.platon.pulsar.common.collect.AbstractUrlPool
add, add, addAll, addAll, clear, getConf, getHigher2Cache, getHigher3Cache, getHigher4Cache, getHigher5Cache, getHigherCache, getHighestCache, getId, getLower2Cache, getLower3Cache, getLower4Cache, getLower5Cache, getLowerCache, getLowestCache, getNormalCache, getTotalCount, hasMore, removeDeceased -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ConcurrentUrlPool
ConcurrentUrlPool(ImmutableConfig conf)
-
-
Method Detail
-
getRealTimeCache
UrlCache getRealTimeCache()
The real time url cache in which urls have the highest priority of all.
-
getDelayCache
Queue<DelayUrl> getDelayCache()
An unbounded queue of Delayed urls, in which an element can only be taken when its delay has expired.
Delay cache has higher priority than all ordered caches and is usually used for retrying tasks.
-
getOrderedCaches
ConcurrentSkipListMap<Integer, UrlCache> getOrderedCaches()
The ordered url caches.
Ordered caches has higher priority than unordered caches.
-
getUnorderedCaches
List<UrlCache> getUnorderedCaches()
The unordered url caches, tasks in unordered caches have the lowest priority.
Unordered caches has the lowest priority of all
-
initialize
Unit initialize()
Initialize the url pool
-
-
-
-