<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: MRUnit wih DistributedCache support in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172860#M37569</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11492/biswajit2015in.html" nodeid="11492"&gt;@Biswajit Chakraborty&lt;/A&gt; I can't believe I didn't think of this earlier, take a look at &lt;A href="https://apache.googlesource.com/mrunit/+/e43ef01dd1199a7eb0963edbf05258a8609bf0dc/src/test/java/org/apache/hadoop/mrunit/mapreduce/TestDistributedCache.java" target="_blank"&gt;https://apache.googlesource.com/mrunit/+/e43ef01dd1199a7eb0963edbf05258a8609bf0dc/src/test/java/org/apache/hadoop/mrunit/mapreduce/TestDistributedCache.java&lt;/A&gt; This is MRUnit's own DistributedCache test with examples how to set it up.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2016 01:10:00 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2016-08-12T01:10:00Z</dc:date>
    <item>
      <title>MRUnit wih DistributedCache support</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172856#M37565</link>
      <description>&lt;P&gt;Hi All , &lt;/P&gt;&lt;P&gt;I have a simple mapper which read some data from a log file and do some join operation with a another file data and send that combined output to reducer for further processing. &lt;/P&gt;&lt;P&gt;In mapper I have used DistributedCache as the file is small one. Its working properly. &lt;/P&gt;&lt;P&gt;Now I have to write some MRUnit test cases for that mapper. Can any one help me out with some code example how to write MRUnit with DistributedCache support. &lt;/P&gt;&lt;P&gt;I am using Hadoop2 and MRUnit version is as follows ....&lt;/P&gt;&lt;PRE&gt;&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;org.apache.mrunit&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;mrunit&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;1.1.0&amp;lt;/version&amp;gt;
    &amp;lt;classifier&amp;gt;hadoop2&amp;lt;/classifier&amp;gt; 
&amp;lt;/dependency&amp;gt;&lt;/PRE&gt;&lt;P&gt;In Driver class I have added for DistributedCache (this is just to explain how I added cache in MR)Job job = Job.getInstance(conf);job.setJarByClass(ReportDriver.class);&lt;/P&gt;&lt;PRE&gt;job.setJobName("Report");
job.addCacheFile(new Path("zone.txt").toUri());
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
job.setMapperClass(ReportMapper.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
job.setReducerClass(ReportReducer.class);
job.setNumReduceTasks(3);
//job.setCombinerClass(ReportReducer.class);
logger.info("map job started ---------------");
System.exit(job.waitForCompletion(true) ? 0 : 1);&lt;/PRE&gt;&lt;P&gt;In Mapper class I am fetching the cases file like this ....&lt;/P&gt;&lt;PRE&gt;@Override
protected void setup(Context context) throws IOException, InterruptedException 
{
        URI[] localPaths = context.getCacheFiles();
}
&lt;/PRE&gt;&lt;P&gt;Please help me out if any one use DistributedCache with MRUnit with some code example...&lt;/P&gt;&lt;P&gt;Thanks a lot ....&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 18:19:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172856#M37565</guid>
      <dc:creator>Biswajit16</dc:creator>
      <dc:date>2016-08-11T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: MRUnit wih DistributedCache support</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172857#M37566</link>
      <description>&lt;P&gt;Hi Biswajit, are you aware that MRUnit is pretty much dead project? There is no more development done on it. that said, I found an example here &lt;A href="http://stackoverflow.com/questions/15674229/mapreduce-unit-test-fails-to-mock-distributedcache-getlocalcachefiles" target="_blank"&gt;http://stackoverflow.com/questions/15674229/mapreduce-unit-test-fails-to-mock-distributedcache-getlocalcachefiles&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 19:52:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172857#M37566</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-08-11T19:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: MRUnit wih DistributedCache support</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172858#M37567</link>
      <description>&lt;P&gt;Hi , Thanks for you reply....&lt;/P&gt;&lt;P&gt;ohhh.... is it , I did not know that. Is there any other unit testing tool do you know for M/R job ? &lt;/P&gt;&lt;P&gt;I gone through the URL also , its helpful but I also experienced the same issue as reported in stackoverlow "Null Pointer" exception when mapper trying to get the path/URI from configuration. &lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 20:47:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172858#M37567</guid>
      <dc:creator>Biswajit16</dc:creator>
      <dc:date>2016-08-11T20:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: MRUnit wih DistributedCache support</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172859#M37568</link>
      <description>&lt;P&gt;unfortunately there are none that I know of. We do have one engineer who's providing support for his unit-testing framework and it has mapreduce unit testing capabilities, though I am not sure if distributedcache testing is supported. &lt;A href="https://github.com/sakserv/hadoop-mini-clusters"&gt;https://github.com/sakserv/hadoop-mini-clusters&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 01:05:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172859#M37568</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-08-12T01:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: MRUnit wih DistributedCache support</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172860#M37569</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11492/biswajit2015in.html" nodeid="11492"&gt;@Biswajit Chakraborty&lt;/A&gt; I can't believe I didn't think of this earlier, take a look at &lt;A href="https://apache.googlesource.com/mrunit/+/e43ef01dd1199a7eb0963edbf05258a8609bf0dc/src/test/java/org/apache/hadoop/mrunit/mapreduce/TestDistributedCache.java" target="_blank"&gt;https://apache.googlesource.com/mrunit/+/e43ef01dd1199a7eb0963edbf05258a8609bf0dc/src/test/java/org/apache/hadoop/mrunit/mapreduce/TestDistributedCache.java&lt;/A&gt; This is MRUnit's own DistributedCache test with examples how to set it up.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 01:10:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172860#M37569</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-08-12T01:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: MRUnit wih DistributedCache support</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172861#M37570</link>
      <description>&lt;P&gt;yapee......Artem , Thanks a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ...... &lt;/P&gt;&lt;P&gt;You really saved my day.... Thanks again .....&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 02:42:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172861#M37570</guid>
      <dc:creator>Biswajit16</dc:creator>
      <dc:date>2016-08-12T02:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: MRUnit wih DistributedCache support</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172862#M37571</link>
      <description>&lt;P&gt;Please consider publishing an article on this, others will find it useful as it's not an obvious find.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 02:50:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/MRUnit-wih-DistributedCache-support/m-p/172862#M37571</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-08-12T02:50:46Z</dc:date>
    </item>
  </channel>
</rss>

