Repository: ignite
Updated Branches:
  refs/heads/ignite-single-op-tx 6b38cd05c -> 19e1f4e16


'Single' operations optimizations for tx cache.


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

Branch: refs/heads/ignite-single-op-tx
Commit: 19e1f4e160e1054e5a95fe115f38afecb763dbf8
Parents: 6b38cd0
Author: sboikov <sboi...@gridgain.com>
Authored: Mon Nov 16 15:20:21 2015 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Mon Nov 16 16:15:10 2015 +0300

----------------------------------------------------------------------
 .../GridDistributedTxRemoteAdapter.java         | 28 ---------
 .../dht/GridDhtTransactionalCacheAdapter.java   |  1 -
 .../cache/distributed/dht/GridDhtTxLocal.java   |  5 --
 .../distributed/dht/GridDhtTxLocalAdapter.java  | 65 --------------------
 .../distributed/dht/GridDhtTxPrepareFuture.java | 43 ++++---------
 .../cache/distributed/dht/GridDhtTxRemote.java  |  6 --
 .../near/GridNearTransactionalCache.java        |  1 -
 .../cache/distributed/near/GridNearTxLocal.java |  7 ---
 .../distributed/near/GridNearTxRemote.java      | 10 +--
 .../cache/transactions/IgniteTxAdapter.java     |  3 -
 .../cache/transactions/IgniteTxHandler.java     |  2 -
 .../transactions/IgniteTxLocalAdapter.java      |  1 -
 .../cache/transactions/IgniteTxLocalState.java  |  6 +-
 .../cache/transactions/IgniteTxRemoteEx.java    | 11 ----
 .../IgniteTxRemoteSingleStateImpl.java          |  8 ---
 .../cache/transactions/IgniteTxRemoteState.java |  5 --
 .../IgniteTxRemoteStateAdapter.java             | 12 ----
 .../transactions/IgniteTxRemoteStateImpl.java   | 24 --------
 .../cache/transactions/IgniteTxState.java       | 31 +++++-----
 19 files changed, 34 insertions(+), 235 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index 3ba88c5..0d49584 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -87,10 +87,6 @@ public class GridDistributedTxRemoteAdapter extends 
IgniteTxAdapter
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** Remote thread ID. */
-    @GridToStringInclude
-    private long rmtThreadId;
-
     /** Explicit versions. */
     @GridToStringInclude
     private List<GridCacheVersion> explicitVers;
@@ -117,7 +113,6 @@ public class GridDistributedTxRemoteAdapter extends 
IgniteTxAdapter
     /**
      * @param ctx Cache registry.
      * @param nodeId Node ID.
-     * @param rmtThreadId Remote thread ID.
      * @param xidVer XID version.
      * @param commitVer Commit version.
      * @param sys System flag.
@@ -133,7 +128,6 @@ public class GridDistributedTxRemoteAdapter extends 
IgniteTxAdapter
     public GridDistributedTxRemoteAdapter(
         GridCacheSharedContext<?, ?> ctx,
         UUID nodeId,
-        long rmtThreadId,
         GridCacheVersion xidVer,
         GridCacheVersion commitVer,
         boolean sys,
@@ -161,7 +155,6 @@ public class GridDistributedTxRemoteAdapter extends 
IgniteTxAdapter
             subjId,
             taskNameHash);
 
-        this.rmtThreadId = rmtThreadId;
         this.invalidate = invalidate;
 
         commitVersion(commitVer);
@@ -330,27 +323,6 @@ public class GridDistributedTxRemoteAdapter extends 
IgniteTxAdapter
         return started;
     }
 
-    /**
-     * @return Remote node thread ID.
-     */
-    @Override public long remoteThreadId() {
-        return rmtThreadId;
-    }
-
-    /**
-     * @param e Transaction entry to set.
-     * @return {@code True} if value was set.
-     */
-    @Override public boolean setWriteValue(IgniteTxEntry e) {
-        checkInternal(e.txKey());
-
-        txState.setWriteValue(e);
-
-        addExplicit(e);
-
-        return true;
-    }
-
     /** {@inheritDoc} */
     @Override public boolean hasWriteKey(IgniteTxKey key) {
         return txState.hasWriteKey(key);

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 3069afd..fe91e5b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -228,7 +228,6 @@ public abstract class GridDhtTransactionalCacheAdapter<K, 
V> extends GridDhtCach
                                     req.futureId(),
                                     nodeId,
                                     req.nearXidVersion(),
-                                    req.threadId(),
                                     req.topologyVersion(),
                                     req.version(),
                                     /*commitVer*/null,

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
index 46304a1..2bed931 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
@@ -223,11 +223,6 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter 
implements GridCacheMa
     }
 
     /** {@inheritDoc} */
-    @Override protected IgniteUuid nearMiniId() {
-        return nearMiniId;
-    }
-
-    /** {@inheritDoc} */
     @Override public boolean dht() {
         return true;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/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 4ee9211..70ebf3f 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
@@ -86,9 +86,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
     protected volatile boolean mapped;
 
     /** */
-    private long dhtThreadId;
-
-    /** */
     protected boolean explicitLock;
 
     /** Versions of pending locks for entries of this tx. */
@@ -159,7 +156,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
         this.explicitLock = explicitLock;
 
         threadId = Thread.currentThread().getId();
-        dhtThreadId = threadId;
     }
 
     /**
@@ -216,11 +212,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
     protected abstract IgniteUuid nearFutureId();
 
     /**
-     * @return Near future mini ID.
-     */
-    protected abstract IgniteUuid nearMiniId();
-
-    /**
      * Adds reader to cached entry.
      *
      * @param msgId Message ID.
@@ -260,13 +251,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
     }
 
     /**
-     * @return DHT thread ID.
-     */
-    long dhtThreadId() {
-        return dhtThreadId;
-    }
-
-    /**
      * Map explicit locks.
      */
     protected void mapExplicitLocks() {
@@ -355,22 +339,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
     }
 
     /**
-     * @param nodeId Node ID.
-     * @return Mapping.
-     */
-    GridDistributedTxMapping dhtMapping(UUID nodeId) {
-        return dhtMap.get(nodeId);
-    }
-
-    /**
-     * @param nodeId Node ID.
-     * @return Mapping.
-     */
-    GridDistributedTxMapping nearMapping(UUID nodeId) {
-        return nearMap.get(nodeId);
-    }
-
-    /**
      * @param mappings Mappings to add.
      */
     void addDhtNodeEntryMapping(Map<ClusterNode, List<GridDhtCacheEntry>> 
mappings) {
@@ -385,19 +353,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
     }
 
     /**
-     * @param mappings Mappings to add.
-     */
-    public void addDhtMapping(Map<UUID, GridDistributedTxMapping> mappings) {
-        addMapping0(mappings, dhtMap);
-    }
-
-    /**
-     * @param mappings Mappings to add.
-     */
-    public void addNearMapping(Map<UUID, GridDistributedTxMapping> mappings) {
-        addMapping0(mappings, nearMap);
-    }
-    /**
      * @param nodeId Node ID.
      * @return {@code True} if mapping was removed.
      */
@@ -481,26 +436,6 @@ public abstract class GridDhtTxLocalAdapter extends 
IgniteTxLocalAdapter {
         }
     }
 
-    /**
-     * @param mappings Mappings to add.
-     * @param dst Map to add to.
-     */
-    private void addMapping0(
-        Map<UUID, GridDistributedTxMapping> mappings,
-        Map<UUID, GridDistributedTxMapping> dst
-    ) {
-        for (Map.Entry<UUID, GridDistributedTxMapping> entry : 
mappings.entrySet()) {
-            GridDistributedTxMapping targetMapping = dst.get(entry.getKey());
-
-            if (targetMapping == null)
-                dst.put(entry.getKey(), entry.getValue());
-            else {
-                for (IgniteTxEntry txEntry : entry.getValue().entries())
-                    targetMapping.add(txEntry);
-            }
-        }
-    }
-
     /** {@inheritDoc} */
     @Override public void addInvalidPartition(GridCacheContext ctx, int part) {
         assert false : "DHT transaction encountered invalid partition [part=" 
+ part + ", tx=" + this + ']';

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/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 b6b8c33..a67950d 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
@@ -1008,18 +1008,15 @@ public final class GridDhtTxPrepareFuture extends 
GridCompoundFuture<IgniteInter
             tx.writeVersion(cctx.versions().next(tx.topologyVersion()));
 
             {
-                Map<UUID, GridDistributedTxMapping> futDhtMap = new 
HashMap<>();
-                Map<UUID, GridDistributedTxMapping> futNearMap = new 
HashMap<>();
-
                 // Assign keys to primary nodes.
                 if (!F.isEmpty(writes)) {
                     for (IgniteTxEntry write : writes)
-                        map(tx.entry(write.txKey()), futDhtMap, futNearMap);
+                        map(tx.entry(write.txKey()));
                 }
 
                 if (!F.isEmpty(reads)) {
                     for (IgniteTxEntry read : reads)
-                        map(tx.entry(read.txKey()), futDhtMap, futNearMap);
+                        map(tx.entry(read.txKey()));
                 }
             }
 
@@ -1211,14 +1208,8 @@ public final class GridDhtTxPrepareFuture extends 
GridCompoundFuture<IgniteInter
 
     /**
      * @param entry Transaction entry.
-     * @param futDhtMap DHT mapping.
-     * @param futNearMap Near mapping.
      */
-    private void map(
-        IgniteTxEntry entry,
-        Map<UUID, GridDistributedTxMapping> futDhtMap,
-        Map<UUID, GridDistributedTxMapping> futNearMap
-    ) {
+    private void map(IgniteTxEntry entry) {
         if (entry.cached().isLocal())
             return;
 
@@ -1244,26 +1235,25 @@ public final class GridDhtTxPrepareFuture extends 
GridCompoundFuture<IgniteInter
                     log.debug("Mapping entry to DHT nodes [nodes=" + 
U.toShortString(dhtNodes) +
                         ", entry=" + entry + ']');
 
-                Collection<UUID> readers = cached.readers();
+                // Exclude local node.
+                map(entry, F.view(dhtNodes, 
F.remoteNodes(cctx.localNodeId())), dhtMap);
 
-                Collection<ClusterNode> nearNodes = null;
+                Collection<UUID> readers = cached.readers();
 
                 if (!F.isEmpty(readers)) {
-                    nearNodes = cctx.discovery().nodes(readers, 
F0.not(F.idForNodeId(tx.nearNodeId())));
+                    Collection<ClusterNode> nearNodes =
+                        cctx.discovery().nodes(readers, 
F0.not(F.idForNodeId(tx.nearNodeId())));
 
                     if (log.isDebugEnabled())
                         log.debug("Mapping entry to near nodes [nodes=" + 
U.toShortString(nearNodes) +
                             ", entry=" + entry + ']');
+
+                    // Exclude DHT nodes.
+                    map(entry, F.view(nearNodes, F0.notIn(dhtNodes)), nearMap);
                 }
                 else if (log.isDebugEnabled())
                     log.debug("Entry has no near readers: " + entry);
 
-                // Exclude local node.
-                map(entry, F.view(dhtNodes, 
F.remoteNodes(cctx.localNodeId())), dhtMap, futDhtMap);
-
-                // Exclude DHT nodes.
-                map(entry, F.view(nearNodes, F0.notIn(dhtNodes)), nearMap, 
futNearMap);
-
                 break;
             }
             catch (GridCacheEntryRemovedException ignore) {
@@ -1278,13 +1268,11 @@ public final class GridDhtTxPrepareFuture extends 
GridCompoundFuture<IgniteInter
      * @param entry Entry.
      * @param nodes Nodes.
      * @param globalMap Map.
-     * @param locMap Exclude map.
      */
     private void map(
         IgniteTxEntry entry,
         Iterable<ClusterNode> nodes,
-        Map<UUID, GridDistributedTxMapping> globalMap,
-        Map<UUID, GridDistributedTxMapping> locMap
+        Map<UUID, GridDistributedTxMapping> globalMap
     ) {
         if (nodes != null) {
             for (ClusterNode n : nodes) {
@@ -1307,13 +1295,6 @@ public final class GridDhtTxPrepareFuture extends 
GridCompoundFuture<IgniteInter
                     globalMap.put(n.id(), global = new 
GridDistributedTxMapping(n));
 
                 global.add(entry);
-
-                GridDistributedTxMapping loc = locMap.get(n.id());
-
-                if (loc == null)
-                    locMap.put(n.id(), loc = new GridDistributedTxMapping(n));
-
-                loc.add(entry);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
index 15d1e0e..0cbe10f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxRemote.java
@@ -79,7 +79,6 @@ public class GridDhtTxRemote extends 
GridDistributedTxRemoteAdapter {
      * @param nearNodeId Near node ID.
      * @param rmtFutId Remote future ID.
      * @param nodeId Node ID.
-     * @param rmtThreadId Remote thread ID.
      * @param topVer Topology version.
      * @param xidVer XID version.
      * @param commitVer Commit version.
@@ -98,7 +97,6 @@ public class GridDhtTxRemote extends 
GridDistributedTxRemoteAdapter {
         UUID nearNodeId,
         IgniteUuid rmtFutId,
         UUID nodeId,
-        long rmtThreadId,
         AffinityTopologyVersion topVer,
         GridCacheVersion xidVer,
         GridCacheVersion commitVer,
@@ -118,7 +116,6 @@ public class GridDhtTxRemote extends 
GridDistributedTxRemoteAdapter {
         super(
             ctx,
             nodeId,
-            rmtThreadId,
             xidVer,
             commitVer,
             sys,
@@ -155,7 +152,6 @@ public class GridDhtTxRemote extends 
GridDistributedTxRemoteAdapter {
      * @param rmtFutId Remote future ID.
      * @param nodeId Node ID.
      * @param nearXidVer Near transaction ID.
-     * @param rmtThreadId Remote thread ID.
      * @param topVer Topology version.
      * @param xidVer XID version.
      * @param commitVer Commit version.
@@ -173,7 +169,6 @@ public class GridDhtTxRemote extends 
GridDistributedTxRemoteAdapter {
         IgniteUuid rmtFutId,
         UUID nodeId,
         GridCacheVersion nearXidVer,
-        long rmtThreadId,
         AffinityTopologyVersion topVer,
         GridCacheVersion xidVer,
         GridCacheVersion commitVer,
@@ -190,7 +185,6 @@ public class GridDhtTxRemote extends 
GridDistributedTxRemoteAdapter {
         super(
             ctx,
             nodeId,
-            rmtThreadId,
             xidVer,
             commitVer,
             sys,

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index 5ab85b2..e8546ef 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -315,7 +315,6 @@ public class GridNearTransactionalCache<K, V> extends 
GridNearCacheAdapter<K, V>
                                         nodeId,
                                         req.nearNodeId(),
                                         req.nearXidVersion(),
-                                        req.threadId(),
                                         req.version(),
                                         null,
                                         ctx.systemTx(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/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 22fff19..8c351cc 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
@@ -208,13 +208,6 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter 
{
     }
 
     /** {@inheritDoc} */
-    @Override protected IgniteUuid nearMiniId() {
-        assert false : "nearMiniId should not be called for colocated 
transactions.";
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
     @Override protected IgniteInternalFuture<Boolean> addReader(
         long msgId,
         GridDhtCacheEntry cached,

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
index c4b1037..d078df4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxRemote.java
@@ -76,7 +76,6 @@ public class GridNearTxRemote extends 
GridDistributedTxRemoteAdapter {
      * @param ldr Class loader.
      * @param nodeId Node ID.
      * @param nearNodeId Near node ID.
-     * @param rmtThreadId Remote thread ID.
      * @param xidVer XID version.
      * @param commitVer Commit version.
      * @param sys System flag.
@@ -94,7 +93,6 @@ public class GridNearTxRemote extends 
GridDistributedTxRemoteAdapter {
         ClassLoader ldr,
         UUID nodeId,
         UUID nearNodeId,
-        long rmtThreadId,
         GridCacheVersion xidVer,
         GridCacheVersion commitVer,
         boolean sys,
@@ -111,8 +109,7 @@ public class GridNearTxRemote extends 
GridDistributedTxRemoteAdapter {
         super(
             ctx, 
             nodeId, 
-            rmtThreadId, 
-            xidVer, 
+            xidVer,
             commitVer, 
             sys, 
             plc, 
@@ -149,7 +146,6 @@ public class GridNearTxRemote extends 
GridDistributedTxRemoteAdapter {
      * @param nodeId Node ID.
      * @param nearNodeId Near node ID.
      * @param nearXidVer Near transaction ID.
-     * @param rmtThreadId Remote thread ID.
      * @param xidVer XID version.
      * @param commitVer Commit version.
      * @param sys System flag.
@@ -165,7 +161,6 @@ public class GridNearTxRemote extends 
GridDistributedTxRemoteAdapter {
         UUID nodeId,
         UUID nearNodeId,
         GridCacheVersion nearXidVer,
-        long rmtThreadId,
         GridCacheVersion xidVer,
         GridCacheVersion commitVer,
         boolean sys,
@@ -181,8 +176,7 @@ public class GridNearTxRemote extends 
GridDistributedTxRemoteAdapter {
         super(
             ctx, 
             nodeId, 
-            rmtThreadId, 
-            xidVer, 
+            xidVer,
             commitVer,
             sys,
             plc,

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/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 109eddf..6a0f8ab 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
@@ -256,7 +256,6 @@ public abstract class IgniteTxAdapter extends 
GridMetadataAwareAdapter
      * @param cctx Cache registry.
      * @param xidVer Transaction ID.
      * @param implicit Implicit flag.
-     * @param implicitSingle Implicit with one key flag.
      * @param loc Local flag.
      * @param sys System transaction flag.
      * @param plc IO policy.
@@ -269,7 +268,6 @@ public abstract class IgniteTxAdapter extends 
GridMetadataAwareAdapter
         GridCacheSharedContext<?, ?> cctx,
         GridCacheVersion xidVer,
         boolean implicit,
-        boolean implicitSingle,
         boolean loc,
         boolean sys,
         byte plc,
@@ -414,7 +412,6 @@ public abstract class IgniteTxAdapter extends 
GridMetadataAwareAdapter
     /** {@inheritDoc} */
     @Override public boolean storeUsed() {
         return storeEnabled() && txState().storeUsed(cctx);
-
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index 173da35..0e5657b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -1095,7 +1095,6 @@ public class IgniteTxHandler {
                     req.nearNodeId(),
                     req.futureId(),
                     nodeId,
-                    req.threadId(),
                     req.topologyVersion(),
                     req.version(),
                     null,
@@ -1236,7 +1235,6 @@ public class IgniteTxHandler {
                     ldr,
                     nodeId,
                     req.nearNodeId(),
-                    req.threadId(),
                     req.version(),
                     null,
                     req.system(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/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 895bcd7..758f82c 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
@@ -196,7 +196,6 @@ public abstract class IgniteTxLocalAdapter extends 
IgniteTxAdapter
             cctx,
             xidVer,
             implicit,
-            implicitSingle,
             /*local*/true,
             sys,
             plc,

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalState.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalState.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalState.java
index 6fd86de..123d396 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalState.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalState.java
@@ -27,13 +27,13 @@ public interface IgniteTxLocalState extends IgniteTxState {
     public void addEntry(IgniteTxEntry entry);
 
     /**
-     * @param txSize
-     * @return
+     * @param txSize Transaction size.
+     * @return {@code True} if transaction was successfully  started.
      */
     public boolean init(int txSize);
 
     /**
-     * @return
+     * @return {@code True} if init method was called.
      */
     public boolean initialized();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
index a8cd16c..b80909f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteEx.java
@@ -25,11 +25,6 @@ import 
org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
  */
 public interface IgniteTxRemoteEx extends IgniteInternalTx {
     /**
-     * @return Remote thread ID.
-     */
-    public long remoteThreadId();
-
-    /**
      * @param baseVer Base version.
      * @param committedVers Committed version.
      * @param rolledbackVers Rolled back version.
@@ -39,10 +34,4 @@ public interface IgniteTxRemoteEx extends IgniteInternalTx {
         Collection<GridCacheVersion> committedVers,
         Collection<GridCacheVersion> rolledbackVers,
         Collection<GridCacheVersion> pendingVers);
-
-    /**
-     * @param e Sets write value for pessimistic transactions.
-     * @return {@code True} if entry was found.
-     */
-    public boolean setWriteValue(IgniteTxEntry e);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
index 528752f..07556a6 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteSingleStateImpl.java
@@ -31,14 +31,6 @@ public class IgniteTxRemoteSingleStateImpl extends 
IgniteTxRemoteStateAdapter {
     private IgniteTxEntry entry;
 
     /** {@inheritDoc} */
-    @Override public void setWriteValue(IgniteTxEntry e) {
-        if (entry == null)
-            entry = e;
-        else
-            copyEntry(e, entry);
-    }
-
-    /** {@inheritDoc} */
     @Override public void addWriteEntry(IgniteTxKey key, IgniteTxEntry e) {
         this.entry = e;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteState.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteState.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteState.java
index f2ba3ba..b8290a1 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteState.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteState.java
@@ -22,11 +22,6 @@ package 
org.apache.ignite.internal.processors.cache.transactions;
  */
 public interface IgniteTxRemoteState extends IgniteTxState {
     /**
-     * @param e Entry.
-     */
-    public void setWriteValue(IgniteTxEntry e);
-
-    /**
      * @param key Key.
      * @param e Entry.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
index 5b15296..e7c4c96 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateAdapter.java
@@ -107,16 +107,4 @@ public abstract class IgniteTxRemoteStateAdapter 
implements IgniteTxRemoteState
     @Override public void onTxEnd(GridCacheSharedContext cctx, 
IgniteInternalTx tx, boolean commit) {
         assert false;
     }
-
-    protected final void copyEntry(IgniteTxEntry e, IgniteTxEntry entry) {
-        entry.value(e.value(), e.hasWriteValue(), e.hasReadValue());
-        entry.entryProcessors(e.entryProcessors());
-        entry.op(e.op());
-        entry.ttl(e.ttl());
-        entry.explicitVersion(e.explicitVersion());
-
-        // Conflict resolution stuff.
-        entry.conflictVersion(e.conflictVersion());
-        entry.conflictExpireTime(e.conflictExpireTime());
-    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
index 4bbb9cf..d7795ed 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxRemoteStateImpl.java
@@ -96,30 +96,6 @@ public class IgniteTxRemoteStateImpl extends 
IgniteTxRemoteStateAdapter {
     }
 
     /** {@inheritDoc} */
-    public void setWriteValue(IgniteTxEntry e) {
-        IgniteTxEntry entry = writeMap.get(e.txKey());
-
-        if (entry == null) {
-            IgniteTxEntry rmv = readMap.remove(e.txKey());
-
-            if (rmv != null) {
-                e.cached(rmv.cached());
-
-                writeMap.put(e.txKey(), e);
-            }
-            // If lock is explicit.
-            else {
-                e.cached(e.context().cache().entryEx(e.key()));
-
-                // explicit lock.
-                writeMap.put(e.txKey(), e);
-            }
-        }
-        else
-            copyEntry(e, entry);
-    }
-
-    /** {@inheritDoc} */
     public void addWriteEntry(IgniteTxKey key, IgniteTxEntry e) {
         writeMap.put(key, e);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/19e1f4e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxState.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxState.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxState.java
index 4965c29..81707ba 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxState.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxState.java
@@ -34,40 +34,42 @@ import org.jetbrains.annotations.Nullable;
 public interface IgniteTxState {
     /**
      *
-     * @return
+     * @return Flag indicating whether transaction is implicit with only one 
key.
      */
     public boolean implicitSingle();
 
     /**
-     *
-     * @return
+     * @return First tx cache id.
      */
     @Nullable public Integer firstCacheId();
 
-    @Nullable GridCacheContext singleCacheContext(GridCacheSharedContext cctx);
+    /**
+     * @param cctx Context.
+     * @return cctx Non-null cache context if tx has only one active cache.
+     */
+    @Nullable public GridCacheContext 
singleCacheContext(GridCacheSharedContext cctx);
 
     /**
-     *
-     * @param cctx
+     * @param cctx Awaits for previous async operations on active caches to be 
completed.
      */
     public void awaitLastFut(GridCacheSharedContext cctx);
 
     /**
      * @param cctx Context.
      * @param topFut Topology future.
-     * @return
+     * @return Error if validation failed.
      */
     public IgniteCheckedException validateTopology(GridCacheSharedContext 
cctx, GridDhtTopologyFuture topFut);
 
     /**
      * @param cctx Context.
-     * @return
+     * @return {@code True} if transaction is fully synchronous.
      */
     public boolean sync(GridCacheSharedContext cctx);
 
     /**
      * @param cctx Context.
-     * @return
+     * @return {@code True} is tx has active near cache.
      */
     public boolean hasNearCache(GridCacheSharedContext cctx);
 
@@ -80,8 +82,8 @@ public interface IgniteTxState {
 
     /**
      * @param cctx Context.
-     * @param fut
-     * @return
+     * @param fut Future to finish with error if some cache is stopping.
+     * @return Topology future.
      */
     public GridDhtTopologyFuture topologyReadLock(GridCacheSharedContext cctx, 
GridFutureAdapter<?> fut);
 
@@ -92,13 +94,14 @@ public interface IgniteTxState {
 
     /**
      * @param cctx Context.
-     * @return
+     * @return {@code True} if transaction is allowed to use store and 
transactions spans one or more caches with
+     *      store enabled.
      */
     public boolean storeUsed(GridCacheSharedContext cctx);
 
     /**
      * @param cctx Context.
-     * @return
+     * @return Configured stores for active caches.
      */
     public Collection<CacheStoreManager> stores(GridCacheSharedContext cctx);
 
@@ -117,7 +120,7 @@ public interface IgniteTxState {
 
     /**
      * @param key Key.
-     * @return
+     * @return {@code True} if tx has write key.
      */
     public boolean hasWriteKey(IgniteTxKey key);
 

Reply via email to