ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [15/17] incubator-ignite git commit: # ignite-51
Date Fri, 27 Feb 2015 07:33:39 GMT
# ignite-51


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

Branch: refs/heads/ignite-51
Commit: 971f7b9284e002936270e28ef7bf976dcf3c8431
Parents: 7d31dde
Author: sboikov <semen.boikov@inria.fr>
Authored: Thu Feb 26 21:02:31 2015 +0300
Committer: sboikov <semen.boikov@inria.fr>
Committed: Thu Feb 26 21:02:31 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/CacheObjectImpl.java |  7 +++++--
 .../internal/processors/cache/GridCacheContext.java       | 10 +++++-----
 .../internal/processors/cache/UserCacheObjectImpl.java    |  3 ++-
 3 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/971f7b92/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
index 52c0d69..9f6d8c1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectImpl.java
@@ -83,7 +83,7 @@ public class CacheObjectImpl implements CacheObject, Externalizable {
 
     /** {@inheritDoc} */
     @Override public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException
{
-        if (!(val instanceof byte[]))
+        if (valBytes == null && !(val instanceof byte[]))
             valBytes = CU.marshal(ctx, val);
     }
 
@@ -201,6 +201,9 @@ public class CacheObjectImpl implements CacheObject, Externalizable {
 
     /** {@inheritDoc} */
     public String toString() {
-        return S.toString(CacheObjectImpl.class, this);
+        if (val instanceof byte[])
+            return getClass().getSimpleName() + " [val=<byte array>, len=" + ((byte[])val).length
+ ']';
+        else
+            return getClass().getSimpleName() + " [val=" + val + ", hasValBytes=" + (valBytes
!= null) + ']';
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/971f7b92/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 8d52f6f..3a1692e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -1804,10 +1804,7 @@ public class GridCacheContext<K, V> implements Externalizable
{
 
         if (!keepCacheObjects) {
             Object key0 = key.value(this);
-            Object val0 = skipVals ? Boolean.TRUE : val.value(this);
-
-            assert key0 != null;
-            assert val0 != null;
+            Object val0 = skipVals ? true : val.value(this);
 
             if (portableEnabled() && deserializePortable) {
                 key0 = unwrapPortableIfNeeded(key0, false);
@@ -1816,10 +1813,13 @@ public class GridCacheContext<K, V> implements Externalizable
{
                     val0 = unwrapPortableIfNeeded(val0, false);
             }
 
+            assert key0 != null : key;
+            assert val0 != null : val;
+
             map.put((K1)key0, (V1)val0);
         }
         else
-            map.put((K1)key, (V1)(skipVals ? Boolean.TRUE : val));
+            map.put((K1)key, (V1)(skipVals ? true : val));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/971f7b92/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
index e5bbe04..1631ae4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/UserCacheObjectImpl.java
@@ -41,7 +41,8 @@ public class UserCacheObjectImpl extends CacheObjectImpl {
         }
         else {
             try {
-                byte[] valBytes = ctx.marshaller().marshal(val);
+                if (valBytes == null)
+                    valBytes = ctx.marshaller().marshal(val);
 
                 return new CacheObjectImpl(null, valBytes);
             }


Mime
View raw message