ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [16/50] [abbrv] ignite git commit: ignite-db - inner replace on remove
Date Tue, 19 Apr 2016 12:58:33 GMT
ignite-db - inner replace on remove


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

Branch: refs/heads/ignite-db-x-10884
Commit: d023107aebf283ab5170fcc1edec016bf61fa123
Parents: ac0b698
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Tue Apr 12 11:20:58 2016 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Tue Apr 12 11:20:58 2016 +0300

----------------------------------------------------------------------
 .../processors/query/h2/database/BPlusTree.java         | 12 ++++++++----
 .../processors/query/h2/database/DataStore.java         |  1 +
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d023107a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/BPlusTree.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/BPlusTree.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/BPlusTree.java
index 5258dd4..f38ff0c 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/BPlusTree.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/BPlusTree.java
@@ -1452,14 +1452,14 @@ public abstract class BPlusTree<L, T extends L> {
                         assert p.fwdId != fwdId || fwdId == 0;
 
                         if (p.foundInner == TRUE) { // Need to replace ref in inner page.
-                            p.foundInner = FALSE;
+                            p.foundInner = FALSE; // Protect from retries.
 
                             res = writePage(page, replace, p, lvl, Put.RETRY);
 
                             if (res != Put.FOUND)
                                 return res; // Need to retry.
 
-                            p.foundInner = DONE; // We can have only single matching inner
key, no more attempts.
+                            p.foundInner = DONE; // We can have only single matching inner
key.
                         }
 
                         // Go down recursively.
@@ -1802,10 +1802,14 @@ public abstract class BPlusTree<L, T extends L> {
 
         /** {@inheritDoc} */
         @Override boolean found(BPlusIO<L> io, ByteBuffer buf, int idx, int lvl) throws
IgniteCheckedException {
-            if (!io.isLeaf() && needReplaceInner == FALSE)
+            if (io.isLeaf())
+                return true;
+
+            // If we can get full row from the inner page, we must do inner replace to update
full row info here.
+            if (io.canGetRow() && needReplaceInner == FALSE)
                 needReplaceInner = TRUE;
 
-            return io.isLeaf();
+            return false;
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/d023107a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/DataStore.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/DataStore.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/DataStore.java
index f979365..5390858 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/DataStore.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/DataStore.java
@@ -30,6 +30,7 @@ public interface DataStore<T> {
      * @param buf Buffer.
      * @param idx Index.
      * @return Data row.
+     * @throws IgniteCheckedException If failed.
      */
     public T getRow(BPlusIO<?> io, ByteBuffer buf, int idx) throws IgniteCheckedException;
 }


Mime
View raw message