Class FileCacheQueueScheduler

    • Constructor Detail

      • FileCacheQueueScheduler

        public FileCacheQueueScheduler​(java.lang.String filePath)
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • poll

        public Request poll​(Task task)
        Description copied from interface: Scheduler
        get an url to crawl
        Specified by:
        poll in interface Scheduler
        Parameters:
        task - the task of spider
        Returns:
        the url to crawl
      • serializeRequest

        protected java.lang.String serializeRequest​(Request request)
      • deserializeRequest

        protected Request deserializeRequest​(java.lang.String line)