You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "nzw921rx (via GitHub)" <gi...@apache.org> on 2026/06/22 05:20:36 UTC
[PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
nzw921rx opened a new pull request, #11157:
URL: https://github.com/apache/seatunnel/pull/11157
## Purpose of this pull request
Related #11007
1. Migrate 4 imperative `if/throw` checks in `KafkaSourceConfig.createConsumerMetadata()` to declarative `Conditions` in `KafkaSourceFactory.optionRule()`
2. Add `greaterOrEqual(START_MODE_TIMESTAMP, 0L)` constraint when `start_mode = TIMESTAMP`
3. Add `greaterOrEqual(START_MODE_END_TIMESTAMP, 0L)` optional value constraint
4. Add `mapNotEmpty(START_MODE_OFFSETS)` constraint when `start_mode = SPECIFIC_OFFSETS`
5. Replace `KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS` conditional-required with `greaterThan(..., 0L)` value constraint when `ignore_no_leader_partition = true`
6. Retain runtime-only checks (`> currentTimestamp`) with explanatory comments
## Does this PR introduce _any_ user-facing change?
Yes — previously invalid configurations (negative timestamps, empty offsets map) were rejected at task execution time with generic `IllegalArgumentException`. Now they are rejected earlier at job submission time with structured `OptionValidationException` including option name, constraint type, and violation details.
## How was this patch tested?
Unit tests in `KafkaFactoryTest`:
- `testValidTimestampConfig` — valid TIMESTAMP mode passes validation
- `testNegativeTimestampRejected` — negative `start_mode.timestamp` is rejected
- `testNegativeEndTimestampRejected` — negative `start_mode.end_timestamp` is rejected
- `testValidSpecificOffsetsConfig` — valid SPECIFIC_OFFSETS mode passes validation
- `testEmptyOffsetsMapRejected` — empty offsets map is rejected
```bash
./mvnw test -pl seatunnel-connectors-v2/connector-kafka -Dtest="KafkaFactoryTest" -DfailIfNoTests=false
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3464121298
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
``` java
m.put(
ConditionOperator.GREATER_THAN,
(v, c, cfg) -> v != null && compareNumbers(v, c.getExpectValue()) > 0);
```
Good question, I have reconfirmed the operator processing logic. If it is empty or less than or equal to 0, it will be rejected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo merged PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "CosmosNi (via GitHub)" <gi...@apache.org>.
CosmosNi commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3458443792
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
This condition is missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "CosmosNi (via GitHub)" <gi...@apache.org>.
CosmosNi commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3458437932
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -195,36 +188,31 @@ private ConsumerMetadata createConsumerMetadata(ReadonlyConfig readonlyConfig) {
long startOffsetsTimestamp =
readonlyConfig.get(START_MODE_TIMESTAMP);
long currentTimestamp = System.currentTimeMillis();
- if (startOffsetsTimestamp < 0
- || startOffsetsTimestamp > currentTimestamp) {
+ // Runtime check: cannot be declarative (depends on current
+ // time)
+ if (startOffsetsTimestamp > currentTimestamp) {
throw new IllegalArgumentException(
- "start_mode.timestamp The value is smaller than 0 or smaller than the current time");
+ "start_mode.timestamp must not be greater than the current time");
}
consumerMetadata.setStartOffsetsTimestamp(
startOffsetsTimestamp);
if (Objects.nonNull(
readonlyConfig.get(START_MODE_END_TIMESTAMP))) {
long endOffsetsTimestamp =
readonlyConfig.get(START_MODE_END_TIMESTAMP);
- if (endOffsetsTimestamp < 0
- || endOffsetsTimestamp > currentTimestamp) {
+ // Runtime check: cannot be declarative (depends on current
+ // time)
+ if (endOffsetsTimestamp > currentTimestamp) {
throw new IllegalArgumentException(
- "start_mode.endTimestamp The value is smaller than 0 or smaller than the current time");
+ "start_mode.end_timestamp must not be greater than the current time");
}
consumerMetadata.setEndOffsetsTimestamp(
endOffsetsTimestamp);
}
break;
case SPECIFIC_OFFSETS:
Review Comment:
This condition is missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3464126474
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
> if KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS is null, does it mean greaterThan never gets executed?
```java
// Numeric (null value -> false, preserving or() short-circuit)
m.put(
ConditionOperator.GREATER_THAN,
(v, c, cfg) -> v != null && compareNumbers(v, c.getExpectValue()) > 0);
```
Good question, I have reconfirmed the operator processing logic. If it is empty or less than or equal to 0, it will be rejected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3464121298
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
``` java
m.put(
ConditionOperator.GREATER_THAN,
(v, c, cfg) -> v != null && compareNumbers(v, c.getExpectValue()) > 0);
```
Good question, I have reconfirmed the operator processing logic. If it is empty or less than or equal to 0, it will be rejected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "CosmosNi (via GitHub)" <gi...@apache.org>.
CosmosNi commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3458437932
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -195,36 +188,31 @@ private ConsumerMetadata createConsumerMetadata(ReadonlyConfig readonlyConfig) {
long startOffsetsTimestamp =
readonlyConfig.get(START_MODE_TIMESTAMP);
long currentTimestamp = System.currentTimeMillis();
- if (startOffsetsTimestamp < 0
- || startOffsetsTimestamp > currentTimestamp) {
+ // Runtime check: cannot be declarative (depends on current
+ // time)
+ if (startOffsetsTimestamp > currentTimestamp) {
throw new IllegalArgumentException(
- "start_mode.timestamp The value is smaller than 0 or smaller than the current time");
+ "start_mode.timestamp must not be greater than the current time");
}
consumerMetadata.setStartOffsetsTimestamp(
startOffsetsTimestamp);
if (Objects.nonNull(
readonlyConfig.get(START_MODE_END_TIMESTAMP))) {
long endOffsetsTimestamp =
readonlyConfig.get(START_MODE_END_TIMESTAMP);
- if (endOffsetsTimestamp < 0
- || endOffsetsTimestamp > currentTimestamp) {
+ // Runtime check: cannot be declarative (depends on current
+ // time)
+ if (endOffsetsTimestamp > currentTimestamp) {
throw new IllegalArgumentException(
- "start_mode.endTimestamp The value is smaller than 0 or smaller than the current time");
+ "start_mode.end_timestamp must not be greater than the current time");
}
consumerMetadata.setEndOffsetsTimestamp(
endOffsetsTimestamp);
}
break;
case SPECIFIC_OFFSETS:
Review Comment:
This condition is missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#issuecomment-4845338712
Thanks for the update. I rechecked the current head against the latest `dev`, and this branch is still behind upstream.
- base branch: `dev`
- head SHA: `345b0d51cefbddc4c72ade2dbf676bb77f2365e1`
- compare status: `diverged`
- ahead_by: `5`
- behind_by: `26`
- mergeable_state: `unknown`
- CI / merge gate snapshot: `pending`
Because the PR is still behind the latest base, any CI result and merge gate signal here is mixed with upstream drift. The lowest-cost next step is to sync with the latest `dev` and rerun CI first. If anything still fails after the sync, I'm happy to take another look on top of the updated head.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "CosmosNi (via GitHub)" <gi...@apache.org>.
CosmosNi commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3464147366
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
if (isConstraintApplicable(constraint, rule) && !validate(constraint)) {,When isConstraintApplicable returns false, validate won't be executed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3459233952
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
> ```java
> KafkaSourceOptions.KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS)
> Conditions.greaterThan(
> KafkaSourceOptions.KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS, 0L)
> ```
@DanielLeens thanks, Can you provide a detailed description of the missing scene?
Here is the judgment logic in my PR submission:
```java
.conditional(
KafkaSourceOptions.IGNORE_NO_LEADER_PARTITION,
Boolean.TRUE,
KafkaSourceOptions.KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS)
Conditions.greaterThan(
KafkaSourceOptions.KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS, 0L))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3466540885
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
Thanks for digging through this thread. On the latest head, the missing `ignore_no_leader_partition` condition is covered from my side now, and the follow-up debug note here matches the current operator behavior.
I re-reviewed the newest revision after that fix. My remaining blocker is no longer this thread itself, but a different compatibility edge in the updated timestamp validation: the new declarative validators now reject `timestamp = 0`, while the historical runtime path still treated `0` as valid and only rejected future timestamps.
I’m posting the full re-review separately, but this specific thread is resolved from my side on the current head.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "CosmosNi (via GitHub)" <gi...@apache.org>.
CosmosNi commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3464112662
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
if KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS is null, does it mean greaterThan never gets executed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3464163593
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
I debugged it locally, but there are issues with my viewpoint. Thank you for correcting it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3458456246
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
```java
.conditional(
KafkaSourceOptions.IGNORE_NO_LEADER_PARTITION,
Boolean.TRUE,
KafkaSourceOptions.KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS)
Conditions.greaterThan(
KafkaSourceOptions.KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS, 0L))
```
Thank you for adding this condition to your review factory🚀
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improve][Connector-V2] Migrate Kafka Source imperative validation to declarative OptionRule [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on code in PR #11157:
URL: https://github.com/apache/seatunnel/pull/11157#discussion_r3459170438
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/source/KafkaSourceConfig.java:
##########
@@ -131,11 +129,6 @@ public KafkaSourceConfig(ReadonlyConfig readonlyConfig) {
this.consumerGroup = readonlyConfig.get(CONSUMER_GROUP);
this.readerCacheQueueSize = readonlyConfig.get(READER_CACHE_QUEUE_SIZE);
this.ignoreNoLeaderPartition = readonlyConfig.get(IGNORE_NO_LEADER_PARTITION);
- if (this.ignoreNoLeaderPartition && this.discoveryIntervalMillis <= 0) {
Review Comment:
+1 to @CosmosNi's point here.
This missing condition is consistent with the validation/runtime gap I called out in my full review: if the declarative rule does not enforce the same requirement that the runtime path assumes, a job can still pass submission-time validation and fail later on startup.
Please include this in the next commit, and once the code is updated I will re-review the latest head.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org