-Context Object in Map Reduce
Tanniru Govardhan 2013-07-26, 13:37
I am trying to pass a string variable from Driver class to Mapper class.
I came to know that i need to use context variable for this purpose.
But the Mapper method i have used has a signature without context object.
It is not allowing to change the method signature.(reporting syntax error)
Can anyone please suggest me what can I do regarding this?
I am very new to Map Reduce Programming.
Here is the code:
class Map<V> extends MapReduceBase implements Mapper<LongWritable, Text,
private Text word = new Text();
private IntWritable var = new IntWritable();
public void map(LongWritable key, Text value, *Context
context,*OutputCollector<Text, IntWritable> output, Reporter reporter)
*//here is the error *
Configuration conf = context.getConfiguration();
myfilename = conf.get("filename");
-- - - -- - -- -
public void compute() throws Exception
Configuration config = new Configuration();
JobConf conf = new JobConf(Hadoop_GNTS.class);
-- - - - -- - -
manish dunani 2013-07-26, 14:33
manish dunani 2013-07-26, 14:56
Tanniru Govardhan 2013-07-26, 15:36