ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [15/49] incubator-ignite git commit: GG-9655 - Fixing tests after merge.
Date Sun, 15 Feb 2015 08:18:35 GMT
GG-9655 - Fixing tests after merge.


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

Branch: refs/heads/sprint-1
Commit: 4fde8d3ddbc0585b8e8ea349b15fbf2f8150dc12
Parents: 0c5e5cc
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Fri Jan 30 17:18:15 2015 -0800
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Fri Jan 30 17:18:15 2015 -0800

----------------------------------------------------------------------
 .../distributed/dht/GridDhtTxPrepareFuture.java     | 16 ++++++++++++++++
 .../cache/transactions/IgniteTxLocalAdapter.java    | 14 --------------
 .../cache/GridCacheAbstractFullApiSelfTest.java     |  3 ++-
 3 files changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4fde8d3d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
index de5428b..fd97fd0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java
@@ -35,11 +35,13 @@ import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.transactions.*;
 import org.jetbrains.annotations.*;
 
+import javax.cache.expiry.*;
 import javax.cache.processor.*;
 import java.io.*;
 import java.util.*;
 import java.util.concurrent.atomic.*;
 
+import static org.apache.ignite.internal.processors.cache.GridCacheOperation.*;
 import static org.apache.ignite.transactions.IgniteTxState.*;
 import static org.apache.ignite.events.IgniteEventType.*;
 import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
@@ -272,6 +274,20 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
             GridCacheEntryEx<K, V> cached = txEntry.cached();
 
             try {
+                if (txEntry.op() == CREATE || txEntry.op() == UPDATE && txEntry.drExpireTime()
== -1L) {
+                    ExpiryPolicy expiry = txEntry.expiry();
+
+                    if (expiry == null)
+                        expiry = cacheCtx.expiry();
+
+                    if (expiry != null) {
+                        Duration duration = cached.hasValue() ?
+                            expiry.getExpiryForUpdate() : expiry.getExpiryForCreation();
+
+                        txEntry.ttl(CU.toTtl(duration));
+                    }
+                }
+
                 boolean hasFilters = !F.isEmptyOrNulls(txEntry.filters()) && !F.isAlwaysTrue(txEntry.filters());
 
                 if (hasFilters || retVal || txEntry.op() == GridCacheOperation.DELETE) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4fde8d3d/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 86c8f53..e190023 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
@@ -750,20 +750,6 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                                     GridCacheVersion explicitVer = txEntry.drVersion() !=
null ?
                                         txEntry.drVersion() : writeVersion();
 
-                                    if (op == CREATE || op == UPDATE && txEntry.drExpireTime()
== -1L) {
-                                        ExpiryPolicy expiry = txEntry.expiry();
-
-                                        if (expiry == null)
-                                            expiry = cacheCtx.expiry();
-
-                                        if (expiry != null) {
-                                            Duration duration = cached.hasValue() ?
-                                                expiry.getExpiryForUpdate() : expiry.getExpiryForCreation();
-
-                                            txEntry.ttl(CU.toTtl(duration));
-                                        }
-                                    }
-
                                     boolean drNeedResolve = cacheCtx.conflictNeedResolve(cached.version(),
explicitVer);
 
                                     if (drNeedResolve) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4fde8d3d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 8b2c814..d71b78d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -4492,7 +4492,8 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
             CacheEntry<String, Integer> curEntry = cache(i).entry(key);
 
             if (curEntry.primary() || curEntry.backup()) {
-                assertEquals(ttl, curEntry.timeToLive());
+                assertEquals("Invalid ttl [primary=" + curEntry.primary() + ", backup=" +
curEntry.backup() + ']',
+                    ttl, curEntry.timeToLive());
 
                 assert curEntry.expirationTime() > startTime;
 


Mime
View raw message