-
- All Implemented Interfaces:
-
ai.platon.pulsar.crawl.Crawler,java.lang.AutoCloseable
public class StreamingCrawler<T extends UrlAware> 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 BooleanisActiveprivate StringjobNameprivate Sequence<T>urlsprivate final GlobalCacheFactoryglobalCacheFactoryprivate final CrawlEventHandlercrawlEventHandlerprivate final BooleannoProxyprivate final Integeridprivate final Stringnameprivate Function2<Integer, UrlAware, Duration>retryDelayPolicyprivate final AtomicBooleanclosedprivate final PulsarSessionsessionprivate final LoadOptionsdefaultOptionsprivate final BooleanautoCloseprivate final StringdefaultArgs
-
Constructor Summary
Constructors Constructor Description StreamingCrawler(Sequence<T> urls, LoadOptions defaultOptions, PulsarSession session, GlobalCacheFactory globalCacheFactory, CrawlEventHandler crawlEventHandler, Boolean noProxy, Boolean autoClose)
-
Method Summary
Modifier and Type Method Description final IntegergetNumPrivacyContexts()final IntegergetNumMaxActiveTabs()final IntegergetFetchConcurrency()final DurationgetOutOfWorkTimeout()final DurationgetFetchTaskTimeout()final DurationgetIdleTime()final BooleangetIsOutOfWork()BooleangetIsActive()final StringgetJobName()final UnitsetJobName(String jobName)final Sequence<T>getUrls()The url sequence final UnitsetUrls(Sequence<T> urls)The url sequence final GlobalCacheFactorygetGlobalCacheFactory()An optional global cache which will hold the retry tasks final CrawlEventHandlergetCrawlEventHandler()The crawl event handler 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()LoadOptionsgetDefaultOptions()The default load options final BooleangetAutoClose()StringgetDefaultArgs()Unitrun()Unitrun(CoroutineScope scope)Unitawait()Await for all tasks be done final Unitquit()-
-
Constructor Detail
-
StreamingCrawler
StreamingCrawler(Sequence<T> urls, LoadOptions defaultOptions, PulsarSession session, GlobalCacheFactory globalCacheFactory, CrawlEventHandler crawlEventHandler, Boolean noProxy, Boolean autoClose)
-
-
Method Detail
-
getNumPrivacyContexts
final Integer getNumPrivacyContexts()
-
getNumMaxActiveTabs
final Integer getNumMaxActiveTabs()
-
getFetchConcurrency
final Integer getFetchConcurrency()
-
getOutOfWorkTimeout
final Duration getOutOfWorkTimeout()
-
getFetchTaskTimeout
final Duration getFetchTaskTimeout()
-
getIdleTime
final Duration getIdleTime()
-
getIsOutOfWork
final Boolean getIsOutOfWork()
-
getIsActive
Boolean getIsActive()
-
getJobName
final String getJobName()
-
setJobName
final Unit setJobName(String jobName)
-
getGlobalCacheFactory
final GlobalCacheFactory getGlobalCacheFactory()
An optional global cache which will hold the retry tasks
-
getCrawlEventHandler
final CrawlEventHandler getCrawlEventHandler()
The crawl event handler
-
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()
-
getDefaultOptions
LoadOptions getDefaultOptions()
The default load options
-
getAutoClose
final Boolean getAutoClose()
-
getDefaultArgs
String getDefaultArgs()
-
-
-
-