You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/01/13 04:58:47 UTC
[7/7] incubator-ignite git commit: # IGNITE-32 WIP: Store
implementation.
# IGNITE-32 WIP: Store implementation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/81d25114
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/81d25114
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/81d25114
Branch: refs/heads/ignite-32
Commit: 81d2511414a3da7d61f6cce26a2f3ff59efe31ec
Parents: aa65812
Author: AKuznetsov <ak...@gridgain.com>
Authored: Tue Jan 13 10:58:48 2015 +0700
Committer: AKuznetsov <ak...@gridgain.com>
Committed: Tue Jan 13 10:58:48 2015 +0700
----------------------------------------------------------------------
.../org/gridgain/grid/cache/store/auto/AutoCacheStore.java | 9 +++++----
.../org/gridgain/grid/cache/store/auto/PojoJdbcMapper.java | 2 ++
2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81d25114/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/AutoCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/AutoCacheStore.java b/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/AutoCacheStore.java
index aeff437..6dfcc3d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/AutoCacheStore.java
+++ b/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/AutoCacheStore.java
@@ -504,6 +504,7 @@ public abstract class AutoCacheStore<K, V> implements GridCacheStore<K, V> {
/**
* Construct load cache query.
+ *
* @param tblName Database table name.
* @param uniqCols Database unique columns.
* @return Load cache query.
@@ -865,12 +866,12 @@ public abstract class AutoCacheStore<K, V> implements GridCacheStore<K, V> {
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
Object typeKey = typeKey(entry.getKey());
- Collection<Map.Entry<? extends K, ? extends V>> s = keyByType.get(typeKey);
+ Collection<Map.Entry<? extends K, ? extends V>> batch = keyByType.get(typeKey);
- if (s == null)
- keyByType.put(typeKey, s = new ArrayList<>());
+ if (batch == null)
+ keyByType.put(typeKey, batch = new ArrayList<>());
- s.add(entry);
+ batch.add(entry);
}
for (Map.Entry<Object, Collection<Map.Entry<? extends K, ? extends V>>> m : keyByType.entrySet())
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/81d25114/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/PojoJdbcMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/PojoJdbcMapper.java b/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/PojoJdbcMapper.java
index b5b4e06..6606c707 100644
--- a/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/PojoJdbcMapper.java
+++ b/modules/core/src/main/java/org/gridgain/grid/cache/store/auto/PojoJdbcMapper.java
@@ -43,6 +43,8 @@ public class PojoJdbcMapper implements JdbcMapper<Object> {
*/
protected PojoJdbcMapper(String clsName, Collection<GridCacheQueryTypeDescriptor> descs,
@Nullable Collection<String> paramNames) throws IgniteCheckedException {
+ assert descs != null && !descs.isEmpty();
+
try {
cls = Class.forName(clsName);