Repository: incubator-griffin Updated Branches: refs/heads/master 3dda6b345 -> 5d7ef04c6
Fix code bug. 1.add java method description 2.reformat import statements violating Griffin's code rule https://github.com/apache/incubator-griffin/blob/master/griffin-doc/dev/code-style.md Author: Eugene <liu...@apache.org> Closes #426 from toyboxman/src/service. Project: http://git-wip-us.apache.org/repos/asf/incubator-griffin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-griffin/commit/5d7ef04c Tree: http://git-wip-us.apache.org/repos/asf/incubator-griffin/tree/5d7ef04c Diff: http://git-wip-us.apache.org/repos/asf/incubator-griffin/diff/5d7ef04c Branch: refs/heads/master Commit: 5d7ef04c6895c67235052fb85781fcf87102c84d Parents: 3dda6b3 Author: Eugene <liu...@apache.org> Authored: Mon Oct 1 23:02:13 2018 +0800 Committer: William Guo <gu...@apache.org> Committed: Mon Oct 1 23:02:13 2018 +0800 ---------------------------------------------------------------------- .../apache/griffin/core/util/YarnNetUtil.java | 23 ++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/5d7ef04c/service/src/main/java/org/apache/griffin/core/util/YarnNetUtil.java ---------------------------------------------------------------------- diff --git a/service/src/main/java/org/apache/griffin/core/util/YarnNetUtil.java b/service/src/main/java/org/apache/griffin/core/util/YarnNetUtil.java index 71308ab..ba0a2e0 100644 --- a/service/src/main/java/org/apache/griffin/core/util/YarnNetUtil.java +++ b/service/src/main/java/org/apache/griffin/core/util/YarnNetUtil.java @@ -19,6 +19,8 @@ under the License. package org.apache.griffin.core.util; +import static org.apache.griffin.core.job.entity.LivySessionStates.State.DEAD; + import com.google.gson.JsonObject; import com.google.gson.JsonParser; import org.apache.commons.lang.StringUtils; @@ -30,13 +32,17 @@ import org.springframework.http.HttpStatus; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RestTemplate; -import static org.apache.griffin.core.job.entity.LivySessionStates.State.DEAD; - public class YarnNetUtil { private static final Logger LOGGER = LoggerFactory .getLogger(YarnNetUtil.class); private static RestTemplate restTemplate = new RestTemplate(); + /** + * delete app task scheduling by yarn. + * + * @param url prefix part of whole url + * @param appId application id + */ public static void delete(String url, String appId) { try { if (appId != null) { @@ -53,6 +59,13 @@ public class YarnNetUtil { } } + /** + * update app task scheduling by yarn. + * + * @param url prefix part of whole url + * @param instance job instance + * @return + */ public static boolean update(String url, JobInstanceBean instance) { try { url += "/ws/v1/cluster/apps/" + instance.getAppId(); @@ -76,6 +89,12 @@ public class YarnNetUtil { return false; } + /** + * parse json string and get app json object. + * + * @param json json string + * @return + */ public static JsonObject parse(String json) { if (StringUtils.isEmpty(json)) { LOGGER.warn("Input string is empty.");