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.
In order to read or write a compressed files, pass a CompressorScheme.Compressor
instance to the appropriate constructors. See Compressors
for provided compression algorithms.
Compressors
,
Serialized FormCompressorScheme.Compressor
Modifier and Type | Field and Description |
---|---|
static Fields |
DEFAULT_FIELDS |
DEFAULT_CHARSET, DEFAULT_SOURCE_FIELDS
compressor, NO_COMPRESSOR
Constructor and Description |
---|
JSONTextLine()
Constructor JSONTextLine creates a new JSONTextLine instance for use with the
LocalFlowConnector returning results with the default field named "json". |
JSONTextLine(CompressorScheme.Compressor compressor)
Constructor JSONTextLine creates a new JSONTextLine instance for use with the
LocalFlowConnector returning results with the default field named "json". |
JSONTextLine(Fields fields)
Constructor JSONTextLine creates a new JSONTextLine instance for use with the
LocalFlowConnector . |
JSONTextLine(Fields fields,
CompressorScheme.Compressor compressor)
Constructor JSONTextLine creates a new JSONTextLine instance for use with the
LocalFlowConnector . |
JSONTextLine(Fields fields,
CompressorScheme.Compressor compressor,
java.lang.String charsetName)
Constructor JSONTextLine creates a new JSONTextLine instance for use with the
LocalFlowConnector . |
JSONTextLine(Fields fields,
java.lang.String charsetName)
Constructor JSONTextLine creates a new JSONTextLine instance for use with the
LocalFlowConnector . |
Modifier and Type | Method and Description |
---|---|
void |
sink(FlowProcess<? extends java.util.Properties> flowProcess,
SinkCall<java.io.PrintWriter,java.io.OutputStream> sinkCall) |
boolean |
source(FlowProcess<? extends java.util.Properties> flowProcess,
SourceCall<java.io.LineNumberReader,java.io.InputStream> sourceCall) |
createInput, createOutput, getCharsetName, getExtension, presentSinkFields, presentSourceFields, setCharsetName, sinkCleanup, sinkConfInit, sinkPrepare, sourceCleanup, sourceConfInit, sourcePrepare, sourceRePrepare, verify
setCompressor, sinkWrap, sourceWrap
equals, getNumSinkParts, getSinkFields, getSourceFields, getTrace, hashCode, isSink, isSource, isSymmetrical, presentSinkFieldsInternal, presentSourceFieldsInternal, retrieveSinkFields, retrieveSourceFields, setNumSinkParts, setSinkFields, setSourceFields, toString
public static final Fields DEFAULT_FIELDS
public JSONTextLine()
LocalFlowConnector
returning results with the default field named "json".public JSONTextLine(Fields fields)
LocalFlowConnector
.fields
- of Fieldspublic JSONTextLine(Fields fields, java.lang.String charsetName)
LocalFlowConnector
.fields
- of FieldscharsetName
- of Stringpublic JSONTextLine(CompressorScheme.Compressor compressor)
LocalFlowConnector
returning results with the default field named "json".compressor
- of type Compressor, see Compressors
public JSONTextLine(Fields fields, CompressorScheme.Compressor compressor)
LocalFlowConnector
.fields
- of Fieldscompressor
- of type Compressor, see Compressors
public JSONTextLine(Fields fields, CompressorScheme.Compressor compressor, java.lang.String charsetName)
LocalFlowConnector
.fields
- of Fieldscompressor
- of type Compressor, see Compressors
charsetName
- of Stringpublic boolean source(FlowProcess<? extends java.util.Properties> flowProcess, SourceCall<java.io.LineNumberReader,java.io.InputStream> sourceCall) throws java.io.IOException
public void sink(FlowProcess<? extends java.util.Properties> flowProcess, SinkCall<java.io.PrintWriter,java.io.OutputStream> sinkCall) throws java.io.IOException
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.