-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AVRO-2511: add case for sync #2392
Conversation
Should the javadoc mention both Syncable and FileOutputStream? |
Yes, I think it should. |
@KalleOlaviNiemitalo : A Javadoc on private field (line 62 of DataFileWriter) or elsewhere in the code ? |
@clesaec, this one: avro/lang/java/avro/src/main/java/org/apache/avro/file/DataFileWriter.java Lines 441 to 448 in 73752a4
The existing text "using a File" seems to refer to |
the comment already mention Syncable : /**
* If this writer was instantiated using a File or using an
* {@linkplain Syncable} instance Should i write something like * If this writer was instantiated using a FileOutputStream or using an
* {@linkplain Syncable} instance ? |
"using a File, FileOutputStream, or Syncable instance", I think. With hyperlinks to each type. |
Thanks, done. |
* AVRO-2511: add case for sync
What is the purpose of the change
AVRO-2511 :
DataFileWriter flush well data to disk only if using constructor with File, because it use internal class SyncableFileOutputStream, and writer activate "getFD().sync" in order to "Force all system buffers to synchronize with the underlying device".
Here, the idea is to do same when the DataFileWriter is initialized with FileOutputStream instance.
This does still not cover all cases; but at least, this one is ok.
Verifying this change
existing unit tests are enough.
Documentation