我在下面提到的行中得到filenotfoundexception。在hadoop1早期,这是功能性的。但现在它抛出了一个filenotfoundexception
Path localManifestFolder;
Path localManifestPath = new Path("hdfs:///WordCount/write/manifest");
PrintWriter pw = null;
FileSystem fs = null;
try {
URI localHDFSManifestUri = new URI("
hdfs:///WordCount/write");
fs = FileSystem.get(localHDFSManifestUri, conf);
localManifestFolder = new Path("hdfs:///WordCount/write");
FileStatus[] listOfFiles = fs.listStatus(localManifestFolder); // Getting Error in this line
} catch (FileNotFoundException ex) {
throw ex;
}
例外情况:
java.io.FileNotFoundException: File hdfs:/WordCount/write does not exist.
请告诉我为什么会发生这种事
1条答案
按热度按时间h4cxqtbf1#
如果类路径上没有core-site.xml,则需要指定hdfs位置(否则默认为本地文件系统)
例如