ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [08/23] incubator-ignite git commit: # IGNITE-56 Get rid Ignite.cache()
Date Sat, 14 Feb 2015 12:23:00 GMT
# IGNITE-56 Get rid Ignite.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/9ddc9813
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9ddc9813
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9ddc9813

Branch: refs/heads/ignite-250
Commit: 9ddc9813cc97992e261c829061cbde0ea6f48962
Parents: 6c37e47
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Sat Feb 14 13:19:42 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Sat Feb 14 13:20:18 2015 +0300

----------------------------------------------------------------------
 modules/core/src/main/java/org/apache/ignite/IgniteCache.java | 2 +-
 .../src/main/java/org/apache/ignite/cache/CacheManager.java   | 4 ++--
 .../ignite/cache/store/jdbc/CacheAbstractJdbcStore.java       | 3 ++-
 .../org/apache/ignite/configuration/CacheConfiguration.java   | 4 ++--
 .../internal/processors/cache/GridCacheConcurrentMap.java     | 7 ++++---
 .../ignite/internal/processors/cache/GridCacheEntrySet.java   | 3 ++-
 .../processors/cache/affinity/GridCacheAffinityProxy.java     | 2 +-
 .../rest/handlers/cache/GridCacheCommandHandler.java          | 2 +-
 .../rest/handlers/cache/GridCacheQueryCommandHandler.java     | 6 +++---
 .../java/org/apache/ignite/startup/BasicWarmupClosure.java    | 3 ++-
 10 files changed, 20 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index 772eb5d..8efcbf4 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -35,7 +35,7 @@ import java.util.concurrent.*;
 import java.util.concurrent.locks.*;
 
 /**
- * Main entry point for all <b>Data Grid APIs.</b> You can get a named cache
by calling {@link Ignite#cache(String)}
+ * Main entry point for all <b>Data Grid APIs.</b> You can get a named cache
by calling {@link Ignite#jcache(String)}
  * method.
  * <h1 class="header">Functionality</h1>
  * This API extends {@link org.apache.ignite.cache.CacheProjection} API which contains vast
majority of cache functionality

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
index 38ce793..3316ff5 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
@@ -297,12 +297,12 @@ public class CacheManager implements javax.cache.CacheManager {
         if (enabled) {
             registerCacheObject(mBeanSrv, ignite.jcache(cacheName).mxBean(), cacheName, CACHE_CONFIGURATION);
 
-            ignite.cache(cacheName).configuration().setManagementEnabled(true);
+            ignite.jcache(cacheName).getConfiguration(CacheConfiguration.class).setManagementEnabled(true);
         }
         else {
             unregisterCacheObject(mBeanSrv, cacheName, CACHE_CONFIGURATION);
 
-            ignite.cache(cacheName).configuration().setManagementEnabled(false);
+            ignite.jcache(cacheName).getConfiguration(CacheConfiguration.class).setManagementEnabled(false);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
index 3bb5d81..ae2643c 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.store.*;
 import org.apache.ignite.cache.store.jdbc.dialect.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
@@ -468,7 +469,7 @@ public abstract class CacheAbstractJdbcStore<K, V> extends CacheStore<K,
V> impl
             if (entryMappings != null)
                 return entryMappings;
 
-            Collection<CacheTypeMetadata> types = ignite().cache(cacheName).configuration()
+            Collection<CacheTypeMetadata> types = ignite().jcache(cacheName).getConfiguration(CacheConfiguration.class)
                 .getTypeMetadata();
 
             entryMappings = U.newHashMap(types.size());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 6105f26..d0e5750 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -403,8 +403,8 @@ public class CacheConfiguration extends MutableConfiguration {
 
     /**
      * Cache name. If not provided or {@code null}, then this will be considered a default
-     * cache which can be accessed via {@link Ignite#cache(String) Grid.cache(null)} method.
Otherwise, if name
-     * is provided, the cache will be accessed via {@link Ignite#cache(String)} method.
+     * cache which can be accessed via {@link Ignite#jcache(String)} method. Otherwise, if
name
+     * is provided, the cache will be accessed via {@link Ignite#jcache(String)} method.
      *
      * @return Cache name.
      */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
index 706c34b..a169706 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
@@ -322,7 +323,7 @@ public class GridCacheConcurrentMap<K, V> {
      */
     private static <K, V> IgnitePredicate<Cache.Entry<K, V>>[] nonInternal(
         IgnitePredicate<Cache.Entry<K, V>>[] filter) {
-        return F.asArray(F0.and((IgnitePredicate<Cache.Entry<K, V>>[]) NON_INTERNAL_ARR,
filter));
+        return F.asArray(F0.and((IgnitePredicate<Cache.Entry<K, V>>[])NON_INTERNAL_ARR,
filter));
     }
 
     /**
@@ -1732,7 +1733,7 @@ public class GridCacheConcurrentMap<K, V> {
             curVal = null;
 
             try {
-                ctx.grid().cache(ctx.name()).remove(e.key(), CU.<K, V>empty());
+                ((IgniteKernal)ctx.grid()).cache(ctx.name()).remove(e.key(), CU.<K, V>empty());
             }
             catch (IgniteCheckedException ex) {
                 throw new IgniteException(ex);
@@ -1907,7 +1908,7 @@ public class GridCacheConcurrentMap<K, V> {
          */
         boolean removeKey(K k) {
             try {
-                return ctx.grid().cache(ctx.name()).remove(k, CU.<K, V>empty());
+                return ((IgniteKernal)ctx.grid()).cache(ctx.name()).remove(k, CU.<K, V>empty());
             }
             catch (IgniteCheckedException e) {
                 throw new IgniteException("Failed to remove cache entry for key: " + k, e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
index 49863ec..afca283 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntrySet.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
@@ -78,7 +79,7 @@ public class GridCacheEntrySet<K, V> extends AbstractSet<Cache.Entry<K,
V>> {
 
         if (F.isAll(e, filter) && set.remove(e)) {
             try {
-                ctx.grid().cache(ctx.name()).remove(e.getKey(), e.getValue());
+                ((IgniteKernal)ctx.grid()).cache(ctx.name()).remove(e.getKey(), e.getValue());
             }
             catch (IgniteCheckedException ex) {
                 throw new IgniteException(ex);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityProxy.java
index 97a7b2b..abef4d5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/affinity/GridCacheAffinityProxy.java
@@ -257,6 +257,6 @@ public class GridCacheAffinityProxy<K, V> implements CacheAffinity<K>,
Externali
      * @throws ObjectStreamException Thrown in case of unmarshalling error.
      */
     private Object readResolve() throws ObjectStreamException {
-        return cctx.grid().cache(cctx.cache().name()).affinity();
+        return cctx.grid().affinity(cctx.cache().name());
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
index 47af1ff..0fbd2fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheCommandHandler.java
@@ -560,7 +560,7 @@ public class GridCacheCommandHandler extends GridRestCommandHandlerAdapter
{
      * @throws IgniteCheckedException If cache not found.
      */
     private static GridCacheProjectionEx<Object, Object> cache(Ignite ignite, String
cacheName) throws IgniteCheckedException {
-        GridCache<Object, Object> cache = ignite.cache(cacheName);
+        GridCache<Object, Object> cache = ((IgniteKernal)ignite).cache(cacheName);
 
         if (cache == null)
             throw new IgniteCheckedException(

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
index c1ebfb3..cb5b5e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheQueryCommandHandler.java
@@ -270,7 +270,7 @@ public class GridCacheQueryCommandHandler extends GridRestCommandHandlerAdapter
         @Override public GridRestResponse call() throws Exception {
             long qryId = qryIdGen.getAndIncrement();
 
-            CacheQueries<Object,Object> queries = g.cache(req.cacheName()).queries();
+            CacheQueries<Object,Object> queries = ((IgniteKernal)g).cache(req.cacheName()).queries();
 
             CacheQuery<?> qry;
 
@@ -405,9 +405,9 @@ public class GridCacheQueryCommandHandler extends GridRestCommandHandlerAdapter
         /** {@inheritDoc} */
         @Override public Object call() throws Exception {
             if (clsName == null)
-                g.cache(cacheName).queries().rebuildAllIndexes();
+                ((IgniteKernal)g).cache(cacheName).queries().rebuildAllIndexes();
             else
-                g.cache(cacheName).queries().rebuildIndexes(clsName);
+                ((IgniteKernal)g).cache(cacheName).queries().rebuildIndexes(clsName);
 
             return null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9ddc9813/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java
b/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java
index 9979af4..fb23f07 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/BasicWarmupClosure.java
@@ -20,6 +20,7 @@ package org.apache.ignite.startup;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
@@ -244,7 +245,7 @@ public class BasicWarmupClosure implements IgniteInClosure<IgniteConfiguration>
 
         try {
             for (GridCache<?, ?> cache : first.caches()) {
-                GridCache<Object, Object> cache0 = first.cache(cache.name());
+                GridCache<Object, Object> cache0 = ((IgniteKernal)first).cache(cache.name());
 
                 for (String warmupMethod : warmupMethods) {
                     Collection<Future> futs = new ArrayList<>(threadCnt);


Mime
View raw message