lp.set((String)entry.getKey(), (String)entry.getValue());
}
FileInputFormat.addInputPath(lp, new Path(inputDir + "/page_views"));
FileOutputFormat.setOutputPath(lp, new Path(outputDir + "/p"));
lp.setNumReduceTasks(Integer.parseInt(parallel));
Job loadPages = new Job(lp);
JobConf lu = new JobConf(L11.class);
lu.setJobName("L11 Load Widerow");
lu.setInputFormat(TextInputFormat.class);
lu.setOutputKeyClass(Text.class);
lu.setOutputValueClass(Text.class);
lu.setMapperClass(ReadWideRow.class);
lu.setCombinerClass(ReadWideRow.class);
lu.setReducerClass(ReadWideRow.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 + "/widerow"));
FileOutputFormat.setOutputPath(lu, new Path(outputDir + "/wr"));
lu.setNumReduceTasks(Integer.parseInt(parallel));
Job loadWideRow = new Job(lu);
JobConf join = new JobConf(L11.class);
join.setJobName("L11 Union WideRow and Pages");
join.setInputFormat(KeyValueTextInputFormat.class);
join.setOutputKeyClass(Text.class);
join.setOutputValueClass(Text.class);
join.setMapperClass(IdentityMapper.class);
join.setCombinerClass(Union.class);
join.setReducerClass(Union.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(outputDir + "/p"));
FileInputFormat.addInputPath(join, new Path(outputDir + "/wr"));
FileOutputFormat.setOutputPath(join, new Path(outputDir + "/L11out"));
join.setNumReduceTasks(Integer.parseInt(parallel));
Job joinJob = new Job(join);
joinJob.addDependingJob(loadPages);
joinJob.addDependingJob(loadWideRow);
JobControl jc = new JobControl("L11 join");
jc.addJob(loadPages);
jc.addJob(loadWideRow);
jc.addJob(joinJob);