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 align
Date Tue, 24 Jan 2017 14:51:32 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3477-align [created] 5ad2602f5


ignite-3477 align


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

Branch: refs/heads/ignite-3477-align
Commit: 5ad2602f5f2a47b8735c9c254c3a2141a870a034
Parents: 4db65d2
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Jan 24 17:43:41 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Jan 24 17:43:41 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheOffheapManagerImpl.java | 12 ++++++++++--
 .../cache/database/freelist/io/PagesListMetaIO.java     |  2 +-
 .../cache/database/freelist/io/PagesListNodeIO.java     |  2 +-
 .../processors/cache/database/tree/io/BPlusIO.java      |  2 +-
 .../processors/cache/database/tree/io/DataPageIO.java   |  8 ++++----
 .../processors/cache/database/tree/io/PageIO.java       | 10 +++++++---
 .../processors/cache/database/tree/io/PageMetaIO.java   |  2 +-
 7 files changed, 25 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5ad2602f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index 5b788fc..83bb55f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -1483,7 +1483,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
          * @param ver Page format version.
          */
         DataInnerIO(int ver) {
-            super(T_DATA_REF_INNER, ver, true, 12);
+            super(T_DATA_REF_INNER, ver, true, 16);
         }
 
         /** {@inheritDoc} */
@@ -1519,6 +1519,8 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
 
         /** {@inheritDoc} */
         @Override public long getLink(long pageAddr, int idx) {
+            assert pageAddr % 8 == 0;
+            assert offset(idx) % 8 == 0;
             assert idx < getCount(pageAddr) : idx;
 
             return PageUtils.getLong(pageAddr, offset(idx));
@@ -1526,6 +1528,9 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
 
         /** {@inheritDoc} */
         @Override public int getHash(long pageAddr, int idx) {
+            assert pageAddr % 8 == 0;
+            assert offset(idx) % 8 == 0;
+
             return PageUtils.getInt(pageAddr, offset(idx) + 8);
         }
     }
@@ -1543,7 +1548,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
          * @param ver Page format version.
          */
         DataLeafIO(int ver) {
-            super(T_DATA_REF_LEAF, ver, 12);
+            super(T_DATA_REF_LEAF, ver, 16);
         }
 
         /** {@inheritDoc} */
@@ -1577,12 +1582,15 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
         /** {@inheritDoc} */
         @Override public long getLink(long pageAddr, int idx) {
             assert idx < getCount(pageAddr) : idx;
+            assert offset(idx) % 8 == 0;
 
             return PageUtils.getLong(pageAddr, offset(idx));
         }
 
         /** {@inheritDoc} */
         @Override public int getHash(long pageAddr, int idx) {
+            assert offset(idx) % 8 == 0;
+
             return PageUtils.getInt(pageAddr, offset(idx) + 8);
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5ad2602f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListMetaIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListMetaIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListMetaIO.java
index 6bd50a3..06b5318 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListMetaIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListMetaIO.java
@@ -32,7 +32,7 @@ public class PagesListMetaIO extends PageIO {
     private static final int CNT_OFF = COMMON_HEADER_END;
 
     /** */
-    private static final int NEXT_META_PAGE_OFF = CNT_OFF + 2;
+    private static final int NEXT_META_PAGE_OFF = CNT_OFF + 8;
 
     /** */
     private static final int ITEMS_OFF = NEXT_META_PAGE_OFF + 8;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5ad2602f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListNodeIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListNodeIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListNodeIO.java
index 6bd0532..d674d76 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListNodeIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/io/PagesListNodeIO.java
@@ -42,7 +42,7 @@ public class PagesListNodeIO extends PageIO {
     private static final int CNT_OFF = NEXT_PAGE_ID_OFF + 8;
 
     /** */
-    private static final int PAGE_IDS_OFF = CNT_OFF + 2;
+    private static final int PAGE_IDS_OFF = CNT_OFF + 8;
 
     /**
      * @param ver  Page format version.

http://git-wip-us.apache.org/repos/asf/ignite/blob/5ad2602f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusIO.java
index c34296a..bca1b23 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/BPlusIO.java
@@ -30,7 +30,7 @@ public abstract class BPlusIO<L> extends PageIO {
     private static final int CNT_OFF = COMMON_HEADER_END;
 
     /** */
-    private static final int FORWARD_OFF = CNT_OFF + 2;
+    private static final int FORWARD_OFF = CNT_OFF + 8;
 
     /** */
     private static final int REMOVE_ID_OFF = FORWARD_OFF + 8;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5ad2602f/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 fdb812f..245ee73 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
@@ -57,16 +57,16 @@ public class DataPageIO extends PageIO {
     private static final int FREE_SPACE_OFF = FREE_LIST_PAGE_ID_OFF + 8;
 
     /** */
-    private static final int DIRECT_CNT_OFF = FREE_SPACE_OFF + 2;
+    private static final int DIRECT_CNT_OFF = FREE_SPACE_OFF + 8;
 
     /** */
-    private static final int INDIRECT_CNT_OFF = DIRECT_CNT_OFF + 1;
+    private static final int INDIRECT_CNT_OFF = DIRECT_CNT_OFF + 8;
 
     /** */
-    private static final int FIRST_ENTRY_OFF = INDIRECT_CNT_OFF + 1;
+    private static final int FIRST_ENTRY_OFF = INDIRECT_CNT_OFF + 8;
 
     /** */
-    private static final int ITEMS_OFF = FIRST_ENTRY_OFF + 2;
+    private static final int ITEMS_OFF = FIRST_ENTRY_OFF + 8;
 
     /** */
     private static final int ITEM_SIZE = 2;

http://git-wip-us.apache.org/repos/asf/ignite/blob/5ad2602f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
index f6ac905..89e6aa5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
@@ -80,13 +80,13 @@ public abstract class PageIO {
     public static final int TYPE_OFF = 0;
 
     /** */
-    public static final int VER_OFF = TYPE_OFF + 2;
+    public static final int VER_OFF = TYPE_OFF + 8;
 
     /** */
-    public static final int CRC_OFF = VER_OFF + 2;
+    public static final int CRC_OFF = VER_OFF + 8;
 
     /** */
-    public static final int PAGE_ID_OFF = CRC_OFF + 4;
+    public static final int PAGE_ID_OFF = CRC_OFF + 8;
 
     /** */
     private static final int RESERVED_1_OFF = PAGE_ID_OFF + 8;
@@ -178,6 +178,8 @@ public abstract class PageIO {
      * @return Page type.
      */
     public static int getType(long pageAddr) {
+        assert pageAddr % 8 == 0;
+
         return PageUtils.getShort(pageAddr, TYPE_OFF) & 0xFFFF;
     }
 
@@ -230,6 +232,8 @@ public abstract class PageIO {
      * @return Page ID.
      */
     public static long getPageId(long pageAddr) {
+        assert pageAddr % 8 == 0;
+
         return PageUtils.getLong(pageAddr, PAGE_ID_OFF);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/5ad2602f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageMetaIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageMetaIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageMetaIO.java
index e768f47..2c01206 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageMetaIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageMetaIO.java
@@ -47,7 +47,7 @@ public class PageMetaIO extends PageIO {
     private static final int LAST_ALLOCATED_INDEX_OFF = LAST_SUCCESSFUL_FULL_SNAPSHOT_TAG_OFF
+ 8;
 
     /** Candidate allocated index offset. */
-    private static final int CANDIDATE_ALLOCATED_INDEX_OFF = LAST_ALLOCATED_INDEX_OFF + 4;
+    private static final int CANDIDATE_ALLOCATED_INDEX_OFF = LAST_ALLOCATED_INDEX_OFF + 8;
 
     /** End of page meta. */
     static final int END_OF_PAGE_META = CANDIDATE_ALLOCATED_INDEX_OFF + 4;


Mime
View raw message