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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]