hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viraj...@apache.org
Subject [19/50] [abbrv] hadoop git commit: YARN-4668. Reuse objectMapper instance in Yarn. (Yiqun Lin via gtcarrera9)
Date Fri, 28 Oct 2016 18:04:17 GMT
YARN-4668. Reuse objectMapper instance in Yarn. (Yiqun Lin via gtcarrera9)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/221582c4
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/221582c4
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/221582c4

Branch: refs/heads/HDFS-9806
Commit: 221582c4ab0ff1d5936f754f23da140aac656654
Parents: 892a834
Author: Li Lu <gtcarrera9@apache.org>
Authored: Thu Oct 27 15:19:59 2016 -0700
Committer: Li Lu <gtcarrera9@apache.org>
Committed: Thu Oct 27 15:20:17 2016 -0700

----------------------------------------------------------------------
 .../hadoop/yarn/client/api/impl/TimelineClientImpl.java      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/221582c4/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineClientImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineClientImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineClientImpl.java
index dc4d3e6..d969c59 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineClientImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineClientImpl.java
@@ -98,6 +98,7 @@ import com.sun.jersey.core.util.MultivaluedMapImpl;
 public class TimelineClientImpl extends TimelineClient {
 
   private static final Log LOG = LogFactory.getLog(TimelineClientImpl.class);
+  private static final ObjectMapper MAPPER = new ObjectMapper();
   private static final String RESOURCE_URI_STR_V1 = "/ws/v1/timeline/";
   private static final String RESOURCE_URI_STR_V2 = "/ws/v2/timeline/";
   private static final Joiner JOINER = Joiner.on("");
@@ -765,15 +766,14 @@ public class TimelineClientImpl extends TimelineClient {
       LOG.error("File [" + jsonFile.getAbsolutePath() + "] doesn't exist");
       return;
     }
-    ObjectMapper mapper = new ObjectMapper();
-    YarnJacksonJaxbJsonProvider.configObjectMapper(mapper);
+    YarnJacksonJaxbJsonProvider.configObjectMapper(MAPPER);
     TimelineEntities entities = null;
     TimelineDomains domains = null;
     try {
       if (type.equals(ENTITY_DATA_TYPE)) {
-        entities = mapper.readValue(jsonFile, TimelineEntities.class);
+        entities = MAPPER.readValue(jsonFile, TimelineEntities.class);
       } else if (type.equals(DOMAIN_DATA_TYPE)){
-        domains = mapper.readValue(jsonFile, TimelineDomains.class);
+        domains = MAPPER.readValue(jsonFile, TimelineDomains.class);
       }
     } catch (Exception e) {
       LOG.error("Error when reading  " + e.getMessage());


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


Mime
View raw message