ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [09/51] [abbrv] incubator-ignite git commit: # Fixed assertion problem in local-atomic cache.
Date Wed, 25 Feb 2015 00:51:47 GMT
# Fixed assertion problem in local-atomic cache.


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

Branch: refs/heads/ignite-264
Commit: add4ee47b1b74ab993dd2155847e4134395058ad
Parents: cad3dde
Author: vozerov <vozerov@gridgain.com>
Authored: Fri Feb 20 12:22:49 2015 +0300
Committer: vozerov <vozerov@gridgain.com>
Committed: Fri Feb 20 12:22:49 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheMapEntry.java    | 12 ++++++------
 .../internal/processors/cache/GridCacheUtils.java       |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/add4ee47/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 e644442..18fce53 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
@@ -1338,7 +1338,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                         expireTime = CU.expireTimeInPast();
                     }
                     else if (ttl == CU.TTL_NOT_CHANGED)
-                        ttl = 0;
+                        ttl = CU.TTL_ETERNAL;
                     else
                         expireTime = CU.toExpireTime(ttl);
                 }
@@ -1441,8 +1441,8 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
 
             boolean hadVal = hasValueUnlocked();
 
-            long ttl = 0;
-            long expireTime = 0;
+            long ttl = CU.TTL_ETERNAL;
+            long expireTime = CU.EXPIRE_TIME_ETERNAL;
 
             if (op == GridCacheOperation.UPDATE) {
                 if (expiryPlc != null) {
@@ -1450,15 +1450,13 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
 
                     if (ttl == CU.TTL_NOT_CHANGED) {
                         ttl = ttlExtras();
-
                         expireTime = expireTimeExtras();
                     }
-                    else
+                    else if (ttl != CU.TTL_ZERO)
                         expireTime = CU.toExpireTime(ttl);
                 }
                 else {
                     ttl = ttlExtras();
-
                     expireTime = expireTimeExtras();
                 }
             }
@@ -1480,6 +1478,8 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                 // in load methods without actually holding entry lock.
                 updateIndex(updated, null, expireTime, ver, old);
 
+                assert ttl != CU.TTL_ZERO;
+
                 update(updated, null, expireTime, ttl, ver);
 
                 if (evt) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/add4ee47/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index cee97bc..f2ffb07 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1614,7 +1614,7 @@ public class GridCacheUtils {
      * @return Expire time.
      */
     public static long toExpireTime(long ttl) {
-        assert ttl != CU.TTL_ZERO && ttl != CU.TTL_NOT_CHANGED && ttl >=
0;
+        assert ttl != CU.TTL_ZERO && ttl != CU.TTL_NOT_CHANGED && ttl >=
0 : "Invalid TTL: " + ttl;
 
         long expireTime = ttl == CU.TTL_ETERNAL ? CU.EXPIRE_TIME_ETERNAL : U.currentTimeMillis()
+ ttl;
 


Mime
View raw message