Repository: ignite Updated Branches: refs/heads/ignite-1232-1 d0c1821e4 -> 68571792c
ignite-1232 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/68571792 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/68571792 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/68571792 Branch: refs/heads/ignite-1232-1 Commit: 68571792c49fb504124304d9cb5be1554f070e86 Parents: d0c1821 Author: sboikov <[email protected]> Authored: Fri Jul 22 09:38:09 2016 +0300 Committer: sboikov <[email protected]> Committed: Fri Jul 22 09:38:09 2016 +0300 ---------------------------------------------------------------------- .../ignite/examples/datagrid/CacheQueryExample.java | 4 ++-- .../internal/processors/query/h2/opt/GridH2Table.java | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/68571792/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java index 2db3234..85d74e0 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java @@ -68,7 +68,7 @@ public class CacheQueryExample { /** Organizations cache name. */ private static final String ORG_CACHE = CacheQueryExample.class.getSimpleName() + "Organizations"; - /** Persons cache name. */ + /** Persons collocated with Organizations cache name. */ private static final String COLLOCATED_PERSON_CACHE = CacheQueryExample.class.getSimpleName() + "CollocatedPersons"; /** Persons cache name. */ @@ -149,7 +149,7 @@ public class CacheQueryExample { * Example for scan query based on a predicate. */ private static void scanQuery() { - IgniteCache<BinaryObject, BinaryObject> cache = Ignition.ignite().cache(PERSON_CACHE).withKeepBinary(); + IgniteCache<BinaryObject, BinaryObject> cache = Ignition.ignite().cache(COLLOCATED_PERSON_CACHE).withKeepBinary(); ScanQuery<BinaryObject, BinaryObject> scan = new ScanQuery<>( new IgniteBiPredicate<BinaryObject, BinaryObject>() { http://git-wip-us.apache.org/repos/asf/ignite/blob/68571792/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java ---------------------------------------------------------------------- diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java index e2356f1..8d080ae 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java @@ -459,9 +459,16 @@ public class GridH2Table extends TableBase { if (!snapshotEnabled) return; + releaseSnapshots0(idxs); + } + + /** + * @param idxs Indexes. + */ + private void releaseSnapshots0(ArrayList<Index> idxs) { // Release snapshots on all except first which is scan. for (int i = 1, len = idxs.size(); i < len; i++) - index(i).releaseSnapshot(); + ((GridH2IndexBase)idxs.get(i)).releaseSnapshot(); } /** @@ -641,6 +648,8 @@ public class GridH2Table extends TableBase { Lock l = lock(true, Long.MAX_VALUE); + ArrayList<Index> idxs0 = new ArrayList<>(idxs); + try { snapshotIndexes(null); // Allow read access while we are rebuilding indexes. @@ -657,7 +666,7 @@ public class GridH2Table extends TableBase { throw new IgniteInterruptedException(e); } finally { - releaseSnapshots(); + releaseSnapshots0(idxs0); unlock(l); }
