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.kr...@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

Reply via email to