FileSystem是否就相当于client?
每次FileSystem.create就是新建了一个client?
关于hdfs文件关闭,当FSDataOutputStream流关闭了,是否就表示这个文件关闭了,该文件可以供其他操作,如hive、MR等,因为文件不关闭,是无法供其他操作的;还是FileSystem关闭了才算文件关闭,才能对该文件做其他操作?
天蓬老师2017-04-18 09:48:04
Yes
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