-
Notifications
You must be signed in to change notification settings - Fork 28
feat - kafka support #243
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
Open
msmygit
wants to merge
56
commits into
master
Choose a base branch
from
feat/kafka_support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat - kafka support #243
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
ba009e5
Initial plan for adding Kafka support
59ad1c9
Phase 1 - implemented
0ef8598
Phase 2: Core Abstraction Layer
415faf9
Phase 3: Pulsar Implementation
83c39a3
Phase 4: Kafka Implementation - week 1
7177099
Phase 2: Core Abstraction Layer - Week 2-3 Deliverables. deleted ph 3…
dc4db54
Phase 3 - week1 - Pulsar Impl
7063a65
Phase 3 - weeks2&3 - Pulsar Impl
022de56
Phase 4 - Kafka implementation initial
a51b74a
Phase 4 - kafka impl basic docs updates
d11b947
Phase 5: Kafka Integration Tests & CI Workflows - Implementation
5a7b98a
Remove Made with Bob comment on files
ed22e03
Phase 1: CI Stabilization - Disable Kafka tests and add resource limits
2a459ba
ci failures
732ba03
backfill-ci failure fix attempt
987204b
attempt to fix backfill-ci
0c8c3dd
temp comment jdk17 from matrix
b1678cd
attempt to remove kafka premature
3fe204f
backfill cli and ci fix attempt
92b47ce
bob created mess to fix backfill-ci job attempt 5
5e4a3a9
phase 3 impl + refactor
5e1d2c1
interim
411a864
interim fixes;slf4j reverts
f358196
interim phase3 fix attempts
a6acb68
interim fixes backfill-ci failures
60f9d1a
interim backfill CI fixes
c3b4c0c
s
33c8a75
s
2423d52
interim backfill-ci fixes
61273f5
interim ci fixes
9aa8899
Fix ClassCastException by reverting NativeSchemaWrapper and Cassandra…
469ceb5
Update BOB_CONTEXT_SUMMARY with ClassCastException fix details
8dd0e8b
backfill-ci fail fix attempt
6b85727
Fix connector test failures: Revert to direct Pulsar API usage
975e8ba
ci failures fixes
892f72f
CI Failure fix attempt
da931bd
fix(kafka_support): correct SSL keystore/truststore mapping and resto…
72fca2d
feat(kafka): complete & validate agent-side dual-provider (Pulsar+Kaf…
3812d82
feat(kafka): add Kafka Connect source connector (events -> Cassandra …
62f298a
fix(backfill): repair messaging-abstraction backfill (SPI discovery +…
c2c3d17
fix(connector): make assertMapsEqual tolerant of shaded/non-shaded Av…
5087624
fix(backfill): forward Docker API version to the e2eTest task and bac…
6c38e29
fix(backfill): discover dsbulk codec providers in the NAR CLI-extensi…
b6e8113
ci: expand Pulsar/Kafka test matrices and restore 360m timeout
cdaa9d8
fix(agent): reject invalid messagingProvider and validate provider co…
184e1e8
docs(kafka): publish Kafka/Confluent user docs and regenerate agent p…
bc75896
feat(backfill): support Kafka as a backfill destination + e2e + CI
2319c0e
docs(backfill): document Kafka as a backfill destination
ca343d4
fix(backfill-ci): pass cassandraFamily to the Kafka e2e so the right …
d081f8c
fix(backfill-ci): wait on CQL readiness for the no-agent Cassandra node
13965b1
fix(backfill-ci): wait on the CQL port, not a log line, for the no-ag…
fae4a4a
fix(backfill-ci): revert to CQL-log wait and make the c4 logback log …
6e00881
fix(connector): make testSchema tolerant of non-shaded Avro and JSON …
46874b5
fix(connector): type assertGenericMap keys as Object for shaded/non-s…
5e0e9ce
fix(connector): normalize non-shaded Avro collections nested inside a…
8b062ec
chore(ci): Bump HardNorth/github-version-generate@v1.4.1 to use Nodej…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,7 +56,7 @@ | |
| import java.util.UUID; | ||
|
|
||
| @Slf4j | ||
| public class PulsarMutationSender extends AbstractPulsarMutationSender<CFMetaData> { | ||
| public class PulsarMutationSender extends AbstractMessagingMutationSender<CFMetaData> { | ||
|
|
||
| private static final ImmutableMap<String, org.apache.avro.Schema> avroNativeTypes = ImmutableMap.<String, org.apache.avro.Schema>builder() | ||
| .put(UTF8Type.instance.asCQL3Type().toString(), org.apache.avro.Schema.create(org.apache.avro.Schema.Type.STRING)) | ||
|
|
@@ -106,6 +106,12 @@ public org.apache.avro.Schema getNativeSchema(String cql3Type) { | |
| */ | ||
| @Override | ||
| public boolean isSupported(final AbstractMutation<CFMetaData> mutation) { | ||
| // Check if metadata is null (table may have been dropped) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is logic change. Can we have a separate pr for logic change? |
||
| if (mutation.metadata == null) { | ||
| log.warn("Table metadata is null for mutation key={}, table may have been dropped, skipping mutation", mutation.key()); | ||
| return false; | ||
| } | ||
|
|
||
| if (!pkSchemas.containsKey(mutation.key())) { | ||
| for (ColumnDefinition cm : mutation.metadata.primaryKeyColumns()) { | ||
| if (!avroNativeTypes.containsKey(cm.type.asCQL3Type().toString())) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
agent-c4/src/test/java/com/datastax/oss/cdc/agent/KafkaSingleNodeC4Tests.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /** | ||
| * Copyright DataStax, Inc 2021. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package com.datastax.oss.cdc.agent; | ||
|
|
||
| import com.datastax.oss.cdc.AgentTestUtil; | ||
| import com.datastax.oss.cdc.KafkaSingleNodeTests; | ||
| import com.datastax.testcontainers.cassandra.CassandraContainer; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.testcontainers.containers.Network; | ||
| import org.testcontainers.utility.DockerImageName; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| @Slf4j | ||
| public class KafkaSingleNodeC4Tests extends KafkaSingleNodeTests { | ||
|
|
||
| public static final DockerImageName CASSANDRA_IMAGE = DockerImageName.parse( | ||
| Optional.ofNullable(System.getenv("CASSANDRA_IMAGE")) | ||
| .orElse("cassandra:" + System.getProperty("cassandraVersion")) | ||
| ).asCompatibleSubstituteFor("cassandra"); | ||
|
|
||
| public KafkaSingleNodeC4Tests() { | ||
| super(AgentTestUtil.Version.C4); | ||
| } | ||
|
|
||
| @Override | ||
| public CassandraContainer<?> createCassandraContainer(int nodeIndex, String kafkaBootstrapServers, Network testNetwork) { | ||
| return CassandraContainer.createCassandraContainerWithAgentKafka( | ||
| CASSANDRA_IMAGE, testNetwork, nodeIndex, "c4", kafkaBootstrapServers); | ||
| } | ||
|
|
||
| @Override | ||
| public int getSegmentSize() { | ||
| return 1024 * 1024; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,23 @@ | ||
| # DSE CDC agent for Apache Pulsar | ||
| # DSE CDC agent for Apache Pulsar and Apache Kafka | ||
|
|
||
| ## Overview | ||
|
|
||
| CDC agent for DataStax Enterprise 4.x with support for both Apache Pulsar and Apache Kafka. | ||
|
|
||
| ## Build | ||
|
|
||
| ./gradlew agent-dse4:shadowJar | ||
|
|
||
| ## Run | ||
| ## Run with Pulsar (Default) | ||
|
|
||
| export JVM_EXTRA_OPTS="-javaagent:agent-dse4/build/libs/agent-dse4-<version>-all.jar=pulsarServiceUrl=pulsar://pulsar:6650,cdcWorkingDir=/var/lib/cassandra/cdc" | ||
|
|
||
| ## Run with Kafka | ||
|
|
||
| export JVM_EXTRA_OPTS="-javaagent:agent-dse4/build/libs/agent-dse4-<version>-all.jar=messagingProvider=KAFKA,kafkaBootstrapServers=localhost:9092,cdcWorkingDir=/var/lib/cassandra/cdc" | ||
|
|
||
| ## Configuration | ||
|
|
||
| export JVM_EXTRA_OPTS="-javaagent:agent-dse4/build/libs/agent-dse4-<version>-SNAPSHOT-all.jar=pulsarServiceUrl=pulsar://pulsar:6650,cdcWorkingDir=/var/lib/cassandra/cdc" | ||
| See [agent/README.md](../agent/README.md) for full configuration options. | ||
|
|
||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Tip
💡 Code reviewers tip - we may not need this