IGNITE-9655-Merge - Minor refactoring

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

Branch: refs/heads/sprint-1
Commit: 25f55de1ec650f7a342693b9f4888f3785542689
Parents: 25980ba
Author: Alexey Goncharuk <agoncha...@gridgain.com>
Authored: Fri Feb 13 18:51:38 2015 -0800
Committer: Alexey Goncharuk <agoncha...@gridgain.com>
Committed: Fri Feb 13 18:51:38 2015 -0800

----------------------------------------------------------------------
 .../near/GridNearTxPrepareFuture.java           | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/25f55de1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
index 24ef9b5..1db698c 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
@@ -775,19 +775,18 @@ public final class GridNearTxPrepareFuture<K, V> extends 
GridCompoundIdentityFut
                 " key)[key=" + entry.key() + ", primaryNodeId=" + primary.id() 
+ ']');
 
         // Must re-initialize cached entry while holding topology lock.
-        if (cacheCtx.isNear()) {
+        if (cacheCtx.isNear())
             entry.cached(cacheCtx.nearTx().entryExx(entry.key(), topVer), 
entry.keyBytes());
-
-            if (waitLock && entry.explicitVersion() == null)
-                lockKeys.add(entry.txKey());
-        }
         else if (!cacheCtx.isLocal())
             entry.cached(cacheCtx.colocated().entryExx(entry.key(), topVer, 
true), entry.keyBytes());
-        else {
+        else
             entry.cached(cacheCtx.local().entryEx(entry.key(), topVer), 
entry.keyBytes());
 
-            if (waitLock && entry.explicitVersion() == null)
-                lockKeys.add(entry.txKey());
+        if (cacheCtx.isNear() || cacheCtx.isLocal()) {
+            if (waitLock && entry.explicitVersion() == null) {
+                if (!tx.groupLock() || tx.groupLockKey().equals(entry.txKey()))
+                    lockKeys.add(entry.txKey());
+            }
         }
 
         if (cur == null || !cur.node().id().equals(primary.id()) || cur.near() 
!= cacheCtx.isNear()) {
@@ -802,11 +801,6 @@ public final class GridNearTxPrepareFuture<K, V> extends 
GridCompoundIdentityFut
         entry.nodeId(primary.id());
 
         if (cacheCtx.isNear()) {
-            if (entry.explicitVersion() == null) {
-                if (!tx.groupLock() || tx.groupLockKey().equals(entry.txKey()))
-                    lockKeys.add(entry.txKey());
-            }
-
             while (true) {
                 try {
                     GridNearCacheEntry<K, V> cached = (GridNearCacheEntry<K, 
V>)entry.cached();

Reply via email to