Skip to content

Commit 7c240a4

Browse files
committed
Merge branch 'dev-0.2.3-log-collector' of github.com:WeDataSphere/Streamis into dev-0.2.3-log-collector
2 parents 7e0e431 + 82f4f5d commit 7c240a4

File tree

1 file changed

+15
-6
lines changed
  • streamis-jobmanager/streamis-jobmanager-server/src/main/java/com/webank/wedatasphere/streamis/jobmanager/restful/api

1 file changed

+15
-6
lines changed

streamis-jobmanager/streamis-jobmanager-server/src/main/java/com/webank/wedatasphere/streamis/jobmanager/restful/api/JobRestfulApi.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ public Message executeHistoryJob(HttpServletRequest req,
235235
private Message withStreamJob(HttpServletRequest req, String projectName,
236236
String jobName, String username,
237237
Function<StreamJob, Message> streamJobFunction) {
238+
if(StringUtils.isBlank(projectName)) {
239+
return Message.error("projectName cannot be empty!");
240+
} else if(StringUtils.isBlank(jobName)) {
241+
return Message.error("jobName cannot be empty!");
242+
}
238243
List<QueryJobListVo> streamJobs = streamJobService.getByProList(projectName, username, jobName, null, null).getList();
239244
if(CollectionUtils.isEmpty(streamJobs)) {
240245
return Message.error("Not exits Streamis job " + jobName);
@@ -259,6 +264,9 @@ public Message addTask(HttpServletRequest req,
259264
@RequestParam(value = "appUrl") String appUrl) {
260265
String username = SecurityFilter.getLoginUsername(req);
261266
LOG.info("User {} try to add a new task for Streamis job {} with appId: {}, appUrl: {}.", username, jobName, appId, appUrl);
267+
if(StringUtils.isBlank(appId)) {
268+
return Message.error("appId cannot be empty!");
269+
}
262270
return withStreamJob(req, projectName, jobName, username, streamJob -> {
263271
// 如果存在正在运行的,先将其停止掉
264272
StreamTask streamTask = streamTaskService.getLatestTaskByJobId(streamJob.getId());
@@ -328,14 +336,15 @@ private Message withFlinkJobInfo(String jobName, String flinkJobInfoStr, Functio
328336
return flinkJobInfoFunction.apply(flinkJobInfo);
329337
}
330338

331-
@RequestMapping(path = "/updateTask", method = RequestMethod.GET)
339+
@RequestMapping(path = "/updateTask", method = RequestMethod.POST)
332340
public Message updateTask(HttpServletRequest req,
333-
@RequestParam(value = "projectName") String projectName,
334-
@RequestParam(value = "jobName") String jobName,
335-
@RequestParam(value = "appId") String appId,
336-
@RequestParam(value = "metrics") String metrics) {
341+
@RequestBody Map<String, String> json) {
337342
String username = SecurityFilter.getLoginUsername(req);
338-
LOG.info("User {} try to update task for Streamis job {} with appId: {}.", username, jobName, appId);
343+
String projectName = json.get("projectName");
344+
String jobName = json.get("jobName");
345+
String appId = json.get("appId");
346+
String metrics = json.get("metrics");
347+
LOG.info("User {} try to update task for Streamis job {} with appId: {}, metrics: {}.", username, jobName, appId, metrics);
339348
return withStreamJob(req, projectName, jobName, username, streamJob -> {
340349
StreamTask streamTask = streamTaskService.getLatestTaskByJobId(streamJob.getId());
341350
if (streamTask == null) {

0 commit comments

Comments
 (0)