ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [7/7] incubator-ignite git commit: #ignite-797: remove groupLockEntry from IgniteTxAdapter.
Date Fri, 15 May 2015 10:38:01 GMT
#ignite-797: remove groupLockEntry from IgniteTxAdapter.


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

Branch: refs/heads/ignite-797
Commit: 0dfc66941347fbd559672df7787d4776b8ad3234
Parents: 84bc3bb
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri May 15 13:37:47 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri May 15 13:37:47 2015 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtTxPrepareFuture.java |  3 +-
 .../cache/distributed/near/GridNearTxLocal.java |  4 +--
 .../cache/transactions/IgniteTxAdapter.java     | 35 +-------------------
 3 files changed, 3 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0dfc6694/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 5948ddd..ceae886 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
@@ -414,8 +414,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
         if (log.isDebugEnabled())
             log.debug("Marking all local candidates as ready: " + this);
 
-        Iterable<IgniteTxEntry> checkEntries = tx.groupLock() ?
-            Collections.singletonList(tx.groupLockEntry()) : writes;
+        Iterable<IgniteTxEntry> checkEntries = writes;
 
         for (IgniteTxEntry txEntry : checkEntries) {
             GridCacheContext cacheCtx = txEntry.context();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0dfc6694/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index dc9b016..8c9c2b4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -555,9 +555,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
         Collection<GridCacheVersion> committedVers,
         Collection<GridCacheVersion> rolledbackVers)
     {
-        Collection<IgniteTxEntry> entries = groupLock() ?
-            Collections.singletonList(groupLockEntry()) :
-            F.concat(false, mapping.reads(), mapping.writes());
+        Collection<IgniteTxEntry> entries = F.concat(false, mapping.reads(), mapping.writes());
 
         for (IgniteTxEntry txEntry : entries) {
             while (true) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0dfc6694/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index bbbdbd3..57adea3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -387,30 +387,7 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
 
     /** {@inheritDoc} */
     @Override public Collection<IgniteTxEntry> optimisticLockEntries() {
-        if (!groupLock())
-            return writeEntries();
-        else {
-            if (!F.isEmpty(invalidParts)) {
-                assert invalidParts.size() == 1 : "Only one partition expected for group
lock transaction " +
-                    "[tx=" + this + ", invalidParts=" + invalidParts + ']';
-                assert groupLockEntry() == null : "Group lock key should be rejected " +
-                    "[tx=" + this + ", groupLockEntry=" + groupLockEntry() + ']';
-                assert F.isEmpty(writeMap()) : "All entries should be rejected for group
lock transaction " +
-                    "[tx=" + this + ", writes=" + writeMap() + ']';
-
-                return Collections.emptyList();
-            }
-
-            IgniteTxEntry grpLockEntry = groupLockEntry();
-
-            assert grpLockEntry != null || (near() && !local()):
-                "Group lock entry was not enlisted into transaction [tx=" + this +
-                ", grpLockKey=" + groupLockKey() + ']';
-
-            return grpLockEntry == null ?
-                Collections.<IgniteTxEntry>emptyList() :
-                Collections.singletonList(grpLockEntry);
-        }
+        return writeEntries();
     }
 
     /** {@inheritDoc} */
@@ -482,16 +459,6 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
         cctx.tm().uncommitTx(this);
     }
 
-    /**
-     * This method uses unchecked assignment to cast group lock key entry to transaction
generic signature.
-     *
-     * @return Group lock tx entry.
-     */
-    @SuppressWarnings("unchecked")
-    public IgniteTxEntry groupLockEntry() {
-        return this.entry(groupLockKey());
-    }
-
     /** {@inheritDoc} */
     @Override public UUID otherNodeId() {
         return null;


Mime
View raw message