public class JSONTextLine extends cascading.scheme.hadoop.TextLine
Scheme for JSON text files. Files are broken into
lines, where each line is a JSON object. Either line-feed or carriage-return are used to signal end of line.
By default, this scheme returns a Tuple with one field, "json" with the type JSONCoercibleType.
Any Fields object passed to the constructor will have the JSONCoercibleType.TYPE type applied.
To create a binary JSON file, use the SequenceFile Scheme with one or more
fields having the JSONCoercibleType type.
Note, when supplying a custom ObjectMapper, the default JSONCoercibleType.TYPE and ObjectMapper
sets the DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY Jackson property.
| Modifier and Type | Field and Description |
|---|---|
static cascading.tuple.Fields |
DEFAULT_FIELDS |
| Constructor and Description |
|---|
JSONTextLine()
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances returning results
with the default field named "json". |
JSONTextLine(cascading.tuple.Fields fields)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(cascading.tuple.Fields fields,
java.lang.String charsetName)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(cascading.tuple.Fields fields,
cascading.scheme.hadoop.TextLine.Compress sinkCompression)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(cascading.tuple.Fields fields,
cascading.scheme.hadoop.TextLine.Compress sinkCompression,
java.lang.String charsetName)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(ObjectMapper mapper,
cascading.tuple.Fields fields)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(ObjectMapper mapper,
cascading.tuple.Fields fields,
java.lang.String charsetName)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(ObjectMapper mapper,
cascading.tuple.Fields fields,
cascading.scheme.hadoop.TextLine.Compress sinkCompression)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(ObjectMapper mapper,
cascading.tuple.Fields fields,
cascading.scheme.hadoop.TextLine.Compress sinkCompression,
java.lang.String charsetName)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getExtension() |
void |
sink(cascading.flow.FlowProcess<? extends org.apache.hadoop.conf.Configuration> flowProcess,
cascading.scheme.SinkCall<java.lang.Object[],org.apache.hadoop.mapred.OutputCollector> sinkCall) |
protected void |
sourceHandleInput(cascading.scheme.SourceCall<java.lang.Object[],org.apache.hadoop.mapred.RecordReader> sourceCall) |
getCharsetName, getSinkCompression, makeEncodedString, presentSinkFields, presentSourceFields, setCharsetName, setSinkCompression, sinkConfInit, sinkPrepare, source, sourceCleanup, sourceConfInit, sourcePrepare, verifyequals, getNumSinkParts, getSinkFields, getSourceFields, getTrace, hashCode, isSink, isSource, isSymmetrical, presentSinkFieldsInternal, presentSourceFieldsInternal, retrieveSinkFields, retrieveSourceFields, setNumSinkParts, setSinkFields, setSourceFields, sinkCleanup, sinkWrap, sourceRePrepare, sourceWrap, toStringpublic static final cascading.tuple.Fields DEFAULT_FIELDS
public JSONTextLine()
FlowConnector instances returning results
with the default field named "json".public JSONTextLine(cascading.tuple.Fields fields)
FlowConnector instances.fields - of Fieldspublic JSONTextLine(cascading.tuple.Fields fields, java.lang.String charsetName)
FlowConnector instances.fields - of FieldscharsetName - of Stringpublic JSONTextLine(cascading.tuple.Fields fields, cascading.scheme.hadoop.TextLine.Compress sinkCompression)
FlowConnector instances.fields - of FieldssinkCompression - of Compresspublic JSONTextLine(cascading.tuple.Fields fields, cascading.scheme.hadoop.TextLine.Compress sinkCompression, java.lang.String charsetName)
FlowConnector instances.fields - of FieldssinkCompression - of CompresscharsetName - of Stringpublic JSONTextLine(ObjectMapper mapper, cascading.tuple.Fields fields)
FlowConnector instances.mapper - of ObjectMapperfields - of Fieldspublic JSONTextLine(ObjectMapper mapper, cascading.tuple.Fields fields, java.lang.String charsetName)
FlowConnector instances.mapper - of ObjectMapperfields - of FieldscharsetName - of Stringpublic JSONTextLine(ObjectMapper mapper, cascading.tuple.Fields fields, cascading.scheme.hadoop.TextLine.Compress sinkCompression)
FlowConnector instances.mapper - of ObjectMapperfields - of FieldssinkCompression - of Compresspublic JSONTextLine(ObjectMapper mapper, cascading.tuple.Fields fields, cascading.scheme.hadoop.TextLine.Compress sinkCompression, java.lang.String charsetName)
FlowConnector instances.mapper - of ObjectMapperfields - of FieldssinkCompression - of CompresscharsetName - of Stringprotected void sourceHandleInput(cascading.scheme.SourceCall<java.lang.Object[],org.apache.hadoop.mapred.RecordReader> sourceCall) throws java.io.IOException
sourceHandleInput in class cascading.scheme.hadoop.TextLinejava.io.IOExceptionpublic void sink(cascading.flow.FlowProcess<? extends org.apache.hadoop.conf.Configuration> flowProcess, cascading.scheme.SinkCall<java.lang.Object[],org.apache.hadoop.mapred.OutputCollector> sinkCall) throws java.io.IOException
sink in class cascading.scheme.hadoop.TextLinejava.io.IOExceptionpublic java.lang.String getExtension()
getExtension in interface cascading.scheme.FileFormatgetExtension in class cascading.scheme.hadoop.TextLineCopyright © 2007-2021 Cascading Maintainers. All Rights Reserved.