[ 
https://issues.apache.org/jira/browse/AVRO-1388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13799722#comment-13799722
 ] 

Hari Shreedharan commented on AVRO-1388:
----------------------------------------

It looks like there are a couple of methods which allow the user to set a raw 
output stream, for the DataFileWriter to use. I don't know if it is reasonable 
to assume that the OutputStream passed in is an instance of FileOutputStream. 
Else we will need to do something like this:
{code}
if(out instanceof FileOutputStream) {
  // we could do this check at the time of initialization and store a ref to 
FileOutputStream directly to avoid this check on every fsync
   ((FileOutputStream)out).getFD().sync();
} else {
  // throw or noop? Not sure throwing is really warranted here
}
{code}



> Avro container files should allow fsync-ing files to disk
> ---------------------------------------------------------
>
>                 Key: AVRO-1388
>                 URL: https://issues.apache.org/jira/browse/AVRO-1388
>             Project: Avro
>          Issue Type: Bug
>            Reporter: Hari Shreedharan
>
> Another feature we require in Avro data files in addition to AVRO-1387 is 
> that we be able to fsync the files to disk. Currently we cannot do this, but 
> this can be achieved without API changes. If there are no objections,  I will 
> submit a patch



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to