ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [38/48] incubator-ignite git commit: # Fixed random entry in NEAR cache.
Date Thu, 05 Mar 2015 20:10:53 GMT
# Fixed random entry in NEAR cache.


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

Branch: refs/heads/ignite-release-test-no-mod
Commit: e0e6945cbd1ba1749a4ac508da022eb4ba381a5d
Parents: 27d7d67
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Mar 5 14:56:42 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Mar 5 14:56:42 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/near/GridNearCacheAdapter.java         | 8 ++++++++
 .../processors/cache/GridCacheConcurrentMapTest.java         | 4 +---
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e0e6945c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 94d2e96..c699ecc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -586,6 +586,14 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
     }
 
     /** {@inheritDoc} */
+    @Nullable @Override public Cache.Entry<K, V> randomEntry() {
+        if (configuration().getDistributionMode() == CacheDistributionMode.NEAR_PARTITIONED)
+            return dht().randomEntry();
+        else
+            return super.randomEntry();
+    }
+
+    /** {@inheritDoc} */
     @Override public Iterator<Map.Entry<K, V>> swapIterator() throws IgniteCheckedException
{
         ctx.denyOnFlags(F.asList(SKIP_SWAP));
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e0e6945c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapTest.java
index dcfc809..e04973e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapTest.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.testframework.junits.common.*;
@@ -69,10 +68,9 @@ public class GridCacheConcurrentMapTest extends GridCommonAbstractTest
{
     }
 
     /**
-     * todo uncomment when IGNITE-203 will be done.
      * @throws Exception If failed.
      */
-    public void _testRandomEntry() throws Exception {
+    public void testRandomEntry() throws Exception {
         IgniteCache<String, String> cache = grid(0).jcache(null);
 
         for (int i = 0; i < 500; i++)


Mime
View raw message