# ignite-656

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

Branch: refs/heads/ignite-gg-9702
Commit: 38004a1151a3d8a418660f62b2ca5702e12a1dd1
Parents: 637a190
Author: sboikov <sboi...@gridgain.com>
Authored: Mon Apr 20 15:53:40 2015 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Mon Apr 20 15:53:40 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheAdapter.java  | 7 +++----
 .../cache/distributed/GridDistributedCacheAdapter.java      | 4 +++-
 .../cache/distributed/GridDistributedLockRequest.java       | 9 ++++++---
 .../processors/cache/distributed/dht/GridDhtLockFuture.java | 8 +++++---
 .../cache/distributed/dht/atomic/GridDhtAtomicCache.java    | 3 +--
 .../distributed/dht/atomic/GridNearAtomicUpdateRequest.java | 4 +++-
 .../processors/cache/transactions/IgniteTxEntry.java        | 8 +++++---
 .../processors/cache/transactions/IgniteTxLocalAdapter.java | 3 +--
 8 files changed, 27 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38004a11/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 59ce0e9..38ebfe4 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -1219,8 +1219,8 @@ public abstract class GridCacheAdapter<K, V> implements 
IgniteInternalCache<K, V
     @Override public V getForcePrimary(K key) throws IgniteCheckedException {
         String taskName = ctx.kernalContext().job().currentTaskName();
 
-        return getAllAsync(F.asList(key), /*force primary*/true, /*skip 
tx*/false, null, null, taskName, true,
-            false).get().get(key);
+        return getAllAsync(F.asList(key), /*force primary*/true, /*skip 
tx*/false, null, null, taskName, true, false)
+            .get().get(key);
     }
 
     /** {@inheritDoc} */
@@ -1229,8 +1229,7 @@ public abstract class GridCacheAdapter<K, V> implements 
IgniteInternalCache<K, V
 
         return getAllAsync(Collections.singletonList(key), /*force 
primary*/true, /*skip tx*/false, null, null,
             taskName, true, false).chain(new CX1<IgniteInternalFuture<Map<K, 
V>>, V>() {
-            @Override
-            public V applyx(IgniteInternalFuture<Map<K, V>> e) throws 
IgniteCheckedException {
+            @Override public V applyx(IgniteInternalFuture<Map<K, V>> e) 
throws IgniteCheckedException {
                 return e.get().get(key);
             }
         });

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38004a11/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
index 90bfa60..8992310 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedCacheAdapter.java
@@ -148,9 +148,10 @@ public abstract class GridDistributedCacheAdapter<K, V> 
extends GridCacheAdapter
                 // Send job to all data nodes.
                 Collection<ClusterNode> nodes = 
ctx.grid().cluster().forDataNodes(name()).nodes();
 
-                if (!nodes.isEmpty())
+                if (!nodes.isEmpty()) {
                     ctx.closures().callAsyncNoFailover(BROADCAST,
                         new GlobalRemoveAllCallable<>(name(), topVer, 
ctx.skipStore()), nodes, true).get();
+                }
             }
             while (ctx.affinity().affinityTopologyVersion().compareTo(topVer) 
> 0);
         }
@@ -252,6 +253,7 @@ public abstract class GridDistributedCacheAdapter<K, V> 
extends GridCacheAdapter
         /**
          * @param cacheName Cache name.
          * @param topVer Topology version.
+         * @param skipStore Skip store flag.
          */
         private GlobalRemoveAllCallable(String cacheName, @NotNull 
AffinityTopologyVersion topVer, boolean skipStore) {
             this.cacheName = cacheName;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38004a11/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
index cddad87..2baee77 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -32,6 +32,8 @@ import org.jetbrains.annotations.*;
 import java.nio.*;
 import java.util.*;
 
+import static org.apache.ignite.internal.processors.cache.GridCacheUtils.*;
+
 /**
  * Lock request message.
  */
@@ -233,14 +235,15 @@ public class GridDistributedLockRequest extends 
GridDistributedBaseMessage {
      * @param skipStore Skip store flag.
      */
     private void skipStore(boolean skipStore){
-        flags = skipStore ? (byte)(flags | 
GridCacheUtils.SKIP_STORE_FLAG_MASK) :
-                    (byte)(flags & ~GridCacheUtils.SKIP_STORE_FLAG_MASK);
+        flags = skipStore ? (byte)(flags | SKIP_STORE_FLAG_MASK) : 
(byte)(flags & ~SKIP_STORE_FLAG_MASK);
     }
 
     /**
      * @return Skip store flag.
      */
-    public boolean skipStore() { return (flags & 
GridCacheUtils.SKIP_STORE_FLAG_MASK) == 1; };
+    public boolean skipStore() {
+        return (flags & SKIP_STORE_FLAG_MASK) == 1;
+    }
 
     /**
      * @return Transaction isolation or <tt>null</tt> if not in transaction.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38004a11/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 f247c0c..c2f652a 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
@@ -957,10 +957,12 @@ public final class GridDhtLockFuture<K, V> extends 
GridCompoundIdentityFuture<Bo
             final GridCacheVersion ver = version();
 
             for (GridDhtCacheEntry entry : entries) {
-                IgniteTxEntry txEntry = tx != null ? tx.entry(entry.txKey()) : 
null;
+                if (!entry.hasValue()) {
+                    IgniteTxEntry txEntry = tx != null ? 
tx.entry(entry.txKey()) : null;
 
-                if (!entry.hasValue() && (txEntry == null || 
!txEntry.skipStore()))
-                    loadMap.put(entry.key(), entry);
+                    if (txEntry == null || !txEntry.skipStore())
+                        loadMap.put(entry.key(), entry);
+                }
             }
 
             try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38004a11/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 08a1622..b00b32b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -1074,10 +1074,9 @@ public class GridDhtAtomicCache<K, V> extends 
GridDhtCacheAdapter<K, V> {
 
                         GridCacheReturn retVal = null;
 
-                        //TODO: support skipStore for putAll
                         if (keys.size() > 1 &&                             // 
Several keys ...
                             writeThrough() && !req.skipStore() &&          // 
and store is enabled ...
-                            !ctx.store().isLocal() &&                 // and 
this is not local store ...
+                            !ctx.store().isLocal() &&                      // 
and this is not local store ...
                             !ctx.dr().receiveEnabled()                     // 
and no DR.
                         ) {
                             // This method can only be used when there are no 
replicated entries in the batch.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38004a11/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index e5229bb..e0e3e26 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -284,7 +284,9 @@ public class GridNearAtomicUpdateRequest extends 
GridCacheMessage implements Gri
     /**
      * @return Skip write-through to a persistent storage.
      */
-    public boolean skipStore() {return skipStore;}
+    public boolean skipStore() {
+        return skipStore;
+    }
 
     /**
      * @param key Key to add.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38004a11/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 88e64d7..43450bd 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -37,6 +37,7 @@ import java.util.*;
 import java.util.concurrent.atomic.*;
 
 import static org.apache.ignite.internal.processors.cache.GridCacheOperation.*;
+import static org.apache.ignite.internal.processors.cache.GridCacheUtils.*;
 
 /**
  * Transaction entry. Note that it is essential that this class does not 
override
@@ -423,14 +424,15 @@ public class IgniteTxEntry implements 
GridPeerDeployAware, Message {
      * @param skipStore Skip store flag.
      */
     public void skipStore(boolean skipStore){
-        flags = skipStore ? (byte)(flags | 
GridCacheUtils.SKIP_STORE_FLAG_MASK) :
-                        (byte)(flags & ~GridCacheUtils.SKIP_STORE_FLAG_MASK);
+        flags = skipStore ? (byte)(flags | SKIP_STORE_FLAG_MASK) : 
(byte)(flags & ~SKIP_STORE_FLAG_MASK);
     }
 
     /**
      * @return Skip store flag.
      */
-    public boolean skipStore() { return (flags & 
GridCacheUtils.SKIP_STORE_FLAG_MASK) == 1; };
+    public boolean skipStore() {
+        return (flags & SKIP_STORE_FLAG_MASK) == 1;
+    }
 
     /**
      * @return Tx key.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38004a11/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 64bcd79..4591c58 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
@@ -1708,9 +1708,8 @@ public abstract class IgniteTxLocalAdapter extends 
IgniteTxAdapter
                                             deserializePortable,
                                             false);
                                     }
-                                    else if (txEntry.skipStore()) {
+                                    else if (txEntry.skipStore())
                                         missed.remove(cacheKey);
-                                    }
 
                                     // Even though we bring the value back 
from lock acquisition,
                                     // we still need to recheck primary node 
for consistent values

Reply via email to