This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RoundRobinTableInputFormat extends TableInputFormat { | |
@Override | |
public List<InputSplit> getSplits(JobContext context) throws IOException { | |
List<InputSplit> inputSplits = super.getSplits(context); // Get splits from HBase TableInputFormat gives | |
List<InputSplit> roundRobinInputSplits = new ArrayList<InputSplit>(); | |
Map<String, List<InputSplit>> regionServersInputSplits = new HashMap<String, List<InputSplit>>(); | |
// Prepare a hashmap with each region server as key and list of Input Splits as value | |
if (inputSplits != null && inputSplits.size() != 0) { | |
for (InputSplit inputSplit : inputSplits) { | |
if (inputSplit instanceof TableSplit) { |