ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/5] ignite git commit: ignite-3484
Date Tue, 05 Sep 2017 14:46:56 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3484 [created] 6be6779b6


ignite-3484


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

Branch: refs/heads/ignite-3484
Commit: cbada3934a386668da0b11d4de7d0f58a4d04dfe
Parents: e1e07ff
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Sep 5 14:49:49 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Sep 5 14:49:49 2017 +0300

----------------------------------------------------------------------
 .../cache/persistence/CacheDataRow.java         |  4 ++++
 .../cache/persistence/CacheSearchRow.java       |  4 ++++
 .../cache/tree/AbstractDataInnerIO.java         | 24 ++++++++++++++++++--
 3 files changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cbada393/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRow.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRow.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRow.java
index 57aeaef..b17baa2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRow.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheDataRow.java
@@ -54,4 +54,8 @@ public interface CacheDataRow extends CacheSearchRow {
      * @param key Key.
      */
     public void key(KeyCacheObject key);
+
+    public long mvccUpdateCounter();
+
+    public long mvccUpdateTopologyVersion();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cbada393/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheSearchRow.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheSearchRow.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheSearchRow.java
index 1637eb0..48ff90a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheSearchRow.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/CacheSearchRow.java
@@ -42,4 +42,8 @@ public interface CacheSearchRow {
      * @return Cache ID or {@code 0} if cache ID is not defined.
      */
     public int cacheId();
+
+    public long mvccUpdateCounter();
+
+    public long mvccUpdateTopologyVersion();
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/cbada393/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/AbstractDataInnerIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/AbstractDataInnerIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/AbstractDataInnerIO.java
index 03e23ff..ac8767d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/AbstractDataInnerIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/tree/AbstractDataInnerIO.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.tree;
 
 import org.apache.ignite.internal.pagemem.PageUtils;
 import org.apache.ignite.internal.processors.cache.GridCacheUtils;
+import org.apache.ignite.internal.processors.cache.mvcc.TxMvccVersion;
 import org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter;
 import org.apache.ignite.internal.processors.cache.persistence.CacheSearchRow;
 import org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree;
@@ -45,12 +46,26 @@ public abstract class AbstractDataInnerIO extends BPlusInnerIO<CacheSearchRow>
i
         assert row.link() != 0;
 
         PageUtils.putLong(pageAddr, off, row.link());
-        PageUtils.putInt(pageAddr, off + 8, row.hash());
+        off += 8;
+
+        PageUtils.putInt(pageAddr, off, row.hash());
+        off += 4;
 
         if (storeCacheId()) {
             assert row.cacheId() != GridCacheUtils.UNDEFINED_CACHE_ID : row;
 
-            PageUtils.putInt(pageAddr, off + 12, row.cacheId());
+            PageUtils.putInt(pageAddr, off, row.cacheId());
+            off += 4;
+        }
+
+        if (storeMvccVersion()) {
+            assert row.mvccUpdateTopologyVersion() > 0 : row;
+            assert row.mvccUpdateCounter() != TxMvccVersion.COUNTER_NA : row;
+
+            PageUtils.putLong(pageAddr, off, row.mvccUpdateTopologyVersion());
+            off += 8;
+
+            PageUtils.putLong(pageAddr, off, row.mvccUpdateCounter());
         }
     }
 
@@ -106,4 +121,9 @@ public abstract class AbstractDataInnerIO extends BPlusInnerIO<CacheSearchRow>
i
      * @return {@code True} if cache ID has to be stored.
      */
     protected abstract boolean storeCacheId();
+
+    /**
+     * @return {@code True} if mvcc version has to be stored.
+     */
+    protected abstract boolean storeMvccVersion();
 }


Mime
View raw message