ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [32/41] incubator-ignite git commit: futures: api cleanup - fixing tests
Date Mon, 09 Mar 2015 20:49:58 GMT
futures: api cleanup - fixing tests


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

Branch: refs/heads/sprint-2
Commit: a14d0f36319eae0183ddc36cbf375e9c73ccf13f
Parents: 6a96fd4
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Fri Mar 6 14:04:22 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Fri Mar 6 14:04:22 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheAdapter.java       |  8 ++++----
 .../internal/processors/cache/GridCacheGateway.java       |  6 ++++++
 .../internal/processors/cache/GridCacheIoManager.java     |  2 +-
 .../ignite/internal/processors/cache/GridCacheUtils.java  |  2 +-
 .../cache/distributed/dht/GridDhtTxLocalAdapter.java      |  2 +-
 .../cache/transactions/IgniteTxLocalAdapter.java          |  4 ++--
 .../processors/cache/transactions/IgniteTxManager.java    | 10 +++++-----
 .../cache/GridCacheReferenceCleanupSelfTest.java          |  2 +-
 8 files changed, 21 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a14d0f36/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 c2f67b1..fe95935 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
@@ -4467,7 +4467,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
 
             saveFuture(holder, f);
 
-            ctx.tm().txContextReset();
+            ctx.tm().resetContext();
 
             return f;
         }
@@ -4602,10 +4602,10 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
                 throw e;
             }
             finally {
-                ctx.tm().txContextReset();
+                ctx.tm().resetContext();
 
                 if (ctx.isNear())
-                    ctx.near().dht().context().tm().txContextReset();
+                    ctx.near().dht().context().tm().resetContext();
             }
         }
         else
@@ -4714,7 +4714,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K,
V>,
             saveFuture(holder, f);
 
             if (tx.implicit())
-                ctx.tm().txContextReset();
+                ctx.tm().resetContext();
 
             return f;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a14d0f36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
index 2de235a..ce603fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
@@ -73,6 +73,9 @@ public class GridCacheGateway<K, V> {
      */
     public void leave() {
         try {
+            ctx.tm().resetContext();
+            ctx.mvcc().contextReset();
+
             // Unwind eviction notifications.
             CU.unwindEvicts(ctx);
         }
@@ -142,6 +145,9 @@ public class GridCacheGateway<K, V> {
      */
     public void leave(GridCacheProjectionImpl<K, V> prev) {
         try {
+            ctx.tm().resetContext();
+            ctx.mvcc().contextReset();
+
             // Unwind eviction notifications.
             CU.unwindEvicts(ctx);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a14d0f36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index de82f35..0a9344e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -306,7 +306,7 @@ public class GridCacheIoManager<K, V> extends GridCacheSharedManagerAdapter<K,
V
         }
         finally {
             // Reset thread local context.
-            cctx.tm().txContextReset();
+            cctx.tm().resetContext();
             cctx.mvcc().contextReset();
 
             // Unwind eviction notifications.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a14d0f36/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 45dfb3f..c99312e 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
@@ -1218,7 +1218,7 @@ public class GridCacheUtils {
         assert ctx != null;
         assert prj != null;
 
-        ctx.tm().txContextReset();
+        ctx.tm().resetContext();
 
         return prj.txStartEx(concurrency, isolation);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a14d0f36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index b98ca00..6c5d248 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -831,7 +831,7 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends IgniteTxLocalAdapter<K
             rollbackAsync().get();
         }
         finally {
-            cctx.tm().txContextReset();
+            cctx.tm().resetContext();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a14d0f36/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 1e349ad..5d39822 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
@@ -429,7 +429,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
             commitAsync().get();
         }
         finally {
-            cctx.tm().txContextReset();
+            cctx.tm().resetContext();
         }
     }
 
@@ -974,7 +974,7 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
                 }
             }
             finally {
-                cctx.tm().txContextReset();
+                cctx.tm().resetContext();
             }
         }
         else {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a14d0f36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index b1569a5..609bd3e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -393,7 +393,7 @@ public class IgniteTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V> {
         ConcurrentMap<GridCacheVersion, IgniteInternalTx<K, V>> txIdMap = transactionMap(tx);
 
         // Start clean.
-        txContextReset();
+        resetContext();
 
         if (isCompleted(tx)) {
             if (log.isDebugEnabled())
@@ -1233,7 +1233,7 @@ public class IgniteTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V> {
             }
 
             // 14. Clear context.
-            txContextReset();
+            resetContext();
 
             // 15. Update metrics.
             if (!tx.dht() && tx.local()) {
@@ -1308,7 +1308,7 @@ public class IgniteTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V> {
                 mappedVers.remove(((GridCacheMappedVersion)tx).mappedVersion());
 
             // 10. Clear context.
-            txContextReset();
+            resetContext();
 
             // 11. Update metrics.
             if (!tx.dht() && tx.local()) {
@@ -1372,7 +1372,7 @@ public class IgniteTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V> {
                 mappedVers.remove(((GridCacheMappedVersion)tx).mappedVersion());
 
             // 8. Clear context.
-            txContextReset();
+            resetContext();
 
             if (log.isDebugEnabled())
                 log.debug("Uncommitted from TM: " + tx);
@@ -1717,7 +1717,7 @@ public class IgniteTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V> {
     /**
      * Commit ended.
      */
-    public void txContextReset() {
+    public void resetContext() {
         threadCtx.set(null);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a14d0f36/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
index fce301d..6994ebd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
@@ -292,7 +292,7 @@ public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest
{
                     System.gc();
 
                     for (WeakReference<?> ref : refs)
-                        assertNull(ref.get());
+                        assertNull("" + ref.get(), ref.get());
                 }
             });
         }


Mime
View raw message