ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [14/50] ignite git commit: Minors.
Date Mon, 14 Aug 2017 10:30:24 GMT
Minors.


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

Branch: refs/heads/ignite-5991-6019
Commit: 51a62134345731c5464c854c62e8be59fb79a9fd
Parents: 12a479f
Author: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Authored: Thu Aug 10 17:06:08 2017 +0300
Committer: Alexander Paschenko <alexander.a.paschenko@gmail.com>
Committed: Thu Aug 10 17:06:08 2017 +0300

----------------------------------------------------------------------
 .../h2/twostep/GridMergeIndexesIterator.java    | 54 ++++++++++----------
 1 file changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/51a62134/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexesIterator.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexesIterator.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexesIterator.java
index 9d18269..5958689 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexesIterator.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndexesIterator.java
@@ -51,8 +51,9 @@ class GridMergeIndexesIterator extends GridCloseableIteratorAdapterEx<List<?>>
{
      * Constructor.
      * @param idxs Indexes to iterate over.
      * @param clo Closure to run when this iterator is closed, or when all indexes have been
traversed.
+     * @throws IgniteCheckedException if failed.
      */
-    GridMergeIndexesIterator(Iterable<GridMergeIndex> idxs, IgniteOutClosure<?>
clo) {
+    GridMergeIndexesIterator(Iterable<GridMergeIndex> idxs, IgniteOutClosure<?>
clo) throws IgniteCheckedException {
         this.idxs = idxs.iterator();
         this.clo = clo;
 
@@ -73,48 +74,47 @@ class GridMergeIndexesIterator extends GridCloseableIteratorAdapterEx<List<?>>
{
         if (res == null)
             throw new NoSuchElementException();
 
-        next = null;
-
-        try {
-            goNext();
-        }
-        catch (Throwable e) {
-            doCleanup();
-
-            throw new IgniteCheckedException(e);
-        }
+        goNext();
 
         return res;
     }
 
     /**
      * Retrieve next row.
+     * @throws IgniteCheckedException if failed.
      */
-    private void goNext() {
+    private void goNext() throws IgniteCheckedException {
         next = null;
 
-        boolean gotNext = false;
+        try {
+            boolean gotNext = false;
 
-        while (cur == null || !(gotNext = cur.next())) {
-            if (idxs.hasNext())
-                cur = idxs.next().findInStream(null, null);
-            else {
-                // We're out of records, let's clean up.
-                doCleanup();
+            while (cur == null || !(gotNext = cur.next())) {
+                if (idxs.hasNext())
+                    cur = idxs.next().findInStream(null, null);
+                else {
+                    // We're out of records, let's clean up.
+                    doCleanup();
 
-                break;
+                    break;
+                }
             }
-        }
 
-        if (gotNext) {
-            Row row = cur.get();
+            if (gotNext) {
+                Row row = cur.get();
 
-            int cols = row.getColumnCount();
+                int cols = row.getColumnCount();
 
-            next = new ArrayList<>(cols);
+                next = new ArrayList<>(cols);
 
-            for (int c = 0; c < cols; c++)
-                next.add(row.getValue(c).getObject());
+                for (int c = 0; c < cols; c++)
+                    next.add(row.getValue(c).getObject());
+            }
+        }
+        catch (Throwable e) {
+            doCleanup();
+
+            throw new IgniteCheckedException(e);
         }
     }
 


Mime
View raw message