public class CommonCrawlFormatWARC extends AbstractCommonCrawlFormat
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MAX_WARC_FILE_SIZE |
static java.lang.String |
TEMPLATE |
conf, content, inLinks, jsonArray, keyPrefix, LOG, metadata, reverseKey, reverseKeyValue, simpleDateFormat, url| Constructor and Description |
|---|
CommonCrawlFormatWARC(Configuration nutchConf,
CommonCrawlConfig config) |
CommonCrawlFormatWARC(java.lang.String url,
Content content,
Metadata metadata,
Configuration nutchConf,
CommonCrawlConfig config,
ParseData parseData) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Optional method that could be implemented if the actual format needs some
close procedure.
|
protected void |
closeArray(java.lang.String key,
boolean nested,
boolean newline) |
protected void |
closeObject(java.lang.String key) |
protected java.lang.String |
generateJson() |
java.lang.String |
getJsonData() |
java.lang.String |
getJsonData(java.lang.String url,
Content content,
Metadata metadata,
ParseData parseData)
Returns a string representation of the JSON structure of the URL content
takes into account the parsed metadata about the URL
|
protected void |
startArray(java.lang.String key,
boolean nested,
boolean newline) |
protected void |
startObject(java.lang.String key) |
protected void |
writeArrayValue(java.lang.String value) |
protected void |
writeKeyNull(java.lang.String key) |
protected void |
writeKeyValue(java.lang.String key,
java.lang.String value) |
protected java.net.URI |
writeRequest(java.net.URI id) |
protected java.net.URI |
writeResponse() |
getImported, getInLinks, getJsonData, getKey, getMethod, getRequestAccept, getRequestAcceptEncoding, getRequestAcceptLanguage, getRequestContactEmail, getRequestContactName, getRequestHostAddress, getRequestHostName, getRequestRobots, getRequestSoftware, getRequestUserAgent, getResponseAddress, getResponseContent, getResponseContentEncoding, getResponseContentType, getResponseDate, getResponseHostName, getResponseServer, getResponseStatus, getTimestamp, getUrl, setInLinkspublic static final java.lang.String MAX_WARC_FILE_SIZE
public static final java.lang.String TEMPLATE
public CommonCrawlFormatWARC(Configuration nutchConf, CommonCrawlConfig config) throws java.io.IOException
java.io.IOExceptionpublic CommonCrawlFormatWARC(java.lang.String url,
Content content,
Metadata metadata,
Configuration nutchConf,
CommonCrawlConfig config,
ParseData parseData)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getJsonData(java.lang.String url,
Content content,
Metadata metadata,
ParseData parseData)
throws java.io.IOException
CommonCrawlFormatgetJsonData in interface CommonCrawlFormatgetJsonData in class AbstractCommonCrawlFormatjava.io.IOExceptionpublic java.lang.String getJsonData()
throws java.io.IOException
getJsonData in interface CommonCrawlFormatgetJsonData in class AbstractCommonCrawlFormatjava.io.IOExceptionprotected java.net.URI writeResponse()
throws java.io.IOException,
java.text.ParseException
java.io.IOExceptionjava.text.ParseExceptionprotected java.net.URI writeRequest(java.net.URI id)
throws java.io.IOException,
java.text.ParseException
java.io.IOExceptionjava.text.ParseExceptionprotected java.lang.String generateJson()
throws java.io.IOException
generateJson in class AbstractCommonCrawlFormatjava.io.IOExceptionprotected void writeKeyValue(java.lang.String key,
java.lang.String value)
throws java.io.IOException
writeKeyValue in class AbstractCommonCrawlFormatjava.io.IOExceptionprotected void writeKeyNull(java.lang.String key)
throws java.io.IOException
writeKeyNull in class AbstractCommonCrawlFormatjava.io.IOExceptionprotected void startArray(java.lang.String key,
boolean nested,
boolean newline)
throws java.io.IOException
startArray in class AbstractCommonCrawlFormatjava.io.IOExceptionprotected void closeArray(java.lang.String key,
boolean nested,
boolean newline)
throws java.io.IOException
closeArray in class AbstractCommonCrawlFormatjava.io.IOExceptionprotected void writeArrayValue(java.lang.String value)
throws java.io.IOException
writeArrayValue in class AbstractCommonCrawlFormatjava.io.IOExceptionprotected void startObject(java.lang.String key)
throws java.io.IOException
startObject in class AbstractCommonCrawlFormatjava.io.IOExceptionprotected void closeObject(java.lang.String key)
throws java.io.IOException
closeObject in class AbstractCommonCrawlFormatjava.io.IOExceptionpublic void close()
CommonCrawlFormatclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface CommonCrawlFormatclose in class AbstractCommonCrawlFormatCopyright © 2019 The Apache Software Foundation