@Override public List<InputSplit> getSplits(JobContext jobCtxt) throws IOException { // get the total data to be generated long toGen = jobCtxt.getConfiguration().getLong(GenerateData.GRIDMIX_GEN_BYTES, -1); if (toGen < 0) { throw new IOException("Invalid/missing generation bytes: " + toGen); } // get the total number of mappers configured int totalMappersConfigured = jobCtxt.getConfiguration().getInt(MRJobConfig.NUM_MAPS, -1); if (totalMappersConfigured < 0) { throw new IOException("Invalid/missing num mappers: " + totalMappersConfigured); } final long bytesPerTracker = toGen / totalMappersConfigured; final ArrayList<InputSplit> splits = new ArrayList<InputSplit>(totalMappersConfigured); for (int i = 0; i < totalMappersConfigured; ++i) { splits.add(new GenSplit(bytesPerTracker, new String[] { "tracker_local" })); } return splits; }