Exception in thread "main" java.lang.IllegalArgumentException:解决方法


使用fileSystem的delete方法无法删除文件或目录

Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://h1:9000/out, expected: file:///

at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:381)

at org.apache.hadoop.fs.RawLocalFileSystem.pathToFile(RawLocalFileSystem.java:55)

at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:393)

at org.apache.hadoop.fs.ChecksumFileSystem.delete(ChecksumFileSystem.java:452)

at mapreduce.WordCountApp.main(WordCountApp.java:36)

由于获取fileSystem对象的时候没有传入访问地址导致。

FileSystem fileSystem = FileSystem.get(new URI(INPUT_PATH),conf);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM