ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [03/10] incubator-ignite git commit: # IGNITE-223 Merge commit.
Date Wed, 18 Feb 2015 16:44:33 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/831f4efc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index 354070c,7d80955..940b346
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@@ -754,45 -751,40 +749,45 @@@ public class GridCacheSwapManager<K, V
                  if (entryBytes != null) {
                      GridCacheSwapEntry<V> entry = swapEntry(unmarshalSwapEntry(entryBytes));
  
 -                    if (entry == null)
 -                        continue;
 -
 -                    iter.remove();
 +                    if (entry != null) {
 +                        // Always fire this event, since preloading depends on it.
 +                        onOffHeaped(part, key, keyBytes, entry);
  
 -                    // Always fire this event, since preloading depends on it.
 -                    onOffHeaped(part, key, keyBytes, entry);
 +                        if (cctx.events().isRecordable(EVT_CACHE_OBJECT_FROM_OFFHEAP))
 +                            cctx.events().addEvent(part, key, cctx.nodeId(), (IgniteUuid)null,
null,
 +                                EVT_CACHE_OBJECT_FROM_OFFHEAP, null, false, null, true,
null, null, null);
  
 -                    if (cctx.events().isRecordable(EVT_CACHE_OBJECT_FROM_OFFHEAP))
 -                        cctx.events().addEvent(part, key, cctx.nodeId(), (IgniteUuid)null,
null,
 -                            EVT_CACHE_OBJECT_FROM_OFFHEAP, null, false, null, true, null,
null, null);
 +                        if (qryMgr != null)
 +                            qryMgr.onUnswap(key, entry.value(), entry.valueBytes());
  
 -                    if (qryMgr != null)
 -                        qryMgr.onUnswap(key, entry.value(), entry.valueBytes());
 +                        GridCacheBatchSwapEntry<K, V> unswapped = new GridCacheBatchSwapEntry<>(key,
 +                            keyBytes,
 +                            part,
-                             ByteBuffer.wrap(entry.valueBytes()),
++                            entry.valueIsByteArray() ? null : ByteBuffer.wrap(entry.valueBytes()),
 +                            entry.valueIsByteArray(),
 +                            entry.version(), entry.ttl(),
 +                            entry.expireTime(),
 +                            entry.keyClassLoaderId(),
 +                            entry.valueClassLoaderId());
  
 -                    GridCacheBatchSwapEntry<K, V> unswapped = new GridCacheBatchSwapEntry<>(key,
 -                        keyBytes,
 -                        part,
 -                        entry.valueIsByteArray() ? null : ByteBuffer.wrap(entry.valueBytes()),
 -                        entry.valueIsByteArray(),
 -                        entry.version(), entry.ttl(),
 -                        entry.expireTime(),
 -                        entry.keyClassLoaderId(),
 -                        entry.valueClassLoaderId());
 +                        unswapped.value(entry.value());
  
 -                    unswapped.value(entry.value());
 +                        res.add(unswapped);
  
 -                    res.add(unswapped);
 +                        continue;
 +                    }
                  }
 +
 +                unprocessedKeysList.add(key);
              }
  
 -            if (!swapEnabled || keysList.isEmpty())
 +            unprocessedKeys = unprocessedKeysList;
 +
 +            if (!swapEnabled || unprocessedKeys.isEmpty())
                  return res;
          }
 +        else
 +            unprocessedKeys = keys;
  
          // Swap is enabled.
          final GridTuple<IgniteCheckedException> err = F.t1();


Mime
View raw message