You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/02/28 12:31:20 UTC

[GitHub] [incubator-inlong] EMsnap opened a new pull request #2787: [INLONG-2786][Agent] [Feature] Agent jetty server support different job type

EMsnap opened a new pull request #2787:
URL: https://github.com/apache/incubator-inlong/pull/2787


   ### [INLONG-2786][Agent] [Feature] Agent jetty server support different job type
   
   Fixes #2786
   
   ### Motivation
   
   Agent jetty server support different job type
   
   ### Modifications
   
   Agent jetty server support different job type
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)


-- 
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-unsubscribe@inlong.apache.org

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



[GitHub] [incubator-inlong] EMsnap commented on a change in pull request #2787: [INLONG-2786][Agent] Jetty server supports different job type

Posted by GitBox <gi...@apache.org>.
EMsnap commented on a change in pull request #2787:
URL: https://github.com/apache/incubator-inlong/pull/2787#discussion_r816727495



##########
File path: inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/conf/ConfigJetty.java
##########
@@ -79,10 +80,22 @@ public void storeJobConf(JobProfile jobProfile) {
             if (jobProfile.hasKey(JOB_TRIGGER)) {
                 triggerManager.submitTrigger(
                     TriggerProfile.parseJsonStr(jobProfile.toJsonStr()));
-            } else if (jobProfile.hasKey(JOB_DIR_FILTER_PATTERN)) {
-                jobManager.submitFileJobProfile(jobProfile);
             } else {
-                jobManager.submitSqlJobProfile(jobProfile);
+                TaskTypeEnum taskType = TaskTypeEnum
+                    .getTaskType(jobProfile.getInt(JOB_SOURCE_TYPE));
+                switch (taskType) {
+                    case SQL:
+                        jobManager.submitSqlJobProfile(jobProfile);
+                        break;
+                    case FILE:
+                        jobManager.submitFileJobProfile(jobProfile);
+                        break;
+                    case KAFKA:
+                    case BINLOG:
+                        jobManager.submitJobProfile(jobProfile, true);
+                        break;
+                    default:

Review comment:
       Thanks for the advice




-- 
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-unsubscribe@inlong.apache.org

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



[GitHub] [incubator-inlong] EMsnap commented on a change in pull request #2787: [INLONG-2786][Agent] Jetty server supports different job type

Posted by GitBox <gi...@apache.org>.
EMsnap commented on a change in pull request #2787:
URL: https://github.com/apache/incubator-inlong/pull/2787#discussion_r816730764



##########
File path: inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/constant/JobConstants.java
##########
@@ -29,6 +29,7 @@
     public static final String JOB_RETRY = "job.retry";
 
     public static final String JOB_SOURCE = "job.source";
+    public static final String JOB_SOURCE_TYPE = "job.sourceType";

Review comment:
       source means the class name for source, I will change the param name for better understanding




-- 
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-unsubscribe@inlong.apache.org

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



[GitHub] [incubator-inlong] dockerzhang commented on a change in pull request #2787: [INLONG-2786][Agent] [Feature] Agent jetty server support different job type

Posted by GitBox <gi...@apache.org>.
dockerzhang commented on a change in pull request #2787:
URL: https://github.com/apache/incubator-inlong/pull/2787#discussion_r816375187



##########
File path: inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/constant/JobConstants.java
##########
@@ -29,6 +29,7 @@
     public static final String JOB_RETRY = "job.retry";
 
     public static final String JOB_SOURCE = "job.source";
+    public static final String JOB_SOURCE_TYPE = "job.sourceType";

Review comment:
       what's difference between `job.source` and `job.sourceType`?

##########
File path: inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/conf/ConfigJetty.java
##########
@@ -79,10 +80,22 @@ public void storeJobConf(JobProfile jobProfile) {
             if (jobProfile.hasKey(JOB_TRIGGER)) {
                 triggerManager.submitTrigger(
                     TriggerProfile.parseJsonStr(jobProfile.toJsonStr()));
-            } else if (jobProfile.hasKey(JOB_DIR_FILTER_PATTERN)) {
-                jobManager.submitFileJobProfile(jobProfile);
             } else {
-                jobManager.submitSqlJobProfile(jobProfile);
+                TaskTypeEnum taskType = TaskTypeEnum
+                    .getTaskType(jobProfile.getInt(JOB_SOURCE_TYPE));
+                switch (taskType) {
+                    case SQL:
+                        jobManager.submitSqlJobProfile(jobProfile);
+                        break;
+                    case FILE:
+                        jobManager.submitFileJobProfile(jobProfile);
+                        break;
+                    case KAFKA:
+                    case BINLOG:
+                        jobManager.submitJobProfile(jobProfile, true);
+                        break;
+                    default:

Review comment:
       the default value better use `UNSUPPORT_TYPE` to mark it, it may be useful to debug if the source type has not been supported.




-- 
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-unsubscribe@inlong.apache.org

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



[GitHub] [incubator-inlong] dockerzhang merged pull request #2787: [INLONG-2786][Agent] Jetty server supports different job type

Posted by GitBox <gi...@apache.org>.
dockerzhang merged pull request #2787:
URL: https://github.com/apache/incubator-inlong/pull/2787


   


-- 
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-unsubscribe@inlong.apache.org

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