kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay Kreps <jay.kr...@gmail.com>
Subject Re: sync() in java
Date Sat, 05 Nov 2011 21:26:17 GMT
But does that sync that file or all files, looking for the later...

-jay

Sent from my iPhone

On Nov 5, 2011, at 1:44 PM, Joe Stein <cryptcom@gmail.com> wrote:

> On the fileoutputstream you can get the filedescriptor using getFD() and then on that
object you can sync()
> 
> /*
> Joe Stein
> http://www.medialets.com
> Twitter: @allthingshadoop
> */
> 
> On Nov 5, 2011, at 4:34 PM, Jay Kreps <jay.kreps@gmail.com> wrote:
> 
>> Does anyone know if there is an equivalent to the sync() system call
>> available in Java? This is the system call that flushes all files. This
>> seems like it might be a good optimization for the time-based log flush. If
>> you are going to sequentially flush all the log partitions anyway it might
>> be better to just do a single sync() and let the I/O scheduler have more
>> leeway in the ordering of he writes. I know who to get the equivalent of
>> fsync() or fdatasync() using FileChannel.force(...) to flush a single file
>> but I don't know how to get the equivalent of sync().
>> 
>> -Jay

Mime
View raw message