君子博学而日参省乎己 则知明而行无过矣

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 107 下一页

2013年4月23日 #

摘要: 本文接着上文分析,CandidateChain candidateChain处理器链相关联的处理器CandidateChain处理器链有两个处理器org.archive.crawler.prefetch.CandidateScoperorg.archive.crawler.prefetch.FrontierPreparer要了解上面的处理器,我们先要了解另外一个抽象类Scoper,继承自抽象父类Processor,该类用来控制CrawlURI caUri对象的范围,里面有一个成员变量DecideRule scope protected DecideRule scope; public D... 阅读全文
posted @ 2013-04-23 11:46 刺猬的温驯 阅读(810) 评论(0) 推荐(0)

摘要: 本文继续分析与heritrix3.1.0系统的处理器相关的源码我们照例先来浏览一下class uml图所有的处理器都继承自抽象父类Processor,其中重要的方法如下/** * Processes the given URI. First checks {@link #ENABLED} and * {@link #DECIDE_RULES}. If ENABLED is false, then nothing happens. * If the DECIDE_RULES indicate REJECT, then the * {@link #innerR... 阅读全文
posted @ 2013-04-23 10:05 刺猬的温驯 阅读(808) 评论(0) 推荐(0)

摘要: 从本文开始,我们来分析与Heritrix3.1.0系统的处理器相关的源码,在Heritrix系统里面,待处理的CrawlURI cURI对象经过系统里面的处理器的重重处理最后才得以修成正果因为处理器很多,除了处理器本身的继承层次的逻辑外,在系统里面将功能相近的处理器归入同一个处理器链Heritrix3.1.0系统逻辑上抽象为两大处理器链(FetchChain和DispositionChain,CandidateChain逻辑上是属于DispositionChain)我们先来看一下处理器链与处理器的相关UML图上面是静态class图,处理器链ProcessorChain维持着一定数目的处理器pr 阅读全文
posted @ 2013-04-23 08:57 刺猬的温驯 阅读(966) 评论(0) 推荐(0)

摘要: 我们接下来分析与与BdbFrontier对象void finished(CrawlURI cURI)方法相关的方法/** * Note that the previously emitted CrawlURI has completed * its processing (for now). * * The CrawlURI may be scheduled to retry, if appropriate, * and other related URIs may become eligible for release * via the ne... 阅读全文
posted @ 2013-04-23 07:39 刺猬的温驯 阅读(767) 评论(1) 推荐(0)

摘要: 我们接下来分析与与BdbFrontier对象CrawlURI next()方法相关的方法/** * Return the next CrawlURI eligible to be processed (and presumably * visited/fetched) by a a worker thread. * * Relies on the readyClassQueues having been loaded with * any work queues that are eligible to provide a URI. * ... 阅读全文
posted @ 2013-04-23 06:57 刺猬的温驯 阅读(862) 评论(0) 推荐(0)

2013年4月21日 #

摘要: 本文分析Heritrix3.1.0系统里面的WorkQueue队列(具体是BdbWorkQueue)的调度机制,这部分是系统里面比较复杂的,我只能是尝试分析(本文可能会修改)我在Heritrix 3.1.0 源码解析(六)一文中涉及BdbFrontier对象的初始化,现在回顾一下我们看到在WorkQueueFrontier类中的初始化方法void start()里面进一步调用了void initInternalQueues()方法而void initInternalQueues()方法 里面进一步调用子类BdbFrontier的void initOtherQueues()方法与void ini 阅读全文
posted @ 2013-04-21 10:02 刺猬的温驯 阅读(844) 评论(0) 推荐(0)

2013年4月20日 #

摘要: 我在分析BdbFrontier对象的void schedule(CrawlURI caURI)、CrawlURI next() 、void finished(CrawlURI cURI)方法是,其实还有一些相关环境没有分析,其实我是有点疲倦本文接下来分析在多线程环境中Heritrix3.1.0系统怎样保持相关对象属性的一致性以及怎样自定义配置相关对象的属性值我们在WorkQueueFrontier类的void schedule(CrawlURI curi)方法里面可以看到@Override public void schedule(CrawlURI curi) { shee... 阅读全文
posted @ 2013-04-20 12:47 刺猬的温驯 阅读(932) 评论(3) 推荐(0)

摘要: 接下来分析BdbFrontier类的void finished(CrawlURI curi) 方法,完成CrawlURI对象的扫尾工作在BdbFrontier类的父类的父类AbstractFrontier里面org.archive.crawler.frontier.BdbFrontier org.archive.crawler.frontier.AbstractFrontier/** * Note that the previously emitted CrawlURI has completed * its processing (for now). * ... 阅读全文
posted @ 2013-04-20 07:16 刺猬的温驯 阅读(844) 评论(0) 推荐(0)

摘要: 接下来分析BdbFrontier类的CrawlURI next()方法,该方法是获取下一个待采集的CrawlURI对象该方法是在BdbFrontier类的父类的父类AbstractFrontier里面org.archive.crawler.frontier.BdbFrontier org.archive.crawler.frontier.AbstractFrontier/* (non-Javadoc) * @see org.archive.crawler.framework.Frontier#next() */ public CrawlURI next() thr... 阅读全文
posted @ 2013-04-20 07:02 刺猬的温驯 阅读(1070) 评论(0) 推荐(0)

摘要: 上文分析了Heritrix3.1.0系统是怎么添加CrawlURI curi对象的,那么在系统初始化的时候,是怎么载入CrawlURI curi种子的呢?我们回顾前面的文章,在我们执行采集任务的launch指令的时候,实际会调用CrawlController对象的void requestCrawlStart()方法/** * Operator requested crawl begin */ public void requestCrawlStart() { hasStarted = true; sendCrawlStateChangeEv... 阅读全文
posted @ 2013-04-20 06:38 刺猬的温驯 阅读(832) 评论(0) 推荐(0)

上一页 1 ··· 37 38 39 40 41 42 43 44 45 ··· 107 下一页