k8ssandra / management-api-for-apache-cassandra

RESTful / Secure Management Sidecar for Apache Cassandra
Apache License 2.0
70 stars 51 forks source link

Avoid serialising objects to json in agent #391

Closed Miles-Garnsey closed 8 months ago

Miles-Garnsey commented 11 months ago

Currently, we are serialising the statusChanges field to a JSON string before adding it to a Map<String, String> returned from getJobStatus().

This change was made here to ensure that we could serialise Job's statusChanges back to the server component. However, it amounts to serialising JSON via Jackson into the existing Map<String,String> which is then serialised using the management API's (Cassandra based) serializers. This is a very unwieldy solution which we have merged just to get the Reaper side of the work progressing.

We should revise this approach and look to either improve the serialisation framework more generally to handle (a) more deeply nested data structures and (b) enums in collections OR we should look to renovate the serialisation code more generally to use a common framework like Jackson or protobuf.

Miles-Garnsey commented 8 months ago

This cannot be resolved using the current serialisation framework. It can be re-opened if we decide to do better with this at some point in future.