ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/3] incubator-ignite git commit: ignite-471: fixed marshalling/unmarshalling over OptimizedOutput/Input object streams
Date Thu, 14 May 2015 13:28:26 GMT
ignite-471: fixed marshalling/unmarshalling over OptimizedOutput/Input object streams


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1f021a73
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1f021a73
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1f021a73

Branch: refs/heads/ignite-471
Commit: 1f021a734620c3c934fabe41f905f7ae7c169ed5
Parents: a66d90f
Author: Denis Magda <dmagda@gridgain.com>
Authored: Thu May 14 13:43:44 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Thu May 14 13:43:44 2015 +0300

----------------------------------------------------------------------
 .../optimized/OptimizedObjectInputStream.java       | 15 ++++-----------
 .../optimized/OptimizedObjectOutputStream.java      | 16 ++++++----------
 2 files changed, 10 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1f021a73/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
index ec84f44..c660669 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
@@ -42,14 +42,7 @@ class OptimizedObjectInputStream extends ObjectInputStream {
     private static final Object DUMMY = new Object();
 
     /** */
-    private static final ThreadLocal<HandleTable> HANDLES_TC = new ThreadLocal<HandleTable>()
{
-        @Override protected HandleTable initialValue() {
-            return new HandleTable(10);
-        }
-    };
-
-    /** */
-    private HandleTable handles;
+    private final HandleTable handles = new HandleTable(10);
 
     /** */
     private MarshallerContext ctx;
@@ -99,8 +92,6 @@ class OptimizedObjectInputStream extends ObjectInputStream {
         this.ctx = ctx;
         this.mapper = mapper;
         this.clsLdr = clsLdr;
-
-        handles = HANDLES_TC.get();
     }
 
     /**
@@ -130,8 +121,10 @@ class OptimizedObjectInputStream extends ObjectInputStream {
     @SuppressWarnings("NonSynchronizedMethodOverridesSynchronizedMethod")
     @Override public void reset() throws IOException {
         in.reset();
-
         handles.clear();
+
+        curObj = null;
+        curFields = null;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1f021a73/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
index cc02c62..d65ca58 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java
@@ -43,19 +43,12 @@ class OptimizedObjectOutputStream extends ObjectOutputStream {
     );
 
     /** */
-    private static final ThreadLocal<GridHandleTable> HANDLES_TC = new ThreadLocal<GridHandleTable>()
{
-        @Override protected GridHandleTable initialValue() {
-            return new GridHandleTable(10, 3.00f);
-        }
-    };
+    private final GridHandleTable handles = new GridHandleTable(10, 3.00f);
 
     /** */
     private final GridDataOutput out;
 
     /** */
-    private GridHandleTable handles;
-
-    /** */
     private MarshallerContext ctx;
 
     /** */
@@ -98,8 +91,6 @@ class OptimizedObjectOutputStream extends ObjectOutputStream {
         this.ctx = ctx;
         this.mapper = mapper;
         this.requireSer = requireSer;
-
-        handles = HANDLES_TC.get();
     }
 
     /**
@@ -757,7 +748,12 @@ class OptimizedObjectOutputStream extends ObjectOutputStream {
 
     /** {@inheritDoc} */
     @Override public void reset() throws IOException {
+        out.reset();
         handles.clear();
+
+        curObj = null;
+        curFields = null;
+        curPut = null;
     }
 
     /** {@inheritDoc} */


Mime
View raw message