TyrantLucifer commented on code in PR #2647:
URL:
https://github.com/apache/incubator-seatunnel/pull/2647#discussion_r963159645
##########
seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/RedisDataType.java:
##########
@@ -29,32 +29,59 @@
public enum RedisDataType {
KEY {
+ @Override
+ public void set(Jedis jedis, String key, String value) {
+ jedis.set(key, value);
+ }
+
@Override
public List<String> get(Jedis jedis, String key) {
return Collections.singletonList(jedis.get(key));
}
},
HASH {
+ @Override
+ public void set(Jedis jedis, String key, String value) {
+ Map<String, String> fieldsMap = JsonUtils.toMap(value);
+ jedis.hset(key, fieldsMap);
+ }
+
@Override
public List<String> get(Jedis jedis, String key) {
Map<String, String> kvMap = jedis.hgetAll(key);
return Collections.singletonList(JsonUtils.toJsonString(kvMap));
}
+
},
LIST {
+ @Override
+ public void set(Jedis jedis, String key, String value) {
+ jedis.lpush(key, value);
Review Comment:
If list key is not existed, when we try to `rpush` it will throw an
exception and operation failed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]