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

Refactor validation code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • c++
    • None

    Description

      This patch reorganizes some of the code around the validator.

      The previous version uses different classes for Writer and ValidatingWriter, and Reader and ValidatingReader.

      These types have been redefined respectively as WriterImpl<NullValidator> and WriterImpl<Validator>, and ReaderImpl<NullValidator> and ReaderImpl<Validator>. The compiler generates 4 types, but the NullValidator compiles away as no-ops, creating essentially the same classes as before. This allows logic to exist in single class definitions instead of duplicates.

      Also, in the Validator some special logic was removed for records, now instead sharing code with the other compound types.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--applypatch520.sh
          0.2 kB
          Scott Banachowski
        2. ASF.LICENSE.NOT.GRANTED--AVRO-520.patch
          36 kB
          Scott Banachowski

        Activity

          People

            Unassigned Unassigned
            sbanacho Scott Banachowski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: