ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/8] ignite git commit: IGNITE-3699: passing ttl to versionedValue and set if old and new topology versions match
Date Fri, 09 Dec 2016 09:57:36 GMT
IGNITE-3699: passing ttl to versionedValue and set if old and new topology versions match


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

Branch: refs/heads/ignite-3699
Commit: b1d2d604820e6792a55eb89c2cc1beab5393198b
Parents: ff608f2
Author: Amir Akhmedov <amir.akhmedov@gmail.com>
Authored: Thu Nov 17 20:48:38 2016 -0500
Committer: Amir Akhmedov <amir.akhmedov@gmail.com>
Committed: Thu Nov 17 20:48:38 2016 -0500

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheAdapter.java      | 11 +++--------
 .../internal/processors/cache/GridCacheEntryEx.java      |  3 ++-
 .../internal/processors/cache/GridCacheMapEntry.java     |  5 ++---
 .../cache/distributed/dht/atomic/GridDhtAtomicCache.java |  2 +-
 .../cache/transactions/IgniteTxLocalAdapter.java         |  2 +-
 .../internal/processors/cache/GridCacheTestEntryEx.java  |  3 ++-
 6 files changed, 11 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b1d2d604/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index ba3ecc3..3dfaa28 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1867,7 +1867,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
         @Nullable final UUID subjId,
         final String taskName,
         final boolean deserializeBinary,
-        @Nullable IgniteCacheExpiryPolicy expiry,
+        @Nullable final IgniteCacheExpiryPolicy expiry,
         final boolean skipVals,
         final boolean keepCacheObjects,
         boolean canRemap,
@@ -2002,13 +2002,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K,
V
                                             GridCacheEntryEx entry = entryEx(key);
 
                                             try {
-                                                GridCacheVersion verSet = entry.versionedValue(cacheVal,
ver, null);
-
-                                                if(expiry != null) {
-                                                    long ttl = expiry.forCreate();
-                                                    if(ttl != CU.TTL_NOT_CHANGED)
-                                                        entry.updateTtl(verSet, ttl);
-                                                }
+                                                long ttl = expiry != null ? expiry.forCreate()
: 0;
+                                                GridCacheVersion verSet = entry.versionedValue(cacheVal,
ver, null, ttl);
 
                                                 boolean set = verSet != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b1d2d604/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index 616854f..84a277a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -722,7 +722,8 @@ public interface GridCacheEntryEx {
      */
     public GridCacheVersion versionedValue(CacheObject val,
         @Nullable GridCacheVersion curVer,
-        @Nullable GridCacheVersion newVer)
+        @Nullable GridCacheVersion newVer,
+        long ttl)
         throws IgniteCheckedException, GridCacheEntryRemovedException;
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/b1d2d604/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 f692bf4..79c76d4 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
@@ -3539,7 +3539,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
     /** {@inheritDoc} */
     @Override public synchronized GridCacheVersion versionedValue(CacheObject val,
         GridCacheVersion curVer,
-        GridCacheVersion newVer)
+        GridCacheVersion newVer,
+        long ttl)
         throws IgniteCheckedException, GridCacheEntryRemovedException {
 
         checkObsolete();
@@ -3556,8 +3557,6 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter
impleme
 
                 CacheObject old = rawGetOrUnmarshalUnlocked(false);
 
-                long ttl = ttlExtras();
-
                 long expTime = CU.toExpireTime(ttl);
 
                 // Detach value before index update.

http://git-wip-us.apache.org/repos/asf/ignite/blob/b1d2d604/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 1e45fa7..af90c98 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -2250,7 +2250,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                         try {
                             GridCacheVersion ver = entry.version();
 
-                            entry.versionedValue(ctx.toCacheObject(v), null, ver);
+                            entry.versionedValue(ctx.toCacheObject(v), null, ver, entry.ttl());
                         }
                         catch (GridCacheEntryRemovedException e) {
                             assert false : "Entry should not get obsolete while holding lock
[entry=" + entry +

http://git-wip-us.apache.org/repos/asf/ignite/blob/b1d2d604/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 9ad7fb0..c567535 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
@@ -491,7 +491,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter implements
Ig
                                 GridCacheEntryEx entry = cacheCtx.cache().entryEx(key);
 
                                 try {
-                                    GridCacheVersion setVer = entry.versionedValue(cacheVal,
ver, null);
+                                    GridCacheVersion setVer = entry.versionedValue(cacheVal,
ver, null, entry.ttl());
 
                                     boolean set = setVer != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/b1d2d604/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 400fb14..de5404a 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
@@ -688,7 +688,8 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements
Gr
     /** @inheritDoc */
     @Override public GridCacheVersion versionedValue(CacheObject val,
         GridCacheVersion curVer,
-        GridCacheVersion newVer) {
+        GridCacheVersion newVer,
+        long ttl) {
         assert false;
 
         return null;


Mime
View raw message