Class AbstractLoadingQueue
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.collect.Loadable,ai.platon.pulsar.common.collect.queue.LoadingQueue,java.util.Queue,kotlin.collections.Collection,kotlin.collections.Iterable,kotlin.collections.MutableCollection,kotlin.collections.MutableIterable
public abstract class AbstractLoadingQueue extends AbstractQueue<UrlAware> implements LoadingQueue<UrlAware>
An url queue should be small since every url uses about 1s to fetch
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegerloadCountprivate final IntegersavedCountprivate final Collection<UrlAware>cacheprivate final Integersizeprivate final IntegerexternalSizeprivate final IntegerestimatedExternalSizeprivate final IntegerestimatedSizeprivate final IntegerfreeSlotsprivate final BooleanisFullprivate final ExternalUrlLoaderloaderprivate final UrlTopictopicprivate final Function1<UrlAware, UrlAware>transformer
-
Constructor Summary
Constructors Constructor Description AbstractLoadingQueue(ExternalUrlLoader loader, UrlTopic topic, Function1<UrlAware, UrlAware> transformer)
-
Method Summary
Modifier and Type Method Description final IntegergetLoadCount()final IntegergetSavedCount()final Collection<UrlAware>getCache()IntegergetSize()IntegergetExternalSize()IntegergetEstimatedExternalSize()IntegergetEstimatedSize()final IntegergetFreeSlots()final BooleanisFull()final ExternalUrlLoadergetLoader()final UrlTopicgetTopic()final Function1<UrlAware, UrlAware>getTransformer()Unitclear()UnitdeepClear()final UnitexternalClear()Unitload()Collection<UrlAware>loadNow()Unitshuffle()Booleanadd(UrlAware url)BooleanaddAll(Collection<UrlAware> urls)Booleanoffer(UrlAware url)BooleanremoveIf(Predicate<in UrlAware> filter)Iterator<UrlAware>iterator()UrlAwarepeek()UrlAwarepoll()Unitoverflow(UrlAware url)Unitoverflow(List<UrlAware> urls)-
Methods inherited from class java.util.AbstractQueue
element, remove -
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString -
Methods inherited from class kotlin.collections.Iterable
forEach -
Methods inherited from class kotlin.collections.Collection
parallelStream, spliterator, stream, toArray -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AbstractLoadingQueue
AbstractLoadingQueue(ExternalUrlLoader loader, UrlTopic topic, Function1<UrlAware, UrlAware> transformer)
-
-
Method Detail
-
getLoadCount
final Integer getLoadCount()
-
getSavedCount
final Integer getSavedCount()
-
getCache
final Collection<UrlAware> getCache()
-
getSize
@Synchronized() Integer getSize()
-
getExternalSize
@Synchronized() Integer getExternalSize()
-
getEstimatedExternalSize
@Synchronized() Integer getEstimatedExternalSize()
-
getEstimatedSize
@Synchronized() Integer getEstimatedSize()
-
getFreeSlots
@Synchronized() final Integer getFreeSlots()
-
isFull
@Synchronized() final Boolean isFull()
-
getLoader
final ExternalUrlLoader getLoader()
-
getTransformer
final Function1<UrlAware, UrlAware> getTransformer()
-
clear
@Synchronized() Unit clear()
-
deepClear
@Synchronized() Unit deepClear()
-
externalClear
@Synchronized() final Unit externalClear()
-
load
@Synchronized() Unit load()
-
loadNow
@Synchronized() Collection<UrlAware> loadNow()
-
shuffle
@Synchronized() Unit shuffle()
-
add
@Synchronized() Boolean add(UrlAware url)
-
addAll
@Synchronized() Boolean addAll(Collection<UrlAware> urls)
-
offer
@Synchronized() Boolean offer(UrlAware url)
-
removeIf
@Synchronized() Boolean removeIf(Predicate<in UrlAware> filter)
-
iterator
@Synchronized() Iterator<UrlAware> iterator()
-
peek
@Synchronized() UrlAware peek()
-
poll
@Synchronized() UrlAware poll()
-
overflow
@Synchronized() Unit overflow(UrlAware url)
-
overflow
@Synchronized() Unit overflow(List<UrlAware> urls)
-
-
-
-