You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/09/29 01:38:43 UTC

[GitHub] [iotdb] Wei-hao-Li commented on a diff in pull request #7474: [IOTDB-4500]CreateTrigger and ShowTrigger process on ConfigNode

Wei-hao-Li commented on code in PR #7474:
URL: https://github.com/apache/iotdb/pull/7474#discussion_r982988877


##########
confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/ConfigNodeProcedureEnv.java:
##########
@@ -362,6 +370,79 @@ public List<TRegionReplicaSet> getAllReplicaSets(String storageGroup) {
     return getPartitionManager().getAllReplicaSets(storageGroup);
   }
 
+  public List<TSStatus> createTriggerOnDataNodes(
+      TriggerInformation triggerInformation, Binary jarFile) throws IOException {
+    NodeManager nodeManager = configManager.getNodeManager();
+    final Map<Integer, TDataNodeLocation> dataNodeLocationMap =
+        nodeManager.getRegisteredDataNodeLocations();
+    final List<TSStatus> dataNodeResponseStatus =
+        Collections.synchronizedList(new ArrayList<>(dataNodeLocationMap.size()));
+    final TCreateTriggerInstanceReq request =
+        new TCreateTriggerInstanceReq(
+            triggerInformation.serialize(), ByteBuffer.wrap(jarFile.getValues()));
+    // TODO: The request sent to DataNodes which stateful trigger needn't to be created don't set
+    // JarFile
+    AsyncDataNodeClientPool.getInstance()
+        .sendAsyncRequestToDataNodeWithRetry(
+            request,
+            dataNodeLocationMap,
+            DataNodeRequestType.CREATE_TRIGGER_INSTANCE,
+            dataNodeResponseStatus);

Review Comment:
   Yes, in the current design of Trigger, DataNode will contain the full information of all triggers.



-- 
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: reviews-unsubscribe@iotdb.apache.org

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