/** * Creates a job with the store specific job initialisation and then applies the operation specific * {@link uk.gov.gchq.gaffer.hdfs.operation.handler.job.initialiser.JobInitialiser}. * * @param operation The operation. * @param store The store executing the operation. * @return The created job. * @throws IOException for IO issues. */ default List<Job> createJobs(final O operation, final Store store) throws IOException { final List<Job> jobs = new ArrayList<>(); Map<String, List<String>> mapperGeneratorsToInputPathsList = new HashMap<>(); for (final Map.Entry<String, String> entry : operation.getInputMapperPairs().entrySet()) { if (mapperGeneratorsToInputPathsList.containsKey(entry.getValue())) { mapperGeneratorsToInputPathsList.get(entry.getValue()).add(entry.getKey()); } else { mapperGeneratorsToInputPathsList.put(entry.getValue(), Lists.newArrayList(entry.getKey())); } } for (final String mapperGeneratorClassName : mapperGeneratorsToInputPathsList.keySet()) { final JobConf jobConf = createJobConf(operation, mapperGeneratorClassName, store); final Job job = Job.getInstance(jobConf); setupJob(job, operation, mapperGeneratorClassName, store); if (null != operation.getJobInitialiser()) { operation.getJobInitialiser().initialiseJob(job, operation, store); } jobs.add(job); } return jobs; }