public abstract class CompleteFileInputPartitioner<OT> extends java.lang.Object implements InputPartitioner<OT,FileInputSplit<OT>>
Modifier and Type | Field and Description |
---|---|
protected Config |
config
Config file required for Hdfs connection
|
protected Path |
filePath
The path to the file that contains the input.
|
protected int |
numSplits
The desired number of splits, as set by the configure() method.
|
static long |
READ_WHOLE_SPLIT_FLAG
The splitLength is set to -1L for reading the whole split.
|
protected FSDataInputStream |
stream
The input data stream
|
Constructor and Description |
---|
CompleteFileInputPartitioner(Path filePath) |
CompleteFileInputPartitioner(Path filePath,
Config cfg) |
Modifier and Type | Method and Description |
---|---|
void |
configure(Config parameters)
Configures this input format.
|
FileInputSplit<OT>[] |
createInputSplits(int minNumSplits)
It creates the split for the complete file.
|
protected abstract FileInputSplit |
createSplit(int num,
Path file,
long start,
long length,
java.lang.String[] hosts) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputSplitAssigner
protected int numSplits
public static final long READ_WHOLE_SPLIT_FLAG
protected Path filePath
protected Config config
protected FSDataInputStream stream
public CompleteFileInputPartitioner(Path filePath)
public void configure(Config parameters)
InputPartitioner
This method is always called first on a newly instantiated input format.
configure
in interface InputPartitioner<OT,FileInputSplit<OT>>
parameters
- The configuration with all parameters
(note: not the Flink config but the TaskConfig).public FileInputSplit<OT>[] createInputSplits(int minNumSplits) throws java.io.IOException
createInputSplits
in interface InputPartitioner<OT,FileInputSplit<OT>>
minNumSplits
- Number of minimal input splits, as a hint.java.io.IOException
protected abstract FileInputSplit createSplit(int num, Path file, long start, long length, java.lang.String[] hosts)