KYLIN-2536 replace codehaus jackson with fasterxml Signed-off-by: lidongsjtu <lid...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b641032b Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b641032b Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b641032b Branch: refs/heads/KYLIN-2506 Commit: b641032bfe2d79ae162c88ac7faf082250ca3a73 Parents: 2e87fb4 Author: etherge <ethe...@163.com> Authored: Fri Apr 7 18:28:07 2017 +0800 Committer: lidongsjtu <lid...@apache.org> Committed: Sun Apr 9 23:54:44 2017 +0800 ---------------------------------------------------------------------- .../kylin/engine/mr/common/HadoopStatusGetter.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/b641032b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java ---------------------------------------------------------------------- diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java index 1107aa5..f31369b 100644 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/common/HadoopStatusGetter.java @@ -43,11 +43,12 @@ import org.apache.http.client.params.AuthPolicy; import org.apache.http.impl.auth.SPNegoSchemeFactory; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.DefaultHttpClient; -import org.codehaus.jackson.JsonNode; -import org.codehaus.jackson.map.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + /** */ public class HadoopStatusGetter { @@ -68,8 +69,8 @@ public class HadoopStatusGetter { String response = useKerberosAuth ? getHttpResponseWithKerberosAuth(url) : getHttpResponse(url); logger.debug("Hadoop job " + mrJobId + " status : " + response); JsonNode root = new ObjectMapper().readTree(response); - RMAppState state = RMAppState.valueOf(root.findValue("state").getTextValue()); - FinalApplicationStatus finalStatus = FinalApplicationStatus.valueOf(root.findValue("finalStatus").getTextValue()); + RMAppState state = RMAppState.valueOf(root.findValue("state").textValue()); + FinalApplicationStatus finalStatus = FinalApplicationStatus.valueOf(root.findValue("finalStatus").textValue()); return Pair.of(state, finalStatus); } @@ -84,12 +85,12 @@ public class HadoopStatusGetter { System.setProperty("java.security.krb5.conf", krb5ConfigPath); System.setProperty("sun.security.krb5.debug", "true"); System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); - + DefaultHttpClient client = new DefaultHttpClient(); AuthSchemeRegistry authSchemeRegistry = new AuthSchemeRegistry(); authSchemeRegistry.register(AuthPolicy.SPNEGO, new SPNegoSchemeFactory(skipPortAtKerberosDatabaseLookup)); client.setAuthSchemes(authSchemeRegistry); - + BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider(); Credentials useJaasCreds = new Credentials() { public String getPassword() { @@ -102,7 +103,7 @@ public class HadoopStatusGetter { }; credentialsProvider.setCredentials(new AuthScope(null, -1, null), useJaasCreds); client.setCredentialsProvider(credentialsProvider); - + String response = null; while (response == null) { if (url.startsWith("https://")) {