public class HiveTableFileInputFormat extends FileInputFormat<RowData>
FileInputFormat
that wraps a HiveTableInputFormat
.
We only use a HiveTableInputFormat
to read the data of a FileInputSplit
.
`createInputSplits`, `getInputSplitAssigner` will use FileInputFormat
's logic.
FileInputFormat.FileBaseStatistics, FileInputFormat.InputSplitOpenThread
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 |
---|
HiveTableFileInputFormat(HiveTableInputFormat inputFormat,
HiveTablePartition hiveTablePartition) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the file input stream of the input format.
|
void |
closeInputFormat()
Closes this InputFormat instance.
|
void |
configure(Configuration parameters)
Configures the file input format by reading the file path from the configuration.
|
RowData |
nextRecord(RowData reuse)
Reads the next record from the input.
|
void |
open(FileInputSplit fileSplit)
Opens an input stream to the file defined in the input format.
|
void |
openInputFormat()
Opens this InputFormat instance.
|
boolean |
reachedEnd()
Method used to check if the end of the input is reached.
|
void |
setRuntimeContext(RuntimeContext t) |
acceptFile, createInputSplits, decorateInputStream, extractFileExtension, getFilePath, getFilePaths, getFileStats, getFileStats, getInflaterInputStreamFactory, getInputSplitAssigner, getMinSplitSize, getNestedFileEnumeration, getNumSplits, getOpenTimeout, getSplitLength, getSplitStart, getStatistics, registerInflaterInputStreamFactory, setFilePath, setFilePath, setFilePaths, setFilePaths, setFilesFilter, setMinSplitSize, setNestedFileEnumeration, setNumSplits, setOpenTimeout, supportsMultiPaths, testForUnsplittable, toString
getRuntimeContext
public HiveTableFileInputFormat(HiveTableInputFormat inputFormat, HiveTablePartition hiveTablePartition)
public void open(FileInputSplit fileSplit) throws IOException
FileInputFormat
The stream is actually opened in an asynchronous thread to make sure any interruptions to the thread working on the input format do not reach the file system.
open
in interface InputFormat<RowData,FileInputSplit>
open
in class FileInputFormat<RowData>
fileSplit
- The split to be opened.IOException
- Thrown, if the spit could not be opened due to an I/O problem.public boolean reachedEnd() throws IOException
InputFormat
When this method is called, the input format it guaranteed to be opened.
IOException
- Thrown, if an I/O error occurred.public RowData nextRecord(RowData reuse) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be opened.
reuse
- Object that may be reused.IOException
- Thrown, if an I/O error occurred.public void configure(Configuration parameters)
FileInputFormat
configure
in interface InputFormat<RowData,FileInputSplit>
configure
in class FileInputFormat<RowData>
parameters
- The configuration with all parameters (note: not the Flink config but the
TaskConfig).InputFormat.configure(org.apache.flink.configuration.Configuration)
public void close() throws IOException
FileInputFormat
close
in interface InputFormat<RowData,FileInputSplit>
close
in class FileInputFormat<RowData>
IOException
- Thrown, if the input could not be closed properly.public void setRuntimeContext(RuntimeContext t)
setRuntimeContext
in class RichInputFormat<RowData,FileInputSplit>
public void openInputFormat() throws IOException
RichInputFormat
openInputFormat
in class RichInputFormat<RowData,FileInputSplit>
IOException
- in case allocating the resources failed.InputFormat
public void closeInputFormat() throws IOException
RichInputFormat
RichInputFormat.openInputFormat()
should be closed in this method.closeInputFormat
in class RichInputFormat<RowData,FileInputSplit>
IOException
- in case closing the resources failedInputFormat
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.