ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [22/25] ignite git commit: Merge remote-tracking branch 'remotes/community/ignite-gg-8.0.2.ea2' into ignite-gg-11810
Date Wed, 11 Jan 2017 13:22:56 GMT
Merge remote-tracking branch 'remotes/community/ignite-gg-8.0.2.ea2' into ignite-gg-11810

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoStoreImpl.java
#	modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/IgniteWriteAheadLogNoopManager.java
#	modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/MetaPageUpdateLastSuccessfulFullSnapshotId.java
#	modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/MetaPageUpdateLastSuccessfulSnapshotId.java
#	modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/MetaPageUpdateNextSnapshotId.java
#	modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PageListMetaResetCountRecord.java
#	modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/TrackingPageDeltaRecord.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageMetaIO.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/TrackingPageIO.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageHandler.java


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

Branch: refs/heads/ignite-gg-11810
Commit: 9876950e729113dd590def6c16309b7d91c753b6
Parents: 4183186
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Dec 29 14:17:26 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Dec 29 14:17:26 2016 +0300

----------------------------------------------------------------------
 .../MetaPageUpdateLastSuccessfulSnapshotId.java |  1 -
 .../record/delta/TrackingPageDeltaRecord.java   |  3 +-
 .../cache/database/tree/io/PageMetaIO.java      | 72 ++++++++---------
 .../cache/database/tree/io/TrackingPageIO.java  | 82 ++++++++++----------
 4 files changed, 78 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9876950e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/MetaPageUpdateLastSuccessfulSnapshotId.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/MetaPageUpdateLastSuccessfulSnapshotId.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/MetaPageUpdateLastSuccessfulSnapshotId.java
index ce2453e..98502a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/MetaPageUpdateLastSuccessfulSnapshotId.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/MetaPageUpdateLastSuccessfulSnapshotId.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal.pagemem.wal.record.delta;
 
-import java.nio.ByteBuffer;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.processors.cache.database.tree.io.PageMetaIO;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/9876950e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/TrackingPageDeltaRecord.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/TrackingPageDeltaRecord.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/TrackingPageDeltaRecord.java
index 7daac81..a76ed48 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/TrackingPageDeltaRecord.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/TrackingPageDeltaRecord.java
@@ -17,7 +17,6 @@
 
 package org.apache.ignite.internal.pagemem.wal.record.delta;
 
-import java.nio.ByteBuffer;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.processors.cache.database.tree.io.TrackingPageIO;
 
@@ -71,7 +70,7 @@ public class TrackingPageDeltaRecord extends PageDeltaRecord {
 
     /** {@inheritDoc} */
     @Override public void applyDelta(long pageAddr, int pageSize) throws IgniteCheckedException
{
-        TrackingPageIO.VERSIONS.forPage(pageAddr).markChanged(pageAddr, pageIdToMark, nextSnapshotId,
lastSuccessfulSnapshotId, buf.capacity());
+        TrackingPageIO.VERSIONS.forPage(pageAddr).markChanged(pageAddr, pageIdToMark, nextSnapshotId,
lastSuccessfulSnapshotId, pageSize);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/9876950e/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 5e6dd87..11a2643 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
@@ -74,30 +74,30 @@ public class PageMetaIO extends PageIO {
     @Override public void initNewPage(long pageAddr, long pageId, int pageSize) {
         super.initNewPage(pageAddr, pageId, pageSize);
 
-        setTreeRoot(buf, 0);
-        setReuseListRoot(buf, 0);
-        setLastSuccessfulFullSnapshotId(buf, 0);
-        setLastSuccessfulSnapshotId(buf, 0);
-        setNextSnapshotTag(buf, 1);
-        setLastSuccessfulSnapshotTag(buf, 0);
-        setLastAllocatedIndex(buf, 0);
-        setCandidateAllocatedIndex(buf, 0);
+        setTreeRoot(pageAddr, 0);
+        setReuseListRoot(pageAddr, 0);
+        setLastSuccessfulFullSnapshotId(pageAddr, 0);
+        setLastSuccessfulSnapshotId(pageAddr, 0);
+        setNextSnapshotTag(pageAddr, 1);
+        setLastSuccessfulSnapshotTag(pageAddr, 0);
+        setLastAllocatedIndex(pageAddr, 0);
+        setCandidateAllocatedIndex(pageAddr, 0);
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @return Tree root page.
      */
-    public long getTreeRoot(ByteBuffer buf) {
-        return buf.getLong(TREE_ROOT_OFF);
+    public long getTreeRoot(long pageAddr) {
+        return PageUtils.getLong(pageAddr, TREE_ROOT_OFF);
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param treeRoot Tree root
      */
-    public void setTreeRoot(@NotNull ByteBuffer buf, long treeRoot) {
-        buf.putLong(TREE_ROOT_OFF, treeRoot);
+    public void setTreeRoot(long pageAddr, long treeRoot) {
+        PageUtils.putLong(pageAddr, TREE_ROOT_OFF, treeRoot);
     }
 
     /**
@@ -117,63 +117,63 @@ public class PageMetaIO extends PageIO {
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param lastSuccessfulSnapshotId Last successful snapshot id.
      */
-    public void setLastSuccessfulSnapshotId(@NotNull ByteBuffer buf, long lastSuccessfulSnapshotId)
{
-        buf.putLong(LAST_SUCCESSFUL_SNAPSHOT_ID_OFF, lastSuccessfulSnapshotId);
+    public void setLastSuccessfulSnapshotId(long pageAddr, long lastSuccessfulSnapshotId)
{
+        PageUtils.putLong(pageAddr, LAST_SUCCESSFUL_SNAPSHOT_ID_OFF, lastSuccessfulSnapshotId);
     }
 
     /**
      * @param pageAddr Page address.
      */
-    public long getLastSuccessfulSnapshotId(@NotNull ByteBuffer buf) {
-        return buf.getLong(LAST_SUCCESSFUL_SNAPSHOT_ID_OFF);
+    public long getLastSuccessfulSnapshotId(long pageAddr) {
+        return PageUtils.getLong(pageAddr, LAST_SUCCESSFUL_SNAPSHOT_ID_OFF);
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param lastSuccessfulFullSnapshotId Last successful full snapshot id.
      */
-    public void setLastSuccessfulFullSnapshotId(@NotNull ByteBuffer buf, long lastSuccessfulFullSnapshotId)
{
-        buf.putLong(LAST_SUCCESSFUL_FULL_SNAPSHOT_ID_OFF, lastSuccessfulFullSnapshotId);
+    public void setLastSuccessfulFullSnapshotId(long pageAddr, long lastSuccessfulFullSnapshotId)
{
+        PageUtils.putLong(pageAddr, LAST_SUCCESSFUL_FULL_SNAPSHOT_ID_OFF, lastSuccessfulFullSnapshotId);
     }
 
     /**
      * @param pageAddr Page address.
      */
-    public long getLastSuccessfulFullSnapshotId(@NotNull ByteBuffer buf) {
-        return buf.getLong(LAST_SUCCESSFUL_FULL_SNAPSHOT_ID_OFF);
+    public long getLastSuccessfulFullSnapshotId(long pageAddr) {
+        return PageUtils.getLong(pageAddr, LAST_SUCCESSFUL_FULL_SNAPSHOT_ID_OFF);
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param nextSnapshotId Next snapshot id.
      */
-    public void setNextSnapshotTag(@NotNull ByteBuffer buf, long nextSnapshotId) {
-        buf.putLong(NEXT_SNAPSHOT_TAG_OFF, nextSnapshotId);
+    public void setNextSnapshotTag(long pageAddr, long nextSnapshotId) {
+        PageUtils.putLong(pageAddr, NEXT_SNAPSHOT_TAG_OFF, nextSnapshotId);
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      */
-    public long getLastSuccessfulSnapshotTag(@NotNull ByteBuffer buf) {
-        return buf.getLong(LAST_SUCCESSFUL_FULL_SNAPSHOT_TAG_OFF);
+    public long getLastSuccessfulSnapshotTag(long pageAddr) {
+        return PageUtils.getLong(pageAddr, LAST_SUCCESSFUL_FULL_SNAPSHOT_TAG_OFF);
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param lastSuccessfulSnapshotTag Last successful snapshot tag.
      */
-    public void setLastSuccessfulSnapshotTag(@NotNull ByteBuffer buf, long lastSuccessfulSnapshotTag)
{
-        buf.putLong(LAST_SUCCESSFUL_FULL_SNAPSHOT_TAG_OFF, lastSuccessfulSnapshotTag);
+    public void setLastSuccessfulSnapshotTag(long pageAddr, long lastSuccessfulSnapshotTag)
{
+        PageUtils.putLong(pageAddr, LAST_SUCCESSFUL_FULL_SNAPSHOT_TAG_OFF, lastSuccessfulSnapshotTag);
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      */
-    public long getNextSnapshotTag(@NotNull ByteBuffer buf) {
-        return buf.getLong(NEXT_SNAPSHOT_TAG_OFF);
+    public long getNextSnapshotTag(long pageAddr) {
+        return PageUtils.getLong(pageAddr, NEXT_SNAPSHOT_TAG_OFF);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/9876950e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/TrackingPageIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/TrackingPageIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/TrackingPageIO.java
index a2fed21..6ecd9ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/TrackingPageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/TrackingPageIO.java
@@ -71,13 +71,13 @@ public class TrackingPageIO extends PageIO {
     /**
      * Will mark pageId as changed for next (!) snapshotId
      *
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param pageId Page id.
      * @param nextSnapshotTag tag of next snapshot.
      * @param pageSize Page size.
      */
-    public boolean markChanged(ByteBuffer buf, long pageId, long nextSnapshotTag, long lastSuccessfulSnapshotTag,
int pageSize) {
-        validateSnapshotId(buf, nextSnapshotTag, lastSuccessfulSnapshotTag, pageSize);
+    public boolean markChanged(long pageAddr, long pageId, long nextSnapshotTag, long lastSuccessfulSnapshotTag,
int pageSize) {
+        validateSnapshotId(pageAddr, nextSnapshotTag, lastSuccessfulSnapshotTag, pageSize);
 
         int cntOfPage = countOfPageToTrack(pageSize);
 
@@ -87,7 +87,7 @@ public class TrackingPageIO extends PageIO {
 
         int idx = sizeOff + SIZE_FIELD_SIZE + (idxToUpdate >> 3);
 
-        byte byteToUpdate = PageUtils.getByte(buf, idx);
+        byte byteToUpdate = PageUtils.getByte(pageAddr, idx);
 
         int updateTemplate = 1 << (idxToUpdate & 0b111);
 
@@ -96,28 +96,28 @@ public class TrackingPageIO extends PageIO {
         if (byteToUpdate == newVal)
             return false;
 
-        buf.put(idx, newVal);
+        PageUtils.putByte(pageAddr, idx, newVal);
 
-        short newSize = (short)(buf.getShort(sizeOff) + 1);
+        short newSize = (short)(PageUtils.getShort(pageAddr, sizeOff) + 1);
 
-        buf.putShort(sizeOff, newSize);
+        PageUtils.putShort(pageAddr, sizeOff, newSize);
 
-        assert newSize == countOfChangedPage(buf, nextSnapshotTag, pageSize);
+        assert newSize == countOfChangedPage(pageAddr, nextSnapshotTag, pageSize);
 
         return true;
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param nextSnapshotTag Next snapshot id.
      * @param lastSuccessfulSnapshotId Last successful snapshot id.
      * @param pageSize Page size.
      */
-    private void validateSnapshotId(ByteBuffer buf, long nextSnapshotTag, long lastSuccessfulSnapshotId,
int pageSize) {
+    private void validateSnapshotId(long pageAddr, long nextSnapshotTag, long lastSuccessfulSnapshotId,
int pageSize) {
         assert nextSnapshotTag != lastSuccessfulSnapshotId : "nextSnapshotTag = " + nextSnapshotTag
+
             ", lastSuccessfulSnapshotId = " + lastSuccessfulSnapshotId;
 
-        long last = getLastSnapshotTag(buf);
+        long last = getLastSnapshotTag(pageAddr);
 
         assert last <= nextSnapshotTag : "last = " + last + ", nextSnapshotTag = " + nextSnapshotTag;
 
@@ -127,9 +127,9 @@ public class TrackingPageIO extends PageIO {
         int cntOfPage = countOfPageToTrack(pageSize);
 
         if (last <= lastSuccessfulSnapshotId) { //we can drop our data
-            buf.putLong(LAST_SNAPSHOT_TAG_OFFSET, nextSnapshotTag);
+            PageUtils.putLong(pageAddr, LAST_SNAPSHOT_TAG_OFFSET, nextSnapshotTag);
 
-            PageHandler.zeroMemory(buf, SIZE_FIELD_OFFSET, buf.capacity() - SIZE_FIELD_OFFSET);
+            PageHandler.zeroMemory(pageAddr, SIZE_FIELD_OFFSET, pageSize - SIZE_FIELD_OFFSET);
         } else { //we can't drop data, it is still necessary for incremental snapshots
             int len = cntOfPage >> 3;
 
@@ -139,55 +139,55 @@ public class TrackingPageIO extends PageIO {
             if (last - lastSuccessfulSnapshotId == 1) { //we should keep only data in last
half
                 //new data will be written in the same half, we should move old data to another
half
                 if ((nextSnapshotTag - last) % 2 == 0)
-                    PageHandler.copyMemory(buf, buf, sizeOff, sizeOff2, len + SIZE_FIELD_SIZE);
+                    PageHandler.copyMemory(pageAddr, pageAddr, sizeOff, sizeOff2, len + SIZE_FIELD_SIZE);
             } else { //last - lastSuccessfulSnapshotId > 1, e.g. we should merge two half
in one
                 int newSize = 0;
                 int i = 0;
 
                 for (; i < len - 8; i += 8) {
-                    long newVal = PageUtils.getLong(buf, sizeOff + SIZE_FIELD_SIZE + i) |
PageUtils.getLong(buf, sizeOff2 + SIZE_FIELD_SIZE + i);
+                    long newVal = PageUtils.getLong(pageAddr, sizeOff + SIZE_FIELD_SIZE +
i) | PageUtils.getLong(pageAddr, sizeOff2 + SIZE_FIELD_SIZE + i);
 
                     newSize += Long.bitCount(newVal);
 
-                    PageUtils.putLong(buf, sizeOff2 + SIZE_FIELD_SIZE + i, newVal);
+                    PageUtils.putLong(pageAddr, sizeOff2 + SIZE_FIELD_SIZE + i, newVal);
                 }
 
                 for (; i < len; i ++) {
-                    byte newVal = (byte) (buf.get(sizeOff + SIZE_FIELD_SIZE + i) | buf.get(sizeOff2
+ SIZE_FIELD_SIZE + i));
+                    byte newVal = (byte)(PageUtils.getByte(pageAddr, sizeOff + SIZE_FIELD_SIZE
+ i) | PageUtils.getByte(pageAddr, sizeOff2 + SIZE_FIELD_SIZE + i));
 
                     newSize += Integer.bitCount(newVal & 0xFF);
 
-                    PageUtils.putByte(buf, sizeOff2 + SIZE_FIELD_SIZE + i, newVal);
+                    PageUtils.putByte(pageAddr, sizeOff2 + SIZE_FIELD_SIZE + i, newVal);
                 }
 
-                PageUtils.putShort(buf, sizeOff2, (short)newSize);
+                PageUtils.putShort(pageAddr, sizeOff2, (short)newSize);
             }
 
-            buf.putLong(LAST_SNAPSHOT_TAG_OFFSET, nextSnapshotTag);
+            PageUtils.putLong(pageAddr, LAST_SNAPSHOT_TAG_OFFSET, nextSnapshotTag);
 
-            PageHandler.zeroMemory(buf, sizeOff, len + SIZE_FIELD_SIZE);
+            PageHandler.zeroMemory(pageAddr, sizeOff, len + SIZE_FIELD_SIZE);
         }
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      */
-    long getLastSnapshotTag(ByteBuffer buf) {
-        return buf.getLong(LAST_SNAPSHOT_TAG_OFFSET);
+    long getLastSnapshotTag(long pageAddr) {
+        return PageUtils.getLong(pageAddr, LAST_SNAPSHOT_TAG_OFFSET);
     }
 
     /**
      * Check that pageId was marked as changed between previous snapshot finish and current
snapshot start.
      *
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param pageId Page id.
      * @param curSnapshotTag Snapshot tag.
      * @param pageSize Page size.
      */
-    public boolean wasChanged(ByteBuffer buf, long pageId, long curSnapshotTag, long lastSuccessfulSnapshotTag,
int pageSize) {
-        validateSnapshotId(buf, curSnapshotTag + 1, lastSuccessfulSnapshotTag, pageSize);
+    public boolean wasChanged(long pageAddr, long pageId, long curSnapshotTag, long lastSuccessfulSnapshotTag,
int pageSize) {
+        validateSnapshotId(pageAddr, curSnapshotTag + 1, lastSuccessfulSnapshotTag, pageSize);
 
-        if (countOfChangedPage(buf, curSnapshotTag, pageSize) < 1)
+        if (countOfChangedPage(pageAddr, curSnapshotTag, pageSize) < 1)
             return false;
 
         int cntOfPage = countOfPageToTrack(pageSize);
@@ -197,9 +197,9 @@ public class TrackingPageIO extends PageIO {
         byte byteToTest;
 
         if (useLeftHalf(curSnapshotTag))
-            byteToTest = buf.get(BITMAP_OFFSET + (idxToTest >> 3));
+            byteToTest = PageUtils.getByte(pageAddr, BITMAP_OFFSET + (idxToTest >>
3));
         else
-            byteToTest = PageUtils.getByte(buf, BITMAP_OFFSET + SIZE_FIELD_SIZE + ((idxToTest
+ cntOfPage) >> 3));
+            byteToTest = PageUtils.getByte(pageAddr, BITMAP_OFFSET + SIZE_FIELD_SIZE + ((idxToTest
+ cntOfPage) >> 3));
 
         int testTemplate = 1 << (idxToTest & 0b111);
 
@@ -207,22 +207,22 @@ public class TrackingPageIO extends PageIO {
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param snapshotTag Snapshot tag.
      * @param pageSize Page size.
      *
      * @return count of pages which were marked as change for given snapshotTag
      */
-    public short countOfChangedPage(ByteBuffer buf, long snapshotTag, int pageSize) {
-        long dif = getLastSnapshotTag(buf) - snapshotTag;
+    public short countOfChangedPage(long pageAddr, long snapshotTag, int pageSize) {
+        long dif = getLastSnapshotTag(pageAddr) - snapshotTag;
 
         if (dif != 0 && dif != 1)
             return -1;
 
         if (useLeftHalf(snapshotTag))
-            return buf.getShort(SIZE_FIELD_OFFSET);
+            return PageUtils.getShort(pageAddr, SIZE_FIELD_OFFSET);
         else
-            return PageUtils.getShort(buf, BITMAP_OFFSET + (countOfPageToTrack(pageSize)
>> 3));
+            return PageUtils.getShort(pageAddr, BITMAP_OFFSET + (countOfPageToTrack(pageSize)
>> 3));
     }
 
     /**
@@ -262,14 +262,14 @@ public class TrackingPageIO extends PageIO {
     }
 
     /**
-     * @param buf Buffer.
+     * @param pageAddr Page address.
      * @param start Start.
      * @param curSnapshotTag Snapshot id.
      * @param pageSize Page size.
      * @return set pageId if it was changed or next closest one, if there is no changed page
null will be returned
      */
-    public Long findNextChangedPage(ByteBuffer buf, long start, long curSnapshotTag, long
lastSuccessfulSnapshotTag, int pageSize) {
-        validateSnapshotId(buf, curSnapshotTag + 1, lastSuccessfulSnapshotTag, pageSize);
+    public Long findNextChangedPage(long pageAddr, long start, long curSnapshotTag, long
lastSuccessfulSnapshotTag, int pageSize) {
+        validateSnapshotId(pageAddr, curSnapshotTag + 1, lastSuccessfulSnapshotTag, pageSize);
 
         int cntOfPage = countOfPageToTrack(pageSize);
 
@@ -278,7 +278,7 @@ public class TrackingPageIO extends PageIO {
         if (start == trackingPage)
             return trackingPage;
 
-        if (countOfChangedPage(buf, curSnapshotTag, pageSize) <= 0)
+        if (countOfChangedPage(pageAddr, curSnapshotTag, pageSize) <= 0)
             return null;
 
         int idxToStartTest = (PageIdUtils.pageIndex(start) - COUNT_OF_EXTRA_PAGE) % cntOfPage;
@@ -292,7 +292,7 @@ public class TrackingPageIO extends PageIO {
         int stopIdx = zeroIdx + (cntOfPage >> 3);
 
         while (idx < stopIdx) {
-            byte byteToTest = PageUtils.getByte(buf, idx);
+            byte byteToTest = PageUtils.getByte(pageAddr, idx);
 
             if (byteToTest != 0) {
                 int foundSetBit;
@@ -302,7 +302,7 @@ public class TrackingPageIO extends PageIO {
                         PageIdUtils.flag(start),
                         PageIdUtils.pageIndex(trackingPage) + ((idx - zeroIdx) << 3)
+ foundSetBit);
 
-                    assert wasChanged(buf, foundPageId, curSnapshotTag, lastSuccessfulSnapshotTag,
pageSize);
+                    assert wasChanged(pageAddr, foundPageId, curSnapshotTag, lastSuccessfulSnapshotTag,
pageSize);
                     assert trackingPageFor(foundPageId, pageSize) == trackingPage;
 
                     return foundPageId;


Mime
View raw message