Open zhaoyang20201221 opened 1 year ago
Great proposal, This feature is very useful for third-party platform integration, Are there any more details about design and implementation?
/**
* Quickly start a flink task
* @param copyId The ID of the copy task
* @param jobName Task name
* @param args parameter
* @param isDel Whether you want to delete duplicate tasks, default value = false
*
* @return
*/
public Boolean quickStartFlinkTask(Long copyId ,String jobName ,String args,Boolean isDel){
try {
// Verify that the task name already exists
boolean existsByJobName = applicationService.existsByJobName(jobName);
if(existsByJobName && isDel) {
// Get the task details through the job name
Application app = applicationService.getByJobName(jobName);
// Delete the previous task
applicationService.delete(app);
}
// First copy a configuration template and get the task id
Long id = applicationService.copy(copyId,jobName,args);
// Get task details
Application application = applicationService.getById(id);
// build flink task
appBuildPipeService.buildApplication(id,false);
// start flink task
applicationService.start(application);
} catch (Exception e) {
throw new RuntimeException(e.toString());
}
}
Search before asking
Description
In the process of data synchronization, I want to use the streampark service to quickly start a flink task. At this time, I found that the following interfaces need to be initiated every time
Modify the previous interface display:
The interface display after the change:
Usage Scenario
When a third-party service uses the streamPark service, it hopes to quickly start a flink task, and does not care how the internal logic of streamPark is implemented. If the above interfaces are combined to provide an interface service, streamPark will have better scalability and applicability.
Related issues
No response
Are you willing to submit a PR?
Code of Conduct