Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
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