ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [05/50] [abbrv] incubator-ignite git commit: # ignite-565
Date Fri, 27 Mar 2015 17:11:26 GMT
# ignite-565


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

Branch: refs/heads/ignite-424
Commit: 75ea413cbfeaed97abcd9bb3ecac78ad6d1b2077
Parents: 195ed52
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Mar 26 16:00:56 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Mar 26 16:00:56 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheProcessor.java    |  8 ++---
 .../junits/common/GridCommonAbstractTest.java   | 33 ++++++++------------
 2 files changed, 16 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75ea413c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index c918ed4..bc68fbc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -2166,12 +2166,10 @@ public class GridCacheProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * @param <K> type of keys.
-     * @param <V> type of values.
-     * @return Default cache.
+     * @return All configured cache instances.
      */
-    public <K, V> GridCache<K, V> publicCache() {
-        return publicCache(null);
+    public Collection<IgniteCacheProxy<?, ?>> jcaches() {
+        return jCacheProxies.values();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/75ea413c/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 507afa3..9dd40d0 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -147,15 +147,6 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @param cache Cache.
      * @return DHT cache.
      */
-    private static <K, V> GridDhtCacheAdapter<K, V> dht(GridCache<K,V>
cache) {
-        return nearEnabled(cache) ? near(cache).dht() :
-            ((IgniteKernal)cache.gridProjection().ignite()).<K, V>internalCache(cache.name()).context().dht();
-    }
-
-    /**
-     * @param cache Cache.
-     * @return DHT cache.
-     */
     protected static <K, V> GridDhtCacheAdapter<K, V> dht(IgniteCache<K,V>
cache) {
         return nearEnabled(cache) ? near(cache).dht() :
             ((IgniteKernal)cache.unwrap(Ignite.class)).<K, V>internalCache(cache.getName()).context().dht();
@@ -198,11 +189,8 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @param cache Cache.
      * @return {@code True} if near cache is enabled.
      */
-    private static <K, V> boolean nearEnabled(GridCache<K,V> cache) {
-        CacheConfiguration cfg = ((IgniteKernal)cache.gridProjection().ignite()).
-            <K, V>internalCache(cache.name()).context().config();
-
-        return isNearEnabled(cfg);
+    private static <K, V> boolean nearEnabled(GridCacheAdapter<K, V> cache) {
+        return isNearEnabled(cache.configuration());
     }
 
     /**
@@ -220,8 +208,8 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
      * @param cache Cache.
      * @return Near cache.
      */
-    private static <K, V> GridNearCacheAdapter<K, V> near(GridCache<K,V>
cache) {
-        return ((IgniteKernal)cache.gridProjection().ignite()).<K, V>internalCache(cache.name()).context().near();
+    private static <K, V> GridNearCacheAdapter<K, V> near(GridCacheAdapter<K,
V> cache) {
+        return cache.context().near();
     }
 
     /**
@@ -352,10 +340,14 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
     @SuppressWarnings("BusyWait")
     protected void awaitPartitionMapExchange() throws InterruptedException {
         for (Ignite g : G.allGrids()) {
-            for (GridCache<?, ?> c : ((IgniteEx)g).cachesx()) {
-                CacheConfiguration cfg = c.configuration();
+            IgniteKernal g0 = (IgniteKernal)g;
+
+            for (IgniteCacheProxy<?, ?> c : g0.context().cache().jcaches()) {
+                CacheConfiguration cfg = c.context().config();
 
-                if (cfg.getCacheMode() == PARTITIONED && cfg.getRebalanceMode() !=
NONE && g.cluster().nodes().size() > 1) {
+                if (cfg.getCacheMode() == PARTITIONED &&
+                    cfg.getRebalanceMode() != NONE &&
+                    g.cluster().nodes().size() > 1) {
                     AffinityFunction aff = cfg.getAffinity();
 
                     GridDhtCacheAdapter<?, ?> dht = dht(c);
@@ -367,7 +359,8 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest
{
 
                         for (int i = 0; ; i++) {
                             // Must map on updated version of topology.
-                            Collection<ClusterNode> affNodes = c.affinity().mapPartitionToPrimaryAndBackups(p);
+                            Collection<ClusterNode> affNodes =
+                                g0.affinity(cfg.getName()).mapPartitionToPrimaryAndBackups(p);
 
                             int exp = affNodes.size();
 


Mime
View raw message