You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/05/02 21:13:42 UTC
[1/3] git commit: STORM-113: changing static thrift ser/deser to
thread local with lazy init
Repository: incubator-storm
Updated Branches:
refs/heads/master f6b843d99 -> 22215b582
STORM-113: changing static thrift ser/deser to thread local with lazy init
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/1b13ca22
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/1b13ca22
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/1b13ca22
Branch: refs/heads/master
Commit: 1b13ca2281f4aafac92e471167ef0e7c3dccb030
Parents: 263fade
Author: supercargo <ad...@acuitysds.com>
Authored: Sun Feb 2 16:31:11 2014 -0500
Committer: supercargo <ad...@acuitysds.com>
Committed: Sun Feb 2 16:31:11 2014 -0500
----------------------------------------------------------------------
.../src/jvm/storm/trident/util/TridentUtils.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/1b13ca22/storm-core/src/jvm/storm/trident/util/TridentUtils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/storm/trident/util/TridentUtils.java b/storm-core/src/jvm/storm/trident/util/TridentUtils.java
index b3ac245..0cdec0a 100644
--- a/storm-core/src/jvm/storm/trident/util/TridentUtils.java
+++ b/storm-core/src/jvm/storm/trident/util/TridentUtils.java
@@ -108,11 +108,16 @@ public class TridentUtils {
return parents.get(0);
}
- private static TSerializer ser = new TSerializer();
- private static TDeserializer des = new TDeserializer();
+ private static ThreadLocal<TSerializer> threadSer = new ThreadLocal<TSerializer>();
+ private static ThreadLocal<TDeserializer> threadDes = new ThreadLocal<TDeserializer>();
public static byte[] thriftSerialize(TBase t) {
try {
+ TSerializer ser = threadSer.get();
+ if (ser == null) {
+ ser = new TSerializer();
+ threadSer.set(ser);
+ }
return ser.serialize(t);
} catch (TException e) {
throw new RuntimeException(e);
@@ -122,6 +127,11 @@ public class TridentUtils {
public static <T> T thriftDeserialize(Class c, byte[] b) {
try {
T ret = (T) c.newInstance();
+ TDeserializer des = threadDes.get();
+ if (des == null) {
+ des = new TDeserializer();
+ threadDes.set(des);
+ }
des.deserialize((TBase) ret, b);
return ret;
} catch (Exception e) {
[3/3] git commit: Updated CHANGELOG.md for STORM-113: making thrift
usage thread safe for local cluster
Posted by bo...@apache.org.
Updated CHANGELOG.md for STORM-113: making thrift usage thread safe for local cluster
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/22215b58
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/22215b58
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/22215b58
Branch: refs/heads/master
Commit: 22215b5827d924b35fd5b41d1781af8824c30ce9
Parents: 3a9e8fc
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Fri May 2 14:09:52 2014 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Fri May 2 14:09:52 2014 -0500
----------------------------------------------------------------------
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/22215b58/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 940d1c9..791dced 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
## 0.9.2-incubating (unreleased)
+ * STORM-113: making thrift usage thread safe for local cluster
* STORM-223: use safe parsing for reading YAML
* STORM-238: LICENSE and NOTICE files are duplicated in storm-core jar
* STORM-276: Add support for logviewer in storm.cmd.
[2/3] git commit: Merge branch 'storm-113' of
github.com:supercargo/incubator-storm
Posted by bo...@apache.org.
Merge branch 'storm-113' of github.com:supercargo/incubator-storm
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/3a9e8fc1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/3a9e8fc1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/3a9e8fc1
Branch: refs/heads/master
Commit: 3a9e8fc1ad28942b398fb3864f59989d5720fca7
Parents: f6b843d 1b13ca2
Author: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Authored: Fri May 2 14:08:57 2014 -0500
Committer: Robert (Bobby) Evans <ev...@yahoo-inc.com>
Committed: Fri May 2 14:08:57 2014 -0500
----------------------------------------------------------------------
.../src/jvm/storm/trident/util/TridentUtils.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------