java - hdfs FSDataOutputStream和FileSystem的问题
迷茫
迷茫 2017-04-18 09:46:04
0
1
565

FileSystem是否就相当于client?
每次FileSystem.create就是新建了一个client?

关于hdfs文件关闭,当FSDataOutputStream流关闭了,是否就表示这个文件关闭了,该文件可以供其他操作,如hive、MR等,因为文件不关闭,是无法供其他操作的;还是FileSystem关闭了才算文件关闭,才能对该文件做其他操作?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
Peter_Zhu
  1. Yes

  2. Just close the FSDataOutputStream stream. This is for writing a single file. FileSystem is just a client as you understand it, and it is completely different from closing the read-write stream of a single file. In addition, the main purpose of closing the FSDataOutputStream stream is to flush the currently written content to the real file system, otherwise the reading and writing may be out of sync and cause problems

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!