[ https://issues.apache.org/jira/browse/HDFS-5478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Randall resolved HDFS-5478. --------------------------------- Resolution: Duplicate Closed, duplicate, fixed in 2.0.3, solution requires {{FSDataOutputStream}} to be cast to {{HdfsDataOutputStream}} to call an overloaded {{hsync}} method. > File size reports as zero after writing and calling FSDataOutputStream#hsync() > ------------------------------------------------------------------------------ > > Key: HDFS-5478 > URL: https://issues.apache.org/jira/browse/HDFS-5478 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.0.0-alpha > Environment: RHEL/OEL 6u3 > Reporter: Brett Randall > > 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. -- This message was sent by Atlassian JIRA (v6.1#6144)