Skip to content

CASSANALYTICS-60: CDC support for Cassandra 5.0 commit logs#175

Draft
lukasz-antoniak wants to merge 2 commits intoapache:trunkfrom
lukasz-antoniak:CASSANALYTICS-60
Draft

CASSANALYTICS-60: CDC support for Cassandra 5.0 commit logs#175
lukasz-antoniak wants to merge 2 commits intoapache:trunkfrom
lukasz-antoniak:CASSANALYTICS-60

Conversation

@lukasz-antoniak
Copy link
Member

Fixes Analytics reader of Cassandra 5.0 commit logs (part of CASSANALYTICS-60).

Using environment variable CASSANDRA_VERSION=5.0.0 (or 4.0.0), developers can run CDC unit tests with different Cassandra versions.

Refactoring all tests to @ParameterizedTest requires more efforts, and will be performed in follow-up PR. Static variables like CdcTests.BRIDGE are references from multiple places in the code.

protected final KafkaStats kafkaStats;

public KafkaPublisher(TopicSupplier topicSupplier,
public KafkaPublisher(String version,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API change between Sidecar and Analytics.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for calling it out.
Thinking from API design perspective, how about passing CassandraVersion, instead of String version value? It, then, ensures the version is always valid. Sidecar anyways has access to CassandraVersion. It would be clear for Sidecar to create the version object.

* @param <T>
*/
public abstract class RangeTombstoneBuilder<T>
public interface RangeTombstoneBuilder<T>
Copy link
Member Author

@lukasz-antoniak lukasz-antoniak Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classloader clash when FourZeroRangeTombstoneBuilder is loaded by bridge classloader and RangeTombstoneBuilder (abstract parent class) by application classloader.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add the note in code so it stays as interface.

protected final KafkaStats kafkaStats;

public KafkaPublisher(TopicSupplier topicSupplier,
public KafkaPublisher(String version,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for calling it out.
Thinking from API design perspective, how about passing CassandraVersion, instead of String version value? It, then, ensures the version is always valid. Sidecar anyways has access to CassandraVersion. It would be clear for Sidecar to create the version object.

}
}

public static <T> T executeActionOnBridgeClassLoader(@NotNull CassandraVersion version, Throwing.Function<ClassLoader, T> action)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add @VisibleForTesting

* @param <T>
*/
public abstract class RangeTombstoneBuilder<T>
public interface RangeTombstoneBuilder<T>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add the note in code so it stays as interface.

Copy link
Contributor

@yifan-c yifan-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed the PR is marked as Draft. I will re-review if there are new changes.
Please share the CI link too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants