Skip to content

Commit 2bbb52d

Browse files
author
Madhavan
committed
CI Failure fix attempt
1 parent 5b052b2 commit 2bbb52d

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

agent-c3/src/main/java/com/datastax/oss/cdc/agent/PulsarMutationSender.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ public org.apache.avro.Schema getNativeSchema(String cql3Type) {
106106
*/
107107
@Override
108108
public boolean isSupported(final AbstractMutation<CFMetaData> mutation) {
109+
// Check if metadata is null (table may have been dropped)
110+
if (mutation.metadata == null) {
111+
log.warn("Table metadata is null for mutation key={}, table may have been dropped, skipping mutation", mutation.key());
112+
return false;
113+
}
114+
109115
if (!pkSchemas.containsKey(mutation.key())) {
110116
for (ColumnDefinition cm : mutation.metadata.primaryKeyColumns()) {
111117
if (!avroNativeTypes.containsKey(cm.type.asCQL3Type().toString())) {

agent-c4/src/main/java/com/datastax/oss/cdc/agent/PulsarMutationSender.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ public org.apache.avro.Schema getNativeSchema(String cql3Type) {
110110
*/
111111
@Override
112112
public boolean isSupported(final AbstractMutation<TableMetadata> mutation) {
113+
// Check if metadata is null (table may have been dropped)
114+
if (mutation.metadata == null) {
115+
log.warn("Table metadata is null for mutation key={}, table may have been dropped, skipping mutation", mutation.key());
116+
return false;
117+
}
118+
113119
if (!pkSchemas.containsKey(mutation.key())) {
114120
for (ColumnMetadata cm : mutation.metadata.primaryKeyColumns()) {
115121
if (!avroSchemaTypes.containsKey(cm.type.asCQL3Type().toString())) {

agent-dse4/src/main/java/com/datastax/oss/cdc/agent/PulsarMutationSender.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public SchemaAndWriter getPkSchema(String key) {
111111
*/
112112
@Override
113113
public boolean isSupported(final AbstractMutation<TableMetadata> mutation) {
114+
// Check if metadata is null (table may have been dropped)
115+
if (mutation.metadata == null) {
116+
log.warn("Table metadata is null for mutation key={}, table may have been dropped, skipping mutation", mutation.key());
117+
return false;
118+
}
119+
114120
if (!pkSchemas.containsKey(mutation.key())) {
115121
for (ColumnMetadata cm : mutation.metadata.primaryKeyColumns()) {
116122
if (!avroSchemaTypes.containsKey(cm.type.asCQL3Type().toString())) {

0 commit comments

Comments
 (0)