I just started working on some hadoop/hbase MapReduce job (using cloudera) and I have the following question :
Let's say, we have a java class with a main and a static viariable. That class define inner class corresponding to the Mapper and Reducer tasks.
Before lauching the job, the main initialize the static variable. This variable is read in the Mapper class. The class is then launched using 'hadoop jar' on a cluster.
My question: I don't see how Map and Reduce tasks on other nodes can see that static variable. Is there any "hadoop magic" that allow nodes to share a jvm or static variables ? How can this even work ?
I have to work on a class doing just that, and I can't figure out how this is ok in a non-mononode cluster.
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…