Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop >> mail # user >> MRUNIT basic question


Copy link to this message
-
MRUNIT basic question
Hi,
  I have been searching in mrunit documentation but hasnt been able to find
it so far..
How do i pass configuration parameters in my mrunit.

So for example, if i take the wordcount example.

Lets say, in my driver code I am setting this parameter...

conf.set("delimiter",args[2])

And in my mapper code I am calling this as:

String delimiter = conf.get("delimiter");
String [] tokens = value.toString().split(delimiter);
for (String token:tokens)
   context.write(token,one);

How do I set up this configuration parameter.

I have been looking into this example:
https://github.com/wpm/Hadoop-Word-Count/blob/master/src/test/java/wpmcn/hadoop/WordCountTest.java

Thanks
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB