标签:
1 hadoop conf.addResource
http://stackoverflow.com/questions/16017538/how-does-configuration-addresource-method-work-in-hadoop
How does Configuration.addResource() method work in hadoop up vote 0 down vote favorite Does Configuration.addResource() method load resource file like ClassLoader of java or it just encapsulates ClassLoader class.Because I find it can not use String like "../resource.xml" as argument of addResource() to load resource file out of classpath, this property is just the same as ClassLoader. Thx! hadoop shareimprove this question asked Apr 15 ‘13 at 14:18 foolyoghurt 478 "How does it work" is a different question from "why is my usage not working for me?" Which do you really want to know? – Matt Ball Apr 15 ‘13 at 14:19 add a comment 1 Answer active oldest votes up vote 2 down vote Browsing the Javadocs and source code for Configuration, Strings are assumed to be classpaths (line 1162), rather than relative to the file system - you should use URLs to reference files on the local file system as follows: conf.addResource(new File("../resource.xml").toURI().toURL()); shareimprove this answer answered Apr 17 ‘1
标签:
原文地址:http://www.cnblogs.com/hdu-2010/p/4929894.html