public class BinaryInputPartitioner extends FileInputPartitioner<byte[]>
| Modifier and Type | Field and Description |
|---|---|
protected int |
numSplits |
protected int |
recordLength
The length of a single record in the given binary file.
|
config, filePath, READ_WHOLE_SPLIT_FLAG, stream| Constructor and Description |
|---|
BinaryInputPartitioner(Path filePath,
int recordLen) |
BinaryInputPartitioner(Path filePath,
int recordLen,
Config cfg) |
BinaryInputPartitioner(Path filePath,
int recordLen,
int numberOfTasks) |
BinaryInputPartitioner(Path filePath,
int recordLen,
int numberOfTasks,
Config config) |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Config parameters)
Configures this input format.
|
FileInputSplit[] |
createInputSplits(int minNumSplits)
Computes the input splits for the file.
|
protected FileInputSplit |
createSplit(int num,
Path file,
long start,
long length,
java.lang.String[] hosts) |
InputSplitAssigner<byte[]> |
getInputSplitAssigner(FileInputSplit<byte[]>[] inputSplits)
Return the input split asigner
|
protected transient int recordLength
protected transient int numSplits
public BinaryInputPartitioner(Path filePath, int recordLen)
public BinaryInputPartitioner(Path filePath, int recordLen, int numberOfTasks)
public void configure(Config parameters)
InputPartitionerThis method is always called first on a newly instantiated input format.
configure in interface InputPartitioner<byte[],FileInputSplit<byte[]>>configure in class FileInputPartitioner<byte[]>parameters - The configuration with all parameters
(note: not the Flink config but the TaskConfig).public FileInputSplit[] createInputSplits(int minNumSplits) throws java.io.IOException
createInputSplits in interface InputPartitioner<byte[],FileInputSplit<byte[]>>createInputSplits in class FileInputPartitioner<byte[]>minNumSplits - The minimum desired number of file splits.java.io.IOExceptionpublic InputSplitAssigner<byte[]> getInputSplitAssigner(FileInputSplit<byte[]>[] inputSplits)
InputPartitionerinputSplits - the input splits to be assignedprotected FileInputSplit createSplit(int num, Path file, long start, long length, java.lang.String[] hosts)
createSplit in class FileInputPartitioner<byte[]>