You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/05 02:15:00 UTC
[GitHub] [arrow] cyb70289 commented on a diff in pull request #13662: ARROW-14635: [Python][C++] implement fadvise
cyb70289 commented on code in PR #13662:
URL: https://github.com/apache/arrow/pull/13662#discussion_r938386723
##########
cpp/src/arrow/util/io_util.cc:
##########
@@ -1115,7 +1116,9 @@ Result<FileDescriptor> FileOpenWritable(const PlatformFilename& file_name,
fd = FileDescriptor(ret);
#else
int oflag = O_CREAT;
-
+ if (sync) {
+ oflag |= O_SYNC;
Review Comment:
It's purely from coding perspective.
As `O_SYNC` is rarely used, avoiding the flag and adding `fdatasync` explicitly before `fadvice` make the code easier to read IMHO.
An additional syscall is probably not a worry. I think the use case is infrequent flushing of large data block.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org