-
- 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 DurationidleTimeoutprivate final DurationidleTimeprivate final BooleanisIdleprivate final StringdefaultArgsprivate final BooleanisActiveprivate StringjobNameprivate ProxyPoolproxyPoolprivate final Integeridprivate Sequence<T>urlsprivate final LoadOptionsdefaultOptionsprivate final GlobalCacheFactoryglobalCacheFactoryprivate final CrawlEventHandlercrawlEventHandlerprivate final Stringnameprivate final AtomicBooleanclosedprivate final PulsarSessionsessionprivate final BooleanautoClose
-
Constructor Summary
Constructors Constructor Description StreamingCrawler(Sequence<T> urls, LoadOptions defaultOptions, PulsarSession session, GlobalCacheFactory globalCacheFactory, CrawlEventHandler crawlEventHandler, String name, Boolean autoClose)
-
Method Summary
Modifier and Type Method Description final IntegergetNumPrivacyContexts()final IntegergetNumMaxActiveTabs()final IntegergetFetchConcurrency()final DurationgetIdleTimeout()final DurationgetIdleTime()final BooleangetIsIdle()final StringgetDefaultArgs()BooleangetIsActive()final StringgetJobName()final UnitsetJobName(String jobName)final ProxyPoolgetProxyPool()final UnitsetProxyPool(ProxyPool proxyPool)final IntegergetId()final Sequence<T>getUrls()The url sequence final UnitsetUrls(Sequence<T> urls)The url sequence final LoadOptionsgetDefaultOptions()The default load options final GlobalCacheFactorygetGlobalCacheFactory()A optional global cache which will hold the retry tasks final CrawlEventHandlergetCrawlEventHandler()The crawl event handler final StringgetName()The crawl name final AtomicBooleangetClosed()final PulsarSessiongetSession()final BooleangetAutoClose()Unitrun()Unitrun(CoroutineScope scope)final Unitquit()-
-
Constructor Detail
-
StreamingCrawler
StreamingCrawler(Sequence<T> urls, LoadOptions defaultOptions, PulsarSession session, GlobalCacheFactory globalCacheFactory, CrawlEventHandler crawlEventHandler, String name, Boolean autoClose)
-
-
Method Detail
-
getNumPrivacyContexts
final Integer getNumPrivacyContexts()
-
getNumMaxActiveTabs
final Integer getNumMaxActiveTabs()
-
getFetchConcurrency
final Integer getFetchConcurrency()
-
getIdleTimeout
final Duration getIdleTimeout()
-
getIdleTime
final Duration getIdleTime()
-
getDefaultArgs
final String getDefaultArgs()
-
getIsActive
Boolean getIsActive()
-
getJobName
final String getJobName()
-
setJobName
final Unit setJobName(String jobName)
-
getProxyPool
final ProxyPool getProxyPool()
-
setProxyPool
final Unit setProxyPool(ProxyPool proxyPool)
-
getDefaultOptions
final LoadOptions getDefaultOptions()
The default load options
-
getGlobalCacheFactory
final GlobalCacheFactory getGlobalCacheFactory()
A optional global cache which will hold the retry tasks
-
getCrawlEventHandler
final CrawlEventHandler getCrawlEventHandler()
The crawl event handler
-
getClosed
final AtomicBoolean getClosed()
-
getSession
final PulsarSession getSession()
-
getAutoClose
final Boolean getAutoClose()
-
-
-
-