You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sh...@apache.org on 2016/11/07 04:30:33 UTC

[46/50] [abbrv] ignite git commit: IGNITE-4075 Cassandra store should load all available data when no parameters are provided in loadCache(). - Fixes #1189.

IGNITE-4075 Cassandra store should load all available data when no parameters are provided in loadCache(). - Fixes #1189.

Signed-off-by: Alexey Kuznetsov <ak...@apache.org>


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

Branch: refs/heads/ignite-2788
Commit: e1defc039899259c6ec2df6a77f575250fe4c81c
Parents: f445e7b
Author: Igor <ir...@gmail.com>
Authored: Mon Oct 31 10:17:08 2016 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Oct 31 10:17:08 2016 +0700

----------------------------------------------------------------------
 .../cache/store/cassandra/CassandraCacheStore.java       |  5 ++++-
 .../apache/ignite/tests/IgnitePersistentStoreTest.java   | 11 +++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e1defc03/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/CassandraCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/CassandraCacheStore.java b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/CassandraCacheStore.java
index aead39a..9058837 100644
--- a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/CassandraCacheStore.java
+++ b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/CassandraCacheStore.java
@@ -96,9 +96,12 @@ public class CassandraCacheStore<K, V> implements CacheStore<K, V> {
 
     /** {@inheritDoc} */
     @Override public void loadCache(IgniteBiInClosure<K, V> clo, Object... args) throws CacheLoaderException {
-        if (clo == null || args == null || args.length == 0)
+        if (clo == null)
             return;
 
+        if (args == null || args.length == 0)
+            args = new String[] {"select * from " + controller.getPersistenceSettings().getKeyspace() + "." + cassandraTable() + ";"};
+
         ExecutorService pool = null;
 
         Collection<Future<?>> futs = new ArrayList<>(args.length);

http://git-wip-us.apache.org/repos/asf/ignite/blob/e1defc03/modules/cassandra/store/src/test/java/org/apache/ignite/tests/IgnitePersistentStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/cassandra/store/src/test/java/org/apache/ignite/tests/IgnitePersistentStoreTest.java b/modules/cassandra/store/src/test/java/org/apache/ignite/tests/IgnitePersistentStoreTest.java
index d0a787a..97e7230 100644
--- a/modules/cassandra/store/src/test/java/org/apache/ignite/tests/IgnitePersistentStoreTest.java
+++ b/modules/cassandra/store/src/test/java/org/apache/ignite/tests/IgnitePersistentStoreTest.java
@@ -444,6 +444,17 @@ public class IgnitePersistentStoreTest {
                     "Expected number of records is 3, but loaded number of records is " + size);
             }
 
+            personCache3.clear();
+
+            personCache3.loadCache(null);
+
+            size = personCache3.size(CachePeekMode.ALL);
+            if (size != TestsHelper.getBulkOperationSize()) {
+                throw new RuntimeException("Cache data was incorrectly loaded from Cassandra. " +
+                    "Expected number of records is " + TestsHelper.getBulkOperationSize() +
+                    ", but loaded number of records is " + size);
+            }
+
             LOGGER.info("Cache data loaded from Cassandra table");
         }