提交 9c3d02f9 authored 作者: 王红亮's avatar 王红亮

更新redis配置

上级 0868f1a9
...@@ -42,9 +42,9 @@ public class RedisAConfiguration { ...@@ -42,9 +42,9 @@ public class RedisAConfiguration {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"redis datasource auth is null, please check your config"); "redis datasource auth is null, please check your config");
} }
if (!redisOption.containsKey(RedisOptionRule.KEY.key())) { if (!redisOption.containsKey(RedisOptionRule.KEY_PATTERN.key())) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"redis datasource key is null, please check your config"); "redis datasource keys is null, please check your config");
} }
if (!redisOption.containsKey(RedisOptionRule.DATA_TYPE.key())) { if (!redisOption.containsKey(RedisOptionRule.DATA_TYPE.key())) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
...@@ -55,7 +55,7 @@ public class RedisAConfiguration { ...@@ -55,7 +55,7 @@ public class RedisAConfiguration {
redisConfiguration.setPort(Integer.valueOf(redisOption.get(RedisOptionRule.PORT.key()))); redisConfiguration.setPort(Integer.valueOf(redisOption.get(RedisOptionRule.PORT.key())));
redisConfiguration.setMode(redisOption.get(RedisOptionRule.MODE.key())); redisConfiguration.setMode(redisOption.get(RedisOptionRule.MODE.key()));
redisConfiguration.setAuth(redisOption.get(RedisOptionRule.AUTH.key())); redisConfiguration.setAuth(redisOption.get(RedisOptionRule.AUTH.key()));
redisConfiguration.setKey(redisOption.get(RedisOptionRule.KEY.key())); redisConfiguration.setKeys(redisOption.get(RedisOptionRule.KEY_PATTERN.key()));
redisConfiguration.setData_type(redisOption.get(RedisOptionRule.DATA_TYPE.key())); redisConfiguration.setData_type(redisOption.get(RedisOptionRule.DATA_TYPE.key()));
return redisConfiguration; return redisConfiguration;
......
...@@ -5,7 +5,7 @@ public class RedisConfiguration { ...@@ -5,7 +5,7 @@ public class RedisConfiguration {
private Integer port; private Integer port;
private String user; private String user;
private String auth; private String auth;
private String key; private String keys;
private String data_type; private String data_type;
private String mode; private String mode;
...@@ -16,14 +16,14 @@ public class RedisConfiguration { ...@@ -16,14 +16,14 @@ public class RedisConfiguration {
Integer port, Integer port,
String user, String user,
String auth, String auth,
String key, String keys,
String data_type, String data_type,
String mode) { String mode) {
this.host = host; this.host = host;
this.port = port; this.port = port;
this.user = user; this.user = user;
this.auth = auth; this.auth = auth;
this.key = key; this.keys = keys;
this.data_type = data_type; this.data_type = data_type;
this.mode = mode; this.mode = mode;
} }
...@@ -42,8 +42,8 @@ public class RedisConfiguration { ...@@ -42,8 +42,8 @@ public class RedisConfiguration {
+ ", auth='" + ", auth='"
+ auth + auth
+ '\'' + '\''
+ ", key='" + ", keys='"
+ key + keys
+ '\'' + '\''
+ ", data_type='" + ", data_type='"
+ data_type + data_type
...@@ -86,12 +86,12 @@ public class RedisConfiguration { ...@@ -86,12 +86,12 @@ public class RedisConfiguration {
this.auth = auth; this.auth = auth;
} }
public String getKey() { public String getKeys() {
return key; return keys;
} }
public void setKey(String key) { public void setKeys(String keys) {
this.key = key; this.keys = keys;
} }
public String getData_type() { public String getData_type() {
......
...@@ -63,12 +63,6 @@ public class RedisOptionRule { ...@@ -63,12 +63,6 @@ public class RedisOptionRule {
.withDescription( .withDescription(
"keys pattern, redis source connector support fuzzy key matching, user needs to ensure that the matched keys are the same type"); "keys pattern, redis source connector support fuzzy key matching, user needs to ensure that the matched keys are the same type");
public static final Option<String> KEY =
Options.key("key")
.stringType()
.noDefaultValue()
.withDescription("The value of key you want to write to redis.");
public static final Option<String> DATA_TYPE = public static final Option<String> DATA_TYPE =
Options.key("data_type") Options.key("data_type")
.stringType() .stringType()
...@@ -105,8 +99,8 @@ public class RedisOptionRule { ...@@ -105,8 +99,8 @@ public class RedisOptionRule {
public static OptionRule optionRule() { public static OptionRule optionRule() {
return OptionRule.builder() return OptionRule.builder()
.required(HOST, PORT, KEY, DATA_TYPE) .required(HOST, PORT, KEY_PATTERN, DATA_TYPE)
.optional(USER, AUTH, MODE, FORMAT, HASH_KEY_PARSE_MODE, KEY_PATTERN) .optional(USER, AUTH, MODE, FORMAT, HASH_KEY_PARSE_MODE)
.build(); .build();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论