Class TextLineInputFormat
- All Implemented Interfaces:
Serializable,org.apache.flink.api.java.typeutils.ResultTypeQueryable<String>,StreamFormat<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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe actual reader for theTextLineInputFormat. -
Field Summary
FieldsFields inherited from interface org.apache.flink.connector.file.src.reader.StreamFormat
FETCH_IO_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateReader(org.apache.flink.configuration.Configuration config, org.apache.flink.core.fs.FSDataInputStream stream) Creates a new reader.org.apache.flink.api.common.typeinfo.TypeInformation<String>Gets the type produced by this format.Methods inherited from class org.apache.flink.connector.file.src.reader.SimpleStreamFormat
createReader, isSplittable, restoreReader
-
Field Details
-
DEFAULT_CHARSET_NAME
- See Also:
-
-
Constructor Details
-
TextLineInputFormat
public TextLineInputFormat() -
TextLineInputFormat
-
-
Method Details
-
createReader
public TextLineInputFormat.Reader createReader(org.apache.flink.configuration.Configuration config, org.apache.flink.core.fs.FSDataInputStream stream) throws IOException Description copied from class:SimpleStreamFormatCreates a new reader. This method is called both for the creation of new reader (from the beginning of a file) and for restoring checkpointed readers.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
StreamFormat.Reader.getCheckpointedPosition()method with an offset other thanCheckpointedPosition.NO_OFFSET).- Specified by:
createReaderin classSimpleStreamFormat<String>- Throws:
IOException
-
getProducedType
Description copied from class:SimpleStreamFormatGets the type produced by this format. This type will be the type produced by the file source as a whole.- Specified by:
getProducedTypein interfaceorg.apache.flink.api.java.typeutils.ResultTypeQueryable<String>- Specified by:
getProducedTypein interfaceStreamFormat<String>- Specified by:
getProducedTypein classSimpleStreamFormat<String>
-