You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/06/07 12:44:50 UTC

[incubator-linkis] 04/09: 1. linkis-entrance - fix method progressWithResource

This is an automated email from the ASF dual-hosted git repository.

peacewong pushed a commit to branch dev-1.1.3
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git

commit f0780ad11d43862cdec8f98cd0d0cc5ea0484bbf
Author: alexkun <xu...@qq.com>
AuthorDate: Mon May 30 23:36:40 2022 +0800

    1. linkis-entrance - fix method progressWithResource
---
 .../apache/linkis/entrance/restful/EntranceRestfulApi.java   | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
index 1e4862755..11d8958f3 100644
--- a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
+++ b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
@@ -294,11 +294,13 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
                             (HashMap<String, ResourceWithStatus>)
                                     metrics.get(TaskConstant.ENTRANCEJOB_YARNRESOURCE);
                     ArrayList<YarnResourceWithStatusVo> resoureList = new ArrayList<>(12);
-                    resourceMap.forEach(
-                            (applicationId, resource) -> {
-                                resoureList.add(
-                                        new YarnResourceWithStatusVo(applicationId, resource));
-                            });
+                    if (null != resourceMap && !resourceMap.isEmpty()) {
+                        resourceMap.forEach(
+                                (applicationId, resource) -> {
+                                    resoureList.add(
+                                            new YarnResourceWithStatusVo(applicationId, resource));
+                                });
+                    }
                     metricsVo.put(TaskConstant.ENTRANCEJOB_YARNRESOURCE, resoureList);
                     Optional<Integer> cores =
                             resourceMap.values().stream()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org