Commit Graph

73 Commits

Author SHA1 Message Date
co63oc 3d7ac0c3d1
MINOR: Fix typos in multiple files (#19102)
Fix typos in multiple files

Reviewers: Andrew Schofield <aschofield@confluent.io>
2025-03-05 14:27:32 +00:00
Ismael Juma d6f24d3665
Use `instanceof` pattern to avoid explicit cast (#18373)
This feature was introduced in Java 16.

Reviewers: David Arthur <mumrah@gmail.com>, Apoorv Mittal <apoorvmittal10@gmail.com>
2025-01-02 09:32:51 -08:00
Ken Huang 2b43c49f51
KAFKA-18050 Upgrade the checkstyle version to 10.20.2 (#17999)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-05 10:59:18 +08:00
TaiJuWu 3bb408c4de
MINOR: rename ConfigName.RENAME to ConfigName.RENAMES for replaceFiled (#17369)
Reviewers: Andrew Schofield <aschofield@confluent.io>, TengYao Chi <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2024-10-05 05:50:48 +08:00
TaiJuWu db56553fd3
KAFKA-17530 Remove blacklist/whitelist from ReplaceField (#17237)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-25 01:02:28 +08:00
xijiu a39037e55c
KAFKA-17399 Apply LambdaValidator to code base (#16980)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-26 21:53:49 +08:00
PoAn Yang 6e9c039eea
KAFKA-17097 Add replace.null.with.default configuration to ValueToKey and ReplaceField (#16571)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-07-15 18:12:59 +08:00
Fiore Mario Vitale e2ec389a7c
KAFKA-15838: KIP-1040: Add replace.null.with.default to InsertField, ExtractField, HeaderFrom, Cast, SetSchemaMetadata, TimestampConverter, MaskField transforms (#15756)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Greg Harris <greg.harris@aiven.io>
2024-07-08 11:09:54 -07:00
gongxuanzhang 596b945072
KAFKA-16643 Add ModifierOrder checkstyle rule (#15890)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-13 15:39:32 +08:00
gongxuanzhang 79b9c44acd
KAFKA-10787 Apply spotless to connect module (#16299)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-06-12 22:19:47 +08:00
Jorge Esteban Quilcate Otoya a4c6cefd10
KAFKA-14226: Introduce FieldPath abstraction and nested path support for ExtractField SMT (#15379)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-05-07 14:07:18 -04:00
Mickael Maison aee9724ee1
MINOR: Remove unneeded explicit type arguments (#15736)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-04-17 21:55:58 +02:00
Mickael Maison 7b1c777b33
MINOR: Various cleanups in connect (#15734)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-04-17 20:47:25 +08:00
Kuan-Po (Cooper) Tseng 12a1d85362
KAFKA-12187 replace assertTrue(obj instanceof X) with assertInstanceOf (#15512)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-03-20 10:36:25 +08:00
Yash Mayya 4e6920cc5f
KAFKA-16196: Handle invalid whole value casts in the Cast transform gracefully (#15267)
Reviewers: Chris Egerton <chrise@aiven.io>
2024-01-26 19:04:39 +05:30
Divij Vaidya 65424ab484
MINOR: New year code cleanup - include final keyword (#15072)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Sagar Rao <sagarmeansocean@gmail.com>
2024-01-11 17:53:35 +01:00
aindriu-aiven db34f8b9a1
KAFKA-15291: Connect plugins should declare a version (#14159)
Signed-off-by: Aindriu Lavelle <aindriu.lavelle@aiven.io>
Reviewers: Andrew Schofield, Greg Harris <greg.harris@aiven.io>
2023-08-10 10:45:12 -07:00
Greg Harris ff4fed5cbe
KAFKA-15031: Add plugin.discovery to Connect worker configuration (KIP-898) (#14055)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-08-08 10:06:35 -07:00
Yash Mayya 9bb2f78d53
KAFKA-15034: Improve performance of the ReplaceField SMT; add JMH benchmark (#13776)
Reviewers: Chris Egerton <chrise@aiven.io>
2023-06-01 15:14:31 -04:00
Mickael Maison d606eb46ef
MINOR: Small javadoc/code cleanups in connect api and transforms (#12558)
Reviewers: Luke Chen <showuon@gmail.com>, Divij Vaidya <diviv@amazon.com>
2022-08-29 09:44:56 +02:00
Yash Mayya 6df57679d0
KAFKA-14162: Stop adding immutable maps/lists to record keys/values in HoistField and MaskField SMTs (#12502)
Reviewers:  Sagar Rao <sagarmeansocean@gmail.com>, Chris Egerton <fearthecellos@gmail.com>
2022-08-23 10:22:02 -04:00
Chris Egerton 43bf464232
KAFKA-13497: Add trace logging to RegexRouter (#11903)
This patch adds runtime logging to the RegexRouter to show exactly which topics get routed where.

Reviewers: David Jacot <djacot@confluent.io>
2022-03-18 10:27:49 +01:00
Marc Löhe 14faea4aab
KAFKA-8659: fix SetSchemaMetadata failing on null value and schema (#7082)
Make SetSchemaMetadata SMT ignore records with null value and valueSchema or key and keySchema.

The transform has been unit tested for handling null values gracefully while still providing the necessary validation for non-null values.

Reviewers: Konstantine Karantasis<konstantine@confluent.io>, Bill Bejeck <bbejeck@apache.org>
2022-03-01 10:10:43 -05:00
Julien Chanaud a5bb45c11a
KAFKA-13511: Add support for different unix precisions in TimestampConverter SMT (#11575)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Tom Bentley <tbentley@redhat.com>
2022-02-22 17:17:16 +01:00
Chris Egerton 79788ca042
KAFKA-12305: Fix Flatten SMT for array types (#10074)
Reviewers: Nigel Liang <nigel@nigelliang.com>, Tom Bentley <tbentley@redhat.com>
2021-08-03 13:53:54 +01:00
Tom Bentley 862f814cc3
KAFKA-7613: Enable -Xlint:rawtypes for connect, fixing warnings (#8571)
Reviewers: Konstantine Karantasis <konstantine@confluent.io>
2021-07-07 17:24:31 +01:00
Daniel 0c707b1fcc
KAFKA-12522: Cast SMT should allow null value records to pass through (#10375)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Lee Dongjin <dongjin@apache.org>, Chris Egerton  <fearthecellos@gmail.com>
2021-05-21 11:34:45 +01:00
Tom Bentley f8f1769256
KIP-145: Add SMTs, HeaderFrom, DropHeaders and InsertHeader (#9549)
These SMTs were originally specified in KIP-145 but never implemented
at the time.

HeaderTo is not included since its original specification doesn't deal with
the fact that there can be >1 header with the same name, but a field can only
have a single value (which could be an array, but not if the headers for
the given name had different schemas).

Reviewers: Chris Egerton <chrise@confluent.io>, Mickael Maison <mickael.maison@gmail.com>
2021-04-16 15:11:25 +01:00
Sven Erik Knop f06a47a7bb
KAFKA-12170: Fix for Connect Cast SMT to correctly transform a Byte array into a string (#9950)
Cast SMT transformation for bytes -> string.
Without this fix, the conversion becomes ByteBuffer.toString(), which always gives this useless result:
    "java.nio.HeapByteBuffer[pos=0 lim=4 cap=4]"

With this change, the byte array is converted into a base64 string of the byte buffer content.

Reviewers: Mickael Maison <mickael.maison@gmail.com>, Randall Hauch <rhauch@gmail.com>, Konstantine Karantasis <k.karantasis@gmail.com>
2021-03-03 22:17:49 +00:00
CHUN-HAO TANG 954c090ffc
MINOR: apply Utils.isBlank to code base (#10124)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2021-02-20 11:44:29 +08:00
Chris Egerton b58b944e70
KAFKA-12303: Fix handling of null values by Flatten SMT (#10073)
Reviewers: Mickael Maison <mickael.maison@gmail.com>, Greg Harris <gregh@confluent.io>
2021-02-18 15:01:49 +00:00
Lev Zemlyanov 07843cfbf4
KAFKA-10834: Remove redundant type casts in Connect (#10053)
Cleanup up to remove redundant type casts in Connect and use the diamond operator when needed 

Reviewers: Konstantine Karantasis <k.karantasis@gmail.com>
2021-02-04 17:08:56 -08:00
Lev Zemlyanov c19a35d1b7
KAFKA-10835: Replace Runnable and Callable overrides with lambdas in Connect (#9867)
Reviewers: Konstantine Karantasis <k.karantasis@gmail.com>
2021-02-04 09:15:49 -08:00
dengziming 4126cfd049
KAFKA-12197: Migrate connect:transforms module to JUnit 5 (#9907)
Reviewers: Ismael Juma <ismael@juma.me.uk>
2021-01-16 07:17:37 -08:00
dengziming 119a2d9127
MINOR: Substitute assertEquals(null) with assertNull (#9852)
Reviewers: David Jacot <djacot@confluent.io>
2021-01-10 20:06:37 +01:00
Chia-Ping Tsai 913a019d6c
MINOR: replace test "expected" parameter by assertThrows (#9520)
This PR includes following changes.

1. @Test(expected = Exception.class) is replaced by assertThrows
2. remove reference to org.scalatest.Assertions
3. change the magic code from 1 to 2 for testAppendAtInvalidOffset to test ZSTD
4. rename testMaybeAddPartitionToTransactionXXXX to testNotReadyForSendXXX
5. increase maxBlockMs from 1s to 3s to avoid unexpected timeout from TransactionsTest#testTimeout

Reviewers: Ismael Juma <ismael@confluent.io>
2021-01-10 20:20:13 +08:00
Xavier Léauté eab61cad2c
KAFKA-10573 Update connect transforms configs for KIP-629 (#9403)
Changes the Connect `ReplaceField` SMT's configuration properties, deprecating and replacing `blacklist` with `exclude`, and `whitelist` with `include`. The old configurations are still allowed (ensuring backward compatibility), but warning messages are written to the log to suggest users change to `include` and `exclude`.

This is part of KIP-629.

Author: Xavier Léauté <xvrl@apache.org>
Reviewer: Randall Hauch <rhauch@gmail.com>
2020-10-13 18:13:44 -05:00
huangyiming 18f70835a3
KAFKA-10502: Use Threadlocal.remote to avoid leak on TimestampRouter (#9304)
Reviewers: Guozhang Wang <wangguoz@gmail.com>
2020-09-27 19:16:17 -07:00
Tom Bentley a1f429d4f6
MINOR: Documentation for KIP-585 (#8839)
* Add documentation for using transformation predicates.
* Add `PredicateDoc` for generating predicate config docs, following the style of `TransformationDoc`.
* Fix the header depth mismatch.
* Avoid generating HTML ids based purely on the config name since there
are very likely to conflict (e.g. #name). Instead allow passing a function
which can be used to generate an id from a config key.

The docs have been generated and tested locally. 

Reviewer: Konstantine Karantasis <konstantine@confluent.io>
2020-06-15 22:07:01 -07:00
Tom Bentley 1c4eb1a575
KAFKA-9673: Filter and Conditional SMTs (#8699)
Implemented KIP-585 to support Filter and Conditional SMTs. Added unit tests and integration tests.

Author: Tom Bentley <tbentley@redhat.com>
Reviewers: Randall Hauch <rhauch@gmail.com>, Konstantine Karantasis <konstantine@confluent.io>
2020-05-28 08:54:30 -05:00
Valeria 9aeb78b990
KAFKA-6755: Allow literal value for MaskField SMT (#6284)
Implemented KIP-437 by adding a new optional configuration property for the `MaskField` transformation that allows users to define a replacement literal for specific fields in matching records.

Author: Valeria Vasylieva <valeria.vasylieva@gmail.com>
Reviewer: Randall Hauch <rhauch@gmail.com>
2020-05-24 09:22:40 -05:00
Arjun Satish 9bc96d54f8
MINOR: Replace null with an actual value for timestamp field in InsertField SMT unit tests (#8649)
Add actual values instead of just passing null in unit tests that check the behavior of the InsertField SMT when trying to insert a field that takes its value from the Kafka record timestamp.

Reviewers: Chris Egerton <chrise@confluent.io>, Konstantine Karantasis <konstantine@confluent.io>
2020-05-12 16:12:31 -07:00
Greg Harris 2c969b14d3
KAFKA-9706: Handle null in keys or values when Flatten transformation is used (#8279)
* Fixed DataException thrown when handling tombstone events with null value
* Passes through original record when finding a null key when it's configured for keys or a null value when it's configured for values. 
* Added unit tests for schema and schemaless data
2020-03-30 15:09:27 -07:00
Svend Vanderveken 169fa0efcc
MINOR: Fix error message in exception when records have schemas in Connect's Flatten transformation (#3982)
In case of an error while flattening a record with schema, the Flatten transformation was reporting an error about a record without schema, as follows: 

```
org.apache.kafka.connect.errors.DataException: Flatten transformation does not support ARRAY for record without schemas (for field ...)
```

The expected behaviour would be an error message specifying "with schemas". 

This looks like a simple copy/paste typo from the schemaless equivalent methods, in the same file 

Reviewers: Ewen Cheslack-Postava <me@ewencp.org>, Konstantine Karantasis <konstantine@confluent.io>
2020-03-28 21:28:06 -07:00
Greg Harris 008a3b21f6
KAFKA-9707: Fix InsertField.Key should apply to keys of tombstone records (#8280)
* KAFKA-9707: Fix InsertField.Key not applying to tombstone events

* Fix typo that hardcoded .value() instead of abstract operatingValue
* Add test for Key transform that was previously not tested

Signed-off-by: Greg Harris <gregh@confluent.io>

* Add null value assertion to tombstone test

* Remove mis-named function and add test for passing-through a null-keyed record.

Signed-off-by: Greg Harris <gregh@confluent.io>

* Simplify unchanged record assertion

Signed-off-by: Greg Harris <gregh@confluent.io>

* Replace assertEquals with assertSame

Signed-off-by: Greg Harris <gregh@confluent.io>

* Fix checkstyleTest indent issue

Signed-off-by: Greg Harris <gregh@confluent.io>
2020-03-26 10:21:11 -07:00
Lev Zemlyanov f51e1e6548
allow ReplaceField SMT to handle tombstone records (#7731)
Signed-off-by: Lev Zemlyanov <lev@confluent.io>
2020-02-12 16:36:06 -06:00
Gunnar Morling 5727b24509
KAFKA-7052 Avoiding NPE in ExtractField SMT in case of non-existent fields (#8059)
Author: Gunnar Morling <gunnar.morling@googlemail.com>
Reviewer: Randall Hauch <rhauch@gmail.com>
2020-02-11 13:48:22 -06:00
Nigel Liang 28f013708f KAFKA-9024: Better error message when field specified does not exist (#7819)
Author: Nigel Liang <nigel@nigelliang.com>
Reviewer: Randall Hauch <rhauch@gmail.com>
2020-01-21 14:25:35 -06:00
Seungha Lee 655447140e MINOR: Cleanup generic & throw syntax in connect (#7892)
Reviewers: Jason Gustafson <jason@confluent.io>
2020-01-11 10:11:29 -08:00
Lee Dongjin 8c64aa080a MINOR: trivial cleanups
- Reformat header: `CustomDeserializerTest`, `ReplicaVerificationToolTest`
- Remove unused constructor: `ConsumerGroupDescription`
- Remove unused variables in `TimeOrderedKeyValueBufferTest#shouldRestoreV2Format`
- Remove deprecated `Number` consturctor calls; use `Number#valueOf` instread.

Author: Lee Dongjin <dongjin@apache.org>

Reviewers: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Manikumar Reddy <manikumar.reddy@gmail.com>

Closes #7202 from dongjinleekr/cleanup/201908
2019-12-18 21:09:16 +05:30