Note that there are some explanatory texts on larger screens.

plurals
  1. POSending a variable to the Mapper Class
    text
    copied!<p>I am trying to get an input from the user and pass it to my mapper class that I have created but whenever the value always initialises to zero instead of using the actual value the user input. </p> <p>How can make sure that whenever I get the variable it always maintain the same value. I have noticed that job1.setMapperClass(Parallel_for.class); creates an instance of the class hence forcing the variable to reinitialize to its original value. Below is the link to the two classes. I am trying to get the value of times from RunnerTool class. </p> <p><a href="https://docs.google.com/leaf?id=0BwSPoDdRDme8NzVmYWRlODctNmEzNC00ZjcwLWEzZDEtZTJiODVmNDI0NWZk&amp;hl=en_US%20https://docs.google.com/leaf?id=0BwSPoDdRDme8NDE1Yzc4N2MtYTM0Yy00M2MxLWIzOWMtMmE1YjhlNmU4NmM3&amp;hl=en_US" rel="nofollow">Link to Java TestFor class</a></p> <p><a href="https://docs.google.com/leaf?id=0BwSPoDdRDme8NDE1Yzc4N2MtYTM0Yy00M2MxLWIzOWMtMmE1YjhlNmU4NmM3&amp;sort=name&amp;layout=list&amp;num=50" rel="nofollow">Link to RunnerTool class</a></p> <p>// setup method in the Mapper</p> <pre><code>@Override public void setup(Context context) { int defaultValue = 1; times = context.getConfiguration().getInt("parallel_for_iteration", defaultValue ); LOG.info(context.getConfiguration().get("parallel_for_iteration") + " Actually name from the commandline"); LOG.info(times + " Actually number of iteration from the commandline"); } </code></pre> <p>// RunnerTools class</p> <p>conf.setInt(ITERATION, times);</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload