ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [2/6] ignite git commit: GridH2TableSelfTest tests fixes (one is still failing)
Date Wed, 29 Mar 2017 12:37:20 GMT
GridH2TableSelfTest tests fixes (one is still failing)


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

Branch: refs/heads/ignite-3477-master
Commit: d3e2afd6db64130b9b4bf110d063d4b2496f5bee
Parents: bafab8d
Author: Sergey Chugunov <sergey.chugunov@gmail.com>
Authored: Wed Mar 29 15:01:26 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Mar 29 15:35:27 2017 +0300

----------------------------------------------------------------------
 .../processors/query/h2/opt/GridH2Table.java        | 16 ++++++++--------
 .../processors/query/h2/opt/GridH2TreeIndex.java    | 16 +++++++++-------
 .../query/h2/opt/GridH2TableSelfTest.java           |  3 ++-
 3 files changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d3e2afd6/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 cd7438b..89a010d 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
@@ -396,11 +396,11 @@ public class GridH2Table extends TableBase {
         assert snapshotEnabled;
 
         if (snapshots == null) // Nothing to reuse, create new snapshots.
-            snapshots = new Object[idxs.size() - 1];
+            snapshots = new Object[idxs.size() - 2];
 
-        // Take snapshots on all except first which is scan.
-        for (int i = 1, len = idxs.size(); i < len; i++) {
-            Object s = snapshots[i - 1];
+        // Take snapshots on all except first which is scan and second which is hash.
+        for (int i = 2, len = idxs.size(); i < len; i++) {
+            Object s = snapshots[i - 2];
 
             boolean reuseExisting = s != null;
 
@@ -411,7 +411,7 @@ public class GridH2Table extends TableBase {
                 if (qctx != null)
                     qctx.clearSnapshots();
 
-                for (int j = 1; j < i; j++)
+                for (int j = 2; j < i; j++)
                     index(j).releaseSnapshot();
 
                 // Drop invalidated snapshot.
@@ -420,7 +420,7 @@ public class GridH2Table extends TableBase {
                 return null;
             }
 
-            snapshots[i - 1] = s;
+            snapshots[i - 2] = s;
         }
 
         return snapshots;
@@ -473,8 +473,8 @@ public class GridH2Table extends TableBase {
      * @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++)
+        // Release snapshots on all except first which is scan and second which is hash.
+        for (int i = 2, len = idxs.size(); i < len; i++)
             ((GridH2IndexBase)idxs.get(i)).releaseSnapshot();
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d3e2afd6/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
index 9180b89..d28b99e 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
@@ -17,18 +17,20 @@
 
 package org.apache.ignite.internal.processors.query.h2.opt;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.NavigableMap;
 import java.util.concurrent.ConcurrentSkipListMap;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.processors.query.h2.*;
-import org.apache.ignite.internal.util.*;
-import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.processors.query.h2.H2Cursor;
+import org.apache.ignite.internal.util.GridCursorIteratorWrapper;
+import org.apache.ignite.internal.util.IgniteTree;
+import org.apache.ignite.internal.util.lang.GridCursor;
 import org.apache.ignite.internal.util.offheap.unsafe.GridOffHeapSnapTreeMap;
 import org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeGuard;
 import org.apache.ignite.internal.util.snaptree.SnapTreeMap;
 import org.apache.ignite.internal.util.typedef.internal.SB;
-import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.spi.indexing.IndexingQueryFilter;
 import org.h2.engine.Session;
 import org.h2.index.Cursor;

http://git-wip-us.apache.org/repos/asf/ignite/blob/d3e2afd6/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
index f64b91b..f9388ef 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
@@ -33,6 +33,7 @@ import java.util.UUID;
 import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.processors.query.h2.database.H2PkHashIndex;
 import org.apache.ignite.internal.processors.query.h2.database.H2RowFactory;
 import org.apache.ignite.internal.util.lang.GridCursor;
 import org.apache.ignite.internal.util.typedef.F;
@@ -104,8 +105,8 @@ public class GridH2TableSelfTest extends GridCommonAbstractTest {
                 IndexColumn str = tbl.indexColumn(2, SortOrder.DESCENDING);
                 IndexColumn x = tbl.indexColumn(3, SortOrder.DESCENDING);
 
+                idxs.add(new H2PkHashIndex(null, tbl, HASH, F.asList(id)));
                 idxs.add(new GridH2TreeIndex(PK_NAME, tbl, true, F.asList(id)));
-                idxs.add(new GridH2TreeIndex(HASH, tbl, true, F.asList(id)));
                 idxs.add(new GridH2TreeIndex(NON_UNIQUE_IDX_NAME, tbl, false, F.asList(x,
t, id)));
                 idxs.add(new GridH2TreeIndex(STR_IDX_NAME, tbl, false, F.asList(str, id)));
 


Mime
View raw message