use of com.flink.platform.dao.entity.LongArrayList in project flink-platform-backend by itinycheng.
the class UserGroupController method createOrUpdate.
@PostMapping(value = "/createOrUpdate")
public ResultInfo<Long> createOrUpdate(@RequestBody UserGroupRequest userGroupRequest) {
try {
ResultInfo<String> sqlInfo = insertSelect(userGroupRequest.getSelect());
String sql = sqlInfo.getData();
JobInfo jobInfo = new JobInfo();
BeanUtils.copyProperties(userGroupRequest, jobInfo);
jobInfo.setSubject(sql);
jobInfo.setType(JobType.FLINK_SQL);
jobInfo.setDeployMode(DeployMode.FLINK_YARN_PER);
jobInfo.setExecMode(ExecutionMode.BATCH);
LongArrayList longs = new LongArrayList();
longs.add(1L);
jobInfo.setCatalogs(longs);
jobInfo.setStatus(JobStatus.ONLINE);
boolean bool = jobInfoService.saveOrUpdate(jobInfo);
if (bool && userGroupRequest.getId() == null) {
JobQuartzInfo jobQuartzInfo = new JobQuartzInfo(jobInfo);
quartzService.runOnce(jobQuartzInfo);
quartzService.addJobToQuartz(jobQuartzInfo);
}
return ResultInfo.success(jobInfo.getId());
} catch (Exception e) {
log.error("create or update user group failed", e);
return ResultInfo.failure(ResponseStatus.SERVICE_ERROR);
}
}
use of com.flink.platform.dao.entity.LongArrayList in project flink-platform-backend by itinycheng.
the class JobFlowTest method test1.
@Test
public void test1() {
JobFlowDag dag = new JobFlowDag();
JobVertex jobVertex1 = new JobVertex(19L, 19L);
JobVertex jobVertex2 = new JobVertex(20L, 20L);
dag.addVertex(jobVertex1);
dag.addVertex(jobVertex2);
JobEdge jobEdge = new JobEdge(19L, 20L, SUCCESS);
dag.addEdge(jobEdge);
JobFlowRequest jobFlowRequest = new JobFlowRequest();
jobFlowRequest.setCode(UuidGenerator.generateShortUuid());
jobFlowRequest.setName("test_1");
jobFlowRequest.setUserId(0L);
jobFlowRequest.setDescription("description");
jobFlowRequest.setCronExpr("0 0/10 * * * ?");
jobFlowRequest.setFlow(dag);
jobFlowRequest.setPriority(8);
jobFlowRequest.setAlerts(new LongArrayList());
jobFlowRequest.setStatus(OFFLINE);
String json = JsonUtil.toJsonString(jobFlowRequest.getJobFlow());
System.out.println(json);
}
Aggregations