ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [10/38] ignite git commit: ignite-4768
Date Tue, 14 Mar 2017 08:00:29 GMT
ignite-4768


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

Branch: refs/heads/ignite-4768
Commit: e9d8820caf63f697593cba7f166c3d5b79ca12ce
Parents: 1d1c58c
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Mar 9 11:19:16 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Mar 9 11:19:16 2017 +0300

----------------------------------------------------------------------
 .../distributed/GridDistributedTxMapping.java   | 18 ++++++------
 .../distributed/dht/GridDhtTxFinishFuture.java  | 14 ++++-----
 .../distributed/dht/GridDhtTxPrepareFuture.java | 20 ++++++-------
 ...arOptimisticSerializableTxPrepareFuture.java | 30 +++++++++++---------
 .../near/GridNearOptimisticTxPrepareFuture.java | 14 ++++-----
 .../GridNearPessimisticTxPrepareFuture.java     | 19 +++++++------
 .../near/GridNearTxFinishFuture.java            | 20 ++++++-------
 .../cache/distributed/near/GridNearTxLocal.java |  8 +++---
 .../near/GridNearTxPrepareFutureAdapter.java    |  4 +--
 .../distributed/near/IgniteTxMappingsImpl.java  |  4 +--
 .../near/IgniteTxMappingsSingleImpl.java        |  6 ++--
 11 files changed, 81 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
index 8c9f181..2f04f58 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxMapping.java
@@ -45,7 +45,7 @@ public class GridDistributedTxMapping implements Externalizable {
 
     /** Mapped node. */
     @GridToStringExclude
-    private ClusterNode node;
+    private ClusterNode primary;
 
     /** Entries. */
     @GridToStringInclude
@@ -74,10 +74,10 @@ public class GridDistributedTxMapping implements Externalizable {
     }
 
     /**
-     * @param node Mapped node.
+     * @param primary Primary node.
      */
-    public GridDistributedTxMapping(ClusterNode node) {
-        this.node = node;
+    public GridDistributedTxMapping(ClusterNode primary) {
+        this.primary = primary;
 
         entries = new LinkedHashSet<>();
     }
@@ -127,8 +127,8 @@ public class GridDistributedTxMapping implements Externalizable {
     /**
      * @return Node.
      */
-    public ClusterNode node() {
-        return node;
+    public ClusterNode primary() {
+        return primary;
     }
 
     /**
@@ -236,20 +236,20 @@ public class GridDistributedTxMapping implements Externalizable {
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(node);
+        out.writeObject(primary);
 
         U.writeCollection(out, entries);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
-        node = (ClusterNode)in.readObject();
+        primary = (ClusterNode)in.readObject();
 
         entries = U.readCollection(in);
     }
 
     /** {@inheritDoc} */
     @Override public String toString() {
-        return S.toString(GridDistributedTxMapping.class, this, "node", node.id());
+        return S.toString(GridDistributedTxMapping.class, this, "node", primary.id());
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
index 60e07b3..5d4e610 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishFuture.java
@@ -393,7 +393,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
 
         // Create mini futures.
         for (GridDistributedTxMapping dhtMapping : dhtMap.values()) {
-            ClusterNode n = dhtMapping.node();
+            ClusterNode n = dhtMapping.primary();
 
             assert !n.isLocal();
 
@@ -474,7 +474,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
         }
 
         for (GridDistributedTxMapping nearMapping : nearMap.values()) {
-            if (!dhtMap.containsKey(nearMapping.node().id())) {
+            if (!dhtMap.containsKey(nearMapping.primary().id())) {
                 if (nearMapping.empty())
                     // Nothing to send.
                     continue;
@@ -513,12 +513,12 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
                 req.writeVersion(tx.writeVersion());
 
                 try {
-                    cctx.io().send(nearMapping.node(), req, tx.ioPolicy());
+                    cctx.io().send(nearMapping.primary(), req, tx.ioPolicy());
 
                     if (msgLog.isDebugEnabled()) {
                         msgLog.debug("DHT finish fut, sent request near [txId=" + tx.nearXidVersion()
+
                             ", dhtTxId=" + tx.xidVersion() +
-                            ", node=" + nearMapping.node().id() + ']');
+                            ", node=" + nearMapping.primary().id() + ']');
                     }
 
                     if (sync)
@@ -534,7 +534,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
                         if (msgLog.isDebugEnabled()) {
                             msgLog.debug("DHT finish fut, failed to send request near [txId="
+ tx.nearXidVersion() +
                                 ", dhtTxId=" + tx.xidVersion() +
-                                ", node=" + nearMapping.node().id() +
+                                ", node=" + nearMapping.primary().id() +
                                 ", err=" + e + ']');
                         }
 
@@ -599,7 +599,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
          * @param nearMapping nearMapping.
          */
         MiniFuture(GridDistributedTxMapping dhtMapping, GridDistributedTxMapping nearMapping)
{
-            assert dhtMapping == null || nearMapping == null || dhtMapping.node().equals(nearMapping.node());
+            assert dhtMapping == null || nearMapping == null || dhtMapping.primary().equals(nearMapping.primary());
 
             this.dhtMapping = dhtMapping;
             this.nearMapping = nearMapping;
@@ -616,7 +616,7 @@ public final class GridDhtTxFinishFuture<K, V> extends GridCompoundIdentityFutur
          * @return Node ID.
          */
         public ClusterNode node() {
-            return node != null ? node : dhtMapping != null ? dhtMapping.node() : nearMapping.node();
+            return node != null ? node : dhtMapping != null ? dhtMapping.primary() : nearMapping.primary();
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/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 dd882f9..053c3b2 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
@@ -1241,7 +1241,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                 for (GridDistributedTxMapping dhtMapping : tx.dhtMap().values()) {
                     assert !dhtMapping.empty();
 
-                    ClusterNode n = dhtMapping.node();
+                    ClusterNode n = dhtMapping.primary();
 
                     assert !n.isLocal();
 
@@ -1368,11 +1368,11 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                 }
 
                 for (GridDistributedTxMapping nearMapping : tx.nearMap().values()) {
-                    if (!tx.dhtMap().containsKey(nearMapping.node().id())) {
+                    if (!tx.dhtMap().containsKey(nearMapping.primary().id())) {
                         if (tx.remainingTime() == -1)
                             return;
 
-                        MiniFuture fut = new MiniFuture(nearMapping.node().id(), null, nearMapping);
+                        MiniFuture fut = new MiniFuture(nearMapping.primary().id(), null,
nearMapping);
 
                         add(fut); // Append new future.
 
@@ -1419,12 +1419,12 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                         assert req.transactionNodes() != null;
 
                         try {
-                            cctx.io().send(nearMapping.node(), req, tx.ioPolicy());
+                            cctx.io().send(nearMapping.primary(), req, tx.ioPolicy());
 
                             if (msgLog.isDebugEnabled()) {
                                 msgLog.debug("DHT prepare fut, sent request near [txId="
+ tx.nearXidVersion() +
                                     ", dhtTxId=" + tx.xidVersion() +
-                                    ", node=" + nearMapping.node().id() + ']');
+                                    ", node=" + nearMapping.primary().id() + ']');
                             }
                         }
                         catch (ClusterTopologyCheckedException ignored) {
@@ -1435,7 +1435,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                                 if (msgLog.isDebugEnabled()) {
                                     msgLog.debug("DHT prepare fut, failed to send request
near [txId=" + tx.nearXidVersion() +
                                         ", dhtTxId=" + tx.xidVersion() +
-                                        ", node=" + nearMapping.node().id() + ']');
+                                        ", node=" + nearMapping.primary().id() + ']');
                                 }
 
                                 fut.onResult(e);
@@ -1444,7 +1444,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                                 if (msgLog.isDebugEnabled()) {
                                     msgLog.debug("DHT prepare fut, failed to send request
near, ignore [txId=" + tx.nearXidVersion() +
                                         ", dhtTxId=" + tx.xidVersion() +
-                                        ", node=" + nearMapping.node().id() +
+                                        ", node=" + nearMapping.primary().id() +
                                         ", err=" + e + ']');
                                 }
                             }
@@ -1627,7 +1627,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
             GridDistributedTxMapping dhtMapping,
             GridDistributedTxMapping nearMapping
         ) {
-            assert dhtMapping == null || nearMapping == null || dhtMapping.node().equals(nearMapping.node());
+            assert dhtMapping == null || nearMapping == null || dhtMapping.primary().equals(nearMapping.primary());
 
             this.nodeId = nodeId;
             this.dhtMapping = dhtMapping;
@@ -1645,7 +1645,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
          * @return Node ID.
          */
         public ClusterNode node() {
-            return dhtMapping != null ? dhtMapping.node() : nearMapping.node();
+            return dhtMapping != null ? dhtMapping.primary() : nearMapping.primary();
         }
 
         /**
@@ -1691,7 +1691,7 @@ public final class GridDhtTxPrepareFuture extends GridCompoundFuture<IgniteInter
                                 try {
                                     GridDhtCacheEntry cached = (GridDhtCacheEntry)entry.cached();
 
-                                    cached.removeReader(nearMapping.node().id(), res.messageId());
+                                    cached.removeReader(nearMapping.primary().id(), res.messageId());
 
                                     break;
                                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
index 7b130d2..3176fa7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticSerializableTxPrepareFuture.java
@@ -148,7 +148,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
             if (isMini(fut)) {
                 MiniFuture f = (MiniFuture) fut;
 
-                if (f.node().id().equals(nodeId)) {
+                if (f.primary().id().equals(nodeId)) {
                     ClusterTopologyCheckedException e = new ClusterTopologyCheckedException("Remote
node left grid: " +
                         nodeId);
 
@@ -181,7 +181,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
 
         if (e instanceof IgniteTxOptimisticCheckedException || e instanceof IgniteTxTimeoutCheckedException)
{
             if (m != null)
-                tx.removeMapping(m.node().id());
+                tx.removeMapping(m.primary().id());
         }
 
         ERR_UPD.compareAndSet(this, null, e);
@@ -393,7 +393,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
 
                     fut = (MiniFuture)fut0;
 
-                    tx.removeMapping(fut.mapping().node().id());
+                    tx.removeMapping(fut.mapping().primary().id());
 
                     fut.onResult(new IgniteCheckedException("Failed to prepare transaction.",
err));
                 }
@@ -421,7 +421,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
     @Nullable private IgniteCheckedException prepare(final MiniFuture fut) {
         GridDistributedTxMapping m = fut.mapping();
 
-        final ClusterNode n = m.node();
+        final ClusterNode primary = m.primary();
 
         long timeout = tx.remainingTime();
 
@@ -475,8 +475,10 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
         req.miniId(fut.futureId());
 
         // If this is the primary node for the keys.
-        if (n.isLocal()) {
-            IgniteInternalFuture<GridNearTxPrepareResponse> prepFut = cctx.tm().txHandler().prepareTx(n.id(),
tx, req);
+        if (primary.isLocal()) {
+            IgniteInternalFuture<GridNearTxPrepareResponse> prepFut = cctx.tm().txHandler().prepareTx(primary.id(),
+                tx,
+                req);
 
             prepFut.listen(new CI1<IgniteInternalFuture<GridNearTxPrepareResponse>>()
{
                 @Override public void apply(IgniteInternalFuture<GridNearTxPrepareResponse>
prepFut) {
@@ -491,7 +493,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
         }
         else {
             try {
-                cctx.io().send(n, req, tx.ioPolicy());
+                cctx.io().send(primary, req, tx.ioPolicy());
             }
             catch (ClusterTopologyCheckedException e) {
                 e.retryReadyFuture(cctx.nextAffinityReadyFuture(tx.topologyVersion()));
@@ -617,8 +619,8 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
         Collection<String> futs = F.viewReadOnly(futures(),
             new C1<IgniteInternalFuture<?>, String>() {
                 @Override public String apply(IgniteInternalFuture<?> f) {
-                    return "[node=" + ((MiniFuture)f).node().id() +
-                        ", loc=" + ((MiniFuture)f).node().isLocal() +
+                    return "[node=" + ((MiniFuture)f).primary().id() +
+                        ", loc=" + ((MiniFuture)f).primary().isLocal() +
                         ", done=" + f.isDone() + "]";
                 }
             },
@@ -645,7 +647,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
         /**
          * Constructor.
          */
-        public ClientRemapFuture() {
+        ClientRemapFuture() {
             super(new ClientRemapFutureReducer());
         }
     }
@@ -720,10 +722,10 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
         }
 
         /**
-         * @return Node ID.
+         * @return Primary node.
          */
-        public ClusterNode node() {
-            return m.node();
+        public ClusterNode primary() {
+            return m.primary();
         }
 
         /**
@@ -788,7 +790,7 @@ public class GridNearOptimisticSerializableTxPrepareFuture extends GridNearOptim
                         assert parent.cctx.kernalContext().clientNode();
                         assert m.clientFirst();
 
-                        parent.tx.removeMapping(m.node().id());
+                        parent.tx.removeMapping(m.primary().id());
 
                         ClientRemapFuture remapFut0 = null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index 3428bd1..9ef6f22 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -355,7 +355,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
 
         GridDistributedTxMapping mapping = map(write, topVer, null, topLocked, remap);
 
-        if (mapping.node().isLocal()) {
+        if (mapping.primary().isLocal()) {
             if (write.context().isNear())
                 tx.nearLocallyMapped(true);
             else if (write.context().isColocated())
@@ -417,12 +417,12 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
 
                 updated.last(true);
 
-                GridDistributedTxMapping prev = map.put(updated.node().id(), updated);
+                GridDistributedTxMapping prev = map.put(updated.primary().id(), updated);
 
                 if (prev != null)
                     prev.last(false);
 
-                if (updated.node().isLocal()) {
+                if (updated.primary().isLocal()) {
                     if (write.context().isNear())
                         tx.nearLocallyMapped(true);
                     else if (write.context().isColocated())
@@ -483,7 +483,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
         try {
             assert !m.empty();
 
-            final ClusterNode n = m.node();
+            final ClusterNode n = m.primary();
 
             long timeout = tx.remainingTime();
 
@@ -643,7 +643,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
             }
         }
 
-        if (cur == null || !cur.node().id().equals(primary.id()) || cur.near() != cacheCtx.isNear())
{
+        if (cur == null || !cur.primary().id().equals(primary.id()) || cur.near() != cacheCtx.isNear())
{
             boolean clientFirst = cur == null && !topLocked && cctx.kernalContext().clientNode();
 
             cur = new GridDistributedTxMapping(primary);
@@ -815,7 +815,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
          * @return Node ID.
          */
         public ClusterNode node() {
-            return m.node();
+            return m.primary();
         }
 
         /**
@@ -848,7 +848,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
         void onNodeLeft(ClusterTopologyCheckedException e, boolean discoThread) {
             if (msgLog.isDebugEnabled()) {
                 msgLog.debug("Near optimistic prepare fut, mini future node left [txId="
+ parent.tx.nearXidVersion() +
-                    ", node=" + m.node().id() + ']');
+                    ", node=" + m.primary().id() + ']');
             }
 
             if (isDone())

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
index 05f3931..caac48c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearPessimisticTxPrepareFuture.java
@@ -237,6 +237,9 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
 
         checkOnePhase();
 
+        if (mappingKnown && tx.onePhaseCommit())
+            mappingKnown = false;
+
         long timeout = tx.remainingTime();
 
         if (timeout == -1) {
@@ -248,7 +251,7 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
         int miniId = 0;
 
         for (final GridDistributedTxMapping m : mappings.values()) {
-            final ClusterNode node = m.node();
+            final ClusterNode primary = m.primary();
 
             GridNearTxPrepareRequest req = new GridNearTxPrepareRequest(
                 futId,
@@ -281,8 +284,8 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
 
             add(fut);
 
-            if (node.isLocal()) {
-                IgniteInternalFuture<GridNearTxPrepareResponse> prepFut = cctx.tm().txHandler().prepareTx(node.id(),
+            if (primary.isLocal()) {
+                IgniteInternalFuture<GridNearTxPrepareResponse> prepFut = cctx.tm().txHandler().prepareTx(primary.id(),
                     tx,
                     req);
 
@@ -299,11 +302,11 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
             }
             else {
                 try {
-                    cctx.io().send(node, req, tx.ioPolicy());
+                    cctx.io().send(primary, req, tx.ioPolicy());
 
                     if (msgLog.isDebugEnabled()) {
                         msgLog.debug("Near pessimistic prepare, sent request [txId=" + tx.nearXidVersion()
+
-                            ", node=" + node.id() + ']');
+                            ", node=" + primary.id() + ']');
                     }
                 }
                 catch (ClusterTopologyCheckedException e) {
@@ -314,7 +317,7 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
                 catch (IgniteCheckedException e) {
                     if (msgLog.isDebugEnabled()) {
                         msgLog.debug("Near pessimistic prepare, failed send request [txId="
+ tx.nearXidVersion() +
-                            ", node=" + node.id() + ", err=" + e + ']');
+                            ", node=" + primary.id() + ", err=" + e + ']');
                     }
 
                     fut.onError(e);
@@ -399,7 +402,7 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
          * @return Node ID.
          */
         public ClusterNode primary() {
-            return m.node();
+            return m.primary();
         }
 
         /**
@@ -421,7 +424,7 @@ public class GridNearPessimisticTxPrepareFuture extends GridNearTxPrepareFutureA
         void onNodeLeft(ClusterTopologyCheckedException e) {
             if (msgLog.isDebugEnabled()) {
                 msgLog.debug("Near pessimistic prepare, mini future node left [txId=" + tx.nearXidVersion()
+
-                    ", nodeId=" + m.node().id() + ']');
+                    ", nodeId=" + m.primary().id() + ']');
             }
 
             if (tx.onePhaseCommit()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index b7fdba3..c13650e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
@@ -198,7 +198,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
                         FinishMiniFuture f = (FinishMiniFuture)fut;
 
                         if (f.futureId().equals(res.miniId())) {
-                            assert f.node().id().equals(nodeId);
+                            assert f.primary().id().equals(nodeId);
 
                             finishFut = f;
 
@@ -441,7 +441,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
         GridDistributedTxMapping mapping = mappings.singleMapping();
 
         if (mapping != null) {
-            UUID nodeId = mapping.node().id();
+            UUID nodeId = mapping.primary().id();
 
             Collection<UUID> backups = tx.transactionNodes().get(nodeId);
 
@@ -471,7 +471,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
         GridDistributedTxMapping mapping = mappings.singleMapping();
 
         if (mapping != null) {
-            UUID nodeId = mapping.node().id();
+            UUID nodeId = mapping.primary().id();
 
             Collection<UUID> backups = tx.transactionNodes().get(nodeId);
 
@@ -657,7 +657,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
      * @param commit Commit flag.
      */
     private void finish(GridDistributedTxMapping m, boolean commit) {
-        ClusterNode n = m.node();
+        ClusterNode n = m.primary();
 
         assert !m.empty();
 
@@ -727,7 +727,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
             }
             catch (ClusterTopologyCheckedException ignored) {
                 // Remove previous mapping.
-                mappings.remove(m.node().id());
+                mappings.remove(m.primary().id());
 
                 fut.onNodeLeft(n.id(), false);
             }
@@ -753,7 +753,7 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
                 if (f.getClass() == FinishMiniFuture.class) {
                     FinishMiniFuture fut = (FinishMiniFuture)f;
 
-                    ClusterNode node = fut.node();
+                    ClusterNode node = fut.primary();
 
                     if (node != null) {
                         return "FinishFuture[node=" + node.id() +
@@ -872,8 +872,8 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
         /**
          * @return Node ID.
          */
-        ClusterNode node() {
-            return m.node();
+        ClusterNode primary() {
+            return m.primary();
         }
 
         /**
@@ -885,10 +885,10 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
 
         /** {@inheritDoc} */
         boolean onNodeLeft(UUID nodeId, boolean discoThread) {
-            if (nodeId.equals(m.node().id())) {
+            if (nodeId.equals(m.primary().id())) {
                 if (msgLog.isDebugEnabled()) {
                     msgLog.debug("Near finish fut, mini future node left [txId=" + tx.nearXidVersion()
+
-                        ", node=" + m.node().id() + ']');
+                        ", node=" + m.primary().id() + ']');
                 }
 
                 if (tx.syncMode() == FULL_SYNC) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/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 0dede22..1954c34 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
@@ -577,12 +577,12 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
     void addEntryMapping(@Nullable Collection<GridDistributedTxMapping> maps) {
         if (!F.isEmpty(maps)) {
             for (GridDistributedTxMapping map : maps) {
-                ClusterNode n = map.node();
+                ClusterNode primary = map.primary();
 
-                GridDistributedTxMapping m = mappings.get(n.id());
+                GridDistributedTxMapping m = mappings.get(primary.id());
 
                 if (m == null) {
-                    mappings.put(m = new GridDistributedTxMapping(n));
+                    mappings.put(m = new GridDistributedTxMapping(primary));
 
                     m.near(map.near());
 
@@ -605,7 +605,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
      * @param entry Entry.
      */
     void addSingleEntryMapping(GridDistributedTxMapping map, IgniteTxEntry entry) {
-        ClusterNode n = map.node();
+        ClusterNode n = map.primary();
 
         GridDistributedTxMapping m = new GridDistributedTxMapping(n);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
index e25ffdd..0ae98fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFutureAdapter.java
@@ -184,13 +184,13 @@ public abstract class GridNearTxPrepareFutureAdapter extends
      * @param res Response.
      */
     @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
-    protected final void onPrepareResponse(GridDistributedTxMapping m, GridNearTxPrepareResponse
res) {
+    final void onPrepareResponse(GridDistributedTxMapping m, GridNearTxPrepareResponse res)
{
         if (res == null)
             return;
 
         assert res.error() == null : res;
 
-        UUID nodeId = m.node().id();
+        UUID nodeId = m.primary().id();
 
         for (Map.Entry<IgniteTxKey, CacheVersionedValue> entry : res.ownedValues().entrySet())
{
             IgniteTxEntry txEntry = tx.entry(entry.getKey());

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsImpl.java
index 7dec7af..9373bc4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsImpl.java
@@ -50,7 +50,7 @@ public class IgniteTxMappingsImpl implements IgniteTxMappings {
 
     /** {@inheritDoc} */
     @Override public void put(GridDistributedTxMapping mapping) {
-        mappings.put(mapping.node().id(), mapping);
+        mappings.put(mapping.primary().id(), mapping);
     }
 
     /** {@inheritDoc} */
@@ -61,7 +61,7 @@ public class IgniteTxMappingsImpl implements IgniteTxMappings {
     /** {@inheritDoc} */
     @Nullable @Override public GridDistributedTxMapping localMapping() {
         for (GridDistributedTxMapping m : mappings.values()) {
-            if (m.node().isLocal())
+            if (m.primary().isLocal())
                 return m;
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/e9d8820c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsSingleImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsSingleImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsSingleImpl.java
index fc15592..b37f8d1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsSingleImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteTxMappingsSingleImpl.java
@@ -44,7 +44,7 @@ public class IgniteTxMappingsSingleImpl implements IgniteTxMappings {
     @Override public GridDistributedTxMapping get(UUID nodeId) {
         GridDistributedTxMapping mapping0 = mapping;
 
-        return (mapping0 != null && mapping0.node().id().equals(nodeId)) ? mapping0
: null;
+        return (mapping0 != null && mapping0.primary().id().equals(nodeId)) ? mapping0
: null;
     }
 
     /** {@inheritDoc} */
@@ -58,7 +58,7 @@ public class IgniteTxMappingsSingleImpl implements IgniteTxMappings {
     @Override public GridDistributedTxMapping remove(UUID nodeId) {
         GridDistributedTxMapping mapping0 = mapping;
 
-        if (mapping0 != null && mapping0.node().id().equals(nodeId)) {
+        if (mapping0 != null && mapping0.primary().id().equals(nodeId)) {
             this.mapping = null;
 
             return mapping0;
@@ -71,7 +71,7 @@ public class IgniteTxMappingsSingleImpl implements IgniteTxMappings {
     @Nullable @Override public GridDistributedTxMapping localMapping() {
         GridDistributedTxMapping mapping0 = mapping;
 
-        if (mapping0 != null && mapping0.node().isLocal())
+        if (mapping0 != null && mapping0.primary().isLocal())
             return mapping0;
 
         return null;


Mime
View raw message