[Gluster-users] How to sync content to a file through standard Java APIs

Sven Ludwig s_ludwig at gmx.de
Wed Mar 14 17:07:19 UTC 2018


Hello,

we have a Gluster FS mounted at some /mnt/... path on a Server. The actual physical device behind this resides on some other Server.

Now, the requirement is to write files to this Gluster FS Volume in a durable fashion, i.e. for an officially succeeded write the contents MUST have been actually synced to disk on at least one of the Gluster FS nodes in the replica set.

Our questions:

1. Which JDK 8 APIs can we use that would fulfill this requirement with an actually working sync?

2. Is java.nio.channels.FileChannel.open with StandardOpenOption#SYNC in the set of options given to this method an option, or would it perhaps not actually guarantee the sync?

3. Apart from 2., are there other ways to achieve the requirement through the standard JDK 8 APIs?

Kind Regards
Sven



More information about the Gluster-users mailing list