ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject incubator-ignite git commit: GG-9569 - Merging changes to ignite
Date Fri, 12 Dec 2014 07:03:24 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1 f0773f5dc -> 3e795a941


GG-9569 - Merging changes to ignite


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

Branch: refs/heads/ignite-1
Commit: 3e795a941ee7363bd8a02dab178cec90c90625f5
Parents: f0773f5
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Thu Dec 11 23:03:21 2014 -0800
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Thu Dec 11 23:03:21 2014 -0800

----------------------------------------------------------------------
 .../processors/cache/GridCacheEntryImpl.java      |  4 ++--
 .../processors/cache/GridCacheEvictionEntry.java  |  4 ++--
 .../distributed/dht/GridDhtCacheEntryImpl.java    |  2 +-
 .../dht/colocated/GridDhtColocatedCache.java      |  2 +-
 .../GridCacheContinuousQueryManager.java          | 11 ++++++++++-
 .../cache/GridCacheAbstractFullApiSelfTest.java   | 18 +++++++++---------
 .../GridCacheReplicatedEvictionSelfTest.java      |  8 ++++++--
 .../dataload/GridDataLoaderProcessorSelfTest.java |  7 +------
 8 files changed, 32 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e795a94/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryImpl.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryImpl.java
index e1a512a..930245e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryImpl.java
@@ -225,13 +225,13 @@ public class GridCacheEntryImpl<K, V> implements GridCacheEntry<K,
V>, Externali
 
     /** {@inheritDoc} */
     @Override public boolean primary() {
-        return ctx.config().getCacheMode() != PARTITIONED ||
+        return ctx.config().getCacheMode() == LOCAL ||
             ctx.affinity().primary(ctx.localNode(), key, ctx.affinity().affinityTopologyVersion());
     }
 
     /** {@inheritDoc} */
     @Override public boolean backup() {
-        return ctx.config().getCacheMode() == PARTITIONED &&
+        return ctx.config().getCacheMode() != LOCAL &&
             ctx.affinity().backups(key, ctx.affinity().affinityTopologyVersion()).contains(ctx.localNode());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e795a94/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionEntry.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionEntry.java
index a051a20..1d0ec9c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionEntry.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEvictionEntry.java
@@ -101,7 +101,7 @@ public class GridCacheEvictionEntry<K, V> implements GridCacheEntry<K,
V>, Exter
     @Override public boolean primary() {
         GridCacheContext<K, V> ctx = cached.context();
 
-        return ctx.config().getCacheMode() != PARTITIONED ||
+        return ctx.config().getCacheMode() == LOCAL ||
             ctx.nodeId().equals(ctx.affinity().primary(cached.key(), ctx.affinity().affinityTopologyVersion()).id());
     }
 
@@ -109,7 +109,7 @@ public class GridCacheEvictionEntry<K, V> implements GridCacheEntry<K,
V>, Exter
     @Override public boolean backup() {
         GridCacheContext<K, V> ctx = cached.context();
 
-        return ctx.config().getCacheMode() == PARTITIONED &&
+        return ctx.config().getCacheMode() != LOCAL &&
             ctx.affinity().backups(cached.key(), ctx.affinity().affinityTopologyVersion()).contains(ctx.localNode());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e795a94/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtCacheEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtCacheEntryImpl.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtCacheEntryImpl.java
index 7136119..a39dc6b 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtCacheEntryImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtCacheEntryImpl.java
@@ -60,7 +60,7 @@ public class GridDhtCacheEntryImpl<K, V> extends GridCacheEntryImpl<K,
V> {
 
     /** {@inheritDoc} */
     @Override public V peek(@Nullable Collection<GridCachePeekMode> modes) throws GridException
{
-        if (!ctx.isNear() && !ctx.isReplicated() && modes.contains(NEAR_ONLY))
+        if (!ctx.isNear() && modes.contains(NEAR_ONLY))
             return null;
 
         V val = null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e795a94/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index 96d837c..4b774cc 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -116,7 +116,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
     @Override public V peek(K key, @Nullable Collection<GridCachePeekMode> modes) throws
GridException {
         GridTuple<V> val = null;
 
-        if (ctx.isReplicated() || !modes.contains(NEAR_ONLY)) {
+        if (!modes.contains(NEAR_ONLY)) {
             try {
                 val = peek0(true, key, modes, ctx.tm().txx());
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e795a94/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryManager.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryManager.java
index 55ea9d1..8d95bc8 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/query/continuous/GridCacheContinuousQueryManager.java
@@ -171,7 +171,16 @@ public class GridCacheContinuousQueryManager<K, V> extends GridCacheManagerAdapt
 
         assert info != null;
 
-        for (GridCacheEntry<K, V> e : internal ? cctx.cache().primaryEntrySetx() :
cctx.cache().primaryEntrySet()) {
+        Set<GridCacheEntry<K, V>> entries;
+
+        if (cctx.isReplicated())
+            entries = internal ? cctx.cache().entrySetx() :
+                cctx.cache().entrySet();
+        else
+            entries = internal ? cctx.cache().primaryEntrySetx() :
+                cctx.cache().primaryEntrySet();
+
+        for (GridCacheEntry<K, V> e : entries) {
             info.onIterate(new GridCacheContinuousQueryEntry<>(cctx, e, e.getKey(),
e.getValue(), null, null, null),
                 !internal && cctx.gridEvents().isRecordable(EVT_CACHE_QUERY_OBJECT_READ));
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e795a94/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index b736135..35f64ca 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -3837,7 +3837,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         assert cache.peek(key, F.asList(DB)) == 1;
         assert cache.peek(key, F.asList(TX, GLOBAL)) == 1;
 
-        if (!partitionedMode()) {
+        if (cacheMode() == LOCAL) {
             assert cache.peek(key, F.asList(TX, NEAR_ONLY)) == 1;
             assert cache.peek(key, F.asList(TX, PARTITIONED_ONLY)) == 1;
         }
@@ -3849,7 +3849,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         assert entry.peek(F.asList(DB)) == 1;
         assert entry.peek(F.asList(TX, GLOBAL)) == 1;
 
-        if (!partitionedMode()) {
+        if (cacheMode() == LOCAL) {
             assert entry.peek(F.asList(TX, NEAR_ONLY)) == 1;
             assert entry.peek(F.asList(TX, PARTITIONED_ONLY)) == 1;
         }
@@ -3860,7 +3860,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         assert cache.peek("wrongKey", F.asList(TX, GLOBAL, SWAP, DB)) == null;
 
-        if (!partitionedMode()) {
+        if (cacheMode() == LOCAL) {
             assert cache.peek("wrongKey", F.asList(TX, NEAR_ONLY, SWAP, DB)) == null;
             assert cache.peek("wrongKey", F.asList(TX, PARTITIONED_ONLY, SWAP, DB)) == null;
         }
@@ -3879,7 +3879,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
             assert cache.peek(key, F.asList(GLOBAL)) == 1;
 
-            if (!partitionedMode()) {
+            if (cacheMode() == LOCAL) {
                 assert cache.peek(key, F.asList(NEAR_ONLY)) == 1;
                 assert cache.peek(key, F.asList(PARTITIONED_ONLY)) == 1;
             }
@@ -3891,7 +3891,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
             assertEquals((Integer)1, entry.peek(F.asList(GLOBAL)));
 
-            if (!partitionedMode()) {
+            if (cacheMode() == LOCAL) {
                 assertEquals((Integer)1, entry.peek(F.asList(NEAR_ONLY)));
                 assertEquals((Integer)1, entry.peek(F.asList(PARTITIONED_ONLY)));
             }
@@ -3908,7 +3908,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         assertEquals((Integer)2, cache.peek(key, F.asList(GLOBAL)));
 
-        if (!partitionedMode()) {
+        if (cacheMode() == LOCAL) {
             assertEquals((Integer)2, cache.peek(key, F.asList(NEAR_ONLY)));
             assertEquals((Integer)2, cache.peek(key, F.asList(PARTITIONED_ONLY)));
         }
@@ -3919,7 +3919,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         assertEquals((Integer)2, entry.peek(F.asList(GLOBAL)));
 
-        if (!partitionedMode()) {
+        if (cacheMode() == LOCAL) {
             assertEquals((Integer)2, entry.peek(F.asList(NEAR_ONLY)));
             assertEquals((Integer)2, entry.peek(F.asList(PARTITIONED_ONLY)));
         }
@@ -3933,7 +3933,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         assertNull(cache.peek(key, F.asList(SMART)));
         assertNull(cache.peek(key, F.asList(TX, GLOBAL)));
 
-        if (!partitionedMode()) {
+        if (cacheMode() == LOCAL) {
             assertNull(cache.peek(key, F.asList(TX, NEAR_ONLY)));
             assertNull(cache.peek(key, F.asList(TX, PARTITIONED_ONLY)));
         }
@@ -3945,7 +3945,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         assertNull(entry.peek(F.asList(SMART)));
         assertNull(entry.peek(F.asList(TX, GLOBAL)));
 
-        if (!partitionedMode()) {
+        if (cacheMode() == LOCAL) {
             assertNull(entry.peek(F.asList(TX, NEAR_ONLY)));
             assertNull(entry.peek(F.asList(TX, PARTITIONED_ONLY)));
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e795a94/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java
index 3067583..f6454bf 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/replicated/GridCacheReplicatedEvictionSelfTest.java
@@ -75,8 +75,12 @@ public class GridCacheReplicatedEvictionSelfTest extends GridCacheAbstractSelfTe
         for (int g = 0 ; g < gridCount(); g++)
             futs.add(waitForLocalEvent(grid(g).events(), nodeEvent(grid(g).localNode().id()),
EVT_CACHE_ENTRY_EVICTED));
 
-        for (int i = 0; i < KEYS; i++)
-            assertTrue(cache(0).evict(String.valueOf(i)));
+        for (int g = 0; g < gridCount(); g++) {
+            for (int i = 0; i < KEYS; i++) {
+                if (cache(g).entry(String.valueOf(i)).primary())
+                    assertTrue(cache(g).evict(String.valueOf(i)));
+            }
+        }
 
         for (IgniteFuture<IgniteEvent> fut : futs)
             fut.get(3000);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3e795a94/modules/core/src/test/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessorSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessorSelfTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessorSelfTest.java
index 2c169e5..b782821 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessorSelfTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/dataload/GridDataLoaderProcessorSelfTest.java
@@ -216,12 +216,7 @@ public class GridDataLoaderProcessorSelfTest extends GridCommonAbstractTest
{
             int s3 = g3.cache(null).primaryKeySet().size();
             int total = threads * cnt;
 
-            if (mode == REPLICATED) {
-                assertEquals(total, s2);
-                assertEquals(total, s3);
-            }
-            else
-                assertEquals(total, s2 + s3);
+            assertEquals(total, s2 + s3);
 
             final IgniteDataLoader<Integer, Integer> rmvLdr = g2.dataLoader(null);
 


Mime
View raw message