diff --git a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/dao/impl/JobInstanceDaoImpl.java b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/dao/impl/JobInstanceDaoImpl.java index 8cd2d10b0..5ece72509 100644 --- a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/dao/impl/JobInstanceDaoImpl.java +++ b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/dao/impl/JobInstanceDaoImpl.java @@ -73,10 +73,8 @@ public IPage queryJobInstanceListPaging( Date endTime, String jobDefineName, JobMode jobMode) { - IPage jobInstanceIPage = - jobInstanceMapper.queryJobInstanceListPaging( - page, startTime, endTime, jobDefineName, jobMode); - return jobInstanceIPage; + return jobInstanceMapper.queryJobInstanceListPaging( + page, startTime, endTime, jobDefineName, jobMode); } @Override diff --git a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/domain/dto/job/SeaTunnelJobInstanceDto.java b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/domain/dto/job/SeaTunnelJobInstanceDto.java index ba69e6008..f01140ec9 100644 --- a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/domain/dto/job/SeaTunnelJobInstanceDto.java +++ b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/domain/dto/job/SeaTunnelJobInstanceDto.java @@ -30,4 +30,6 @@ public class SeaTunnelJobInstanceDto extends JobInstance { private long writeRowCount; private Long runningTime; + + private String username; } diff --git a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/TaskInstanceServiceImpl.java b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/TaskInstanceServiceImpl.java index dd249e711..d40b69ad0 100644 --- a/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/TaskInstanceServiceImpl.java +++ b/seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/TaskInstanceServiceImpl.java @@ -21,7 +21,6 @@ import org.apache.seatunnel.app.common.Status; import org.apache.seatunnel.app.dal.dao.IJobDefinitionDao; import org.apache.seatunnel.app.dal.dao.IJobInstanceDao; -import org.apache.seatunnel.app.dal.entity.JobDefinition; import org.apache.seatunnel.app.dal.entity.JobInstance; import org.apache.seatunnel.app.domain.dto.job.SeaTunnelJobInstanceDto; import org.apache.seatunnel.app.domain.response.executor.JobExecutionStatus; @@ -93,7 +92,8 @@ public Result> getSyncTaskInstancePaging( if (CollectionUtils.isEmpty(records)) { return result; } - populateExecutionMetricsData(userId, jobMode, records); + addRunningTimeToResult(records); + jobPipelineSummaryMetrics(records, jobMode, userId); pageInfo.setTotal((int) jobInstanceIPage.getTotal()); pageInfo.setTotalList(records); result.setData(pageInfo); @@ -102,7 +102,6 @@ public Result> getSyncTaskInstancePaging( private void populateExecutionMetricsData( Integer userId, JobMode jobMode, List records) { - addJobDefineNameToResult(records); addRunningTimeToResult(records); jobPipelineSummaryMetrics(records, jobMode, userId); } @@ -126,16 +125,6 @@ private void addRunningTimeToResult(List records) { } } - private void addJobDefineNameToResult(List records) { - for (SeaTunnelJobInstanceDto jobInstanceDto : records) { - JobDefinition jobDefinition = - jobDefinitionService.getJobDefinitionByJobId(jobInstanceDto.getJobDefineId()); - if (jobDefinition != null) { - jobInstanceDto.setJobDefineName(jobDefinition.getName()); - } - } - } - public Date dateConverter(String time) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); diff --git a/seatunnel-server/seatunnel-app/src/main/resources/org/apache/seatunnel/app/dal/mapper/JobInstanceMapper.xml b/seatunnel-server/seatunnel-app/src/main/resources/org/apache/seatunnel/app/dal/mapper/JobInstanceMapper.xml index 3862c7982..6f4b4dfa0 100644 --- a/seatunnel-server/seatunnel-app/src/main/resources/org/apache/seatunnel/app/dal/mapper/JobInstanceMapper.xml +++ b/seatunnel-server/seatunnel-app/src/main/resources/org/apache/seatunnel/app/dal/mapper/JobInstanceMapper.xml @@ -32,26 +32,28 @@