Skip to content

Commit 7418fae

Browse files
authored
[Feature][Connector-V2] Make some sink parameters optional for DataHub (#9229)
1 parent 9c16d7c commit 7418fae

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

docs/en/connector-v2/sink/Datahub.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ A sink plugin which use send message to DataHub
2121
| accessKey | string | yes | - |
2222
| project | string | yes | - |
2323
| topic | string | yes | - |
24-
| timeout | int | yes | - |
25-
| retryTimes | int | yes | - |
24+
| timeout | int | no | 3000 |
25+
| retryTimes | int | no | 3 |
2626
| common-options | | no | - |
2727

2828
### endpoint [string]

docs/zh/connector-v2/sink/Datahub.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ import ChangeLog from '../changelog/connector-datahub.md';
1414

1515
## 选项
1616

17-
| 名称 | 类型 | 必需 | 默认值 |
18-
|----------------|--------|----|---------------|
19-
| endpoint | string || - |
20-
| accessId | string || - |
21-
| accessKey | string || - |
22-
| project | string || - |
23-
| topic | string || - |
24-
| timeout | int | | - |
25-
| retryTimes | int | | - |
26-
| common-options | || - |
17+
| 名称 | 类型 | 必需 | 默认值 |
18+
|----------------|--------|-----|------|
19+
| endpoint | string | | - |
20+
| accessId | string | | - |
21+
| accessKey | string | | - |
22+
| project | string | | - |
23+
| topic | string | | - |
24+
| timeout | int | | 3000 |
25+
| retryTimes | int | | 3 |
26+
| common-options | | | - |
2727

2828
### endpoint [string]
2929

seatunnel-connectors-v2/connector-datahub/src/main/java/org/apache/seatunnel/connectors/seatunnel/datahub/config/DataHubSinkOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ public class DataHubSinkOptions {
5757
public static Option<Integer> TIMEOUT =
5858
Options.key("timeout")
5959
.intType()
60-
.noDefaultValue()
60+
.defaultValue(3000)
6161
.withDescription("The max connection timeout");
6262

6363
public static Option<Integer> RETRY_TIMES =
6464
Options.key("retryTimes")
6565
.intType()
66-
.noDefaultValue()
66+
.defaultValue(3)
6767
.withDescription("The max retry times when your client put record failed");
6868
}

seatunnel-connectors-v2/connector-datahub/src/main/java/org/apache/seatunnel/connectors/seatunnel/datahub/sink/DataHubSinkFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ public String factoryIdentifier() {
4444
@Override
4545
public OptionRule optionRule() {
4646
return OptionRule.builder()
47-
.required(ENDPOINT, ACCESS_ID, ACCESS_KEY, PROJECT, TOPIC, TIMEOUT, RETRY_TIMES)
47+
.required(ENDPOINT, ACCESS_ID, ACCESS_KEY, PROJECT, TOPIC)
4848
.optional(SinkConnectorCommonOptions.MULTI_TABLE_SINK_REPLICA)
49+
.optional(TIMEOUT, RETRY_TIMES)
4950
.build();
5051
}
5152

0 commit comments

Comments
 (0)