title: Hadoop DistributedCache is deprecated - what is the preferred API?
body: <p>My map tasks need some configuration data, which I would like to distribute via the Distributed Cache.</p>
  
  <p>The Hadoop <a href="https://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html#DistributedCache">MapReduce Tutorial</a> shows the <a href="https://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html#Example%3a+WordCount+v2.0">usage</a> of the DistributedCache class, roughly as follows:</p>
  
  <pre><code>// In the driver
  JobConf conf = new JobConf(getConf(), WordCount.class);
  ...
  DistributedCache.addCacheFile(new Path(filename).toUri(), conf); 
  
  // In the mapper
  Path[] myCacheFiles = DistributedCache.getLocalCacheFiles(job);
  ...
  </code></pre>
  
  <p>However, <code>DistributedCache</code> is <a href="http://hadoop.apache.org/docs/stable/api/org/apache/hadoop/filecache/DistributedCache.html">marked as deprecated</a> in Hadoop 2.2.0.</p>
  
  <p>What is the new preferred way to achieve this? Is there an up-to-date example or tutorial covering this API?</p>