hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yq...@apache.org
Subject hadoop git commit: HADOOP-15817. Reuse Object Mapper in KMSJSONReader. Contributed by Jonathan Eagles.
Date Thu, 04 Oct 2018 03:05:02 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-3.2 4de3cf196 -> e185ae2d1


HADOOP-15817. Reuse Object Mapper in KMSJSONReader. Contributed by Jonathan Eagles.

(cherry picked from commit 81f635f47f0737eb551bef1aa55afdf7b268253d)


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

Branch: refs/heads/branch-3.2
Commit: e185ae2d17e1ac4e432549fde077a5ee21041d8f
Parents: 4de3cf1
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 11:04:39 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/e185ae2d/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