ignite-commits mailing list archives

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


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

Branch: refs/heads/ignite-db-x-10884
Commit: 22b2cb6719a19e67c41313ca3831b76c85e92c93
Parents: 2596f7c
Author: S.Vladykin <svladykin@gridgain.com>
Authored: Mon Apr 18 04:06:03 2016 +0300
Committer: S.Vladykin <svladykin@gridgain.com>
Committed: Mon Apr 18 04:06:03 2016 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/database/tree/io/DataPageIO.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/22b2cb67/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 37f78e6..beaed49 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
@@ -126,7 +126,7 @@ public class DataPageIO extends PageIO {
      * @param dataOff Entry data offset.
      */
     private void setFirstEntryOffset(ByteBuffer buf, int dataOff) {
-        assert dataOff >= ITEMS_OFF + ITEM_SIZE && dataOff < buf.capacity()
- KV_LEN_SIZE - VER_SIZE;
+        assert dataOff >= ITEMS_OFF + ITEM_SIZE && dataOff <= buf.capacity():
dataOff;
 
         buf.putShort(FIRST_ENTRY_OFF, (short)dataOff);
     }
@@ -522,7 +522,9 @@ public class DataPageIO extends PageIO {
         if (!enoughSpaceForEntry(entrySize, dataOff, directCnt, indirectCnt)) {
             dataOff = compactDataEntries(buf, directCnt);
 
-            assert enoughSpaceForEntry(entrySize, dataOff, directCnt, indirectCnt);
+//            assert enoughSpaceForEntry(entrySize, dataOff, directCnt, indirectCnt);
+            if (!enoughSpaceForEntry(entrySize, dataOff, directCnt, indirectCnt))
+                return -1; // TODO replace with assert
         }
 
         // Attempt to write data right before the first entry.


Mime
View raw message