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

博客园 首页 新随笔 联系 订阅 管理

2013年4月23日 #

摘要: 上文中的抽象类Scoper关联到另外一个成员变量DecideRule scope,我不得不先中断处理器类的分析(后面再继续处理器分析),来插叙一下DecideRule scope对象,我说了,DecideRule scope成员是用来控制CrawlURI caUri对象的范围照例先来浏览一下DecideRule相关类图DecideRule类是一个抽象类,用来判断一个CrawlURI caUri对象是接受还是拒绝public DecideResult decisionFor(CrawlURI uri) { if (!getEnabled()) { return... 阅读全文
posted @ 2013-04-23 13:27 刺猬的温驯 阅读(967) 评论(0) 推荐(0) 编辑

摘要: 本文接着上文分析,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 刺猬的温驯 阅读(758) 评论(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 刺猬的温驯 阅读(773) 评论(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 刺猬的温驯 阅读(919) 评论(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 刺猬的温驯 阅读(735) 评论(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 刺猬的温驯 阅读(827) 评论(0) 推荐(0) 编辑