public class FSSegmentWriter extends Object implements SegmentWriter
| 构造器和说明 |
|---|
FSSegmentWriter(String crawlPath,
String segmentPath)
构造一个在指定文件夹写爬取信息的Writer
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
关闭Writer
|
void |
wrtieContent(Content content)
写入一条Content对象(存储网页/文件内容的对象)
|
void |
wrtieFetch(CrawlDatum fetch)
写入一条爬取历史记录
|
void |
wrtieParse(ParseResult parseresult)
写入一条网页解析结果
|
public void wrtieFetch(CrawlDatum fetch) throws IOException
wrtieFetch 在接口中 SegmentWriterfetch - 爬取历史记录(爬取任务)IOExceptionIOExceptionpublic void wrtieContent(Content content) throws IOException
wrtieContent 在接口中 SegmentWritercontent - IOExceptionIOExceptionpublic void wrtieParse(ParseResult parseresult) throws IOException
wrtieParse 在接口中 SegmentWriterparseresult - 网页解析结果IOExceptionIOExceptionpublic void close()
throws IOException
close 在接口中 SegmentWriterIOExceptionIOExceptionCopyright © 2014. All Rights Reserved.