ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/6] incubator-ignite git commit: # ignite-51
Date Mon, 02 Mar 2015 13:29:51 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-51 2f43d32d1 -> 7f9a6630b


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a040311d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 167c2e9..7f39503 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -366,7 +366,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                 return new GridFinishedFuture<>(cctx.kernalContext(), e);
             }
         }
-        else
+        else {
             return cctx.kernalContext().closure().callLocalSafe(
                 new GPC<Boolean>() {
                     @Override public Boolean call() throws Exception {
@@ -381,6 +381,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     }
                 },
                 true);
+        }
     }
 
     /**
@@ -502,8 +503,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                         if (intercept || !F.isEmpty(e.entryProcessors()))
                             e.cached().unswap(true, false);
 
-                        // TODO IGNITE-51 (do not need convert to CacheObject to pass to
store?).
-                        GridTuple3<GridCacheOperation, CacheObject, byte[]> res = applyTransformClosures(e,
false);
+                        IgniteBiTuple<GridCacheOperation, CacheObject> res = applyTransformClosures(e,
false);
 
                         GridCacheContext cacheCtx = e.context();
 
@@ -716,7 +716,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     if (!F.isEmpty(txEntry.entryProcessors()) || !F.isEmpty(txEntry.filters()))
                                         txEntry.cached().unswap(true, false);
 
-                                    GridTuple3<GridCacheOperation, CacheObject, byte[]>
res = applyTransformClosures(txEntry,
+                                    IgniteBiTuple<GridCacheOperation, CacheObject>
res = applyTransformClosures(txEntry,
                                         true);
 
                                     // For near local transactions we must record DHT version
@@ -740,7 +740,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                                     GridCacheOperation op = res.get1();
                                     CacheObject val = res.get2();
-                                    byte[] valBytes = res.get3();
 
                                     // Deal with conflicts.
                                     GridCacheVersion explicitVer = txEntry.conflictVersion()
!= null ?
@@ -814,7 +813,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                             eventNodeId(),
                                             txEntry.nodeId(),
                                             val,
-                                            valBytes,
                                             false,
                                             false,
                                             txEntry.ttl(),
@@ -834,7 +832,6 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                                 eventNodeId(),
                                                 nodeId,
                                                 val,
-                                                valBytes,
                                                 false,
                                                 false,
                                                 txEntry.ttl(),
@@ -1101,7 +1098,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
     /**
      * Checks if there is a cached or swapped value for
-     * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, boolean)}
method.
+     * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, boolean,
boolean)} method.
      *
      * @param cacheCtx Cache context.
      * @param keys Key to enlist.
@@ -1112,20 +1109,22 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
      * @param keysCnt Keys count (to avoid call to {@code Collection.size()}).
      * @param deserializePortable Deserialize portable flag.
      * @param skipVals Skip values flag.
+     * @param keepCacheObjects Keep cache objects flag.
      * @throws IgniteCheckedException If failed.
      * @return Enlisted keys.
      */
     @SuppressWarnings({"RedundantTypeArguments"})
     private <K, V> Collection<KeyCacheObject> enlistRead(
         final GridCacheContext cacheCtx,
-        Collection<? extends K> keys,
+        Collection<KeyCacheObject> keys,
         @Nullable GridCacheEntryEx cached,
         @Nullable ExpiryPolicy expiryPlc,
         Map<K, V> map,
         Map<KeyCacheObject, GridCacheVersion> missed,
         int keysCnt,
         boolean deserializePortable,
-        boolean skipVals
+        boolean skipVals,
+        boolean keepCacheObjects
     ) throws IgniteCheckedException {
         assert !F.isEmpty(keys);
         assert keysCnt == keys.size();
@@ -1144,16 +1143,11 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
         // In this loop we cover only read-committed or optimistic transactions.
         // Transactions that are pessimistic and not read-committed are covered
         // outside of this loop.
-        for (K key : keys) {
-            if (key == null)
-                continue;
-
+        for (KeyCacheObject key : keys) {
             if (pessimistic() && !readCommitted() && !skipVals)
                 addActiveCache(cacheCtx);
 
-            KeyCacheObject cacheKey = cacheCtx.toCacheKeyObject(key);
-
-            IgniteTxKey txKey = cacheCtx.txKey(cacheKey);
+            IgniteTxKey txKey = cacheCtx.txKey(key);
 
             // Check write map (always check writes first).
             IgniteTxEntry txEntry = entry(txKey);
@@ -1167,14 +1161,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     if (!F.isEmpty(txEntry.entryProcessors()))
                         val = txEntry.applyEntryProcessors(val);
 
-                    if (val != null) {
-                        Object val0 = val.value(cacheCtx, true);
-
-                        if (cacheCtx.portableEnabled())
-                            val0 = cacheCtx.unwrapPortableIfNeeded(val0, !deserializePortable);
-
-                        map.put(key, (V)CU.skipValue(val0, skipVals));
-                    }
+                    if (val != null)
+                        cacheCtx.addResult(map, key, val, skipVals, keepCacheObjects, deserializePortable,
false);
                 }
                 else {
                     assert txEntry.op() == TRANSFORM || (groupLock() && !txEntry.groupLockEntry());
@@ -1205,15 +1193,16 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                 if (!F.isEmpty(txEntry.entryProcessors()))
                                     val = txEntry.applyEntryProcessors(val);
 
-                                Object val0 = val.value(cacheCtx, !skipVals);
-
-                                if (cacheCtx.portableEnabled())
-                                    val0 = cacheCtx.unwrapPortableIfNeeded(val0, !deserializePortable);
-
-                                map.put(key, (V)CU.skipValue(val0, skipVals));
+                                cacheCtx.addResult(map,
+                                    key,
+                                    val,
+                                    skipVals,
+                                    keepCacheObjects,
+                                    deserializePortable,
+                                    false);
                             }
                             else
-                                missed.put(cacheKey, txEntry.cached().version());
+                                missed.put(key, txEntry.cached().version());
 
                             break;
                         }
@@ -1233,10 +1222,10 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
             // First time access within transaction.
             else {
                 if (lockKeys == null && !skipVals)
-                    lockKeys = single ? Collections.singleton(cacheKey) : new ArrayList<KeyCacheObject>(keysCnt);
+                    lockKeys = single ? Collections.singleton(key) : new ArrayList<KeyCacheObject>(keysCnt);
 
                 if (!single && !skipVals)
-                    lockKeys.add(cacheKey);
+                    lockKeys.add(key);
 
                 while (true) {
                     GridCacheEntryEx entry;
@@ -1273,19 +1262,20 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                 accessPlc);
 
                             if (val != null) {
-                                Object val0 = val.value(cacheCtx, false);
-
-                                if (cacheCtx.portableEnabled())
-                                    val0 = cacheCtx.unwrapPortableIfNeeded(val0, !deserializePortable);
-
-                                map.put(key, (V)CU.skipValue(val0, skipVals));
+                                cacheCtx.addResult(map,
+                                    key,
+                                    val,
+                                    skipVals,
+                                    keepCacheObjects,
+                                    deserializePortable,
+                                    false);
                             }
                             else
-                                missed.put(cacheKey, ver);
+                                missed.put(key, ver);
                         }
                         else
                             // We must wait for the lock in pessimistic mode.
-                            missed.put(cacheKey, ver);
+                            missed.put(key, ver);
 
                         if (!readCommitted() && !skipVals) {
                             txEntry = addEntry(READ,
@@ -1392,22 +1382,24 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
     /**
      * Loads all missed keys for
-     * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, boolean)}
method.
+     * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, boolean,
boolean)} method.
      *
      * @param cacheCtx Cache context.
      * @param map Return map.
      * @param missedMap Missed keys.
      * @param redos Keys to retry.
      * @param deserializePortable Deserialize portable flag.
+     * @param keepCacheObjects Keep cache objects flag.
      * @return Loaded key-value pairs.
      */
     private <K, V> IgniteInternalFuture<Map<K, V>> checkMissed(
         final GridCacheContext cacheCtx,
         final Map<K, V> map,
         final Map<KeyCacheObject, GridCacheVersion> missedMap,
-        @Nullable final Collection<K> redos,
+        @Nullable final Collection<KeyCacheObject> redos,
         final boolean deserializePortable,
-        final boolean skipVals
+        final boolean skipVals,
+        final boolean keepCacheObjects
     ) {
         assert redos != null || pessimistic();
 
@@ -1443,7 +1435,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                     CacheObject cacheVal = cacheCtx.toCacheObject(val);
 
-                    Object visibleVal = val;
+                    CacheObject visibleVal = cacheVal;
 
                     IgniteTxKey txKey = cacheCtx.txKey(key);
 
@@ -1506,16 +1498,30 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                             if (readCommitted() || groupLock() || skipVals) {
                                 cacheCtx.evicts().touch(e, topologyVersion());
 
-                                if (visibleVal != null)
-                                    map.put(key.<K>value(cacheCtx, false), (V)CU.skipValue(visibleVal,
skipVals));
+                                if (visibleVal != null) {
+                                    cacheCtx.addResult(map,
+                                        key,
+                                        visibleVal,
+                                        skipVals,
+                                        keepCacheObjects,
+                                        deserializePortable,
+                                        false);
+                                }
                             }
                             else {
                                 assert txEntry != null;
 
                                 txEntry.setAndMarkValid(cacheVal);
 
-                                if (visibleVal != null)
-                                    map.put(key.<K>value(cacheCtx, false), (V)visibleVal);
+                                if (visibleVal != null) {
+                                    cacheCtx.addResult(map,
+                                        key,
+                                        visibleVal,
+                                        skipVals,
+                                        keepCacheObjects,
+                                        deserializePortable,
+                                        false);
+                                }
                             }
 
                             loaded.add(key);
@@ -1575,10 +1581,11 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     /** {@inheritDoc} */
     @Override public <K, V> IgniteInternalFuture<Map<K, V>> getAllAsync(
         final GridCacheContext cacheCtx,
-        Collection<? extends K> keys,
+        Collection<KeyCacheObject> keys,
         @Nullable GridCacheEntryEx cached,
         final boolean deserializePortable,
-        final boolean skipVals) {
+        final boolean skipVals,
+        final boolean keepCacheObjects) {
         if (F.isEmpty(keys))
             return new GridFinishedFuture<>(cctx.kernalContext(), Collections.<K,
V>emptyMap());
 
@@ -1595,7 +1602,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
             final Map<KeyCacheObject, GridCacheVersion> missed = new GridLeanMap<>(pessimistic()
? keysCnt : 0);
 
-            GridCacheProjectionImpl<K, V> prj = cacheCtx.projectionPerCall();
+            GridCacheProjectionImpl prj = cacheCtx.projectionPerCall();
 
             ExpiryPolicy expiryPlc = prj != null ? prj.expiry() : null;
 
@@ -1607,7 +1614,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                 missed,
                 keysCnt,
                 deserializePortable,
-                skipVals);
+                skipVals,
+                keepCacheObjects);
 
             if (single && missed.isEmpty())
                 return new GridFinishedFuture<>(cctx.kernalContext(), retMap);
@@ -1636,7 +1644,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                         // Load keys only after the locks have been acquired.
                         for (KeyCacheObject cacheKey : lockKeys) {
-                            K keyVal = cacheKey.<K>value(cacheCtx, false);
+                            K keyVal = (K)(keepCacheObjects ? cacheKey : cacheKey.value(cacheCtx,
false));
 
                             if (retMap.containsKey(keyVal))
                                 // We already have a return value.
@@ -1682,10 +1690,13 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                         if (!F.isEmpty(txEntry.entryProcessors()))
                                             val0 = txEntry.applyEntryProcessors(val0);
 
-                                        if (cacheCtx.portableEnabled())
-                                            val0 = cacheCtx.unwrapPortableIfNeeded(val0,
!deserializePortable);
-
-                                        retMap.put(keyVal, (V)val0);
+                                        cacheCtx.addResult(retMap,
+                                            cacheKey,
+                                            val,
+                                            skipVals,
+                                            keepCacheObjects,
+                                            deserializePortable,
+                                            false);
                                     }
 
                                     // Even though we bring the value back from lock acquisition,
@@ -1718,8 +1729,15 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                             }
                         }
 
-                        if (!missed.isEmpty() && (cacheCtx.isReplicated() || cacheCtx.isLocal()))
-                            return checkMissed(cacheCtx, retMap, missed, null, deserializePortable,
skipVals);
+                        if (!missed.isEmpty() && (cacheCtx.isReplicated() || cacheCtx.isLocal()))
{
+                            return checkMissed(cacheCtx,
+                                retMap,
+                                missed,
+                                null,
+                                deserializePortable,
+                                skipVals,
+                                keepCacheObjects);
+                        }
 
                         return new GridFinishedFuture<>(cctx.kernalContext(), Collections.<K,
V>emptyMap());
                     }
@@ -1764,12 +1782,14 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
             else {
                 assert optimistic() || readCommitted() || groupLock() || skipVals;
 
-                final Collection<K> redos = new ArrayList<>();
+                final Collection<KeyCacheObject> redos = new ArrayList<>();
 
                 if (!missed.isEmpty()) {
                     if (!readCommitted())
                         for (Iterator<KeyCacheObject> it = missed.keySet().iterator();
it.hasNext(); ) {
-                            K keyVal = it.next().value(cacheCtx, false);
+                            KeyCacheObject cacheKey = it.next();
+
+                            K keyVal = (K)(keepCacheObjects ? cacheKey : cacheKey.value(cacheCtx,
false));
 
                             if (retMap.containsKey(keyVal))
                                 it.remove();
@@ -1781,7 +1801,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     return new GridEmbeddedFuture<>(
                         cctx.kernalContext(),
                         // First future.
-                        checkMissed(cacheCtx, retMap, missed, redos, deserializePortable,
skipVals),
+                        checkMissed(cacheCtx, retMap, missed, redos, deserializePortable,
skipVals, keepCacheObjects),
                         // Closure that returns another future, based on result from first.
                         new PMC<Map<K, V>>() {
                             @Override public IgniteInternalFuture<Map<K, V>>
postMiss(Map<K, V> map) {
@@ -1793,27 +1813,37 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     log.debug("Starting to future-recursively get values
for keys: " + redos);
 
                                 // Future recursion.
-                                return getAllAsync(cacheCtx, redos, null, deserializePortable,
skipVals);
+                                return getAllAsync(cacheCtx,
+                                    redos,
+                                    null,
+                                    deserializePortable,
+                                    skipVals,
+                                    true);
                             }
                         },
                         // Finalize.
                         new FinishClosure<Map<K, V>>() {
                             @Override Map<K, V> finish(Map<K, V> loaded) {
                                 for (Map.Entry<K, V> entry : loaded.entrySet()) {
-                                    // TODO IGNITE-51.
-                                    KeyCacheObject cacheKey = cacheCtx.toCacheKeyObject(entry.getKey());
+                                    KeyCacheObject cacheKey = (KeyCacheObject)entry.getKey();
 
                                     IgniteTxEntry txEntry = entry(cacheCtx.txKey(cacheKey));
 
-                                    V val = entry.getValue();
+                                    CacheObject val = (CacheObject)entry.getValue();
 
                                     if (!readCommitted())
-                                        txEntry.readValue(cacheCtx.toCacheObject(val));
+                                        txEntry.readValue(val);
 
                                     if (!F.isEmpty(txEntry.entryProcessors()))
                                         val = txEntry.applyEntryProcessors(val);
 
-                                    retMap.put(entry.getKey(), val);
+                                    cacheCtx.addResult(retMap,
+                                        cacheKey,
+                                        val,
+                                        skipVals,
+                                        keepCacheObjects,
+                                        deserializePortable,
+                                        false);
                                 }
 
                                 return retMap;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a040311d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
index 0391e58..43737e4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
@@ -69,14 +69,17 @@ public interface IgniteTxLocalEx extends IgniteInternalTx {
      * @param cached Cached entry if this method is called from entry wrapper.
      *      Cached entry is passed if and only if there is only one key in collection of
keys.
      * @param deserializePortable Deserialize portable flag.
+     * @param skipVals Skip values flag.
+     * @param keepCacheObjects Keep cache objects
      * @return Future for this get.
      */
     public <K, V> IgniteInternalFuture<Map<K, V>> getAllAsync(
         GridCacheContext cacheCtx,
-        Collection<? extends K> keys,
+        Collection<KeyCacheObject> keys,
         @Nullable GridCacheEntryEx cached,
         boolean deserializePortable,
-        boolean skipVals);
+        boolean skipVals,
+        boolean keepCacheObjects);
 
     /**
      * @param cacheCtx Cache context.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a040311d/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
index e7c401c..f9cb4cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dataload/IgniteDataLoaderImpl.java
@@ -367,8 +367,8 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K,
V>, Delay
         // TODO IGNITE-51.
         Collection<? extends IgniteDataLoaderEntry> entries0 = F.viewReadOnly(entries,
new C1<Entry<K, V>, IgniteDataLoaderEntry>() {
             @Override public IgniteDataLoaderEntry apply(Entry<K, V> e) {
-                KeyCacheObject key = cacheObjProc.toCacheKeyObject(null, e.getKey());
-                CacheObject val = cacheObjProc.toCacheObject(null, e.getValue());
+                KeyCacheObject key = cacheObjProc.toCacheKeyObject(cacheObjCtx, e.getKey());
+                CacheObject val = cacheObjProc.toCacheObject(cacheObjCtx, e.getValue(), null);
 
                 return new IgniteDataLoaderEntry(key, val);
             }
@@ -461,8 +461,8 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K,
V>, Delay
     @Override public IgniteFuture<?> addData(K key, V val) {
         A.notNull(key, "key");
 
-        KeyCacheObject key0 = cacheObjProc.toCacheKeyObject(null, key);
-        CacheObject val0 = cacheObjProc.toCacheObject(null, val);
+        KeyCacheObject key0 = cacheObjProc.toCacheKeyObject(cacheObjCtx, key);
+        CacheObject val0 = cacheObjProc.toCacheObject(cacheObjCtx, val, null);
 
         return addDataInternal(Collections.singleton(new IgniteDataLoaderEntry(key0, val0)));
     }
@@ -1332,7 +1332,6 @@ public class IgniteDataLoaderImpl<K, V> implements IgniteDataLoader<K,
V>, Delay
                     entry.unswap(true, false);
 
                     entry.initialValue(e.getValue(),
-                        null,
                         ver,
                         CU.TTL_ETERNAL,
                         CU.EXPIRE_TIME_ETERNAL,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a040311d/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
index 880445f..5da5ee9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/GridPortableProcessor.java
@@ -158,7 +158,7 @@ public interface GridPortableProcessor extends GridProcessor {
      * @param obj Object.
      * @return Cache object.
      */
-    @Nullable public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj);
+    @Nullable public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj,
byte[] bytes);
 
     /**
      * @param obj Key value.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a040311d/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
index 8738bf4..414c292 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/portable/os/GridOsPortableProcessor.java
@@ -143,10 +143,13 @@ public class GridOsPortableProcessor extends IgniteCacheObjectProcessorAdapter
{
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable
Object obj) {
-        if (obj == null || obj instanceof CacheObject)
+    @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable
Object obj, byte[] bytes) {
+        if ((obj == null && bytes == null) || obj instanceof CacheObject)
             return (CacheObject)obj;
 
+        if (bytes != null)
+            return new CacheObjectImpl(obj, bytes);
+
         return new UserCacheObjectImpl(obj);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a040311d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 1aa7c96..b53386c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -1460,8 +1460,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
             m.put(null, 2);
 
             GridTestUtils.assertThrows(log, new Callable<Void>() {
-                @Override
-                public Void call() throws Exception {
+                @Override public Void call() throws Exception {
                     cache.putAll(m);
 
                     return null;
@@ -1480,8 +1479,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
             m.put("key4", null);
 
             GridTestUtils.assertThrows(log, new Callable<Void>() {
-                @Override
-                public Void call() throws Exception {
+                @Override public Void call() throws Exception {
                     cache.putAll(m);
 
                     return null;
@@ -1696,7 +1694,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
             IgniteFuture<Integer> fut1 = cacheAsync.future();
 
-            assert fut1.get() == null;
+            assertNull(fut1.get());
             assertEquals((Integer)1, cache.get("key"));
 
             cacheAsync.getAndPutIfAbsent("key", 2);
@@ -3934,7 +3932,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         CacheAffinity<Integer> aff = ignite(0).affinity(null);
 
         boolean near = cfg.getDistributionMode() == CacheDistributionMode.NEAR_PARTITIONED
||
-                cfg.getDistributionMode() == CacheDistributionMode.NEAR_ONLY;
+            cfg.getDistributionMode() == CacheDistributionMode.NEAR_ONLY;
 
         ClusterNode locNode = ignite(0).cluster().localNode();
 
@@ -3964,7 +3962,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
             assertEquals(i, getObj1.val);
 
-            if (loc)
+            if (loc && !offHeapValues())
                 assertSame("Same expected [key=" + i + ", primary=" + primary + ", backup="
+ backup + ']',
                     putObj1,
                     getObj1);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a040311d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index 6cdd97e..40691d8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@ -453,7 +453,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements
Gr
         UUID evtNodeId,
         UUID affNodeId,
         @Nullable CacheObject val,
-        @Nullable byte[] valBytes,
         boolean writeThrough,
         boolean retval,
         long ttl,
@@ -467,7 +466,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements
Gr
     }
 
     /** {@inheritDoc} */
-    @Override public GridTuple3<Boolean, CacheObject, EntryProcessorResult<Object>>
innerUpdateLocal(
+    @Override public GridTuple3<Boolean, Object, EntryProcessorResult<Object>>
innerUpdateLocal(
         GridCacheVersion ver,
         GridCacheOperation op,
         @Nullable Object writeObj,
@@ -492,7 +491,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements
Gr
         UUID affNodeId,
         GridCacheOperation op,
         @Nullable Object val,
-        @Nullable byte[] valBytes,
         @Nullable Object[] invokeArgs,
         boolean writeThrough,
         boolean retval,
@@ -653,7 +651,6 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements
Gr
 
     /** @inheritDoc */
     @Override public boolean initialValue(CacheObject val,
-        @Nullable byte[] valBytes,
         GridCacheVersion ver,
         long ttl,
         long expireTime,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a040311d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
index 3336798..4b5a260 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFullApiSelfTest.java
@@ -38,6 +38,7 @@ public class GridCacheReplicatedFullApiSelfTest extends GridCacheAbstractFullApi
         return PARTITIONED_ONLY;
     }
 
+    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
         IgniteConfiguration c = super.getConfiguration(gridName);
 


Mime
View raw message