Created on 07-27-2015 02:58 AM - edited 09-16-2022 02:35 AM
Hi,
I am running my oozie workflow through command prompt.
I assigning value to a parameter "var" in my my workflow.
<property>
<name>var</name>
<value>2</value>
</property>
Now how can i access the variable value in my java Mapper Program.
Will the below metioned work for me:
protected void setup(Context context) throws IOException,InterruptedException {
Configuration conf = context.getConfiguration();
var_val = conf.get("var");
}
Created 07-27-2015 03:03 AM
Created 07-27-2015 03:03 AM
Created 07-28-2015 06:43 AM
Hi Harsh,
The information provided for Java Action is clear to me. But I have doubt regarding MapReduce action.
I am using only Mapreduce action for my workflow and I am placing only my Mapper class & Reducer Class in the .jar file. I want to pass all the properties and parameters through Oozie workflow.
Now can I get the value of the "var" variable, i.e. "2", in my Mapper using the below code in my mapper class.
protected void setup(Context context) throws IOException,InterruptedException {
Configuration conf = context.getConfiguration();
var_val = conf.get("var");
}
Created 07-28-2015 07:06 AM