ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [18/34] ignite git commit: IGNITE-3477 - Fixing segmented queries
Date Thu, 30 Mar 2017 17:25:28 GMT
IGNITE-3477 - Fixing segmented queries


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

Branch: refs/heads/ignite-3477-master
Commit: 96286f215ea35dd62fa619109cf6bb6edb5b74f8
Parents: 2bcf8f5
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Tue Mar 28 19:32:29 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Mar 29 19:29:37 2017 +0300

----------------------------------------------------------------------
 .../processors/query/h2/database/H2TreeIndex.java | 18 +++++++-----------
 .../cache/IgniteCacheAbstractQuerySelfTest.java   | 13 ++++++++-----
 .../near/IgniteCachePartitionedQuerySelfTest.java |  2 +-
 3 files changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/96286f21/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
index 0185fa5..74ff9c7 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2TreeIndex.java
@@ -155,7 +155,7 @@ public class H2TreeIndex extends GridH2IndexBase {
 
     /** {@inheritDoc} */
     @Override protected int segmentsCount() {
-        return 1;
+        return segments.length;
     }
 
     /** {@inheritDoc} */
@@ -184,7 +184,7 @@ public class H2TreeIndex extends GridH2IndexBase {
     /** {@inheritDoc} */
     @Override public GridH2Row findOne(GridH2Row row) {
         try {
-            int seg = threadLocalSegment();
+            int seg = segmentForRow(row);
 
             H2Tree tree = treeForRead(seg);
 
@@ -200,7 +200,7 @@ public class H2TreeIndex extends GridH2IndexBase {
         try {
             InlineIndexHelper.setCurrentInlineIndexes(inlineIdxs);
 
-            int seg = threadLocalSegment();
+            int seg = segmentForRow(row);
 
             H2Tree tree = treeForRead(seg);
 
@@ -219,7 +219,7 @@ public class H2TreeIndex extends GridH2IndexBase {
         try {
             InlineIndexHelper.setCurrentInlineIndexes(inlineIdxs);
 
-            int seg = threadLocalSegment();
+            int seg = segmentForRow(row);
 
             H2Tree tree = treeForRead(seg);
 
@@ -238,7 +238,7 @@ public class H2TreeIndex extends GridH2IndexBase {
         try {
             InlineIndexHelper.setCurrentInlineIndexes(inlineIdxs);
 
-            int seg = threadLocalSegment();
+            int seg = segmentForRow(row);
 
             H2Tree tree = treeForRead(seg);
 
@@ -257,7 +257,7 @@ public class H2TreeIndex extends GridH2IndexBase {
         try {
             InlineIndexHelper.setCurrentInlineIndexes(inlineIdxs);
 
-            int seg = threadLocalSegment();
+            int seg = segmentForRow(row);
 
             H2Tree tree = treeForRead(seg);
 
@@ -348,11 +348,7 @@ public class H2TreeIndex extends GridH2IndexBase {
         @Nullable SearchRow last,
         IndexingQueryFilter filter) {
         try {
-            int seg = threadLocalSegment();
-
-            H2Tree tree = treeForRead(seg);
-
-            GridCursor<GridH2Row> range = tree.find(first, last);
+            GridCursor<GridH2Row> range = t.find(first, last);
 
             if (range == null)
                 return EMPTY_CURSOR;

http://git-wip-us.apache.org/repos/asf/ignite/blob/96286f21/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
index 82e83ca..c1e54cd 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
@@ -205,7 +205,9 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
         qryEntity.setIndexes(Arrays.asList(strIdx));
 
-        entityList.add(qryEntity);cc.setQueryEntities(entityList);
+        entityList.add(qryEntity);
+
+        cc.setQueryEntities(entityList);
 
         if (cacheMode() != CacheMode.LOCAL)
             cc.setAffinity(new RendezvousAffinityFunction());
@@ -259,6 +261,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         super.afterTest();
+
         for(String cacheName : ignite().cacheNames())
             ignite().cache(cacheName).removeAll();
     }
@@ -366,7 +369,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
      * @throws Exception In case of error.
      */
     public void testTableAliasInSqlQuery() throws Exception {
-        IgniteCache<Integer, Integer> cache = ignite().cache(null);
+        IgniteCache<Integer, Integer> cache = jcache(Integer.class, Integer.class);
 
         int key = 898;
 
@@ -657,7 +660,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
      * @throws Exception In case of error.
      */
     public void testMixedCustomTableName() throws Exception {
-        final IgniteCache<Integer, Object> cache = ignite().cache(null);
+        final IgniteCache<Integer, Object> cache = jcache(Integer.class, Object.class);
 
         cache.put(10, new Type1(1, "Type1 record #1"));
         cache.put(20, new Type1(2, "Type1 record #2"));
@@ -703,7 +706,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
      * @throws Exception In case of error.
      */
     public void testDistributedJoinCustomTableName() throws Exception {
-        IgniteCache<Integer, Object> cache = ignite().cache(null);
+        IgniteCache<Integer, Object> cache = jcache(Integer.class, Object.class);
 
         cache.put(10, new Type1(1, "Type1 record #1"));
         cache.put(20, new Type1(2, "Type1 record #2"));
@@ -768,7 +771,7 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
      * @throws Exception In case of error.
      */
     public void testObjectWithString() throws Exception {
-        IgniteCache<Integer, ObjectValue2> cache = ignite().cache(null);
+        IgniteCache<Integer, ObjectValue2> cache = jcache(Integer.class, ObjectValue2.class);
 
         cache.put(1, new ObjectValue2("value 1"));
         cache.put(2, new ObjectValue2("value 2"));

http://git-wip-us.apache.org/repos/asf/ignite/blob/96286f21/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
index db56fa4..30a825b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
@@ -159,7 +159,7 @@ public class IgniteCachePartitionedQuerySelfTest extends IgniteCacheAbstractQuer
 
         final AtomicInteger pages = new AtomicInteger(0);
 
-        IgniteCache<Integer, Integer> cache = ignite().cache(null);
+        IgniteCache<Integer, Integer> cache = jcache(Integer.class, Integer.class);
 
         for (int i = 0; i < 50; i++)
             cache.put(i, i);


Mime
View raw message