Linchen-Xu commented on code in PR #13238:
URL: https://github.com/apache/dubbo/pull/13238#discussion_r1371556210
##########
dubbo-metadata/dubbo-metadata-report-redis/src/main/java/org/apache/dubbo/metadata/store/redis/RedisMetadataReport.java:
##########
@@ -61,12 +77,34 @@ public class RedisMetadataReport extends
AbstractMetadataReport {
private Set<HostAndPort> jedisClusterNodes;
private int timeout;
private String password;
+ private final String root;
+ private MD5Utils md5Utils = new MD5Utils();
+ protected ConcurrentMap<String, MappingDataListener> listenerMap = new
ConcurrentHashMap<>();
+ private String luaScript="local key = KEYS[1];\n" +
+ "local field = ARGV[1];\n" +
+ "local oldValue = ARGV[2];\n" +
+ "local newValue = ARGV[3];\n" +
+ "local channel = ARGV[4];\n" +
+ "local valueExists = redis.call(\"HEXISTS\", key, field);\n" +
+ "if valueExists == 0 then\n" +
+ " redis.call(\"HSET\", key, field, newValue);\n" +
Review Comment:
麻烦再改一下watch那里的逻辑,其他部分我觉得ok。
##########
dubbo-metadata/dubbo-metadata-report-redis/src/main/java/org/apache/dubbo/metadata/store/redis/RedisMetadataReport.java:
##########
@@ -61,12 +77,34 @@ public class RedisMetadataReport extends
AbstractMetadataReport {
private Set<HostAndPort> jedisClusterNodes;
private int timeout;
private String password;
+ private final String root;
+ private MD5Utils md5Utils = new MD5Utils();
+ protected ConcurrentMap<String, MappingDataListener> listenerMap = new
ConcurrentHashMap<>();
+ private String luaScript="local key = KEYS[1];\n" +
+ "local field = ARGV[1];\n" +
+ "local oldValue = ARGV[2];\n" +
+ "local newValue = ARGV[3];\n" +
+ "local channel = ARGV[4];\n" +
+ "local valueExists = redis.call(\"HEXISTS\", key, field);\n" +
+ "if valueExists == 0 then\n" +
+ " redis.call(\"HSET\", key, field, newValue);\n" +
Review Comment:
麻烦再改一下watch那里的逻辑,其他部分我觉得ok。
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]