public abstract class FixedInputPartitioner<OT> extends java.lang.Object implements InputPartitioner<OT,FileInputSplit<OT>>
Modifier and Type | Field and Description |
---|---|
protected Config |
config |
protected Path |
filePath |
protected FSDataInputStream |
stream |
Constructor and Description |
---|
FixedInputPartitioner(Path filePath) |
FixedInputPartitioner(Path filePath,
Config cfg) |
FixedInputPartitioner(Path filePath,
Config cfg,
int datasize) |
Modifier and Type | Method and Description |
---|---|
void |
configure(Config parameters)
Configures this input format.
|
FileInputSplit<OT>[] |
createInputSplits(int minNumSplits)
This method create the input splits which is based on the number of lines in the input and the
parallelism value.
|
protected abstract FileInputSplit |
createSplit(int num,
Path file,
long start,
long length,
java.lang.String[] hosts) |
InputSplitAssigner<OT> |
getInputSplitAssigner(FileInputSplit<OT>[] inputSplits)
Return the input split asigner
|
protected Path filePath
protected Config config
protected FSDataInputStream stream
public FixedInputPartitioner(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)
public InputSplitAssigner<OT> getInputSplitAssigner(FileInputSplit<OT>[] inputSplits)
InputPartitioner
getInputSplitAssigner
in interface InputPartitioner<OT,FileInputSplit<OT>>
inputSplits
- the input splits to be assigned