Skip to content

Instantly share code, notes, and snippets.

@also
Created August 16, 2011 20:28
Show Gist options
  • Save also/1150089 to your computer and use it in GitHub Desktop.
Save also/1150089 to your computer and use it in GitHub Desktop.
val job = new Job(getConf())
job.getConfiguration().setInt("mapred.map.tasks", 1)
job.setJarByClass(classOf[LogStats])
job.setJobName("logstats")
job.setMapperClass(classOf[LocMap])
job.setReducerClass(classOf[CountReduce])
job.setMapOutputKeyClass(classOf[TextTriple])
job.setMapOutputValueClass(classOf[LongWritable])
job.setOutputKeyClass(classOf[TextTriple])
job.setOutputValueClass(classOf[LongWritable])
FileInputFormat.setInputPaths(job, new Path(inputPath))
FileOutputFormat.setOutputPath(job, new Path(outputPath))
val success = job.waitForCompletion(true)
return if (success) 0 else 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment