-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
stheppi
committed
Oct 30, 2024
1 parent
61f1e45
commit 2399777
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/main/java/io/lenses/connect/smt/header/RecordIsNull.java
This file contains 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,45 @@ | ||
package io.lenses.connect.smt.header; | ||
|
||
import org.apache.kafka.common.config.ConfigDef; | ||
import org.apache.kafka.common.utils.AppInfoParser; | ||
import org.apache.kafka.connect.components.Versioned; | ||
import org.apache.kafka.connect.connector.ConnectRecord; | ||
import org.apache.kafka.connect.transforms.predicates.Predicate; | ||
|
||
import java.util.Map; | ||
|
||
public class RecordIsNull<R extends ConnectRecord<R>> implements Predicate<R>, Versioned { | ||
|
||
public static final String OVERVIEW_DOC = "A predicate which is true for records which are tombstones (i.e. have null value)."; | ||
public static final ConfigDef CONFIG_DEF = new ConfigDef(); | ||
|
||
@Override | ||
public String version() { | ||
return AppInfoParser.getVersion(); | ||
} | ||
|
||
@Override | ||
public ConfigDef config() { | ||
return CONFIG_DEF; | ||
} | ||
|
||
@Override | ||
public boolean test(R record) { | ||
return record == null; | ||
} | ||
|
||
@Override | ||
public void close() { | ||
|
||
} | ||
|
||
@Override | ||
public void configure(Map<String, ?> configs) { | ||
|
||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "RecordIsTombstone{}"; | ||
} | ||
} |