ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [06/17] ignite git commit: ignite-2620: Need override 'unswap' for detached entry. (cherry picked from commit f7b376b)
Date Thu, 26 May 2016 06:30:36 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/9a48b4b0
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9a48b4b0
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9a48b4b0

Branch: refs/heads/ignite-3116
Commit: 9a48b4b0d36324dc3e075f0baaea09410119a327
Parents: 69a0afa
Author: sboikov <sboikov@gridgain.com>
Authored: Tue May 24 11:14:03 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue May 24 13:49:59 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/9a48b4b0/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 480403e..74dfe00 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/9a48b4b0/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