mukesh katariya created AVRO-2169:

             Summary: Flushing of output stream in 
DataFileWriter<D>#BufferedFileOutputStream out
                 Key: AVRO-2169
             Project: Avro
          Issue Type: Improvement
          Components: java
    Affects Versions: 1.8.2
            Reporter: mukesh katariya
             Fix For: 1.8.2


I am looking a the code of DataFileWriter inside the package 

private BufferedFileOutputStream out; we use the out stream.

when the close method is called this stream is not flushed.
  /** Return the current position as a value that may be passed to {@link
   * DataFileReader#seek(long)}.  Forces the end of the current block,
   * emitting a synchronization marker. By default, this will also flush the
   * block to the stream.
   * If {@linkplain #setFlushOnEveryBlock(boolean)} is
   * called with param set to false, then this method may not flush
   * the block. In this case, the {@linkplain #flush()} must be called to
   * flush the stream.
  public long sync() throws IOException {
    return out.tell();

  /** Calls {@linkplain #sync()} and then flushes the current state of the
   * file.
  public void flush() throws IOException {
Can this lead to potential issues?

This message was sent by Atlassian JIRA

Reply via email to