ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [48/50] [abbrv] incubator-ignite git commit: GG-9655 - Fixing tests after merge.
Date Sat, 31 Jan 2015 03:55:48 GMT
GG-9655 - Fixing tests after merge.


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

Branch: refs/heads/ingite-9655-merge
Commit: 0c5e5ccb047289025dcd3cd37e24d4da0b0cec50
Parents: 9a995a3
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Fri Jan 30 17:10:44 2015 -0800
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Fri Jan 30 17:10:44 2015 -0800

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheEntryInfo.java   |  9 +++++++++
 .../internal/processors/cache/GridCacheMapEntry.java    |  9 +++------
 .../cache/distributed/dht/GridDhtTxPrepareFuture.java   | 12 ++++++++++--
 .../cache/distributed/dht/GridDhtTxPrepareResponse.java |  2 ++
 .../cache/transactions/IgniteTxLocalAdapter.java        |  7 +++++--
 .../cache/GridCacheAbstractFullApiSelfTest.java         |  3 +++
 6 files changed, 32 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c5e5ccb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
index ad8d862..099f876 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryInfo.java
@@ -80,6 +80,13 @@ public class GridCacheEntryInfo<K, V> implements Externalizable {
     }
 
     /**
+     * @param cacheId Cache ID.
+     */
+    public void cacheId(int cacheId) {
+        this.cacheId = cacheId;
+    }
+
+    /**
      * @param key Entry key.
      */
     public void key(K key) {
@@ -254,6 +261,7 @@ public class GridCacheEntryInfo<K, V> implements Externalizable
{
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
+        out.writeInt(cacheId);
         out.writeBoolean(keyBytesSent);
         out.writeBoolean(valBytesSent);
 
@@ -299,6 +307,7 @@ public class GridCacheEntryInfo<K, V> implements Externalizable
{
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
+        cacheId = in.readInt();
         keyBytesSent = in.readBoolean();
         valBytesSent = in.readBoolean();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c5e5ccb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 3c4e9d6..61d4959 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -426,6 +426,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                     info = new GridCacheEntryInfo<>();
 
                     info.key(key);
+                    info.cacheId(cctx.cacheId());
 
                     long expireTime = expireTimeExtras();
 
@@ -1675,9 +1676,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
             if (isNew())
                 unswap(true, retval);
 
-            boolean newTtlResolved = false;
-
-            boolean drNeedResolve = false;
+            boolean drNeedResolve;
 
             Object transformClo = null;
 
@@ -1715,8 +1714,6 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                         newExpireTime = CU.toExpireTime(newTtl);
                     }
 
-                    newTtlResolved = true;
-
                     GridCacheVersionedEntryEx<K, V> oldEntry = versionedEntry();
                     GridCacheVersionedEntryEx<K, V> newEntry =
                         new GridCachePlainVersionedEntry<>(k, (V)writeObj, newTtl,
newExpireTime, drVer);
@@ -1871,7 +1868,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                             expiryPlc.ttlUpdated(key,
                                 getOrMarshalKeyBytes(),
                                 version(),
-                                hasReaders() ? ((GridDhtCacheEntry) this).readers() : null);
+                                hasReaders() ? ((GridDhtCacheEntry<K, V>) this).readers()
: null);
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c5e5ccb/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 256c9f9..de5428b 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
@@ -826,6 +826,8 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
                         try {
                             GridDhtCacheEntry<K, V> cached = (GridDhtCacheEntry<K,
V>)entry.cached();
 
+                            GridCacheContext<K, V> cacheCtx = cached.context();
+
                             if (entry.explicitVersion() == null) {
                                 GridCacheMvccCandidate<K> added = cached.candidate(version());
 
@@ -842,8 +844,14 @@ public final class GridDhtTxPrepareFuture<K, V> extends GridCompoundIdentityFutu
                             req.invalidateNearEntry(idx, !tx.nearNodeId().equals(n.id())
&&
                                 cached.readerId(n.id()) != null);
 
-                            if (cached.isNewLocked())
-                                req.markKeyForPreload(idx);
+                            if (cached.isNewLocked()) {
+                                List<ClusterNode> owners = cacheCtx.topology().owners(cached.partition(),
+                                    tx != null ? tx.topologyVersion() : cacheCtx.affinity().affinityTopologyVersion());
+
+                                // Do not preload if local node is partition owner.
+                                if (!owners.contains(cctx.localNode()))
+                                    req.markKeyForPreload(idx);
+                            }
 
                             break;
                         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c5e5ccb/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 165e294..2e7caa9 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
@@ -170,6 +170,8 @@ public class GridDhtTxPrepareResponse<K, V> extends GridDistributedTxPrepareResp
      * @param info Info to add.
      */
     public void addPreloadEntry(GridCacheEntryInfo<K, V> info) {
+        assert info.cacheId() != 0;
+
         if (preloadEntries == null)
             preloadEntries = new ArrayList<>();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c5e5ccb/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 e481f84..86c8f53 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
@@ -2249,9 +2249,12 @@ public abstract class IgniteTxLocalAdapter<K, V> extends IgniteTxAdapter<K,
V>
 
                         IgniteTxEntry<K, V> e = entry(new IgniteTxKey<>(key,
cacheCtx.cacheId()));
 
-                        assert e != null && e.op() == TRANSFORM : e;
+                        assert e != null;
 
-                        addInvokeResult(e, val, ret);
+                        if (e.op() == TRANSFORM)
+                            addInvokeResult(e, val, ret);
+                        else
+                            ret.set(val, true);
                     }
                 });
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0c5e5ccb/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 5526c7b..8b2c814 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -5408,6 +5408,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         checkIteratorRemove(cache, entries);
 
         checkIteratorEmpty(cache);
+
+        for (int i = 0; i < SIZE; i++)
+            cache.remove(Integer.toString(i));
     }
 
     /**


Mime
View raw message