Class UrlCacheCollector
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.collect.collector.DataCollector,ai.platon.pulsar.common.collect.collector.PriorityDataCollector,kotlin.Comparable
public class UrlCacheCollector extends AbstractPriorityDataCollector<UrlAware>
-
-
Field Summary
Fields Modifier and Type Field Description private Stringnameprivate final Integersizeprivate final IntegerexternalSizeprivate final IntegerestimatedExternalSizeprivate final IntegerestimatedSizeprivate final UrlCacheurlCacheprivate final Integercapacityprivate final Integerpriorityprivate final Integeridprivate final Set<String>labelsprivate Stringlangprivate Stringcountryprivate Stringdistrictprivate IntegercollectCountprivate IntegercollectedCountprivate final InstantcreateTimeprivate InstantfirstCollectTimeprivate InstantlastCollectedTimeprivate InstantdeadTimeprivate final DurationcollectTimeprivate final BooleanisDead
-
Constructor Summary
Constructors Constructor Description UrlCacheCollector(UrlCache urlCache)
-
Method Summary
Modifier and Type Method Description StringgetName()The collector name UnitsetName(String name)The collector name IntegergetSize()IntegergetExternalSize()IntegergetEstimatedExternalSize()IntegergetEstimatedSize()final UrlCachegetUrlCache()BooleanhasMore()If the fetch cache is a LoadingurlCache, the items can be both in memory or in external source, so even if all queues are empty, hasMore can return true IntegercollectTo(List<UrlAware> sink)Collect an element to the sink List<String>dump()Dump the collector Unitclear()Clear the collector UnitdeepClear()Clear the collector both from the local cache and the external source -
Methods inherited from class ai.platon.pulsar.common.collect.collector.AbstractPriorityDataCollector
getCapacity, getPriority, toString -
Methods inherited from class ai.platon.pulsar.common.collect.collector.AbstractDataCollector
collectTo, collectTo, collectTo, getCollectCount, getCollectTime, getCollectedCount, getCountry, getCreateTime, getDeadTime, getDistrict, getFirstCollectTime, getId, getLabels, getLang, getLastCollectedTime, setCollectCount, setCollectedCount, setCountry, setDeadTime, setDistrict, setFirstCollectTime, setLang, setLastCollectedTime -
Methods inherited from class ai.platon.pulsar.common.collect.collector.DataCollector
isDead -
Methods inherited from class ai.platon.pulsar.common.collect.collector.PriorityDataCollector
compareTo -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
UrlCacheCollector
UrlCacheCollector(UrlCache urlCache)
-
-
Method Detail
-
getExternalSize
Integer getExternalSize()
-
getEstimatedExternalSize
Integer getEstimatedExternalSize()
-
getEstimatedSize
Integer getEstimatedSize()
-
getUrlCache
final UrlCache getUrlCache()
-
hasMore
@Synchronized() Boolean hasMore()
If the fetch cache is a LoadingurlCache, the items can be both in memory or in external source, so even if all queues are empty, hasMore can return true
-
collectTo
@Synchronized() Integer collectTo(List<UrlAware> sink)
Collect an element to the sink
-
dump
@Synchronized() List<String> dump()
Dump the collector
-
clear
@Synchronized() Unit clear()
Clear the collector
-
deepClear
@Synchronized() Unit deepClear()
Clear the collector both from the local cache and the external source
-
-
-
-