@Public public abstract class GenericInputFormat<OT> extends RichInputFormat<OT,GenericInputSplit>
Modifier and Type | Field and Description |
---|---|
protected int |
partitionNumber
The partition of this split.
|
Constructor and Description |
---|
GenericInputFormat() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Method that marks the end of the life-cycle of an input split.
|
void |
configure(Configuration parameters)
Configures this input format.
|
GenericInputSplit[] |
createInputSplits(int numSplits)
Creates the different splits of the input that can be processed in parallel.
|
DefaultInputSplitAssigner |
getInputSplitAssigner(GenericInputSplit[] splits)
Gets the type of the input splits that are processed by this input format.
|
BaseStatistics |
getStatistics(BaseStatistics cachedStatistics)
Gets the basic statistics from the input described by this format.
|
void |
open(GenericInputSplit split)
Opens a parallel instance of the input format to work on a split.
|
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
nextRecord, reachedEnd
public void configure(Configuration parameters)
InputFormat
This method is always called first on a newly instantiated input format.
parameters
- The configuration with all parameters (note: not the Flink config but the TaskConfig).public BaseStatistics getStatistics(BaseStatistics cachedStatistics) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be configured.
cachedStatistics
- The statistics that were cached. May be null.IOException
public GenericInputSplit[] createInputSplits(int numSplits) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be configured.
numSplits
- The minimum desired number of splits. If fewer are created, some parallel
instances may remain idle.IOException
- Thrown, when the creation of the splits was erroneous.public DefaultInputSplitAssigner getInputSplitAssigner(GenericInputSplit[] splits)
InputFormat
public void open(GenericInputSplit split) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be configured.
split
- The split to be opened.IOException
- Thrown, if the spit could not be opened due to an I/O problem.public void close() throws IOException
InputFormat
When this method is called, the input format it guaranteed to be opened.
IOException
- Thrown, if the input could not be closed properly.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.