title: MapReduce Distributed Cache
body: <p>I am adding a file to distributed cache of Hadoop using</p>
  
  <pre><code>     Configuration cng=new Configuration();
       JobConf conf = new JobConf(cng, Driver.class);
       DistributedCache.addCacheFile(new Path("DCache/Orders.txt").toUri(), cng);
  </code></pre>
  
  <p>where DCache/Orders.txt is the file in HDFS. </p>
  
  <p>When I try to retrieve this file from the cache in configure method of mapper using:</p>
  
  <pre><code>    Path[] cacheFiles=DistributedCache.getLocalCacheFiles(conf);
  </code></pre>
  
  <p>I get null pointer. What can be the error?</p>
  
  <p>Thanks</p>