Class BatchFetchComponent

    • Constructor Detail

      • BatchFetchComponent

        BatchFetchComponent(WebDb webDb, ImmutableConfig immutableConfig)
    • Method Detail

      • fetchAll

         final Collection<WebPage> fetchAll(Iterable<String> urls, LoadOptions options)

        Fetch all the urls, config property 'fetch.concurrency' controls the concurrency level. If concurrency level is not great than 1, fetch all urls in the caller thread

        Eager fetch only some urls to response as soon as possible, the rest urls will be fetched in background later

        Parameters:
        urls - The urls to fetch
        options - The options
      • parallelFetchAll

         final Collection<WebPage> parallelFetchAll(Iterable<String> urls, LoadOptions options)

        Parallel fetch all the urls

        Eager fetch only some urls to response as soon as possible, the rest urls will be fetched in background later

        Parameters:
        urls - The urls to fetch
        options - The options
      • parallelFetchAllGroupedBySchema

         final Collection<WebPage> parallelFetchAllGroupedBySchema(Iterable<String> urls, LoadOptions options)

        Group all urls by URL schema, and parallel fetch each group.

        Eager fetch only some urls to response as soon as possible, the rest urls will be fetched in background later

        Parameters:
        urls - The urls to fetch
        options - The options