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 2016/02/15 08:52:00 UTC

[16/50] [abbrv] ignite git commit: ignite-split2 - fixes + more asserts

ignite-split2 - fixes + more asserts


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

Branch: refs/heads/ignite-1232
Commit: 4a46085e6111eec6e1ed8285d57269bc96cd822d
Parents: 9c110e8
Author: S.Vladykin <sv...@gridgain.com>
Authored: Tue Dec 8 03:52:04 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Tue Dec 8 03:52:04 2015 +0300

----------------------------------------------------------------------
 .../processors/query/h2/opt/GridH2RowFactory.java |  2 +-
 .../processors/query/h2/opt/GridH2TreeIndex.java  | 18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4a46085e/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java
index 3817308..148fab8 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowFactory.java
@@ -48,7 +48,7 @@ public class GridH2RowFactory extends RowFactory {
     public static GridH2Row create(Value... data) {
         switch (data.length) {
             case 0:
-                throw new IllegalStateException();
+                throw new IllegalStateException("Zero columns row.");
 
             case 1:
                 return new RowKey(data[0]);

http://git-wip-us.apache.org/repos/asf/ignite/blob/4a46085e/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 04fd233..98b0b6a 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
@@ -285,6 +285,8 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
                     // This is the first request containing all the search rows.
                     ConcurrentNavigableMap<GridSearchRowPointer,GridH2Row> snapshot0 = qctx.getSnapshot(idxId);
 
+                    assert !msg.bounds().isEmpty() : "empty bounds";
+
                     src = new RangeSource(msg.bounds(), snapshot0);
                 }
                 else {
@@ -298,12 +300,16 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
 
                 int maxRows = qctx.pageSize();
 
+                assert maxRows > 0 : maxRows;
+
                 while (maxRows > 0) {
                     GridH2RowRange range = src.next(maxRows);
 
                     if (range == null)
                         break;
 
+                    ranges.add(range);
+
                     maxRows -= range.rows().size();
                 }
 
@@ -820,9 +826,13 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
         if (row == null)
             return null;
 
-        List<GridH2ValueMessage> vals = new ArrayList<>(row.getColumnCount());
+        int cols = row.getColumnCount();
+
+        assert cols > 0 : cols;
 
-        for (int i = 0; i < vals.size(); i++) {
+        List<GridH2ValueMessage> vals = new ArrayList<>(cols);
+
+        for (int i = 0; i < cols; i++) {
             try {
                 vals.add(GridH2ValueMessageFactory.toMessage(row.getValue(i)));
             }
@@ -850,6 +860,8 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
 
         Value[] vals = new Value[getTable().getColumns().length];
 
+        assert vals.length > 0;
+
         for (int i = 0; i < indexColumns.length; i++) {
             try {
                 vals[indexColumns[i].column.getColumnId()] = msg.values().get(i).value(ctx);
@@ -905,6 +917,8 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
 
         List<GridH2ValueMessage> vals = msg.values();
 
+        assert !F.isEmpty(vals) : vals;
+
         Value[] vals0 = new Value[vals.size()];
 
         for (int i = 0; i < vals0.length; i++) {