ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [41/57] [abbrv] ignite git commit: HashIDX on client is allowed in case if client is affinity node
Date Wed, 12 Apr 2017 07:34:12 GMT
HashIDX on client is allowed in case if client is affinity node


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

Branch: refs/heads/ignite-3477-debug
Commit: 3e86c511b0aef0d4edc75e411be98c8b56b6b0a4
Parents: 085c612
Author: Sergey Chugunov <sergey.chugunov@gmail.com>
Authored: Thu Apr 6 19:21:07 2017 +0300
Committer: Sergey Chugunov <sergey.chugunov@gmail.com>
Committed: Tue Apr 11 14:38:26 2017 +0300

----------------------------------------------------------------------
 .../processors/query/h2/IgniteH2Indexing.java        | 15 +++++++++------
 .../processors/query/h2/opt/GridH2Table.java         | 15 ++++++++++++---
 2 files changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3e86c511/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 725e742..5f2d8c0 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -2868,11 +2868,14 @@ public class IgniteH2Indexing implements GridQueryIndexing {
 
             int cacheId = CU.cacheId(schema.ccfg.getName());
 
-            idxs.add(createHashIndex(
-                cacheId,
-                "_key_PK_hash",
-                tbl,
-                treeIndexColumns(new ArrayList<IndexColumn>(2), keyCol, affCol)));
+            Index hashIdx = createHashIndex(
+                    cacheId,
+                    "_key_PK_hash",
+                    tbl,
+                    treeIndexColumns(new ArrayList<IndexColumn>(2), keyCol, affCol));
+
+            if (hashIdx != null)
+                idxs.add(hashIdx);
 
             // Add primary key index.
             idxs.add(createSortedIndex(
@@ -3002,7 +3005,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
                 return pkHashIdx;
             }
 
-            return new GridH2TreeIndex(name, tbl, true, cols);
+            return null;
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/3e86c511/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 89a010d..94c8843 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
@@ -149,10 +149,13 @@ public class GridH2Table extends TableBase {
         idxs = idxsFactory.createIndexes(this);
 
         assert idxs != null;
-        assert idxs.size() >= 2;
 
         // Add scan index at 0 which is required by H2.
-        idxs.add(0, new ScanIndex(index(1), index(0)));
+        if (idxs.size() >= 2
+                && index(0).getIndexType().isHash())
+            idxs.add(0, new ScanIndex(index(1), index(0)));
+        else
+            idxs.add(0, new ScanIndex(index(0), null));
 
         snapshotEnabled = desc == null || desc.snapshotableIndex();
 
@@ -927,7 +930,13 @@ public class GridH2Table extends TableBase {
          *
          */
         @Override protected GridH2IndexBase delegate() {
-            return rebuildFromHashInProgress ? hashIdx : super.delegate();
+            if (hashIdx != null)
+                return rebuildFromHashInProgress ? hashIdx : super.delegate();
+            else {
+                assert !rebuildFromHashInProgress;
+
+                return super.delegate();
+            }
         }
 
         /** {@inheritDoc} */


Mime
View raw message