scylladb / cql-stress

8 stars 4 forks source link

c-s: params wrapper #51

Closed muzarski closed 9 months ago

muzarski commented 9 months ago

Motivation

Before the changes, a lot of common logic (and fields) would be repeated in implementations of Param trait. I found it annoying when implementing yet another type of parameters (DistributionParam - https://github.com/scylladb/cql-stress/pull/48) to repeat the same boilerplate code.

Simple examples:

This PR introduces a new generic type ParamWrapperImpl<P: Param> which wraps the Param implementations. The logic shared between all of the types of parameters is extracted to the wrapping type.

Changes

Notes

Please review this PR before https://github.com/scylladb/cql-stress/pull/48, since the options implemented in the mentioned PR base on the changes introduced by this PR.

muzarski commented 9 months ago

v2:

muzarski commented 9 months ago

v3: rebased on top of master

muzarski commented 9 months ago

@piodul should I squash some of the commits (e.g. porting fields from ParamImpl implementations to TypedParam) before mergning?

piodul commented 9 months ago

@piodul should I squash some of the commits (e.g. porting fields from ParamImpl implementations to TypedParam) before mergning?

No, I think the commits are fine as they are right now.