justinwwhuang commented on code in PR #10801:
URL: https://github.com/apache/inlong/pull/10801#discussion_r1732065544


##########
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/RedisSource.java:
##########
@@ -84,6 +182,96 @@ public boolean sourceFinish() {
 
     @Override
     public boolean sourceExist() {
-        return false;
+        return true;
+    }
+
+    private String getRedisUri() {
+        StringBuffer sb = new StringBuffer("redis://");
+        sb.append(hostName).append(":").append(port);
+        if (!StringUtils.isEmpty(dbNumber)) {
+            sb.append("/").append(dbNumber);
+        }
+        sb.append("?");
+        if (!StringUtils.isEmpty(authPassword)) {
+            sb.append("authPassword=").append(authPassword).append("&");
+        }
+        if (!StringUtils.isEmpty(authUser)) {
+            sb.append("authUser=").append(authUser).append("&");
+        }
+        if (!StringUtils.isEmpty(readTimeout)) {
+            sb.append("readTimeout=").append(readTimeout).append("&");
+        }
+        if (ssl) {
+            sb.append("ssl=").append("yes").append("&");
+        }
+        if (!StringUtils.isEmpty(snapShot)) {
+            sb.append("replOffset=").append(snapShot).append("&");
+        }
+        if (!StringUtils.isEmpty(replId)) {
+            sb.append("replId=").append(replId).append("&");
+        }
+        if (sb.charAt(sb.length() - 1) == '?' || sb.charAt(sb.length() - 1) == 
'&') {
+            sb.deleteCharAt(sb.length() - 1);
+        }
+        return sb.toString();
+    }
+
+    private void initReplicator() {
+        redisReplicator.addEventListener((replicator, event) -> {

Review Comment:
   Sorry, obtaining data through commands is recommended to be at the same 
level as obtaining data through subscriptions, rather than filtering through 
commands after subscribing.



-- 
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: commits-unsubscr...@inlong.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to