lp.set((String)entry.getKey(), (String)entry.getValue());
}
FileInputFormat.addInputPath(lp, new Path(inputDir + "/page_views"));
FileOutputFormat.setOutputPath(lp, new Path(outputDir + "/highest_value_page_per_user"));
lp.setNumReduceTasks(Integer.parseInt(parallel));
Job loadPages = new Job(lp);
JobConf lu = new JobConf(L12.class);
lu.setJobName("L12 Find Total Timespent per Term");
lu.setInputFormat(TextInputFormat.class);
lu.setOutputKeyClass(Text.class);
lu.setOutputValueClass(LongWritable.class);
lu.setMapperClass(TotalTimespentPerTerm.class);
lu.setCombinerClass(TotalTimespentPerTerm.class);
lu.setReducerClass(TotalTimespentPerTerm.class);
props = System.getProperties();
for (Map.Entry<Object,Object> entry : props.entrySet()) {
lu.set((String)entry.getKey(), (String)entry.getValue());
}
FileInputFormat.addInputPath(lu, new Path(inputDir + "/page_views"));
FileOutputFormat.setOutputPath(lu, new Path(outputDir + "/total_timespent_per_term"));
lu.setNumReduceTasks(Integer.parseInt(parallel));
Job loadUsers = new Job(lu);
JobConf join = new JobConf(L12.class);
join.setJobName("L12 Find Queries Per Action");
join.setInputFormat(TextInputFormat.class);
join.setOutputKeyClass(Text.class);
join.setOutputValueClass(LongWritable.class);
join.setMapperClass(QueriesPerAction.class);
join.setCombinerClass(QueriesPerAction.class);
join.setReducerClass(QueriesPerAction.class);
props = System.getProperties();
for (Map.Entry<Object,Object> entry : props.entrySet()) {
join.set((String)entry.getKey(), (String)entry.getValue());
}
FileInputFormat.addInputPath(join, new Path(inputDir + "/page_views"));
FileOutputFormat.setOutputPath(join, new Path(outputDir + "/queries_per_action"));
join.setNumReduceTasks(Integer.parseInt(parallel));
Job joinJob = new Job(join);
JobControl jc = new JobControl("L12 join");
jc.addJob(loadPages);
jc.addJob(loadUsers);
jc.addJob(joinJob);