hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [23/50] [abbrv] hadoop git commit: HADOOP-15817. Reuse Object Mapper in KMSJSONReader. Contributed by Jonathan Eagles.
Date Fri, 05 Oct 2018 22:06:52 GMT
HADOOP-15817. Reuse Object Mapper in KMSJSONReader. Contributed by Jonathan Eagles.


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

Branch: refs/heads/HDFS-12943
Commit: 81f635f47f0737eb551bef1aa55afdf7b268253d
Parents: 39b3503
Author: Yiqun Lin <yqlin@apache.org>
Authored: Thu Oct 4 10:30:30 2018 +0800
Committer: Yiqun Lin <yqlin@apache.org>
Committed: Thu Oct 4 10:30:30 2018 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/crypto/key/kms/server/KMSJSONReader.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/81f635f4/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONReader.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONReader.java
b/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONReader.java
index f6f670b..af781f5 100644
--- a/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONReader.java
+++ b/hadoop-common-project/hadoop-kms/src/main/java/org/apache/hadoop/crypto/key/kms/server/KMSJSONReader.java
@@ -38,6 +38,7 @@ import java.util.Map;
 @Consumes(MediaType.APPLICATION_JSON)
 @InterfaceAudience.Private
 public class KMSJSONReader implements MessageBodyReader<Object> {
+  private static final ObjectMapper MAPPER = new ObjectMapper();
 
   @Override
   public boolean isReadable(Class<?> type, Type genericType,
@@ -51,7 +52,6 @@ public class KMSJSONReader implements MessageBodyReader<Object> {
       Annotation[] annotations, MediaType mediaType,
       MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
       throws IOException, WebApplicationException {
-    ObjectMapper mapper = new ObjectMapper();
-    return mapper.readValue(entityStream, type);
+    return MAPPER.readValue(entityStream, type);
   }
 }


---------------------------------------------------------------------
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