-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
@Component() public final class LoadComponent implements AutoCloseable
Created by vincent on 17-7-15. Copyright @ 2013-2017 Platon AI. All rights reserved
Load pages from storage or fetch from the Internet if it's not fetched or expired
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLoadComponent.Companion
-
Field Summary
Fields Modifier and Type Field Description private final GlobalCacheglobalCacheprivate final ConcurrentExpiringLRUCache<String, WebPage>pageCacheprivate final ConcurrentExpiringLRUCache<String, FeaturedDocument>documentCacheprivate final Array<String>metadataFieldsprivate volatile StringlastPageReportprivate final WebDbwebDbprivate final GlobalCacheFactoryglobalCacheFactoryprivate final BatchFetchComponentfetchComponentprivate final ParseComponentparseComponentprivate final UpdateComponentupdateComponentprivate final AppStatusTrackerstatusTrackerprivate final CrawlLoopcrawlLoopprivate final ImmutableConfigimmutableConfig
-
Constructor Summary
Constructors Constructor Description LoadComponent(WebDb webDb, GlobalCacheFactory globalCacheFactory, BatchFetchComponent fetchComponent, ParseComponent parseComponent, UpdateComponent updateComponent, ImmutableConfig immutableConfig)LoadComponent(WebDb webDb, GlobalCacheFactory globalCacheFactory, BatchFetchComponent fetchComponent, ParseComponent parseComponent, UpdateComponent updateComponent, AppStatusTracker statusTracker, CrawlLoop crawlLoop, ImmutableConfig immutableConfig)
-
Method Summary
Modifier and Type Method Description final GlobalCachegetGlobalCache()final ConcurrentExpiringLRUCache<String, WebPage>getPageCache()final ConcurrentExpiringLRUCache<String, FeaturedDocument>getDocumentCache()final Array<String>getMetadataFields()final StringgetLastPageReport()final UnitsetLastPageReport(String lastPageReport)final WebDbgetWebDb()final GlobalCacheFactorygetGlobalCacheFactory()final BatchFetchComponentgetFetchComponent()final ParseComponentgetParseComponent()final UpdateComponentgetUpdateComponent()final AppStatusTrackergetStatusTracker()final CrawlLoopgetCrawlLoop()final ImmutableConfiggetImmutableConfig()final CheckStatefetchState(WebPage page, LoadOptions options)final WebPageload(String configuredUrl)Load an url, options can be specified following the url, see LoadOptions for all options final WebPageload(String url, String args)Load an url with specified options, see LoadOptions for all options final WebPageload(String url, LoadOptions options)Load an url with specified options If there is no page in local storage nor at the given remote location, WebPage.NIL is returned final WebPageload(URL url, LoadOptions options)final WebPageload(GHypeLink link, LoadOptions options)Load an url in GHypeLink format If there is no page in local storage nor at the given remote location, WebPage.NIL is returned final WebPageload(NormUrl normUrl)final WebPageloadDeferred(NormUrl normUrl)final WebPageloadWithRetry(NormUrl normUrl)final WebPageloadWithRetryDeferred(NormUrl normUrl)final Collection<WebPage>loadAll(Iterable<NormUrl> normUrls, LoadOptions options)final Unitflush()Unitclose()-
-
Constructor Detail
-
LoadComponent
LoadComponent(WebDb webDb, GlobalCacheFactory globalCacheFactory, BatchFetchComponent fetchComponent, ParseComponent parseComponent, UpdateComponent updateComponent, ImmutableConfig immutableConfig)
-
LoadComponent
LoadComponent(WebDb webDb, GlobalCacheFactory globalCacheFactory, BatchFetchComponent fetchComponent, ParseComponent parseComponent, UpdateComponent updateComponent, AppStatusTracker statusTracker, CrawlLoop crawlLoop, ImmutableConfig immutableConfig)
-
-
Method Detail
-
getGlobalCache
final GlobalCache getGlobalCache()
-
getPageCache
final ConcurrentExpiringLRUCache<String, WebPage> getPageCache()
-
getDocumentCache
final ConcurrentExpiringLRUCache<String, FeaturedDocument> getDocumentCache()
-
getMetadataFields
final Array<String> getMetadataFields()
-
getLastPageReport
final String getLastPageReport()
-
setLastPageReport
final Unit setLastPageReport(String lastPageReport)
-
getWebDb
final WebDb getWebDb()
-
getGlobalCacheFactory
final GlobalCacheFactory getGlobalCacheFactory()
-
getFetchComponent
final BatchFetchComponent getFetchComponent()
-
getParseComponent
final ParseComponent getParseComponent()
-
getUpdateComponent
final UpdateComponent getUpdateComponent()
-
getStatusTracker
final AppStatusTracker getStatusTracker()
-
getCrawlLoop
final CrawlLoop getCrawlLoop()
-
getImmutableConfig
final ImmutableConfig getImmutableConfig()
-
fetchState
final CheckState fetchState(WebPage page, LoadOptions options)
-
load
final WebPage load(String configuredUrl)
Load an url, options can be specified following the url, see LoadOptions for all options
- Parameters:
configuredUrl- The url followed by options
-
load
final WebPage load(String url, String args)
Load an url with specified options, see LoadOptions for all options
- Parameters:
url- The url to load
-
load
final WebPage load(String url, LoadOptions options)
Load an url with specified options If there is no page in local storage nor at the given remote location, WebPage.NIL is returned
- Parameters:
url- The url to loadoptions- The options
-
load
final WebPage load(URL url, LoadOptions options)
-
load
final WebPage load(GHypeLink link, LoadOptions options)
Load an url in GHypeLink format If there is no page in local storage nor at the given remote location, WebPage.NIL is returned
- Parameters:
link- The url in GHypeLink format to loadoptions- The options
-
loadDeferred
final WebPage loadDeferred(NormUrl normUrl)
-
loadWithRetry
final WebPage loadWithRetry(NormUrl normUrl)
-
loadWithRetryDeferred
final WebPage loadWithRetryDeferred(NormUrl normUrl)
-
loadAll
final Collection<WebPage> loadAll(Iterable<NormUrl> normUrls, LoadOptions options)
-
-
-
-