scylladb / cql-stress

10 stars 4 forks source link

c-s operation: Extract common operation logic #68

Closed muzarski closed 7 months ago

muzarski commented 7 months ago

Fixes: https://github.com/scylladb/cql-stress/issues/67

Motivation

Currently, the common logic for operations is repeated. The idea is to introduce an additional struct that will handle the common logic and encapsulate the logic of specific c-s operation.

This will also help to implement mixed operation. This is why, we should merge it before https://github.com/scylladb/cql-stress/pull/63.

Solution

Introduced a CassandraStressOperation trait which represents a specific c-s operation. The GenericCassandraStressOperation structure will handle the common logic and delegate the specific operation logic to some object implementing CassandraStressOperation.

The common logic that was extracted to GenericCassandraStressOperation:

muzarski commented 7 months ago

v2: addressed review comments