healchow commented on code in PR #5910:
URL: https://github.com/apache/inlong/pull/5910#discussion_r973571347


##########
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/trigger/DirectoryTrigger.java:
##########
@@ -128,13 +134,28 @@ private void registerAllSubDir(PathPattern entity,
             } else {
                 JobProfile copiedJobProfile = 
PluginUtils.copyJobProfile(profile,
                         entity.getSuitTime(), path.toFile());
+                if (!validateJobProfile(copiedJobProfile, path)) {
+                    return;
+                }
                 LOGGER.info("trigger {} generate job profile to read file {}",
                         getTriggerProfile().getTriggerId(), path.toString());
                 queue.offer(copiedJobProfile);
             }
         }
     }
 
+    private boolean validateJobProfile(JobProfile jobProfile, Path path) {
+        String groupId = jobProfile.get(JOB_GROUP_ID);
+        String streamId = jobProfile.get(JOB_STREAM_ID);
+        String pathUri = path.toUri().getPath();
+        String key = 
groupId.concat(DELIMITER_HYPHEN).concat(streamId).concat(DELIMITER_HYPHEN).concat(pathUri);

Review Comment:
   Adding more comments, please.



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

Reply via email to