Search in sources :

Example 1 with NonParallelInput

use of org.apache.flink.api.common.io.NonParallelInput in project flink by apache.

the class NonRichGenericInputFormat method createInputSplits.

@Override
public GenericInputSplit[] createInputSplits(int numSplits) throws IOException {
    if (numSplits < 1) {
        throw new IllegalArgumentException("Number of input splits has to be at least 1.");
    }
    numSplits = (this instanceof NonParallelInput) ? 1 : numSplits;
    GenericInputSplit[] splits = new GenericInputSplit[numSplits];
    for (int i = 0; i < splits.length; i++) {
        splits[i] = new GenericInputSplit(i, numSplits);
    }
    return splits;
}
Also used : GenericInputSplit(org.apache.flink.core.io.GenericInputSplit) NonParallelInput(org.apache.flink.api.common.io.NonParallelInput)

Aggregations

NonParallelInput (org.apache.flink.api.common.io.NonParallelInput)1 GenericInputSplit (org.apache.flink.core.io.GenericInputSplit)1