Package ai.platon.pulsar.crawl.impl
Class StreamingCrawler
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.event.EventEmitter,ai.platon.pulsar.crawl.Crawler,java.lang.AutoCloseable
public class StreamingCrawler extends AbstractCrawler
-
-
Field Summary
Fields Modifier and Type Field Description private final IntegernumPrivacyContextsprivate final IntegernumMaxActiveTabsprivate final IntegerfetchConcurrencyprivate final Integerconcurrencyprivate final DurationoutOfWorkTimeoutprivate final DurationfetchTaskTimeoutprivate final DurationidleTimeprivate final BooleanisOutOfWorkprivate final BooleanisSmartRetryEnabledprivate final BooleanisIdleprivate final BooleanisActiveprivate StringjobNameprivate Sequence<UrlAware>urlsprivate final BooleannoProxyprivate final Integeridprivate final Stringnameprivate Function2<Integer, UrlAware, Duration>retryDelayPolicyprivate final PulsarSessionsessionprivate final BooleanautoCloseprivate Function1<Throwable, Unit>eventExceptionHandlerprivate final Map<CrawlEvents, List<Function<Object>>>listeners
-
Constructor Summary
Constructors Constructor Description StreamingCrawler(Sequence<UrlAware> urls, PulsarSession session, Boolean noProxy, Boolean autoClose)
-
Method Summary
Modifier and Type Method Description final IntegergetNumPrivacyContexts()final IntegergetNumMaxActiveTabs()final IntegergetFetchConcurrency()final IntegergetConcurrency()final DurationgetOutOfWorkTimeout()The out of work timeout. final DurationgetFetchTaskTimeout()final DurationgetIdleTime()final BooleanisOutOfWork()final BooleanisSmartRetryEnabled()final BooleanisIdle()BooleanisActive()final StringgetJobName()The job name. final UnitsetJobName(String jobName)The job name. final Sequence<UrlAware>getUrls()The url sequence final UnitsetUrls(Sequence<UrlAware> urls)The url sequence final BooleangetNoProxy()Do not use proxy Unitrun()Run the crawler. Unitrun(CoroutineScope scope)Run the crawler in the given coroutine scope. Unitawait()Wait until all tasks are done. final Unitquit()Quit the crawl loop. Unitclose()Quit and close the crawl loop. -
Methods inherited from class ai.platon.pulsar.crawl.impl.AbstractCrawler
getAutoClose, getId, getName, getRetryDelayPolicy, getSession, onLoad, onLoaded, onWillLoad, pause, resume, setRetryDelayPolicy -
Methods inherited from class ai.platon.pulsar.common.event.AbstractEventEmitter
count, emit, emit, emit, emit, emit1, emit1, emit1, emit1, getEventExceptionHandler, getListeners, hasListeners, listeners, listeners, off, off, off, off, off, off1, off1, off1, off1, off1, on, on, on, on, on1, on1, on1, on1, once, once, once, once1, once1, once1, setEventExceptionHandler -
Methods inherited from class ai.platon.pulsar.common.event.EventEmitter
hasNormalListeners, hasSuspendListeners, normalListeners, normalListeners, suspendListeners, suspendListeners -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
StreamingCrawler
StreamingCrawler(Sequence<UrlAware> urls, PulsarSession session, Boolean noProxy, Boolean autoClose)
-
-
Method Detail
-
getNumPrivacyContexts
final Integer getNumPrivacyContexts()
-
getNumMaxActiveTabs
final Integer getNumMaxActiveTabs()
-
getFetchConcurrency
final Integer getFetchConcurrency()
-
getConcurrency
final Integer getConcurrency()
-
getOutOfWorkTimeout
final Duration getOutOfWorkTimeout()
The out of work timeout.
-
getFetchTaskTimeout
final Duration getFetchTaskTimeout()
-
getIdleTime
final Duration getIdleTime()
-
isOutOfWork
final Boolean isOutOfWork()
-
isSmartRetryEnabled
final Boolean isSmartRetryEnabled()
-
getJobName
final String getJobName()
The job name.
-
setJobName
final Unit setJobName(String jobName)
The job name.
-
getNoProxy
final Boolean getNoProxy()
Do not use proxy
-
-
-
-