hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: Calling o/s.flush() in HLog.sync()?
Date Thu, 07 Nov 2013 22:56:56 GMT
Himanshu:
See
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/io/DataOutputStream.java#DataOutputStream.flush%28%29
The flush() call results in OutputStream.flush().

Cheers


On Mon, Nov 4, 2013 at 9:11 PM, Himanshu Vashishtha <hv.csuoa@gmail.com>wrote:

> Looking at ProtobufLogWriter class, it looks like the call to flush() in
> the sync method is a noop.
>
>
> https://github.com/apache/hbase/blob/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/ProtobufLogWriter.java#L134
>
> The underlying output stream is DFSOutputStream, which doesn't implement
> flush().
>
> And, it calls sync() anyway, which ensures the data is written to DN's
> (cache).
>
> Previously with SequenceFile$Writer, it writes data to the outputstream
> (using Writables#write), and invoke sync/hflush.
>
> https://github.com/apache/hadoop-common/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SequenceFile.java#L1314
>
> Is there a reason we have this call here? Please let me know if I miss any
> context.
>
> Thanks,
> Himanshu
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message