java - Sending a variable to the Mapper Class -


i trying input user , pass mapper class have created whenever value initialises 0 instead of using actual value user input.

how can make sure whenever variable maintain same value. have noticed job1.setmapperclass(parallel_for.class); creates instance of class hence forcing variable reinitialize original value. below link 2 classes. trying value of times runnertool class.

link java testfor class

link runnertool class

// setup method in mapper

@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") + " name commandline");     log.info(times + " number of iteration commandline"); } 

// runnertools class

conf.setint(iteration, times);

you should note mapper class recreated on many cluster nodes initalization done instance of mapper class when running job not affect other nodes. technically relevant jar file/s distributed among nodes , mappers created there. pointed in answer above, way pass information mappers using configuration class.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -