@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.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
TextLineInputFormat.Reader
The actual reader for the
TextLineInputFormat. |
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEFAULT_CHARSET_NAME |
FETCH_IO_SIZE| 构造器和说明 |
|---|
TextLineInputFormat() |
TextLineInputFormat(String charsetName) |
| 限定符和类型 | 方法和说明 |
|---|---|
TextLineInputFormat.Reader |
createReader(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> |
getProducedType()
Gets the type produced by this format.
|
createReader, isSplittable, restoreReaderpublic TextLineInputFormat()
public TextLineInputFormat(String charsetName)
public TextLineInputFormat.Reader createReader(org.apache.flink.configuration.Configuration config, org.apache.flink.core.fs.FSDataInputStream stream) throws IOException
SimpleStreamFormatIf 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 在类中 SimpleStreamFormat<String>IOExceptionpublic org.apache.flink.api.common.typeinfo.TypeInformation<String> getProducedType()
SimpleStreamFormatgetProducedType 在接口中 org.apache.flink.api.java.typeutils.ResultTypeQueryable<String>getProducedType 在接口中 StreamFormat<String>getProducedType 在类中 SimpleStreamFormat<String>Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.