You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "clesaec (via GitHub)" <gi...@apache.org> on 2023/07/25 13:17:27 UTC

[GitHub] [avro] clesaec opened a new pull request, #2392: AVRO-2511: add case for sync

clesaec opened a new pull request, #2392:
URL: https://github.com/apache/avro/pull/2392

   <!--
   
   *Thank you very much for contributing to Apache Avro - we are happy that you want to help us improve Avro. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Avro a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/AVRO/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "AVRO-XXXX: [component] Title of the pull request", where *AVRO-XXXX* should be replaced by the actual issue number. 
       The *component* is optional, but can help identify the correct reviewers faster: either the language ("java", "python") or subsystem such as "build" or "doc" are good candidates.  
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests. You can [build the entire project](https://github.com/apache/avro/blob/master/BUILD.md) or just the [language-specific SDK](https://avro.apache.org/project/how-to-contribute/#unit-tests).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Every commit message references Jira issues in their subject lines. In addition, commits follow the guidelines from [How to write a good git commit message](https://chris.beams.io/posts/git-commit/)
       1. Subject is separated from body by a blank line
       1. Subject is limited to 50 characters (not including Jira issue reference)
       1. Subject does not end with a period
       1. Subject uses the imperative mood ("add", not "adding")
       1. Body wraps at 72 characters
       1. Body explains "what" and "why", not "how"
   
   -->
   
   ## What is the purpose of the change
   
   [AVRO-2511](https://issues.apache.org/jira/browse/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
   
   - Does this pull request introduce a new feature? (no)
   - If yes, how is the feature documented? (not applicable)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] clesaec commented on pull request #2392: AVRO-2511: add case for sync

Posted by "clesaec (via GitHub)" <gi...@apache.org>.
clesaec commented on PR #2392:
URL: https://github.com/apache/avro/pull/2392#issuecomment-1727171406

   the comment already mention Syncable :
   ```java
     /**
       * If this writer was instantiated using a File or using an 
       * {@linkplain Syncable} instance
   ```
   Should i write something like
   ```java
       * If this writer was instantiated using a FileOutputStream or using an 
       * {@linkplain Syncable} instance
   ```
   ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] clesaec commented on pull request #2392: AVRO-2511: add case for sync

Posted by "clesaec (via GitHub)" <gi...@apache.org>.
clesaec commented on PR #2392:
URL: https://github.com/apache/avro/pull/2392#issuecomment-1727133846

   @KalleOlaviNiemitalo : A Javadoc on private field (line 62 of DataFileWriter<D>) or elsewhere in the code ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] clesaec commented on pull request #2392: AVRO-2511: add case for sync

Posted by "clesaec (via GitHub)" <gi...@apache.org>.
clesaec commented on PR #2392:
URL: https://github.com/apache/avro/pull/2392#issuecomment-1727224429

   Thanks, done.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] KalleOlaviNiemitalo commented on pull request #2392: AVRO-2511: add case for sync

Posted by "KalleOlaviNiemitalo (via GitHub)" <gi...@apache.org>.
KalleOlaviNiemitalo commented on PR #2392:
URL: https://github.com/apache/avro/pull/2392#issuecomment-1727204965

   "using a File, FileOutputStream, or Syncable instance", I think.  With hyperlinks to each type.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] KalleOlaviNiemitalo commented on pull request #2392: AVRO-2511: add case for sync

Posted by "KalleOlaviNiemitalo (via GitHub)" <gi...@apache.org>.
KalleOlaviNiemitalo commented on PR #2392:
URL: https://github.com/apache/avro/pull/2392#issuecomment-1717641429

   Should the javadoc mention both Syncable and FileOutputStream?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] KalleOlaviNiemitalo commented on pull request #2392: AVRO-2511: add case for sync

Posted by "KalleOlaviNiemitalo (via GitHub)" <gi...@apache.org>.
KalleOlaviNiemitalo commented on PR #2392:
URL: https://github.com/apache/avro/pull/2392#issuecomment-1727144032

   @clesaec, this one: <https://github.com/apache/avro/blob/73752a404c63fdfc0b132d1be891f80d66b4dca8/lang/java/avro/src/main/java/org/apache/avro/file/DataFileWriter.java#L441-L448>
   
   The existing text "using a File" seems to refer to `public DataFileWriter<D> create(Schema schema, File file)` and doesn't quite cover the case where `public DataFileWriter<D> create(Schema schema, OutputStream outs)` is called with `outs` being a FileOutputStream.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] clesaec merged pull request #2392: AVRO-2511: add case for sync

Posted by "clesaec (via GitHub)" <gi...@apache.org>.
clesaec merged PR #2392:
URL: https://github.com/apache/avro/pull/2392


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] opwvhk commented on pull request #2392: AVRO-2511: add case for sync

Posted by "opwvhk (via GitHub)" <gi...@apache.org>.
opwvhk commented on PR #2392:
URL: https://github.com/apache/avro/pull/2392#issuecomment-1719282318

   > Should the javadoc mention both Syncable and FileOutputStream?
   
   Yes, I think it should.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org