ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [5/5] ignite git commit: ignite-5293
Date Mon, 05 Jun 2017 08:57:09 GMT
ignite-5293


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

Branch: refs/heads/ignite-5293
Commit: 282d0d6d1e0b91cc690e8d1dd7e8be753220ad17
Parents: fa2e7f7
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Jun 5 11:40:47 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Jun 5 11:56:49 2017 +0300

----------------------------------------------------------------------
 .../ignite/codegen/MessageCodeGenerator.java    | 20 +++---
 .../GridDistributedLockResponse.java            |  1 +
 .../distributed/dht/GridDhtLockFuture.java      | 49 +++++++++-----
 .../distributed/dht/GridDhtLockResponse.java    |  2 +
 .../distributed/dht/GridDhtTxFinishFuture.java  | 28 ++++----
 .../distributed/dht/GridDhtTxFinishRequest.java |  2 +-
 .../dht/GridDhtTxFinishResponse.java            |  2 +-
 .../distributed/dht/GridDhtTxPrepareFuture.java | 68 +++++++++++---------
 .../dht/GridDhtTxPrepareRequest.java            |  2 +-
 .../dht/GridDhtTxPrepareResponse.java           |  2 +-
 .../dht/colocated/GridDhtColocatedCache.java    |  2 +
 .../ignite/internal/util/StripedExecutor.java   |  2 -
 12 files changed, 104 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
index 24f5087..99ec08a 100644
--- a/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
+++ b/modules/codegen/src/main/java/org/apache/ignite/codegen/MessageCodeGenerator.java
@@ -44,12 +44,8 @@ import org.apache.ignite.internal.GridDirectCollection;
 import org.apache.ignite.internal.GridDirectMap;
 import org.apache.ignite.internal.GridDirectTransient;
 import org.apache.ignite.internal.IgniteCodeGeneratingFail;
-import org.apache.ignite.internal.processors.cache.distributed.GridDistributedLockRequest;
-import org.apache.ignite.internal.processors.cache.distributed.GridDistributedLockResponse;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLockRequest;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLockResponse;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockRequest;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridNearLockResponse;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
+import org.apache.ignite.internal.processors.cache.version.GridCacheVersionEx;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteUuid;
@@ -181,12 +177,12 @@ public class MessageCodeGenerator {
 //        gen.generateAndWrite(GridMessageCollection.class);
 //        gen.generateAndWrite(DataStreamerEntry.class);
 
-        gen.generateAndWrite(GridDistributedLockRequest.class);
-        gen.generateAndWrite(GridDistributedLockResponse.class);
-        gen.generateAndWrite(GridNearLockRequest.class);
-        gen.generateAndWrite(GridNearLockResponse.class);
-        gen.generateAndWrite(GridDhtLockRequest.class);
-        gen.generateAndWrite(GridDhtLockResponse.class);
+//        gen.generateAndWrite(GridDistributedLockRequest.class);
+//        gen.generateAndWrite(GridDistributedLockResponse.class);
+//        gen.generateAndWrite(GridNearLockRequest.class);
+//        gen.generateAndWrite(GridNearLockResponse.class);
+//        gen.generateAndWrite(GridDhtLockRequest.class);
+//        gen.generateAndWrite(GridDhtLockResponse.class);
 //
 //        gen.generateAndWrite(GridDistributedTxPrepareRequest.class);
 //        gen.generateAndWrite(GridDistributedTxPrepareResponse.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
index eb65239..a6ac426 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockResponse.java
@@ -74,6 +74,7 @@ public class GridDistributedLockResponse extends GridDistributedBaseMessage
{
      * @param cacheId Cache ID.
      * @param lockVer Lock version.
      * @param futId Future ID.
+     * @param part Partition.
      * @param cnt Key count.
      * @param addDepInfo Deployment info.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index a6cec4f..8bb0def 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -80,6 +80,9 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
     /** Logger reference. */
     private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
 
+    /** */
+    private static final List<MiniFuture> CLEARED = Collections.emptyList();
+
     /** Logger. */
     private static IgniteLogger log;
 
@@ -184,7 +187,9 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
      * @param tx Transaction.
      * @param threadId Thread ID.
      * @param accessTtl TTL for read operation.
+     * @param createTtl TTL for create operation.
      * @param skipStore Skip store flag.
+     * @param keepBinary Keep binary flag.
      */
     public GridDhtLockFuture(
         GridCacheContext<?, ?> cctx,
@@ -475,26 +480,30 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
      */
     @SuppressWarnings({"ThrowableInstanceNeverThrown"})
     @Override public boolean onNodeLeft(UUID nodeId) {
-        boolean found = false;
-
-        List<MiniFuture> miniFuts0;
+        MiniFuture miniFut0 = null;
 
         synchronized (this) {
             if (miniFuts == null)
                 return false;
 
-            miniFuts0 = new ArrayList<>(miniFuts);
-        }
+            for (int i = 0; i < miniFuts.size(); i++) {
+                MiniFuture miniFut = miniFuts.get(i);
 
-        for (MiniFuture miniFut : miniFuts0) {
-            if (miniFut.node().id().equals(nodeId)) {
-                miniFut.onResult();
+                if (miniFut.node().id().equals(nodeId)) {
+                    miniFut0 = miniFut;
 
-                found = true;
+                    break;
+                }
             }
         }
 
-        return found;
+        if (miniFut0 != null) {
+            miniFut0.onResult();
+
+            return true;
+        }
+
+        return false;
     }
 
     /**
@@ -657,9 +666,6 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
         }
 
         assert err == null || !success;
-//      TODO:
-//      assert !success || (initialized() && !hasPending()) : "Invalid done callback
[success=" + success +
-//            ", fut=" + this + ']';
 
         if (log.isDebugEnabled())
             log.debug("Received onDone(..) callback [success=" + success + ", err=" + err
+ ", fut=" + this + ']');
@@ -909,7 +915,8 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
                             if (tx != null)
                                 tx.addLockTransactionNode(n);
 
-                            add(fut); // Append new future.
+                            if (!add(fut))
+                                return;
 
                             cctx.io().send(n, req, cctx.ioPolicy());
 
@@ -959,7 +966,7 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
         boolean completed;
 
         synchronized (this) {
-            if (inited)
+            if (inited || timedOut)
                 return;
 
             inited = true;
@@ -973,14 +980,20 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
 
     /**
      * @param fut Mini future to add.
+     * @return {@code False} if future is already completed on timeout.
      */
-    private synchronized void add(MiniFuture fut) {
+    private synchronized boolean add(MiniFuture fut) {
+        if (miniFuts == CLEARED)
+            return false;
+
         if (miniFuts == null)
             miniFuts = new ArrayList<>();
 
         assert fut.futureId() == miniFuts.size();
 
         miniFuts.add(fut);
+
+        return true;
     }
 
     /**
@@ -1126,6 +1139,8 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
 
                 // Stop locks and responses processing.
                 pendingLocks.clear();
+
+                miniFuts = CLEARED;
             }
 
             boolean releaseLocks = !(inTx() && cctx.tm().deadlockDetectionEnabled());
@@ -1329,7 +1344,7 @@ public final class GridDhtLockFuture extends GridCacheFutureAdapter<Boolean>
 
         /** {@inheritDoc} */
         @Override public String toString() {
-            return S.toString(MiniFuture.class, this, "nodeId", node.id(), "super", super.toString());
+            return "MiniFuture [node=" + node.id() + ", loc=" + node.isLocal() + ", done="
+ done + ']';
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
index ee116c8..19b3f97 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockResponse.java
@@ -65,6 +65,7 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
     }
 
     /**
+     * @param cacheId Cache ID.
      * @param lockVer Lock version.
      * @param futId Future ID.
      * @param miniId Mini future ID.
@@ -87,6 +88,7 @@ public class GridDhtLockResponse extends GridDistributedLockResponse {
     }
 
     /**
+     * @param cacheId Cache ID.
      * @param lockVer Lock ID.
      * @param futId Future ID.
      * @param miniId Mini future ID.

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/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 98442bf..31cec19 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
@@ -50,8 +50,7 @@ import static org.apache.ignite.transactions.TransactionState.COMMITTING;
 /**
  *
  */
-public final class GridDhtTxFinishFuture<K, V>
-    extends GridCacheFutureAdapter<IgniteInternalTx>
+public final class GridDhtTxFinishFuture<K, V> extends GridCacheFutureAdapter<IgniteInternalTx>
     implements GridCacheFuture<IgniteInternalTx> {
     /** Logger reference. */
     private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
@@ -146,23 +145,29 @@ public final class GridDhtTxFinishFuture<K, V>
 
     /** {@inheritDoc} */
     @Override public boolean onNodeLeft(UUID nodeId) {
-        List<MiniFuture> miniFuts0;
+        MiniFuture miniFut0 = null;
 
         synchronized (this) {
             if (miniFuts == null)
                 return false;
 
-            miniFuts0 = new ArrayList<>(miniFuts);
-        }
+            for (int i = 0; i < miniFuts.size(); i++) {
+                MiniFuture miniFut = miniFuts.get(i);
 
-        for (MiniFuture miniFut : miniFuts0) {
-            if (miniFut.node().id().equals(nodeId)) {
-                miniFut.onNodeLeft();
+                if (miniFut.node().id().equals(nodeId)) {
+                    miniFut0 = miniFut;
 
-                return true;
+                    break;
+                }
             }
         }
 
+        if (miniFut0 != null) {
+            miniFut0.onNodeLeft();
+
+            return true;
+        }
+
         return false;
     }
 
@@ -198,7 +203,6 @@ public final class GridDhtTxFinishFuture<K, V>
      * @param miniId Mini ID to find.
      * @return Mini future.
      */
-    @SuppressWarnings("ForLoopReplaceableByForEach")
     private MiniFuture miniFuture(int miniId) {
         synchronized (this) {
             if (miniFuts != null && !miniFuts.get(miniId).isDone())
@@ -529,7 +533,7 @@ public final class GridDhtTxFinishFuture<K, V>
                     // Nothing to send.
                     continue;
 
-                MiniFuture fut = new MiniFuture(++miniId, null, nearMapping);
+                MiniFuture fut = new MiniFuture(miniId++, null, nearMapping);
 
                 add(fut); // Append new future.
 
@@ -726,7 +730,7 @@ public final class GridDhtTxFinishFuture<K, V>
 
         /** {@inheritDoc} */
         @Override public String toString() {
-            return S.toString(MiniFuture.class, this, "done", isDone(), "cancelled", isCancelled(),
"err", error());
+            return "MiniFuture [node=" + node.id() + ", loc=" + node.isLocal() + ", done="
+ done + ']';
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
index 90f3687..f74533d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishRequest.java
@@ -142,7 +142,7 @@ public class GridDhtTxFinishRequest extends GridDistributedTxFinishRequest
{
             txSize,
             addDepInfo);
 
-        assert miniId != 0;
+        assert miniId >= 0;
         assert nearNodeId != null;
         assert isolation != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
index d777a22..67be2dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxFinishResponse.java
@@ -71,7 +71,7 @@ public class GridDhtTxFinishResponse extends GridDistributedTxFinishResponse
{
     public GridDhtTxFinishResponse(int part, GridCacheVersion xid, IgniteUuid futId, int
miniId) {
         super(part, xid, futId);
 
-        assert miniId != 0;
+        assert miniId >= 0;
 
         this.miniId = miniId;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/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 d764ea5..474219d 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
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.distributed.dht;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -96,12 +97,14 @@ import static org.apache.ignite.transactions.TransactionState.PREPARED;
  *
  */
 @SuppressWarnings("unchecked")
-public final class GridDhtTxPrepareFuture
-    extends GridCacheFutureAdapter<GridNearTxPrepareResponse>
+public final class GridDhtTxPrepareFuture extends GridCacheFutureAdapter<GridNearTxPrepareResponse>
     implements GridCacheMvccFuture<GridNearTxPrepareResponse> {
     /** Logger reference. */
     private static final AtomicReference<IgniteLogger> logRef = new AtomicReference<>();
 
+    /** */
+    private static final List<MiniFuture> CLEARED = Collections.emptyList();
+
     /** Error updater. */
     private static final AtomicReferenceFieldUpdater<GridDhtTxPrepareFuture, Throwable>
ERR_UPD =
         AtomicReferenceFieldUpdater.newUpdater(GridDhtTxPrepareFuture.class, Throwable.class,
"err");
@@ -149,10 +152,10 @@ public final class GridDhtTxPrepareFuture
     private volatile int mapped;
 
     /** Prepare reads. */
-    private Iterable<IgniteTxEntry> reads;
+    private Collection<IgniteTxEntry> reads;
 
     /** Prepare writes. */
-    private Iterable<IgniteTxEntry> writes;
+    private Collection<IgniteTxEntry> writes;
 
     /** Tx nodes. */
     private Map<UUID, Collection<UUID>> txNodes;
@@ -253,7 +256,7 @@ public final class GridDhtTxPrepareFuture
         boolean completed;
 
         synchronized (this) {
-            if (inited)
+            if (inited || miniFuts == CLEARED)
                 return;
 
             inited = true;
@@ -267,14 +270,20 @@ public final class GridDhtTxPrepareFuture
 
     /**
      * @param fut Mini future to add.
+     * @return {@code False} if future is already completed on timeout.
      */
-    private synchronized void add(MiniFuture fut) {
+    private synchronized boolean add(MiniFuture fut) {
+        if (miniFuts == CLEARED)
+            return false;
+
         if (miniFuts == null)
             miniFuts = new ArrayList<>();
 
         assert fut.futureId() == miniFuts.size();
 
         miniFuts.add(fut);
+
+        return true;
     }
 
     /** {@inheritDoc} */
@@ -339,23 +348,29 @@ public final class GridDhtTxPrepareFuture
 
     /** {@inheritDoc} */
     @Override public boolean onNodeLeft(UUID nodeId) {
-        List<MiniFuture> miniFuts0;
+        MiniFuture miniFut0 = null;
 
         synchronized (this) {
             if (miniFuts == null)
                 return false;
 
-            miniFuts0 = new ArrayList<>(miniFuts);
-        }
+            for (int i = 0; i < miniFuts.size(); i++) {
+                MiniFuture miniFut = miniFuts.get(i);
 
-        for (MiniFuture miniFut : miniFuts0) {
-            if (miniFut.node().id().equals(nodeId)) {
-                miniFut.onNodeLeft();
+                if (miniFut.node().id().equals(nodeId)) {
+                    miniFut0 = miniFut;
 
-                return true;
+                    break;
+                }
             }
         }
 
+        if (miniFut0 != null) {
+            miniFut0.onNodeLeft();
+
+            return true;
+        }
+
         return false;
     }
 
@@ -400,7 +415,7 @@ public final class GridDhtTxPrepareFuture
                 if (readOld) {
                     boolean readThrough = !txEntry.skipStore() &&
                         (txEntry.op() == TRANSFORM || ((retVal || hasFilters) &&
-                            cacheCtx.config().isLoadPreviousValue()));
+                        cacheCtx.config().isLoadPreviousValue()));
 
                     boolean evt = retVal || txEntry.op() == TRANSFORM;
 
@@ -584,7 +599,6 @@ public final class GridDhtTxPrepareFuture
      * @param miniId Mini ID to find.
      * @return Mini future.
      */
-    @SuppressWarnings("ForLoopReplaceableByForEach")
     private MiniFuture miniFuture(int miniId) {
         synchronized (this) {
             if (miniFuts != null && !miniFuts.get(miniId).isDone())
@@ -697,9 +711,6 @@ public final class GridDhtTxPrepareFuture
 
     /** {@inheritDoc} */
     @Override public boolean onDone(GridNearTxPrepareResponse res0, Throwable err) {
-// TODO        assert err != null || (initialized() && !hasPending()) : "On done
called for prepare future that has " +
-//            "pending mini futures: " + this;
-
         ERR_UPD.compareAndSet(this, null, err);
 
         // Must clear prepare future before response is sent or listeners are notified.
@@ -851,8 +862,7 @@ public final class GridDhtTxPrepareFuture
         assert F.isEmpty(tx.invalidPartitions());
 
         GridNearTxPrepareResponse res = new GridNearTxPrepareResponse(
-            tx.writeEntries() != null && !tx.writeEntries().isEmpty() ?
-                F.first(tx.writeEntries()).key().partition() : -1,
+            writes != null && !writes.isEmpty() ? F.first(writes).key().partition()
: -1,
             tx.nearXidVersion(),
             tx.colocated() ? tx.xid() : tx.nearFutureId(),
             nearMiniId,
@@ -1250,7 +1260,8 @@ public final class GridDhtTxPrepareFuture
 
                     MiniFuture fut = new MiniFuture(n.id(), miniId++, dhtMapping, nearMapping);
 
-                    add(fut); // Append new future.
+                    if (!add(fut))
+                        return;
 
                     assert txNodes != null;
 
@@ -1362,9 +1373,10 @@ public final class GridDhtTxPrepareFuture
                         if (tx.remainingTime() == -1)
                             return;
 
-                        MiniFuture fut = new MiniFuture(nearMapping.primary().id(), ++miniId,
null, nearMapping);
+                        MiniFuture fut = new MiniFuture(nearMapping.primary().id(), miniId++,
null, nearMapping);
 
-                        add(fut); // Append new future.
+                        if (!add(fut))
+                            return;
 
                         GridDhtTxPrepareRequest req = new GridDhtTxPrepareRequest(
                             futId,
@@ -1568,8 +1580,7 @@ public final class GridDhtTxPrepareFuture
     }
 
     /**
-     * Mini-future for get operations. Mini-futures are only waiting on a single
-     * node as opposed to multiple nodes.
+     *
      */
     private class MiniFuture {
         /** */
@@ -1808,10 +1819,7 @@ public final class GridDhtTxPrepareFuture
 
         /** {@inheritDoc} */
         @Override public String toString() {
-            return S.toString(MiniFuture.class, this,
-                "done", isDone(),
-                "cancelled", isCancelled(),
-                "err", error());
+            return "MiniFuture [node=" + nodeId + ", loc=" + node().isLocal() + ", done="
+ done + ']';
         }
     }
 
@@ -1834,6 +1842,8 @@ public final class GridDhtTxPrepareFuture
         /** {@inheritDoc} */
         @Override public void onTimeout() {
             synchronized (GridDhtTxPrepareFuture.this) {
+                miniFuts = CLEARED;
+
                 lockKeys.clear();
             }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
index c7c4280..8c1f74d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareRequest.java
@@ -145,7 +145,7 @@ public class GridDhtTxPrepareRequest extends GridDistributedTxPrepareRequest
{
             addDepInfo);
 
         assert futId != null;
-        assert miniId != 0;
+        assert miniId >= 0;
 
         this.topVer = topVer;
         this.futId = futId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
index 5dcb98c..aa74e5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareResponse.java
@@ -91,7 +91,7 @@ public class GridDhtTxPrepareResponse extends GridDistributedTxPrepareResponse
{
         super(part, xid, addDepInfo);
 
         assert futId != null;
-        assert miniId != 0;
+        assert miniId >= 0;
 
         this.futId = futId;
         this.miniId = miniId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index 815800c..84d3ea1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -919,6 +919,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
      * @param createTtl TTL for create operation.
      * @param accessTtl TTL for read operation.
      * @param skipStore Skip store flag.
+     * @param keepBinary Keep binary flag.
      * @return Lock future.
      */
     IgniteInternalFuture<Exception> lockAllAsync(
@@ -999,6 +1000,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
      * @param createTtl TTL for create operation.
      * @param accessTtl TTL for read operation.
      * @param skipStore Skip store flag.
+     * @param keepBinary Keep binary flag.
      * @return Lock future.
      */
     private IgniteInternalFuture<Exception> lockAllAsync0(

http://git-wip-us.apache.org/repos/asf/ignite/blob/282d0d6d/modules/core/src/main/java/org/apache/ignite/internal/util/StripedExecutor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/StripedExecutor.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/StripedExecutor.java
index 709f454..6c85b32 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/StripedExecutor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/StripedExecutor.java
@@ -479,8 +479,6 @@ public class StripedExecutor implements ExecutorService {
                     if (cmd != null) {
                         active = true;
 
-//                        U.debug(log, "Running [r=" + cmd + ']');
-
                         try {
                             cmd.run();
                         }


Mime
View raw message