ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [13/15] incubator-ignite git commit: # Refactoring: minors.
Date Wed, 18 Feb 2015 14:55:02 GMT
# Refactoring: minors.


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

Branch: refs/heads/ignite-gg-9809
Commit: 510fd17e796e4286e19cc109a920e2245d7b44ff
Parents: e630564
Author: vozerov <vozerov@gridgain.com>
Authored: Wed Feb 18 17:42:06 2015 +0300
Committer: vozerov <vozerov@gridgain.com>
Committed: Wed Feb 18 17:42:06 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/dht/GridDhtCacheAdapter.java  |  3 ++-
 .../distributed/dht/atomic/GridDhtAtomicCache.java  | 16 ++++++++--------
 .../dht/atomic/GridDhtAtomicUpdateRequest.java      |  2 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java     | 10 +++++-----
 4 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/510fd17e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index 6e828fb..50c7910 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -458,7 +458,8 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
 
                     entry = entryEx(key, false);
 
-                    entry.initialValue(val, null, ver, ttl, -1, false, topVer, replicate
? DR_LOAD : DR_NONE);
+                    entry.initialValue(val, null, ver, ttl, CU.EXPIRE_TIME_CALCULATE, false,
topVer,
+                        replicate ? DR_LOAD : DR_NONE);
                 }
                 catch (IgniteCheckedException e) {
                     throw new IgniteException("Failed to put cache value: " + entry, e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/510fd17e/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 48ba518..4b88985 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
@@ -1965,15 +1965,15 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                         ctx.config().getAtomicWriteOrderMode() == CLOCK, // Check version
in CLOCK mode on primary node.
                         null,
                         replicate ? primary ? DR_PRIMARY : DR_BACKUP : DR_NONE,
-                        -1L,
-                        -1L,
+                        CU.TTL_NOT_CHANGED,
+                        CU.EXPIRE_TIME_CALCULATE,
                         null,
                         false,
                         false,
                         req.subjectId(),
                         taskName);
 
-                    assert updRes.newTtl() == -1L || expiry != null;
+                    assert updRes.newTtl() == CU.TTL_NOT_CHANGED || expiry != null;
 
                     if (intercept) {
                         if (op == UPDATE)
@@ -2009,7 +2009,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                                 valBytes,
                                 entryProcessor,
                                 updRes.newTtl(),
-                                -1,
+                                CU.EXPIRE_TIME_CALCULATE,
                                 null);
 
                         if (!F.isEmpty(filteredReaders))
@@ -2019,7 +2019,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                                 valBytes,
                                 entryProcessor,
                                 updRes.newTtl(),
-                                -1);
+                                CU.EXPIRE_TIME_CALCULATE);
                     }
 
                     if (hasNear) {
@@ -2036,10 +2036,10 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
                                         writeVal,
                                         valBytes,
                                         updRes.newTtl(),
-                                        -1);
+                                        CU.EXPIRE_TIME_CALCULATE);
                                 }
                                 else
-                                    res.addNearTtl(idx, updRes.newTtl(), -1);
+                                    res.addNearTtl(idx, updRes.newTtl(), CU.EXPIRE_TIME_CALCULATE);
 
                                 if (writeVal != null || !entry.valueBytes().isNull()) {
                                     IgniteInternalFuture<Boolean> f = entry.addReader(node.id(),
req.messageId(), topVer);
@@ -2280,7 +2280,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
             for (int i = 0; i < size; i++) {
                 long ttl = req.conflictTtl(i);
 
-                if (ttl == -1L)
+                if (ttl == CU.TTL_NOT_CHANGED)
                     drPutVals.add(new GridCacheDrInfo<>(req.value(i), req.conflictVersion(i)));
                 else
                     drPutVals.add(new GridCacheDrExpirationInfo<>(req.value(i), req.conflictVersion(i),
ttl,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/510fd17e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index f31fdcf..36428d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -615,7 +615,7 @@ public class GridDhtAtomicUpdateRequest<K, V> extends GridCacheMessage<K,
V> imp
             return nearExpireTimes.get(idx);
         }
 
-        return -1L;
+        return CU.EXPIRE_TIME_CALCULATE;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/510fd17e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index f5ec9fa..7f11214 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -328,7 +328,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K,
V> im
                 conflictTtls = new GridLongList(keys.size());
 
                 for (int i = 0; i < keys.size() - 1; i++)
-                    conflictTtls.add(-1);
+                    conflictTtls.add(CU.TTL_NOT_CHANGED);
             }
 
             conflictTtls.add(conflictTtl);
@@ -339,7 +339,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K,
V> im
                 conflictExpireTimes = new GridLongList(keys.size());
 
                 for (int i = 0; i < keys.size() - 1; i++)
-                    conflictExpireTimes.add(-1);
+                    conflictExpireTimes.add(CU.EXPIRE_TIME_CALCULATE);
             }
 
             conflictExpireTimes.add(conflictExpireTime);
@@ -434,7 +434,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K,
V> im
     }
 
     /**
-     * @return COnflict versions.
+     * @return Conflict versions.
      */
     @Nullable public List<GridCacheVersion> conflictVersions() {
         return conflictVers;
@@ -465,7 +465,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K,
V> im
             return conflictTtls.get(idx);
         }
 
-        return -1L;
+        return CU.TTL_NOT_CHANGED;
     }
 
     /**
@@ -479,7 +479,7 @@ public class GridNearAtomicUpdateRequest<K, V> extends GridCacheMessage<K,
V> im
             return conflictExpireTimes.get(idx);
         }
 
-        return -1L;
+        return CU.EXPIRE_TIME_CALCULATE;
     }
 
     /**


Mime
View raw message