ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-3477
Date Tue, 31 Jan 2017 14:59:39 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3477-compact [created] f110b247e


ignite-3477


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

Branch: refs/heads/ignite-3477-compact
Commit: f110b247ee1af0cc54223da32939fc408a7b4e62
Parents: 587a05e
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Jan 31 17:59:32 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Jan 31 17:59:32 2017 +0300

----------------------------------------------------------------------
 .../cache/database/tree/io/DataPageIO.java      | 25 ++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f110b247/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
index df14dc1..010a7fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/DataPageIO.java
@@ -1225,13 +1225,30 @@ public class DataPageIO extends PageIO {
             if (delta != 0) { // Move right.
                 assert delta > 0: delta;
 
-                moveBytes(pageAddr, off, entrySize, delta, pageSize);
-
                 int itemId = offs[i] & 0xFF;
 
-                off += delta;
+                setItem(pageAddr, itemId, directItemFromOffset(off + delta));
+
+                for (int j = i - 1; j >= 0; j--) {
+                    int offNext = offs[j] >>> 8;
+                    int nextSize = getPageEntrySize(pageAddr, offNext, SHOW_PAYLOAD_LEN |
SHOW_LINK);
+
+                    if (offNext + nextSize == off) {
+                        i--;
 
-                setItem(pageAddr, itemId, directItemFromOffset(off));
+                        off = offNext;
+                        entrySize += nextSize;
+
+                        itemId = offs[j] & 0xFF;
+                        setItem(pageAddr, itemId, directItemFromOffset(offNext + delta));
+                    }
+                    else
+                        break;
+                }
+
+                moveBytes(pageAddr, off, entrySize, delta, pageSize);
+
+                off += delta;
             }
 
             prevOff = off;


Mime
View raw message