[Hadoop] 自定义InputFormat文件输入格式

最近在着手公开数据Common Crawl的解析,commoncrawl提供的数据有三类格式:

- WARC files which store the raw crawl data
- WAT files which store computed metadata for the data stored in the WARC
- WET files which store extracted plaintext from the data stored in the WARC

我们需要的是网页正文的数据wet file。如果是直接解析gz文件可以参考官方网站提供的DEMO,而我们需要解析的是gz文件解压后的*.wet文件,其中每个文件里一个网页的数据被分散到各行,所以得想办法把每个网页的数据作为一个整体作为map的输入,所以调研了一下自定义inputFormat的方法,找到了这篇文章自定义 hadoop MapReduce InputFormat 切分输入文件,写的很好。

你可能感兴趣的:([Hadoop] 自定义InputFormat文件输入格式)