hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vandana kumari <kvandana1...@gmail.com>
Subject Error in using filecache
Date Fri, 20 Mar 2015 09:29:00 GMT
Hello all

I am using hadoop 2.2.0 and there is problem in using filecache.
*Following code is in driver class:*

      Configuration conf = new Configuration();

      Job job = Job.getInstance();
      job.addCacheFile(new URI(args[0]));


*Following code is in setup() of Mapper class:*
      Configuration conf = context.getConfiguration();

       URI[] dataFile = context.getCacheFiles();
       try {
       String line;
       BufferedReader cacheReader = new BufferedReader(
               new FileReader(dataFile[0].toString()));
               try {
               while ((line = cacheReader.readLine()) != null) {
               System.out.println(line);
               }
               } finally {
                   System.out.println("Error");
               cacheReader.close();
               }
        } catch (Exception e) {
            System.out.println("Error");
             e.printStackTrace();
             }

And i am getting File not found exception. Same problem if i use
DistributedCache.getLocalCacheFile().



-- 
Thanks and regards
  Vandana kumari

Mime
View raw message