CalvinKirs commented on a change in pull request #4928:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/4928#discussion_r586027108



##########
File path: 
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/ResourceProcessDefinitionUtils.java
##########
@@ -30,31 +30,33 @@
      * @param list the map key is process definition id and value is 
resource_ids
      * @return resource process definition map
      */
-    public static Map<Integer, Set<Integer>> 
getResourceProcessDefinitionMap(List<Map<String, Object>> list) {
-        Map<Integer, String> map = new HashMap<>();
-        Map<Integer, Set<Integer>> result = new HashMap<>();
+    public static Map<Integer, Set<Long>> 
getResourceProcessDefinitionMap(List<Map<String, Object>> list) {
+        Map<Long, String> map = new HashMap<>();
+
+        // resourceId -> processDefinitionCodes
+        Map<Integer, Set<Long>> result = new HashMap<>();
         if (CollectionUtils.isNotEmpty(list)) {
             for (Map<String, Object> tempMap : list) {
-                map.put((Integer) tempMap.get("id"), 
(String)tempMap.get("resource_ids"));
+                map.put((Long) tempMap.get("code"), 
(String)tempMap.get("resource_ids"));
             }

Review comment:
       It's best to avoid magic numbers




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to