You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by da...@apache.org on 2017/08/13 04:47:07 UTC
hive git commit: HIVE-17301: Make JSONMessageFactory.getTObj method
thread safe
Repository: hive
Updated Branches:
refs/heads/master eb7a8f909 -> 0f9990bdf
HIVE-17301: Make JSONMessageFactory.getTObj method thread safe
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/0f9990bd
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/0f9990bd
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/0f9990bd
Branch: refs/heads/master
Commit: 0f9990bdf84cea71a804a46b14c05e5bfc9d48e4
Parents: eb7a8f9
Author: Daniel Dai <da...@hortonworks.com>
Authored: Sat Aug 12 21:46:39 2017 -0700
Committer: Daniel Dai <da...@hortonworks.com>
Committed: Sat Aug 12 21:46:39 2017 -0700
----------------------------------------------------------------------
.../hadoop/hive/metastore/messaging/json/JSONMessageFactory.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/0f9990bd/metastore/src/java/org/apache/hadoop/hive/metastore/messaging/json/JSONMessageFactory.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/messaging/json/JSONMessageFactory.java b/metastore/src/java/org/apache/hadoop/hive/metastore/messaging/json/JSONMessageFactory.java
index 71e25ed..f53b14b 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/messaging/json/JSONMessageFactory.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/messaging/json/JSONMessageFactory.java
@@ -85,7 +85,6 @@ public class JSONMessageFactory extends MessageFactory {
private static final Logger LOG = LoggerFactory.getLogger(JSONMessageFactory.class.getName());
private static JSONMessageDeserializer deserializer = new JSONMessageDeserializer();
- private static TDeserializer thriftDeSerializer = new TDeserializer(new TJSONProtocol.Factory());
@Override
public MessageDeserializer getDeserializer() {
@@ -303,12 +302,12 @@ public class JSONMessageFactory extends MessageFactory {
*/
public static TBase getTObj(String tSerialized, Class<? extends TBase> objClass) throws Exception{
+ TDeserializer thriftDeSerializer = new TDeserializer(new TJSONProtocol.Factory());
TBase obj = objClass.newInstance();
thriftDeSerializer.deserialize(obj, tSerialized, "UTF-8");
return obj;
}
-
public static Iterable<? extends TBase> getTObjs(
Iterable<String> objRefStrs, final Class<? extends TBase> objClass) throws Exception {