Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1742

Avro C# DataFileWriter Flush() does not flush the buffer to disk

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • csharp
    • None

    Description

      In C# DataFileWriter.Flush() is implemented as

      public void Flush()
              {
                  EnsureHeader();
                  Sync();
              }
      

      Is this by Avro spec or is this a bug. So should calling DataFileWriter.Flush() just start a new Sync block and not flush the file to disc?

      In Java the implementation is

       @Override
        public void flush() throws IOException {
          sync();
          vout.flush();
        }
      

      where vout is a BinaryEncoder. So I think the correct implementation in C# is

      public void Flush()
              {
                  EnsureHeader();
                  Sync();
                 _encoder.Flush()
              }
      

      If someone can confirm my suspicion I'll try to contribute a fix in the near future.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mristima Mika Ristimaki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: