Saturday 15 March 2014

nullpointerexception - hadoop DistributedCache returns null -


I'm using a hat distributive catcher, but I've got some trouble. My proxy is in pseudo-distributed mode.

8022 / User / Admin / MyFile ") .tori (), Job .gate configuration ());

then recover in mapper setup (), but distributed cache .getLocalCache returns null.i can view through my cache file

System.out.println ("cache:" + context.get configuration (.) Get ("mapred.cache.files"));

P> This is my pseudocode:

  Public Static class zonmapper {@ protected void setup override {reference reference} {path [] cache files = distributed cache .gatecast files (reference .getconfiguration ()); System.out.println ("cache:" + context.get configuration (.) Get ("mapred.cache.files")); Path cachefile; If (cachefile! = Null) {}}} xx .... public static zero main (string [] args) {job job = new work (conf, "join test"); DistributedCache.addCacheFile (new path ("hdfs: // localhost: 8022 / user / admin / myfile") .tori (), job.getConfiguration ());}   

about the poor Sorry in

BTW, I

URI [] uris = Distributed cache. Get the URLs using GateCatch files (references .getconfiguration ()).

/ Ios / i / p>

URI Returns: When I try to read from Yuri, the file does not get an exception with the error.

  file system fs = FileSystem.get (new path ("hdfs: // localhost: 8022 / user / admin / myfile") .tori () , New configuration ()); Path path = new path (url); BuffettDr BR = New buffed reader (new intestine reader (F. Open (path));    

No comments:

Post a Comment