-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Feature][Connector-redis] fix redis cluster bug and add cluster e2e #9869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
5d97f46
120a2d3
466a78d
5bd90da
21658da
9dc1794
3532ccf
8ebcb90
11a9628
65b3536
72873c7
86e2ecb
836872c
e3a0500
06924ae
673d109
76b5a70
7162406
cd2fb91
fb9d65a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,22 +17,23 @@ import ChangeLog from '../changelog/connector-redis.md'; | |
| name | type | required | default value | | ||
|--------------------|---------|-----------------------|---------------| | ||
| host | string | `mode=single`时必须 | - | | ||
| port | int | no | 6379 | | ||
| key | string | yes | - | | ||
| data_type | string | yes | - | | ||
| batch_size | int | no | 10 | | ||
| user | string | no | - | | ||
| auth | string | no | - | | ||
| db_num | int | no | 0 | | ||
| mode | string | no | single | | ||
| nodes | list | yes when mode=cluster | - | | ||
| format | string | no | json | | ||
| expire | long | no | -1 | | ||
| support_custom_key | boolean | no | false | | ||
| value_field | string | no | - | | ||
| hash_key_field | string | no | - | | ||
| hash_value_field | string | no | - | | ||
| common-options | | no | - | | ||
| port | int | 否 | 6379 | | ||
| key | string | 是 | - | | ||
| data_type | string | 是 | - | | ||
| batch_size | int | 否 | 10 | | ||
| user | string | 否 | - | | ||
| auth | string | 否 | - | | ||
| db_num | int | 否 | 0 | | ||
| mode | string | 否 | single | | ||
| nodes | list | `mode=cluster`时必须 | - | | ||
| format | string | 否 | json | | ||
| expire | long | 否 | -1 | | ||
| support_custom_key | boolean | 否 | false | | ||
| value_field | string | 否 | - | | ||
| hash_key_field | string | 否 | - | | ||
| hash_value_field | string | 否 | - | | ||
| field_delimiter | string | 否 | "," | | ||
| common-options | | 否 | - | | ||
|
||
### host [string] | ||
|
||
|
@@ -114,7 +115,7 @@ Redis 节点信息,在集群模式下使用,必须按如下格式: | |
|
||
### format [string] | ||
|
||
上游数据的格式,目前只支持 `json`,以后会支持 `text`,默认 `json`。 | ||
上游数据的格式,目前只支持 `json`,`text`,默认 `json`。 | ||
|
||
当你指定格式为 `json` 时,例如: | ||
|
||
|
@@ -130,6 +131,18 @@ Redis 节点信息,在集群模式下使用,必须按如下格式: | |
{"code": 200, "data": "获取成功", "success": "true"} | ||
``` | ||
|
||
当你指定format为`text`,并设置field_delimiter为`#`时,连接器将生成如下数据并将其写入redis: | ||
|
||
```text | ||
200#get success#true | ||
``` | ||
|
||
### field_delimiter [string] | ||
字段分隔符,用于告诉连接器如何分割字段。 | ||
|
||
目前仅当格式为text时需要配置。默认为","。 | ||
|
||
|
||
### expire [long] | ||
|
||
设置 Redis 的过期时间,单位为秒。默认值为 -1,表示键不会自动过期。 | ||
|
@@ -210,7 +223,7 @@ Redis { | |
Redis { | ||
host = localhost | ||
port = 6379 | ||
key = "name:{name}" | ||
key = "name:${name}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should do some special case for redis to make sure legacy behavior work fine too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. In the |
||
support_custom_key = true | ||
data_type = key | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a question. Text format has been applied to Redis here. However, it is still not supported in HTTP. Do we need to modify the HTTP connector separately in the future? @Hisoka-X
https://github.com/apache/seatunnel/blob/02c7eb3177989bcd50ba6c1059862c1586d3fa39/docs/en/connector-v2/source/Http.md?plain=1#L176C1-L177C1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can do the same thing in HTTP. LocalFile already did this.