Kev*_*uli 4 hadoop hdfs cloudera-cdh
这里是HDFS的新手.
我有一小段代码来测试附加到文件:
val path: Path = new Path("/tmp", "myFile")
val config = new Configuration()
val fileSystem: FileSystem = FileSystem.get(config)
val outputStream = fileSystem.append(path)
outputStream.writeChars("what's up")
outputStream.close()
Run Code Online (Sandbox Code Playgroud)
它失败了这条消息:
Not supported
java.io.IOException: Not supported
at org.apache.hadoop.fs.ChecksumFileSystem.append(ChecksumFileSystem.java:352)
at org.apache.hadoop.fs.FileSystem.append(FileSystem.java:1163)
Run Code Online (Sandbox Code Playgroud)
我查看了ChecksumFileSystem.java的源代码,它似乎被硬编码为不支持追加:
@Override
public FSDataOutputStream append(Path f, int bufferSize,
Progressable progress) throws IOException {
throw new IOException("Not supported");
}
Run Code Online (Sandbox Code Playgroud)
如何使这项工作?是否有某种方式为默认文件系统更改为其他的实现,并支持追加?
| 归档时间: |
|
| 查看次数: |
3186 次 |
| 最近记录: |