Skip to content

Commit 7bd5865

Browse files
authored
[hotfix][redis] fix npe cause by null host parameter (#8881)
1 parent 9f1e590 commit 7bd5865

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Diff for: docs/en/connector-v2/sink/Redis.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Used to write data to Redis.
1414

1515
| name | type | required | default value |
1616
|--------------------|---------|-----------------------|---------------|
17-
| host | string | yes | - |
18-
| port | int | yes | - |
17+
| host | string | yes when mode=single | - |
18+
| port | int | no | 6379 |
1919
| key | string | yes | - |
2020
| data_type | string | yes | - |
2121
| batch_size | int | no | 10 |

Diff for: docs/en/connector-v2/source/Redis.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Used to read data from Redis.
1818
## Options
1919

2020
| name | type | required | default value |
21-
| ------------------- | ------ | --------------------- | ------------- |
22-
| host | string | yes | - |
23-
| port | int | yes | - |
21+
| ------------------- | ------ |-----------------------| ------------- |
22+
| host | string | yes when mode=single | - |
23+
| port | int | no | 6379 |
2424
| keys | string | yes | - |
2525
| batch_size | int | yes | 10 |
2626
| data_type | string | yes | - |

Diff for: docs/zh/connector-v2/sink/Redis.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
| name | type | required | default value |
1616
|--------------------|---------|-----------------------|---------------|
17-
| host | string | yes | - |
18-
| port | int | yes | - |
17+
| host | string | `mode=single`时必须 | - |
18+
| port | int | no | 6379 |
1919
| key | string | yes | - |
2020
| data_type | string | yes | - |
2121
| batch_size | int | no | 10 |

Diff for: docs/zh/connector-v2/source/Redis.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
| 名称 | 类型 | 是否必须 | 默认值 |
2121
|---------------------|--------|--------------------|--------|
22-
| host | string | | - |
23-
| port | int | | - |
22+
| host | string | `mode=single`时必须 | - |
23+
| port | int | | 6379 |
2424
| keys | string || - |
2525
| batch_size | int || 10 |
2626
| data_type | string || - |

Diff for: seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/RedisBaseOptions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public enum RedisMode {
3838
.withDescription("redis hostname or ip");
3939

4040
public static final Option<Integer> PORT =
41-
Options.key("port").intType().noDefaultValue().withDescription("redis port");
41+
Options.key("port").intType().defaultValue(6379).withDescription("redis port");
4242

4343
public static final Option<String> AUTH =
4444
Options.key("auth")

Diff for: seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/RedisParameters.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
@Slf4j
4747
public class RedisParameters implements Serializable {
4848
private String host;
49-
private int port;
49+
private Integer port;
5050
private String auth = "";
5151
private int dbNum;
5252
private String user = "";

0 commit comments

Comments
 (0)