ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-1.8 drop
Date Wed, 07 Dec 2016 09:20:34 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.8-drop2 15233cb96 -> df0bc5353


ignite-1.8 drop


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

Branch: refs/heads/ignite-1.8-drop2
Commit: df0bc53539c7970c0f529e817d6eaaa03c613b34
Parents: 15233cb
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Dec 7 12:20:27 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Dec 7 12:20:27 2016 +0300

----------------------------------------------------------------------
 .../cache/distributed/dht/GridDhtGetFuture.java      |  2 +-
 .../near/GridNearOptimisticTxPrepareFuture.java      |  3 ++-
 .../internal/util/future/GridCompoundFuture.java     | 15 ++++++++++++---
 3 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/df0bc535/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
index d2a3b3c..d2eab5f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
@@ -275,7 +275,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
         // Optimization to avoid going through compound future,
         // if getAsync() has been completed and no other futures added to this
         // compound future.
-        if (fut.isDone() && futuresCount() == 0) {
+        if (fut.isDone() && !hasFutures()) {
             if (fut.error() != null)
                 onDone(fut.error());
             else

http://git-wip-us.apache.org/repos/asf/ignite/blob/df0bc535/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 9de56f5..b314b81 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
@@ -901,7 +901,8 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
                         }
                         else
                             remap();
-                    } else {
+                    }
+                    else {
                         parent.onPrepareResponse(m, res);
 
                         // Proceed prepare before finishing mini future.

http://git-wip-us.apache.org/repos/asf/ignite/blob/df0bc535/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
index d90cf3a..7abd367 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridCompoundFuture.java
@@ -162,7 +162,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R>
implements Ig
     @SuppressWarnings("unchecked")
     public final Collection<IgniteInternalFuture<T>> futures() {
         synchronized (sync) {
-            if(futs == null)
+            if (futs == null)
                 return Collections.emptyList();
 
             if (futs instanceof IgniteInternalFuture)
@@ -313,6 +313,7 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R>
implements Ig
     /**
      * @return Futures size.
      */
+    @SuppressWarnings("unchecked")
     protected final int futuresCountNoLock() {
         assert Thread.holdsLock(sync);
 
@@ -328,13 +329,21 @@ public class GridCompoundFuture<T, R> extends GridFutureAdapter<R>
implements Ig
     /**
      * @return Futures size.
      */
-    @SuppressWarnings("unchecked")
-    protected final int futuresCount() {
+    private int futuresCount() {
         synchronized (sync) {
             return futuresCountNoLock();
         }
     }
 
+    /**
+     * @return {@code True} if has at least one future.
+     */
+    protected final boolean hasFutures() {
+        synchronized (sync) {
+            return futs != null;
+        }
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(GridCompoundFuture.class, this,


Mime
View raw message