@PublicEvolving public class TextLineInputFormat extends SimpleStreamFormat<String>
The reader uses Java's built-in InputStreamReader
to decode the byte stream using
various supported charset encodings.
This format does not support optimized recovery from checkpoints. On recovery, it will re-read and discard the number of lined that were processed before the last checkpoint. That is due to the fact that the offsets of lines in the file cannot be tracked through the charset decoders with their internal buffering of stream input and charset decoder state.
Modifier and Type | Class and Description |
---|---|
static class |
TextLineInputFormat.Reader
The actual reader for the
TextLineInputFormat . |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CHARSET_NAME |
FETCH_IO_SIZE
Constructor and Description |
---|
TextLineInputFormat() |
TextLineInputFormat(String charsetName) |
Modifier and Type | Method and Description |
---|---|
TextLineInputFormat.Reader |
createReader(Configuration config,
FSDataInputStream stream)
Creates a new reader.
|
TypeInformation<String> |
getProducedType()
Gets the type produced by this format.
|
createReader, isSplittable, restoreReader
public static final String DEFAULT_CHARSET_NAME
public TextLineInputFormat()
public TextLineInputFormat(String charsetName)
public TextLineInputFormat.Reader createReader(Configuration config, FSDataInputStream stream) throws IOException
SimpleStreamFormat
If the reader previously checkpointed an offset, then the input stream will be positioned
to that particular offset. Readers checkpoint an offset by returning a value from the method
Reader#getCheckpointedPosition()
method with an offset other than CheckpointedPosition.NO_OFFSET
).
createReader
in class SimpleStreamFormat<String>
IOException
public TypeInformation<String> getProducedType()
SimpleStreamFormat
getProducedType
in interface ResultTypeQueryable<String>
getProducedType
in interface StreamFormat<String>
getProducedType
in class SimpleStreamFormat<String>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.