Class DefaultScheduler

  • Direct Known Subclasses:
    AdaptiveScheduler

    public class DefaultScheduler
    extends Scheduler
    Schedules a nextFetchDate based on the configuration
    • Field Detail

      • DELAY_METADATA

        public static final String DELAY_METADATA
        Key used to pass a custom delay via metadata. Used by the sitemaps to stagger the scheduling of URLs.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultScheduler

        public DefaultScheduler()
    • Method Detail

      • init

        public void init​(Map<String,​Object> stormConf)
        Description copied from class: Scheduler
        Configuration of the scheduler based on the config. Should be called by Scheduler.getInstance() *
        Specified by:
        init in class Scheduler
      • schedule

        public Optional<Date> schedule​(Status status,
                                       Metadata metadata)
        Description copied from class: Scheduler
        Returns an optional Date indicating when the document should be refetched next, based on its status. It is empty if the URL should never be refetched.
        Specified by:
        schedule in class Scheduler
      • checkCustomInterval

        protected final Optional<Integer> checkCustomInterval​(Metadata metadata,
                                                              Status s)
        Returns the first matching custom interval