Sunday, January 15, 2012

How to Pass Parameter to Mapper in Hadoop Map Reuce

In Main of Your Program

String Input_Parameter_Value = "Value_send_to_Mapper";
Configuration conf = HBaseConfiguration.create();
conf.set("Input_Parameter_Name",Input_Parameter_Value);

In Mapper, I access this value in setup function

String value = context.getConfiguration().get("Input_Parameter_Name");
System.out.print("Value: "+value);

No comments:

Post a Comment