public class JSONTextLine extends 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.
TextLine.Compress
Modifier and Type | Field and Description |
---|---|
static Fields |
DEFAULT_FIELDS |
DEFAULT_CHARSET, DEFAULT_SOURCE_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(Fields fields)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(Fields fields,
java.lang.String charsetName)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(Fields fields,
TextLine.Compress sinkCompression)
Constructor JSONTextLine creates a new JSONTextLine instance for use with any of the
Hadoop based
FlowConnector instances. |
JSONTextLine(Fields fields,
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 |
---|---|
void |
sink(FlowProcess<? extends org.apache.hadoop.conf.Configuration> flowProcess,
SinkCall<java.lang.Object[],org.apache.hadoop.mapred.OutputCollector> sinkCall) |
protected void |
sourceHandleInput(SourceCall<java.lang.Object[],org.apache.hadoop.mapred.RecordReader> sourceCall) |
getCharsetName, getExtension, getSinkCompression, makeEncodedString, presentSinkFields, presentSourceFields, setCharsetName, setSinkCompression, sinkConfInit, sinkPrepare, source, sourceCleanup, sourceConfInit, sourcePrepare, verify
equals, getNumSinkParts, getSinkFields, getSourceFields, getTrace, hashCode, isSink, isSource, isSymmetrical, presentSinkFieldsInternal, presentSourceFieldsInternal, retrieveSinkFields, retrieveSourceFields, setNumSinkParts, setSinkFields, setSourceFields, sinkCleanup, sinkWrap, sourceRePrepare, sourceWrap, toString
public static final Fields DEFAULT_FIELDS
public JSONTextLine()
FlowConnector
instances returning results
with the default field named "json".public JSONTextLine(Fields fields)
FlowConnector
instances.fields
- of Fieldspublic JSONTextLine(Fields fields, java.lang.String charsetName)
FlowConnector
instances.fields
- of FieldscharsetName
- of Stringpublic JSONTextLine(Fields fields, TextLine.Compress sinkCompression)
FlowConnector
instances.fields
- of FieldssinkCompression
- of Compresspublic JSONTextLine(Fields fields, TextLine.Compress sinkCompression, java.lang.String charsetName)
FlowConnector
instances.fields
- of FieldssinkCompression
- of CompresscharsetName
- of Stringprotected void sourceHandleInput(SourceCall<java.lang.Object[],org.apache.hadoop.mapred.RecordReader> sourceCall) throws java.io.IOException
sourceHandleInput
in class TextLine
java.io.IOException
public void sink(FlowProcess<? extends org.apache.hadoop.conf.Configuration> flowProcess, SinkCall<java.lang.Object[],org.apache.hadoop.mapred.OutputCollector> sinkCall) throws java.io.IOException
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.