ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [44/50] ignite git commit: Fixed page ID allocation in case when no store is present.
Date Thu, 28 Apr 2016 08:53:14 GMT
Fixed page ID allocation in case when no store is present.


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

Branch: refs/heads/ignite-db-x-10884
Commit: 66fb8ef05ffacedacf01e5d800f54224783b8454
Parents: ca839c8
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Wed Apr 27 00:32:54 2016 -0700
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Apr 27 00:32:54 2016 -0700

----------------------------------------------------------------------
 .../ignite/internal/pagemem/impl/PageMemoryImpl.java  | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/66fb8ef0/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryImpl.java
index b8d58f6..09e0df8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryImpl.java
@@ -38,6 +38,7 @@ import org.apache.ignite.internal.mem.OutOfMemoryException;
 import org.apache.ignite.internal.pagemem.DirectMemoryUtils;
 import org.apache.ignite.internal.pagemem.FullPageId;
 import org.apache.ignite.internal.pagemem.Page;
+import org.apache.ignite.internal.pagemem.PageIdUtils;
 import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager;
 import org.apache.ignite.internal.util.GridConcurrentHashSet;
@@ -199,6 +200,11 @@ public class  PageMemoryImpl implements PageMemory {
             absPtr = absolute(relPtr);
 
             pageId = readPageId(absPtr);
+
+            long idx = PageIdUtils.pageIdx(pageId);
+
+            // Reassign page ID according to flags and partition ID.
+            pageId = PageIdUtils.pageId(partId, flags, idx);
         }
         else {
             while (true) {
@@ -208,13 +214,16 @@ public class  PageMemoryImpl implements PageMemory {
                     break;
             }
 
+            // Assign page ID according to flags and partition ID.
+            pageId = PageIdUtils.pageId(partId, flags, pageId);
+
             relPtr = allocateFreePage();
 
             absPtr = absolute(relPtr);
-
-            writePageId(absPtr, pageId);
         }
 
+        writePageId(absPtr, pageId);
+
         // TODO pass an argument to decide whether the page should be cleaned.
         mem.setMemory(absPtr + PAGE_OVERHEAD, sysPageSize - PAGE_OVERHEAD, (byte)0);
 
@@ -234,7 +243,6 @@ public class  PageMemoryImpl implements PageMemory {
         return fullId;
     }
 
-
     /** {@inheritDoc} */
     @Override public boolean freePage(FullPageId fullId) throws IgniteCheckedException {
         Segment seg = segment(fullId);


Mime
View raw message