ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dma...@apache.org
Subject [09/17] ignite git commit: ignite-2620: Need override 'unswap' for detached entry. (cherry picked from commit f7b376b)
Date Fri, 27 May 2016 11:30:48 GMT
ignite-2620: Need override 'unswap' for detached entry.
(cherry picked from commit f7b376b)


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

Branch: refs/heads/master
Commit: c8269da30a1d55f06531857c52d254268056e84e
Parents: 54e432e
Author: sboikov <sboikov@gridgain.com>
Authored: Tue May 24 11:14:03 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue May 24 13:42:36 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheMapEntry.java    | 12 ++++++++----
 .../dht/colocated/GridDhtDetachedCacheEntry.java        |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c8269da3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 4fbe0e6..de69f53 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -475,12 +475,12 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
     }
 
     /** {@inheritDoc} */
-    @Override public CacheObject unswap() throws IgniteCheckedException, GridCacheEntryRemovedException
{
+    @Override public final CacheObject unswap() throws IgniteCheckedException, GridCacheEntryRemovedException
{
         return unswap(true);
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public CacheObject unswap(boolean needVal)
+    @Nullable @Override public final CacheObject unswap(boolean needVal)
         throws IgniteCheckedException, GridCacheEntryRemovedException {
         return unswap(needVal, true);
     }
@@ -489,14 +489,18 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
      * Unswaps an entry.
      *
      * @param needVal If {@code false} then do not to deserialize value during unswap.
+     * @param checkExpire If {@code true} checks for expiration, as result entry can be obsoleted
or marked deleted.
      * @return Value.
      * @throws IgniteCheckedException If failed.
+     * @throws GridCacheEntryRemovedException If entry was removed.
      */
-    @Nullable private CacheObject unswap(boolean needVal, boolean checkExpire)
+    @Nullable protected CacheObject unswap(boolean needVal, boolean checkExpire)
         throws IgniteCheckedException, GridCacheEntryRemovedException {
         if (!cctx.isSwapOrOffheapEnabled())
             return null;
 
+        assert !detached() : this;
+
         boolean obsolete = false;
         boolean deferred = false;
         GridCacheVersion ver0 = null;
@@ -527,7 +531,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
                     }
                 }
                 else
-                    e = detached() ? cctx.swap().read(this, true, true, true, false) : cctx.swap().readAndRemove(this);
+                    e = cctx.swap().readAndRemove(this);
 
                 if (log.isDebugEnabled())
                     log.debug("Read swap entry [swapEntry=" + e + ", cacheEntry=" + this
+ ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/c8269da3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
index c06f68b..db91134 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtDetachedCacheEntry.java
@@ -57,7 +57,7 @@ public class GridDhtDetachedCacheEntry extends GridDistributedCacheEntry
{
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public CacheObject unswap(boolean needVal) throws IgniteCheckedException
{
+    @Nullable @Override public CacheObject unswap(boolean needVal, boolean checkExpire) throws
IgniteCheckedException {
         return null;
     }
 


Mime
View raw message