by bupo.jung
在之前的文章“Nutch Indexer分析”中简单的介绍了在Indexer类中的索引过程,在Indexer类中的index函数以crawlDb,linkDb,segments,job为参数调用了IndexerMapReduce,在IndexerMapReduce类中map函数读入各个输入目录的内容,对键(url)相同的值(value)整合到一起,形成reduce函数的输入<text url,values>其中values对应不同的目录有不同的类型,可能是Inlinks类型,CrawlDatum类型等等,但是这些不同的类型都实现了NutchWritable接口,所以可以向上转型。