ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [28/61] [abbrv] incubator-ignite git commit: # ignite-42
Date Thu, 22 Jan 2015 15:41:26 GMT
# ignite-42


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

Branch: refs/heads/ignite-107
Commit: 7c979e1e56699485a3ed1c63529cc8fc9bec959e
Parents: 5f6156e
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Jan 20 14:43:52 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Jan 20 14:43:52 2015 +0300

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  8 ++++----
 .../IgniteCacheLoadAllAbstractTest.java         | 21 ++++++++++++++++++++
 .../hibernate/GridCacheHibernateBlobStore.java  |  8 +++++---
 3 files changed, 30 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7c979e1e/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
index 29571c7..a3cb47d 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
@@ -180,9 +180,9 @@ public class CacheJdbcBlobStore<K, V> extends CacheStoreAdapter<K,
V> {
 
         IgniteTx tx = transaction();
 
-        Map<Object, Object> props = session().properties();
+        Map<String, Connection> props = session().properties();
 
-        Connection conn = (Connection)props.remove(ATTR_CONN);
+        Connection conn = props.remove(ATTR_CONN);
 
         if (conn != null) {
             try {
@@ -319,9 +319,9 @@ public class CacheJdbcBlobStore<K, V> extends CacheStoreAdapter<K,
V> {
      */
     private Connection connection(@Nullable IgniteTx tx) throws SQLException  {
         if (tx != null) {
-            Map<Object, Object> props = session().properties();
+            Map<String, Connection> props = session().properties();
 
-            Connection conn = (Connection)props.get(ATTR_CONN);
+            Connection conn = props.get(ATTR_CONN);
 
             if (conn == null) {
                 conn = openConnection(false);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7c979e1e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoadAllAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoadAllAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoadAllAbstractTest.java
index 5cbd2cb..6ee5708 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoadAllAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheLoadAllAbstractTest.java
@@ -18,7 +18,9 @@
 package org.apache.ignite.internal.processors.cache.integration;
 
 import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.gridgain.grid.cache.affinity.*;
 
 import javax.cache.integration.*;
 import java.util.*;
@@ -58,8 +60,27 @@ public abstract class IgniteCacheLoadAllAbstractTest extends IgniteCacheAbstract
 
         cache.loadAll(keys, false, lsnr);
 
+        GridCacheAffinity<Object> aff = cache(0).affinity();
+
         for (int i = 0; i < gridCount(); i++) {
+            ClusterNode node = ignite(i).cluster().localNode();
+
+            IgniteCache<Integer, String> cache0 = jcache(i);
+
+            for (int key = 0; key < 1000; key++) {
+                String expVal = (keys.contains(key) && !nonExistKeys.contains(key))
? String.valueOf(key) : null;
+
+                if (aff.isPrimaryOrBackup(node, key)) {
+                    assertEquals(expVal, cache0.localPeek(key));
+
+                    assertEquals(expVal, cache0.get(key));
+                } else {
+                    assertNull(cache0.localPeek(key));
+
+                    assertNull(cache0.get(key));
+                }
 
+            }
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7c979e1e/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
b/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
index d4633b1..a7e0b0a 100644
--- a/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
+++ b/modules/hibernate/src/main/java/org/gridgain/grid/cache/store/hibernate/GridCacheHibernateBlobStore.java
@@ -329,7 +329,9 @@ public class GridCacheHibernateBlobStore<K, V> extends CacheStoreAdapter<K,
V> {
 
         IgniteTx tx = transaction();
 
-        Session ses = (Session)session().properties().remove(ATTR_SES);
+        Map<String, Session> props = session().properties();
+
+        Session ses = props.remove(ATTR_SES);
 
         if (ses != null) {
             Transaction hTx = ses.getTransaction();
@@ -368,9 +370,9 @@ public class GridCacheHibernateBlobStore<K, V> extends CacheStoreAdapter<K,
V> {
         Session ses;
 
         if (tx != null) {
-            Map<Object, Object> props = session().properties();
+            Map<String, Session> props = session().properties();
 
-            ses = (Session)props.get(ATTR_SES);
+            ses = props.get(ATTR_SES);
 
             if (ses == null) {
                 ses = sesFactory.openSession();


Mime
View raw message