-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.event.EventEmitter,ai.platon.pulsar.crawl.Crawler,java.lang.AutoCloseable
public class StreamingCrawler extends AbstractCrawler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classStreamingCrawler.Companion
-
Field Summary
Fields Modifier and Type Field Description private final IntegernumPrivacyContextsprivate final IntegernumMaxActiveTabsprivate final IntegerfetchConcurrencyprivate 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 AtomicBooleanclosedprivate 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 DurationgetOutOfWorkTimeout()The out of work timeout. final DurationgetFetchTaskTimeout()final DurationgetIdleTime()final BooleangetIsOutOfWork()final BooleangetIsSmartRetryEnabled()final BooleangetIsIdle()BooleangetIsActive()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 IntegergetId()The crawl id StringgetName()Function2<Integer, UrlAware, Duration>getRetryDelayPolicy()Delay policy for retry tasks UnitsetRetryDelayPolicy(Function2<Integer, UrlAware, Duration> retryDelayPolicy)Delay policy for retry tasks final AtomicBooleangetClosed()final PulsarSessiongetSession()final BooleangetAutoClose()final Function1<Throwable, Unit>getEventExceptionHandler()final UnitsetEventExceptionHandler(Function1<Throwable, Unit> eventExceptionHandler)final Map<CrawlEvents, List<Function<Object>>>getListeners()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.StreamingCrawler
onLoad, onLoaded, onWillLoad -
Methods inherited from class ai.platon.pulsar.crawl.impl.AbstractCrawler
count, emit, emit, emit, emit, emit1, emit1, emit1, emit1, 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 -
Methods inherited from class ai.platon.pulsar.common.event.AbstractEventEmitter
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()
-
getOutOfWorkTimeout
final Duration getOutOfWorkTimeout()
The out of work timeout.
-
getFetchTaskTimeout
final Duration getFetchTaskTimeout()
-
getIdleTime
final Duration getIdleTime()
-
getIsOutOfWork
final Boolean getIsOutOfWork()
-
getIsSmartRetryEnabled
final Boolean getIsSmartRetryEnabled()
-
getIsActive
Boolean getIsActive()
-
getJobName
final String getJobName()
The job name.
-
setJobName
final Unit setJobName(String jobName)
The job name.
-
getNoProxy
final Boolean getNoProxy()
Do not use proxy
-
getRetryDelayPolicy
Function2<Integer, UrlAware, Duration> getRetryDelayPolicy()
Delay policy for retry tasks
-
setRetryDelayPolicy
Unit setRetryDelayPolicy(Function2<Integer, UrlAware, Duration> retryDelayPolicy)
Delay policy for retry tasks
-
getClosed
final AtomicBoolean getClosed()
-
getSession
final PulsarSession getSession()
-
getAutoClose
final Boolean getAutoClose()
-
getEventExceptionHandler
final Function1<Throwable, Unit> getEventExceptionHandler()
-
setEventExceptionHandler
final Unit setEventExceptionHandler(Function1<Throwable, Unit> eventExceptionHandler)
-
getListeners
final Map<CrawlEvents, List<Function<Object>>> getListeners()
-
-
-
-