T
- the data typepublic abstract class AbstractJsonStreamFormat<T> extends ConfigurableBinaryStreamFormat<T>
Constructor and Description |
---|
AbstractJsonStreamFormat() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterInput(T model,
StringOption path,
JsonInput<T> input)
Processes the data object, which has filled the current record data.
|
protected void |
beforeOutput(T model,
StringOption path,
JsonOutput<T> output)
Process the data object.
|
protected abstract void |
configureJsonFormat(JsonFormat.Builder<T> builder)
Configures
JsonFormat builder. |
ModelInput<T> |
createInput(Class<? extends T> dataType,
String path,
InputStream stream,
long offset,
long fragmentSize)
Creates a new
ModelInput for the specified properties. |
ModelOutput<T> |
createOutput(Class<? extends T> dataType,
String path,
OutputStream stream)
Creates a new
ModelOutput for the specified properties. |
protected Class<? extends org.apache.hadoop.io.compress.CompressionCodec> |
getCompressionCodecClass()
Returns the compression codec class.
|
protected InputSplitter |
getInputSplitter()
Returns the input splitter of this format.
|
JsonFormat<T> |
getJsonFormat()
Returns the
JsonFormat . |
long |
getMinimumFragmentSize()
Returns the lower limit of fragment size (in bytes).
|
long |
getPreferredFragmentSize()
Returns the preferred fragment size (in bytes).
|
getConf, setConf
createInput
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedType
protected abstract void configureJsonFormat(JsonFormat.Builder<T> builder)
JsonFormat
builder.builder
- the target builderprotected InputSplitter getInputSplitter()
null
is input split is disabledprotected Class<? extends org.apache.hadoop.io.compress.CompressionCodec> getCompressionCodecClass()
null
if compression is disabledprotected void afterInput(T model, StringOption path, JsonInput<T> input)
model
- the data objectpath
- the current input pathinput
- the current inputprotected void beforeOutput(T model, StringOption path, JsonOutput<T> output)
model
- the data objectpath
- the current output pathoutput
- the current outputpublic final JsonFormat<T> getJsonFormat()
JsonFormat
.public final long getPreferredFragmentSize()
FragmentableDataFormat
-1
as infinitepublic final long getMinimumFragmentSize()
FragmentableDataFormat
-1
as infinite (never split into fragments)public ModelInput<T> createInput(Class<? extends T> dataType, String path, InputStream stream, long offset, long fragmentSize) throws IOException, InterruptedException
BinaryStreamFormat
ModelInput
for the specified properties.createInput
in class BinaryStreamFormat<T>
dataType
- the target data typepath
- the path about the target stream (for label)stream
- the target streamoffset
- starting stream offsetfragmentSize
- suggested fragment bytes count, or -1
as infiniteIOException
- if failed to create readerInterruptedException
- if interruptedpublic ModelOutput<T> createOutput(Class<? extends T> dataType, String path, OutputStream stream) throws IOException, InterruptedException
BinaryStreamFormat
ModelOutput
for the specified properties.createOutput
in class BinaryStreamFormat<T>
dataType
- the target data typepath
- the path about the target stream (for label)stream
- the target streamIOException
- if failed to create writerInterruptedException
- if interruptedCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.