title: hadoop DistributedCache returns null
body: <p>i'm using hadoop DistributedCache,but i got some troubles.
  my hadoop is in pseudo-distributed mode.</p>
  
  <p><a href="http://mail-archives.apache.org/mod_mbox/hadoop-common-user/201007.mbox/%3C651981.45757.qm@web46311.mail.sp1.yahoo.com%3E" rel="nofollow">from here we can see in pseudo-distributed mode we use 
  DistributedCache.getLocalCache(xx) to retrive cached file.</a></p>
  
  <p>first i put my file into DistributedCache:</p>
  
  <pre><code>DistributedCache.addCacheFile(new Path(
  "hdfs://localhost:8022/user/administrator/myfile").toUri(),
              job.getConfiguration());
  </code></pre>
  
  <p>then retrieve in mapper setup(),but <code>DistributedCache.getLocalCache</code> returns null.i can see my cached file through</p>
  
  <p><code>System.out.println("Cache: "+context.getConfiguration().get("mapred.cache.files"));</code></p>
  
  <p>and it print out:</p>
  
  <p><code>hdfs://localhost:8022/user/administrator/myfile</code></p>
  
  <p>here is my Pseudocode:</p>
  
  <pre><code>public static class JoinMapper{
       @Override
  protected void setup(Context context){
          Path[] cacheFiles = DistributedCache.getLocalCacheFiles(context
                  .getConfiguration());
      System.out.println("Cache 
               :"+context.getConfiguration().get("mapred.cache.files"));
        Path cacheFile;
        if (cacheFiles != null) {}
      }
  }
  
  xx....
  
  public static void main(String[] args){
               Job job = new Job(conf, "Join Test");
          DistributedCache.addCacheFile(new Path("hdfs://localhost:8022/user/administrator/myfile").toUri(),
              job.getConfiguration());}
  </code></pre>
  
  <p>sorry about poor Typesetting.anyone help please....</p>
  
  <p>btw,i can get uris using</p>
  
  <p><code>URI[] uris = DistributedCache.getCacheFiles(context
                          .getConfiguration());</code></p>
  
  <p>uris returns :
  hdfs://localhost:8022/user/administrator/myfile</p>
  
  <p>when i try to read from uri,error with file not found exception.</p>