-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add default constructor + setters to RanChangeSet
& related classes
#5336
add default constructor + setters to RanChangeSet
& related classes
#5336
Conversation
this is needed to be able to de-serialise them using [jackson] which relies on the default constructor & setters. in the upcoming liquibase-opensearch implementation [opensearch-java] is used, which underneath is using jackson for the (de-)serialisation of classes. specifically, this is used in the implementation of `AbstractChangeLogHistoryService#queryRanChangeSets` which needs to load `RanChangeSet`s from the DB. also do some minor cleanups by removing manually implemented getters & setters where lombok annotations can do the job instead (no functional impact). [jackson]: https://github.com/FasterXML/jackson [opensearch-java]: https://github.com/opensearch-project/opensearch-java/ Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Code changes look good to me.
FYI @rursprung, someone from the team will be meeting soon with Nathan to get some guidance and be able to help you with your questions.
Thanks,
Daniel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those fields were final for a reason: once we load them from db we don't want them to be changed, as a ranChangeSet should not change. But I see the case here that's required to support Opensearch, so let's merge it and keep an eye on future PRs changes!.
this is needed to be able to de-serialise it using [jackson] which relies on the default constructor & setters. in the upcoming [liquibase-opensearch] implementation [opensearch-java] is used, which underneath is using jackson for the (de-)serialisation of classes. specifically, this is used in the implementation of `LockService#listLocks` which needs to load `DatabaseChangeLogLock`s from the DB. also do some minor cleanups by removing manually implemented getters & setters where lombok annotations can do the job instead (no functional impact). this could be cleaned up even further if `Date` were replaced with `LocalTime` (which is immutable), but that'd be a bigger (breaking) change. note that this is the same pattern as was previously done in liquibase#5336 (commit b4726a0) for `RanChangeSet` & other classes. [jackson]: https://github.com/FasterXML/jackson [opensearch-java]: https://github.com/opensearch-project/opensearch-java/ [liquibase-opensearch]: https://github.com/liquibase/liquibase-opensearch/ Signed-off-by: Ralph Ursprung <Ralph.Ursprung@avaloq.com>
this is needed to be able to de-serialise it using [jackson] which relies on the getters. in the upcoming [liquibase-opensearch] implementation [opensearch-java] is used, which underneath is using jackson for the (de-)serialisation of classes. this is a follow-up to commit 3823f0b (PR liquibase#5336) where only the deserialisation was fixed (by adding a default constructor + setters). [jackson]: https://github.com/FasterXML/jackson [opensearch-java]: https://github.com/opensearch-project/opensearch-java/ [liquibase-opensearch]: https://github.com/liquibase/liquibase-opensearch/
Impact
Description
this is needed to be able to de-serialise them using jackson which relies on the default constructor & setters.
in the upcoming liquibase-opensearch implementation opensearch-java is used, which underneath is using jackson for the (de-)serialisation of classes.
specifically, this is used in the implementation of
AbstractChangeLogHistoryService#queryRanChangeSets
which needs to loadRanChangeSet
s from the DB.also do some minor cleanups by removing manually implemented getters & setters where lombok annotations can do the job instead (no functional impact).
Things to be aware of
n/a
Things to worry about
n/a
Additional Context
for liquibase-opensearch see #4236 & opensearch-project/opensearch-migrations#148 (btw: still waiting for a reply from @nvoxland there! if you have any way of pinging him to get his feedback there that'd be great)