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

implement interface-based code-generation

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The current specific compiler generates a concrete class per record. Instead, we might generate an interface per record that might be implemented in different ways. Implementations might include:

      • A wrapper for a generic record. This would permit the schema that is compiled against to differ from that of the runtime instance. A field that was added since code-generation could be retained as records are filtered or sorted and re-written.
      • A concrete record. This would be similar to the existing specific.
      • A wrapped POJO. The generated class could wrap a POJO using reflection. Aliases could map between the schema used at compilation and that of the POJO, so field and class names need not match exactly. This would permit one to evolve from a POJO-based Avro application to using generated code without breaking existing code.

      This approach was first described in http://s.apache.org/AvroFlex

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                cutting Doug Cutting
              • Votes:
                3 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated: