Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
2.0.0-alpha
-
None
-
None
-
None
-
RHEL/OEL 6u3
Description
Using a Java client to write to a FSDataOutputStream. After some data is written and hsync() is called, hdfs dfs -get /path/to/file gets a file containing the data written so-far, all good.
hdfs dfs -ls /path/to/file however reports a zero-byte file, presumably until the stream is closed (it then shows the correct size). Hue File Browser (running CDH4) also shows zero bytes until the stream is closed.
See also http://grokbase.com/t/hadoop/hdfs-user/113j63nrce/zero-file-size-after-hsync which discusses the same problem.
After the buffer is flushed it would be good if the reported file size was updated.