Package org.apache.nutch.tools
Class CommonCrawlFormatSimple
java.lang.Object
org.apache.nutch.tools.AbstractCommonCrawlFormat
org.apache.nutch.tools.CommonCrawlFormatSimple
- All Implemented Interfaces:
Closeable,AutoCloseable,CommonCrawlFormat
This class provides methods to map crawled data on JSON using a StringBuilder object.
- See Also:
-
Field Summary
Fields inherited from class org.apache.nutch.tools.AbstractCommonCrawlFormat
conf, content, inLinks, jsonArray, keyPrefix, LOG, metadata, reverseKey, reverseKeyValue, simpleDateFormat, url -
Constructor Summary
ConstructorsConstructorDescriptionCommonCrawlFormatSimple(String url, Content content, Metadata metadata, Configuration nutchConf, CommonCrawlConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseArray(String key, boolean nested, boolean newline) protected voidcloseObject(String key) protected Stringprotected voidstartArray(String key, boolean nested, boolean newline) protected voidstartObject(String key) protected voidwriteArrayValue(String value) protected voidwriteKeyNull(String key) protected voidwriteKeyValue(String key, String value) Methods inherited from class org.apache.nutch.tools.AbstractCommonCrawlFormat
close, getImported, getInLinks, getJsonData, getJsonData, getJsonData, getKey, getMethod, getRequestAccept, getRequestAcceptEncoding, getRequestAcceptLanguage, getRequestContactEmail, getRequestContactName, getRequestHostAddress, getRequestHostName, getRequestRobots, getRequestSoftware, getRequestUserAgent, getResponseAddress, getResponseContent, getResponseContentEncoding, getResponseContentType, getResponseDate, getResponseHostName, getResponseServer, getResponseStatus, getTimestamp, getUrl, setInLinks
-
Constructor Details
-
CommonCrawlFormatSimple
public CommonCrawlFormatSimple(String url, Content content, Metadata metadata, Configuration nutchConf, CommonCrawlConfig config) throws IOException - Throws:
IOException
-
-
Method Details
-
writeKeyValue
- Specified by:
writeKeyValuein classAbstractCommonCrawlFormat- Throws:
IOException
-
writeKeyNull
- Specified by:
writeKeyNullin classAbstractCommonCrawlFormat- Throws:
IOException
-
startArray
- Specified by:
startArrayin classAbstractCommonCrawlFormat- Throws:
IOException
-
closeArray
- Specified by:
closeArrayin classAbstractCommonCrawlFormat- Throws:
IOException
-
writeArrayValue
- Specified by:
writeArrayValuein classAbstractCommonCrawlFormat
-
startObject
- Specified by:
startObjectin classAbstractCommonCrawlFormat- Throws:
IOException
-
closeObject
- Specified by:
closeObjectin classAbstractCommonCrawlFormat- Throws:
IOException
-
generateJson
- Specified by:
generateJsonin classAbstractCommonCrawlFormat- Throws:
IOException
-