@PublicEvolving public class TextInputFormat extends DelimitedInputFormat<String>
FileInputFormat.FileBaseStatistics, FileInputFormat.InputSplitOpenThread
currBuffer, currLen, currOffset, RECORD_DELIMITER
currentSplit, ENUMERATE_NESTED_FILES_FLAG, enumerateNestedFiles, filePath, INFLATER_INPUT_STREAM_FACTORIES, minSplitSize, numSplits, openTimeout, READ_WHOLE_SPLIT_FLAG, splitLength, splitStart, stream, unsplittable
Constructor and Description |
---|
TextInputFormat(Path filePath) |
Modifier and Type | Method and Description |
---|---|
void |
configure(Configuration parameters)
Configures this input format by reading the path to the file from the configuration and the
string that defines the record delimiter.
|
String |
getCharsetName() |
String |
readRecord(String reusable,
byte[] bytes,
int offset,
int numBytes)
This function parses the given byte array which represents a serialized record.
|
void |
setCharsetName(String charsetName) |
boolean |
supportsMultiPaths()
Override this method to supports multiple paths.
|
String |
toString() |
close, getBufferSize, getCharset, getCurrentState, getDelimiter, getLineLengthLimit, getNumLineSamples, getStatistics, initializeSplit, loadConfigParameters, loadGlobalConfigParams, nextRecord, open, reachedEnd, readLine, reopen, setBufferSize, setCharset, setDelimiter, setDelimiter, setDelimiter, setLineLengthLimit, setNumLineSamples
acceptFile, createInputSplits, decorateInputStream, extractFileExtension, getFilePath, getFilePaths, getFileStats, getFileStats, getInflaterInputStreamFactory, getInputSplitAssigner, getMinSplitSize, getNestedFileEnumeration, getNumSplits, getOpenTimeout, getSplitLength, getSplitStart, registerInflaterInputStreamFactory, setFilePath, setFilePath, setFilePaths, setFilePaths, setFilesFilter, setMinSplitSize, setNestedFileEnumeration, setNumSplits, setOpenTimeout, testForUnsplittable
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
public TextInputFormat(Path filePath)
public String getCharsetName()
public void setCharsetName(String charsetName)
public void configure(Configuration parameters)
DelimitedInputFormat
configure
in interface InputFormat<String,FileInputSplit>
configure
in class DelimitedInputFormat<String>
parameters
- The configuration object to read the parameters from.InputFormat.configure(org.apache.flink.configuration.Configuration)
public String readRecord(String reusable, byte[] bytes, int offset, int numBytes) throws IOException
DelimitedInputFormat
readRecord
in class DelimitedInputFormat<String>
reusable
- An optionally reusable object.bytes
- Binary data of serialized records.offset
- The offset where to start to read the record data.numBytes
- The number of bytes that can be read starting at the offset position.IOException
- if the record could not be read.public String toString()
toString
in class FileInputFormat<String>
public boolean supportsMultiPaths()
FileInputFormat
supportsMultiPaths
in class FileInputFormat<String>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.