Advertisement
Guest User

Untitled

a guest
May 25th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public class ConfigReader extends Configured implements Tool{
  2.  
  3. public static class CRMapper extends Mapper<LongWritable, Text, Text, IntWritable>
  4. {
  5. @Override
  6. protected void map( LongWritable key,Text value,org.apache.hadoop.mapreduce.Mapper.Context context)throws IOException,
  7. InterruptedException {
  8. Configuration conf = context.getConfiguration();
  9. String propValue = conf.get("propertyName");
  10.  
  11. }
  12. }
  13.  
  14. public int run(String[] args) throws Exception {
  15.  
  16. Configuration myConf = getConf();
  17. Configuration tdpConf = new Configuration();
  18. myConf.addResource("conf-file.xml");
  19.  
  20. }
  21. public static void main(String[] args) throws Exception {
  22. int exitCode = ToolRunner.run(new ConfigReader(), args);
  23. System.exit(exitCode);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement