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/04/19 14:58:33 UTC
[16/50] [abbrv] ignite git commit: ignite-db - inner replace on remove
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 <sv...@gridgain.com>
Authored: Tue Apr 12 11:20:58 2016 +0300
Committer: S.Vladykin <sv...@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;
}