Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-8577

Single source of truth for ConfigSchema structure

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • MiNiFi
    • None

    Description

      Motivation:
      We currently have ConfigSchema implementations in both C++ and Java code and will probably want a more compact binary format (Avro, Protobuf, etc) for sending configurations over the wire.

      Having many different hand-coded ways to represent the same functionality seems tedious and error-prone.

      One alternative:
      Json file declaring the structure of the configuration objects as well as basic metadata (type, default, required). This could be used to autogenerate the Java code required to serialize and deserialize these objects to/from yaml as well as the Avro or Protobuf schema and the glue code between the two.

      This metadata could also be useful on the minifi-cpp side.

      Pros:
      Single source of truth
      Less tedious copy/paste code
      Automagically keep other formats in sync

      Cons:
      Custom code generation - higher barrier to entry in codegen module, code generation isn't always a good idea

      Branch with partial implementation

      Attachments

        1. configSchema.json
          25 kB
          Bryan Rosander

        Activity

          People

            Unassigned Unassigned
            bryanrosander@gmail.com Bryan Rosander
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: