[Improvement-8218][dolphinscheduler-api] QueryTaskInstanceListPaging API performance improvement (#8223)
This commit is contained in:
parent
aa8ae5de45
commit
294882f5d7
|
|
@ -143,8 +143,9 @@ public class TaskInstanceServiceImpl extends BaseServiceImpl implements TaskInst
|
|||
Map<Integer, User> userMap = users.stream().collect(Collectors.toMap(User::getId, v -> v));
|
||||
for (TaskInstance taskInstance : taskInstanceList) {
|
||||
taskInstance.setDuration(DateUtils.format2Duration(taskInstance.getStartTime(), taskInstance.getEndTime()));
|
||||
if (userMap.containsKey(taskInstance.getExecutorId())) {
|
||||
taskInstance.setExecutorName(userMap.get(taskInstance.getExecutorId()).getUserName());
|
||||
User user = userMap.get(taskInstance.getExecutorId());
|
||||
if (user != null) {
|
||||
taskInstance.setExecutorName(user.getUserName());
|
||||
}
|
||||
}
|
||||
pageInfo.setTotal((int) taskInstanceIPage.getTotal());
|
||||
|
|
|
|||
|
|
@ -78,9 +78,6 @@ public class CollectionUtils {
|
|||
*/
|
||||
public static <T extends Object> List<Map<String, Object>> getListByExclusion(List<T> originList, Set<String> exclusionSet) {
|
||||
List<Map<String, Object>> instanceList = new ArrayList<>();
|
||||
if (exclusionSet == null) {
|
||||
exclusionSet = new HashSet<>();
|
||||
}
|
||||
if (originList == null) {
|
||||
return instanceList;
|
||||
}
|
||||
|
|
@ -89,7 +86,7 @@ public class CollectionUtils {
|
|||
BeanMap beanMap = new BeanMap(instance);
|
||||
instanceMap = new LinkedHashMap<>(16, 0.75f, true);
|
||||
for (Map.Entry<Object, Object> entry : beanMap.entrySet()) {
|
||||
if (exclusionSet.contains(entry.getKey())) {
|
||||
if (exclusionSet != null && exclusionSet.contains(entry.getKey())) {
|
||||
continue;
|
||||
}
|
||||
instanceMap.put((String) entry.getKey(), entry.getValue());
|
||||
|
|
|
|||
Loading…
Reference in New Issue