ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [1/2] incubator-ignite git commit: # sprint-1 Added store session initialization for loadCache
Date Thu, 12 Feb 2015 08:26:18 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-96 b7457a9eb -> d72fe0d6f


# sprint-1 Added store session initialization for loadCache


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

Branch: refs/heads/ignite-96
Commit: 533944a5a62e9d4d08bb25dcd4bb2be9ea9f67f5
Parents: b434ae8
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Feb 12 10:41:09 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Feb 12 10:41:09 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/GridCacheStoreManager.java  |  7 ++++++-
 .../integration/IgniteCacheStoreSessionAbstractTest.java  | 10 +++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/533944a5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
index 6fc8589..a3edcbc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheStoreManager.java
@@ -489,6 +489,8 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K,
V> {
             if (log.isDebugEnabled())
                 log.debug("Loading all values from store.");
 
+            initSession(null);
+
             try {
                 store.loadCache(new IgniteBiInClosure<K, Object>() {
                     @Override public void apply(K k, Object o) {
@@ -514,6 +516,9 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K,
V> {
             catch (Exception e) {
                 throw new IgniteCheckedException(new CacheLoaderException(e));
             }
+            finally {
+                sesHolder.set(null);
+            }
 
             if (log.isDebugEnabled())
                 log.debug("Loaded all values from store.");
@@ -522,7 +527,7 @@ public class GridCacheStoreManager<K, V> extends GridCacheManagerAdapter<K,
V> {
         }
 
         LT.warn(log, null, "Calling Cache.loadCache() method will have no effect, " +
-            "GridCacheConfiguration.getStore() is not defined for cache: " + cctx.namexx());
+            "CacheConfiguration.getStore() is not defined for cache: " + cctx.namexx());
 
         return false;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/533944a5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
index 42cf516..055ca1b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreSessionAbstractTest.java
@@ -173,6 +173,12 @@ public abstract class IgniteCacheStoreSessionAbstractTest extends IgniteCacheAbs
         cache.removeAll(keys);
 
         assertTrue(expData.isEmpty());
+
+        expectedData(false, "loadCache", cache.getName());
+
+        cache.localLoadCache(null);
+
+        assertTrue(expData.isEmpty());
     }
 
     /**
@@ -223,7 +229,9 @@ public abstract class IgniteCacheStoreSessionAbstractTest extends IgniteCacheAbs
     private class TestStore extends CacheStore<Object, Object> {
         /** {@inheritDoc} */
         @Override public void loadCache(IgniteBiInClosure<Object, Object> clo, @Nullable
Object... args) {
-            fail();
+            log.info("Load cache [tx=" + session().transaction() + ']');
+
+            checkSession("loadCache");
         }
 
         /** {@inheritDoc} */


Mime
View raw message