src/main/java/it/unibo/bd1819/utils/JobFactory.java
public static Job createThreeActorDirectorJob(final Configuration conf) throws Exception {

        FileSystem fs = FileSystem.get(conf);
        deleteOutputFolder(fs, threeActorsDirectorPath);

        Job threeDirectorsActorJob = Job.getInstance(conf, "Find for each director the three actors");

        threeDirectorsActorJob.setMapperClass(FindThreeActorsMapper.class);
        threeDirectorsActorJob.setReducerClass(FindThreeActorsReducer.class);

        threeDirectorsActorJob.setJarByClass(Main.class);

        threeDirectorsActorJob.setMapOutputKeyClass(Text.class);
        threeDirectorsActorJob.setMapOutputValueClass(Text.class);

        threeDirectorsActorJob.setOutputKeyClass(Text.class);
        threeDirectorsActorJob.setOutputValueClass(Text.class);

        threeDirectorsActorJob.setCombinerClass(FindThreeActorsCombiner.class);
        threeDirectorsActorJob.setInputFormatClass(KeyValueTextInputFormat.class);

        FileInputFormat.addInputPath(threeDirectorsActorJob, directorActorsJoinPath);
        FileOutputFormat.setOutputPath(threeDirectorsActorJob, threeActorsDirectorPath);

        return threeDirectorsActorJob;
    }
/**
     * Search the three most frequent actors for each director
     * @param conf the job configuration
     * @return an Hadoop job
     * @throws Exception if something goes wrong
     */
Search the three most frequent actors for each director
@param conf the job configuration
@return an Hadoop job
@throws Exception if something goes wrong
Search the three most frequent actors for each director @param conf the job configuration @return an Hadoop job @throws Exception if something goes wrong
public static Job createThreeActorDirectorJob(final Configuration conf) throws Exception {
        FileSystem fs = FileSystem.get(conf);
        deleteOutputFolder(fs, threeActorsDirectorPath);
        Job threeDirectorsActorJob = Job.getInstance(conf, "Find for each director the three actors");
        threeDirectorsActorJob.setMapperClass(FindThreeActorsMapper.class);
        threeDirectorsActorJob.setReducerClass(FindThreeActorsReducer.class);
        threeDirectorsActorJob.setJarByClass(Main.class);
        threeDirectorsActorJob.setMapOutputKeyClass(Text.class);
        threeDirectorsActorJob.setMapOutputValueClass(Text.class);
        threeDirectorsActorJob.setOutputKeyClass(Text.class);
        threeDirectorsActorJob.setOutputValueClass(Text.class);
        threeDirectorsActorJob.setCombinerClass(FindThreeActorsCombiner.class);
        threeDirectorsActorJob.setInputFormatClass(KeyValueTextInputFormat.class);
        FileInputFormat.addInputPath(threeDirectorsActorJob, directorActorsJoinPath);
        FileOutputFormat.setOutputPath(threeDirectorsActorJob, threeActorsDirectorPath);
        return threeDirectorsActorJob;
    }
public static Job createThreeActorDirectorJob ( final Configuration conf ) throws Exception { FileSystem fs = FileSystem . get ( conf ) ; deleteOutputFolder ( fs , threeActorsDirectorPath ) ; Job threeDirectorsActorJob = Job . getInstance ( conf , "Find for each director the three actors" ) ; threeDirectorsActorJob . setMapperClass ( FindThreeActorsMapper . class ) ; threeDirectorsActorJob . setReducerClass ( FindThreeActorsReducer . class ) ; threeDirectorsActorJob . setJarByClass ( Main . class ) ; threeDirectorsActorJob . setMapOutputKeyClass ( Text . class ) ; threeDirectorsActorJob . setMapOutputValueClass ( Text . class ) ; threeDirectorsActorJob . setOutputKeyClass ( Text . class ) ; threeDirectorsActorJob . setOutputValueClass ( Text . class ) ; threeDirectorsActorJob . setCombinerClass ( FindThreeActorsCombiner . class ) ; threeDirectorsActorJob . setInputFormatClass ( KeyValueTextInputFormat . class ) ; FileInputFormat . addInputPath ( threeDirectorsActorJob , directorActorsJoinPath ) ; FileOutputFormat . setOutputPath ( threeDirectorsActorJob , threeActorsDirectorPath ) ; return threeDirectorsActorJob ; }
Search the three most frequent actors for each director
 @param conf the job configuration
 @return an Hadoop job
 @throws Exception if something goes wrong
Search the three most frequent actors for each director @param conf the job configuration @return an Hadoop job @throws Exception if something goes wrong