You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/04/08 08:25:07 UTC

[GitHub] [shardingsphere] zjcnb commented on a diff in pull request #16440: use zk to support show processlist.

zjcnb commented on code in PR #16440:
URL: https://github.com/apache/shardingsphere/pull/16440#discussion_r845866480


##########
shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/registry/status/compute/watcher/ComputeNodeStateChangedWatcher.java:
##########
@@ -70,10 +75,31 @@
         } else if (event.getKey().startsWith(ComputeNode.getOnlineInstanceNodePath())) {
             Optional<InstanceDefinition> instanceDefinition = ComputeNode.getInstanceDefinitionByInstanceOnlinePath(event.getKey());
             return instanceDefinition.isPresent() ? createInstanceEvent(instanceDefinition.get(), event.getType()) : Optional.empty();
+        } else if (event.getKey().startsWith(ComputeNode.getProcessTriggerNodePatch())) {
+            return createShowProcessListTriggerEvent(event);
         }
         return Optional.empty();
     }
     
+    private Optional<GovernanceEvent> createShowProcessListTriggerEvent(final DataChangedEvent event) {
+        Matcher matcher = getShowProcessTriggerMatcher(event);
+        if (!matcher.find()) {
+            return Optional.empty();
+        }
+        if (event.getType() == Type.ADDED) {

Review Comment:
   @tuichenchuxin Thank you for your pull request. I think `event.getType() == Type.ADDED` can change to `Type.ADDED == event.getType()`



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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