Your Map class needs to have a configure method that can access the JobConf.
Like this:
public void configure(JobConf conf)
{
System.out.println(conf.get("map.input.file");
}
randy
----- Original Message -----
From: "Rares Vernica" <[email protected]>
To: [email protected]
Sent: Tuesday, June 2, 2009 12:45:02 PM GMT -05:00 US/Canada Eastern
Subject: problem getting map input filename
Hello,
I have a problem getting the map input file name. Here is what I tried:
public class Map extends Mapper<Object, Text, LongWritable, Text> {
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
Configuration conf = context.getConfiguration();
System.out.println(conf.get("map.input.file"));
System.out.println(conf.get("map.input.filename"));
System.out.println(conf.get("mapred.input.file"));
System.out.println(conf.get("mapred.input.filename"));
}
protected void setup(Context context) throws IOException,
InterruptedException {
Configuration conf = context.getConfiguration();
System.out.println(conf.get("map.input.file"));
System.out.println(conf.get("map.input.filename"));
System.out.println(conf.get("mapred.input.file"));
System.out.println(conf.get("mapred.input.filename"));
}
}
All the get is "null". What am I doing wrong?
Thanks,
Rares