ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [04/50] [abbrv] ignite git commit: ignite-db-x - get rid of pageId
Date Mon, 10 Oct 2016 14:57:09 GMT
ignite-db-x -  get rid of pageId


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

Branch: refs/heads/ignite-gg-8-io2-park
Commit: 7d05c09a4928fd9094c0bcf8b1689e8c1dab7e98
Parents: 0fb3e40
Author: Sergi Vladykin <sergi.vladykin@gmail.com>
Authored: Mon Sep 26 20:20:56 2016 +0300
Committer: Sergi Vladykin <sergi.vladykin@gmail.com>
Committed: Mon Sep 26 20:20:56 2016 +0300

----------------------------------------------------------------------
 .../cache/database/DataStructure.java           |  16 +-
 .../cache/database/freelist/FreeListImpl.java   |  10 +-
 .../cache/database/freelist/PagesList.java      |  46 +++---
 .../cache/database/tree/BPlusTree.java          | 146 +++++++++----------
 .../cache/database/tree/util/PageHandler.java   |  36 ++---
 .../database/tree/util/PageLockListener.java    |   6 +-
 .../database/BPlusTreeReuseSelfTest.java        |   8 +-
 .../processors/database/BPlusTreeSelfTest.java  |  12 +-
 8 files changed, 125 insertions(+), 155 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7d05c09a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/DataStructure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/DataStructure.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/DataStructure.java
index 1aaad08..490f009 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/DataStructure.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/DataStructure.java
@@ -131,12 +131,11 @@ public abstract class DataStructure implements PageLockListener {
     }
 
     /**
-     * @param pageId Virtual page ID.
      * @param page Page.
      * @return Buffer.
      */
-    protected final ByteBuffer tryWriteLock(long pageId, Page page) {
-        onBeforeWriteLock(pageId, page);
+    protected final ByteBuffer tryWriteLock(Page page) {
+        onBeforeWriteLock(page);
 
         ByteBuffer buf = page.tryGetForWrite();
 
@@ -147,12 +146,11 @@ public abstract class DataStructure implements PageLockListener {
 
 
     /**
-     * @param pageId Virtual page ID.
      * @param page Page.
      * @return Buffer.
      */
-    protected final ByteBuffer writeLock(long pageId, Page page) {
-        onBeforeWriteLock(pageId, page);
+    protected final ByteBuffer writeLock(Page page) {
+        onBeforeWriteLock(page);
 
         ByteBuffer buf = page.getForWrite();
 
@@ -178,7 +176,7 @@ public abstract class DataStructure implements PageLockListener {
      * @return Buffer.
      */
     protected final ByteBuffer readLock(long pageId, Page page) {
-        onBeforeReadLock(pageId, page);
+        onBeforeReadLock(page);
 
         ByteBuffer buf = page.getForRead();
 
@@ -198,7 +196,7 @@ public abstract class DataStructure implements PageLockListener {
     }
 
     /** {@inheritDoc} */
-    @Override public void onBeforeWriteLock(long pageId, Page page) {
+    @Override public void onBeforeWriteLock(Page page) {
         // No-op.
     }
 
@@ -213,7 +211,7 @@ public abstract class DataStructure implements PageLockListener {
     }
 
     /** {@inheritDoc} */
-    @Override public void onBeforeReadLock(long pageId, Page page) {
+    @Override public void onBeforeReadLock(Page page) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d05c09a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java
index f9faf96..748dea0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/FreeListImpl.java
@@ -66,7 +66,7 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList {
     /** */
     private final PageHandler<CacheDataRow, Integer> writeRow =
         new PageHandler<CacheDataRow, Integer>() {
-            @Override public Integer run(long pageId, Page page, PageIO iox, ByteBuffer buf, CacheDataRow row, int written)
+            @Override public Integer run(Page page, PageIO iox, ByteBuffer buf, CacheDataRow row, int written)
                 throws IgniteCheckedException {
                 DataPageIO io = (DataPageIO)iox;
 
@@ -173,7 +173,7 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList {
 
     /** */
     private final PageHandler<Void, Long> rmvRow = new PageHandler<Void, Long>() {
-        @Override public Long run(long pageId, Page page, PageIO iox, ByteBuffer buf, Void arg, int itemId)
+        @Override public Long run(Page page, PageIO iox, ByteBuffer buf, Void arg, int itemId)
             throws IgniteCheckedException {
             DataPageIO io = (DataPageIO)iox;
 
@@ -318,7 +318,7 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList {
                 // If it is an existing page, we do not need to initialize it.
                 DataPageIO init = reuseBucket || pageId == 0L ? DataPageIO.VERSIONS.latest() : null;
 
-                written = writePage(page.id(), page, this, writeRow, init, wal, row, written);
+                written = writePage(page, this, writeRow, init, wal, row, written);
             }
         }
         while (written != COMPLETE);
@@ -334,7 +334,7 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList {
         long nextLink;
 
         try (Page page = pageMem.page(cacheId, pageId)) {
-            nextLink = writePage(pageId, page, this, rmvRow, null, itemId);
+            nextLink = writePage(page, this, rmvRow, null, itemId);
         }
 
         while (nextLink != 0) {
@@ -342,7 +342,7 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList {
             pageId = PageIdUtils.pageId(nextLink);
 
             try (Page page = pageMem.page(cacheId, pageId)) {
-                nextLink = writePage(pageId, page, this, rmvRow, null, itemId);
+                nextLink = writePage(page, this, rmvRow, null, itemId);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d05c09a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
index 017a6a4..7a6bfa2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/freelist/PagesList.java
@@ -83,10 +83,9 @@ public abstract class PagesList extends DataStructure {
 
     /** */
     private final PageHandler<Void, Boolean> cutTail = new PageHandler<Void, Boolean>() {
-        @Override public Boolean run(long pageId, Page page, PageIO pageIo, ByteBuffer buf, Void ignore, int bucket)
+        @Override public Boolean run(Page page, PageIO pageIo, ByteBuffer buf, Void ignore, int bucket)
             throws IgniteCheckedException {
-            if (getPageId(buf) != pageId)
-                return Boolean.FALSE;
+            assert getPageId(buf) == page.id();
 
             PagesListNodeIO io = (PagesListNodeIO)pageIo;
 
@@ -97,9 +96,9 @@ public abstract class PagesList extends DataStructure {
             io.setNextId(buf, 0L);
 
             if (isWalDeltaRecordNeeded(wal, page))
-                wal.log(new PagesListSetNextRecord(cacheId, pageId, 0L));
+                wal.log(new PagesListSetNextRecord(cacheId, page.id(), 0L));
 
-            updateTail(bucket, tailId, pageId);
+            updateTail(bucket, tailId, page.id());
 
             return Boolean.TRUE;
         }
@@ -138,7 +137,7 @@ public abstract class PagesList extends DataStructure {
         if (metaPageId != 0L) {
             if (initNew) {
                 try (Page page = page(metaPageId)) {
-                    initPage(metaPageId, page, this, PagesListMetaIO.VERSIONS.latest(), wal);
+                    initPage(page, this, PagesListMetaIO.VERSIONS.latest(), wal);
                 }
             }
             else {
@@ -222,7 +221,7 @@ public abstract class PagesList extends DataStructure {
                                 }
 
                                 curPage = page(nextPageId);
-                                curBuf = writeLock(nextPageId, curPage);
+                                curBuf = writeLock(curPage);
 
                                 curIo = PagesListMetaIO.VERSIONS.latest();
 
@@ -233,7 +232,7 @@ public abstract class PagesList extends DataStructure {
                                 curPage = null;
 
                                 curPage = page(nextPageId);
-                                curBuf = writeLock(nextPageId, curPage);
+                                curBuf = writeLock(curPage);
 
                                 curIo = PagesListMetaIO.VERSIONS.forPage(curBuf);
 
@@ -254,7 +253,7 @@ public abstract class PagesList extends DataStructure {
 
         while (nextPageId != 0L) {
             try (Page page = page(nextPageId)) {
-                ByteBuffer buf = writeLock(nextPageId, page);
+                ByteBuffer buf = writeLock(page);
 
                 try {
                     PagesListMetaIO io = PagesListMetaIO.VERSIONS.forPage(buf);
@@ -335,7 +334,7 @@ public abstract class PagesList extends DataStructure {
         long pageId = reuse ? allocatePage(null) : allocatePageNoReuse();
 
         try (Page page = page(pageId)) {
-            initPage(pageId, page, this, PagesListNodeIO.VERSIONS.latest(), wal);
+            initPage(page, this, PagesListNodeIO.VERSIONS.latest(), wal);
         }
 
         Stripe stripe = new Stripe(pageId);
@@ -498,7 +497,7 @@ public abstract class PagesList extends DataStructure {
             long tailId = stripe.tailId;
 
             try (Page tail = page(tailId)) {
-                ByteBuffer buf = writeLockPage(tailId, tail, bucket, lockAttempt++);
+                ByteBuffer buf = writeLockPage(tail, bucket, lockAttempt++);
 
                 if (buf == null)
                     continue;
@@ -626,7 +625,7 @@ public abstract class PagesList extends DataStructure {
             long nextId = allocatePage(null);
 
             try (Page next = page(nextId)) {
-                ByteBuffer nextBuf = writeLock(nextId, next);
+                ByteBuffer nextBuf = writeLock(next);
 
                 try {
                     setupNextPage(io, pageId, buf, nextId, nextBuf);
@@ -701,7 +700,7 @@ public abstract class PagesList extends DataStructure {
 
                 if (idx == -1) { // Attempt to add page failed: the node page is full.
                     try (Page next = page(nextId)) {
-                        ByteBuffer nextBuf = writeLock(nextId, next);
+                        ByteBuffer nextBuf = writeLock(next);
 
                         if (locked == null) {
                             locked = new ArrayList<>(2);
@@ -772,16 +771,15 @@ public abstract class PagesList extends DataStructure {
     }
 
     /**
-     * @param pageId Page ID.
      * @param page Page.
      * @param bucket Bucket.
      * @param lockAttempt Lock attempts counter.
      * @return Buffer if page is locket of {@code null} if can retry lock.
      * @throws IgniteCheckedException If failed.
      */
-    @Nullable private ByteBuffer writeLockPage(long pageId, Page page, int bucket, int lockAttempt)
+    @Nullable private ByteBuffer writeLockPage(Page page, int bucket, int lockAttempt)
         throws IgniteCheckedException {
-        ByteBuffer buf = tryWriteLock(pageId, page);
+        ByteBuffer buf = tryWriteLock(page);
 
         if (buf != null)
             return buf;
@@ -796,7 +794,7 @@ public abstract class PagesList extends DataStructure {
             }
         }
 
-        return lockAttempt < TRY_LOCK_ATTEMPTS ? null : writeLock(pageId, page);
+        return lockAttempt < TRY_LOCK_ATTEMPTS ? null : writeLock(page);
     }
 
     /**
@@ -817,7 +815,7 @@ public abstract class PagesList extends DataStructure {
             long tailId = stripe.tailId;
 
             try (Page tail = page(tailId)) {
-                ByteBuffer tailBuf = writeLockPage(tailId, tail, bucket, lockAttempt++);
+                ByteBuffer tailBuf = writeLockPage(tail, bucket, lockAttempt++);
 
                 if (tailBuf == null)
                     continue;
@@ -850,7 +848,7 @@ public abstract class PagesList extends DataStructure {
                     if (prevId != 0L) {
                         try (Page prev = page(prevId)) {
                             // Lock pages from next to previous.
-                            Boolean ok = writePage(prevId, prev, this, cutTail, null, bucket);
+                            Boolean ok = writePage(prev, this, cutTail, null, bucket);
 
                             assert ok;
                         }
@@ -917,7 +915,7 @@ public abstract class PagesList extends DataStructure {
 
             long recycleId = 0L;
 
-            ByteBuffer buf = writeLock(pageId, page);
+            ByteBuffer buf = writeLock(page);
 
             boolean rmvd = false;
 
@@ -986,7 +984,7 @@ public abstract class PagesList extends DataStructure {
 
         if (prevId != 0L) { // Cut tail if we have a previous page.
             try (Page prev = page(prevId)) {
-                Boolean ok = writePage(prevId, prev, this, cutTail, null, bucket);
+                Boolean ok = writePage(prev, this, cutTail, null, bucket);
 
                 assert ok; // Because we keep lock on current tail and do a world consistency check.
             }
@@ -1014,8 +1012,8 @@ public abstract class PagesList extends DataStructure {
             try (Page next = nextId == 0L ? null : page(nextId)) {
                 boolean write = false;
 
-                ByteBuffer nextBuf = next == null ? null : writeLock(nextId, next);
-                ByteBuffer buf = writeLock(pageId, page);
+                ByteBuffer nextBuf = next == null ? null : writeLock(next);
+                ByteBuffer buf = writeLock(page);
 
                 try {
                     if (getPageId(buf) != pageId)
@@ -1112,7 +1110,7 @@ public abstract class PagesList extends DataStructure {
         ByteBuffer nextBuf)
         throws IgniteCheckedException {
         try (Page prev = page(prevId)) {
-            ByteBuffer prevBuf = writeLock(prevId, prev);
+            ByteBuffer prevBuf = writeLock(prev);
 
             try {
                 assert getPageId(prevBuf) == prevId; // Because we keep a reference.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d05c09a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
index 882f0ac..fc89ec6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java
@@ -193,7 +193,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Get> askNeighbor = new GetPageHandler<Get>() {
-        @Override public Result run0(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, Get g, int isBack) {
+        @Override public Result run0(Page page, ByteBuffer buf, BPlusIO<L> io, Get g, int isBack) {
             assert !io.isLeaf(); // Inner page.
 
             boolean back = isBack == TRUE.ordinal();
@@ -220,7 +220,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Get> search = new GetPageHandler<Get>() {
-        @Override public Result run0(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, Get g, int lvl)
+        @Override public Result run0(Page page, ByteBuffer buf, BPlusIO<L> io, Get g, int lvl)
             throws IgniteCheckedException {
             // Check the triangle invariant.
             if (io.getForward(buf) != g.fwdId)
@@ -299,7 +299,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Put> replace = new GetPageHandler<Put>() {
-        @Override public Result run0(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, Put p, int lvl)
+        @Override public Result run0(Page page, ByteBuffer buf, BPlusIO<L> io, Put p, int lvl)
             throws IgniteCheckedException {
             assert p.btmLvl == 0 : "split is impossible with replace";
 
@@ -337,7 +337,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Put> insert = new GetPageHandler<Put>() {
-        @Override public Result run0(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, Put p, int lvl)
+        @Override public Result run0(Page page, ByteBuffer buf, BPlusIO<L> io, Put p, int lvl)
             throws IgniteCheckedException {
             assert p.btmLvl == lvl : "we must always insert at the bottom level: " + p.btmLvl + " " + lvl;
 
@@ -377,7 +377,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Remove> removeFromLeaf = new GetPageHandler<Remove>() {
-        @Override public Result run0(long leafId, Page leaf, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
+        @Override public Result run0(Page leaf, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
             throws IgniteCheckedException {
             assert lvl == 0 : lvl; // Leaf.
 
@@ -432,7 +432,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                 if (needReplaceInner)
                     r.needReplaceInner = TRUE;
 
-                Tail<L> t = r.addTail(leafId, leaf, buf, io, 0, Tail.EXACT);
+                Tail<L> t = r.addTail(leaf, buf, io, 0, Tail.EXACT);
 
                 t.idx = (short)idx;
 
@@ -449,7 +449,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Remove> lockBackAndRemoveFromLeaf = new GetPageHandler<Remove>() {
-        @Override protected Result run0(long backId, Page back, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
+        @Override protected Result run0(Page back, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
             throws IgniteCheckedException {
             // Check that we have consistent view of the world.
             if (io.getForward(buf) != r.pageId)
@@ -460,7 +460,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
             // Keep locks on back and leaf pages for subsequent merges.
             if (res == FOUND && r.tail != null)
-                r.addTail(backId, back, buf, io, lvl, Tail.BACK);
+                r.addTail(back, buf, io, lvl, Tail.BACK);
 
             return res;
         }
@@ -468,7 +468,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Remove> lockBackAndTail = new GetPageHandler<Remove>() {
-        @Override public Result run0(long backId, Page back, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
+        @Override public Result run0(Page back, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
             throws IgniteCheckedException {
             // Check that we have consistent view of the world.
             if (io.getForward(buf) != r.pageId)
@@ -478,7 +478,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
             Result res = r.doLockTail(lvl);
 
             if (res == FOUND)
-                r.addTail(backId, back, buf, io, lvl, Tail.BACK);
+                r.addTail(back, buf, io, lvl, Tail.BACK);
 
             return res;
         }
@@ -486,9 +486,9 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Remove> lockTailForward = new GetPageHandler<Remove>() {
-        @Override protected Result run0(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
+        @Override protected Result run0(Page page, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
             throws IgniteCheckedException {
-            r.addTail(pageId, page, buf, io, lvl, Tail.FORWARD);
+            r.addTail(page, buf, io, lvl, Tail.FORWARD);
 
             return FOUND;
         }
@@ -496,7 +496,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final GetPageHandler<Remove> lockTail = new GetPageHandler<Remove>() {
-        @Override public Result run0(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
+        @Override public Result run0(Page page, ByteBuffer buf, BPlusIO<L> io, Remove r, int lvl)
             throws IgniteCheckedException {
             assert lvl > 0 : lvl; // We are not at the bottom.
 
@@ -512,7 +512,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                     return res; // Retry.
             }
 
-            r.addTail(pageId, page, buf, io, lvl, Tail.EXACT);
+            r.addTail(page, buf, io, lvl, Tail.EXACT);
 
             return FOUND;
         }
@@ -520,7 +520,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final PageHandler<Void, Void> cutRoot = new PageHandler<Void, Void>() {
-        @Override public Void run(long metaId, Page meta, PageIO iox, ByteBuffer buf, Void ignore, int lvl)
+        @Override public Void run(Page meta, PageIO iox, ByteBuffer buf, Void ignore, int lvl)
             throws IgniteCheckedException {
             // Safe cast because we should never recycle meta page until the tree is destroyed.
             BPlusMetaIO io = (BPlusMetaIO)iox;
@@ -538,7 +538,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final PageHandler<Long, Void> addRoot = new PageHandler<Long, Void>() {
-        @Override public Void run(long metaId, Page meta, PageIO iox, ByteBuffer buf, Long rootPageId, int lvl)
+        @Override public Void run(Page meta, PageIO iox, ByteBuffer buf, Long rootPageId, int lvl)
             throws IgniteCheckedException {
             assert rootPageId != null;
 
@@ -558,7 +558,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
     /** */
     private final PageHandler<Long, Void> initRoot = new PageHandler<Long, Void>() {
-        @Override public Void run(long metaId, Page meta, PageIO iox, ByteBuffer buf, Long rootId, int lvl)
+        @Override public Void run(Page meta, PageIO iox, ByteBuffer buf, Long rootId, int lvl)
             throws IgniteCheckedException {
             assert rootId != null;
 
@@ -641,12 +641,12 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         long rootId = allocatePage(null);
 
         try (Page root = page(rootId)) {
-            initPage(rootId, root, this, latestLeafIO(), wal);
+            initPage(root, this, latestLeafIO(), wal);
         }
 
         // Initialize meta page with new root page.
         try (Page meta = page(metaPageId)) {
-            writePage(metaPageId, meta, this, initRoot, BPlusMetaIO.VERSIONS.latest(), wal, rootId, 0);
+            writePage(meta, this, initRoot, BPlusMetaIO.VERSIONS.latest(), wal, rootId, 0);
         }
     }
 
@@ -823,7 +823,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                 g.pageId = pageId;
                 g.fwdId = fwdId;
 
-                Result res = readPage(pageId, page, this, search, g, lvl);
+                Result res = readPage(page, this, search, g, lvl);
 
                 switch (res) {
                     case GO_DOWN:
@@ -857,7 +857,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
             }
         }
         finally {
-            if (g.canRelease(pageId, page, lvl))
+            if (g.canRelease(page, lvl))
                 page.close();
         }
     }
@@ -1342,7 +1342,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                 r.fwdId = fwdId;
                 r.backId = backId;
 
-                Result res = readPage(pageId, page, this, search, r, lvl);
+                Result res = readPage(page, this, search, r, lvl);
 
                 switch (res) {
                     case GO_DOWN_X:
@@ -1416,7 +1416,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         finally {
             r.page = null;
 
-            if (r.canRelease(pageId, page, lvl))
+            if (r.canRelease(page, lvl))
                 page.close();
         }
     }
@@ -1592,7 +1592,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         long pagesCnt = 0;
 
         try (Page meta = page(metaPageId)) {
-            ByteBuffer metaBuf = writeLock(metaPageId, meta); // No checks, we must be out of use.
+            ByteBuffer metaBuf = writeLock(meta); // No checks, we must be out of use.
 
             try {
                 for (long pageId : getFirstPageIds(metaBuf)) {
@@ -1600,7 +1600,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
                     do {
                         try (Page page = page(pageId)) {
-                            ByteBuffer buf = writeLock(pageId, page); // No checks, we must be out of use.
+                            ByteBuffer buf = writeLock(page); // No checks, we must be out of use.
 
                             try {
                                 BPlusIO<L> io = io(buf);
@@ -1753,7 +1753,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
      */
     private Result askNeighbor(long pageId, Get g, boolean back) throws IgniteCheckedException {
         try (Page page = page(pageId)) {
-            return readPage(pageId, page, this, askNeighbor, g,
+            return readPage(page, this, askNeighbor, g,
                 back ? TRUE.ordinal() : FALSE.ordinal());
         }
     }
@@ -1778,7 +1778,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                 p.pageId = pageId;
                 p.fwdId = fwdId;
 
-                Result res = readPage(pageId, page, this, search, p, lvl);
+                Result res = readPage(page, this, search, p, lvl);
 
                 switch (res) {
                     case GO_DOWN:
@@ -1791,7 +1791,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                         if (p.needReplaceInner == TRUE) {
                             p.needReplaceInner = FALSE; // Protect from retries.
 
-                            res = writePage(pageId, page, this, replace, p, lvl);
+                            res = writePage(page, this, replace, p, lvl);
 
                             if (res != FOUND)
                                 return res; // Need to retry.
@@ -1817,7 +1817,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                         p.pageId = pageId;
                         p.fwdId = fwdId;
 
-                        return writePage(pageId, page, this, replace, p, lvl);
+                        return writePage(page, this, replace, p, lvl);
 
                     case NOT_FOUND: // Do insert.
                         assert lvl == p.btmLvl : "must insert at the bottom level";
@@ -1827,7 +1827,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                         p.pageId = pageId;
                         p.fwdId = fwdId;
 
-                        return writePage(pageId, page, this, insert, p, lvl);
+                        return writePage(page, this, insert, p, lvl);
 
                     default:
                         return res;
@@ -1835,7 +1835,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
             }
         }
         finally {
-            if (p.canRelease(pageId, page, lvl))
+            if (p.canRelease(page, lvl))
                 page.close();
         }
     }
@@ -1989,12 +1989,11 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         }
 
         /**
-         * @param pageId Page ID.
          * @param page Page.
          * @param lvl Level.
          * @return {@code true} If we can release the given page.
          */
-        boolean canRelease(long pageId, Page page, int lvl) {
+        boolean canRelease(Page page, int lvl) {
             return page != null;
         }
     }
@@ -2135,7 +2134,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         }
 
         /** {@inheritDoc} */
-        @Override boolean canRelease(long pageId, Page page, int lvl) {
+        @Override boolean canRelease(Page page, int lvl) {
             return page != null && tail != page;
         }
 
@@ -2210,7 +2209,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                 // Need to check this before the actual split, because after the split we will have new forward page here.
                 boolean hadFwd = io.getForward(buf) != 0;
 
-                ByteBuffer fwdBuf = writeLock(fwdId, fwd); // Initial write, no need to check for concurrent modification.
+                ByteBuffer fwdBuf = writeLock(fwd); // Initial write, no need to check for concurrent modification.
 
                 try {
                     // Never write full forward page, because it is known to be new.
@@ -2255,7 +2254,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                             if (io.isLeaf())
                                 io = latestInnerIO();
 
-                            ByteBuffer newRootBuf = writeLock(newRootId, newRoot); // Initial write.
+                            ByteBuffer newRootBuf = writeLock(newRoot); // Initial write.
 
                             try {
                                 // Never write full new root page, because it is known to be new.
@@ -2274,7 +2273,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                             }
                         }
 
-                        writePage(metaPageId, meta, BPlusTree.this, addRoot, newRootId, lvl + 1);
+                        writePage(meta, BPlusTree.this, addRoot, newRootId, lvl + 1);
 
                         return null; // We've just moved link up to root, nothing to return here.
                     }
@@ -2596,7 +2595,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                     if (tail.getCount() == 0 && tail.lvl != 0 && getRootLevel(meta) == tail.lvl) {
                         // Free root if it became empty after merge.
                         cutRoot(tail.lvl);
-                        freePage(tail.pageId, tail.page, tail.buf, false);
+                        freePage(tail.page, tail.buf, false);
 
                         // Exit: we are done.
                     }
@@ -2657,10 +2656,10 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
             Page back = page(backId);
 
             try {
-                return writePage(backId, back, BPlusTree.this, lockBackAndRemoveFromLeaf, this, 0);
+                return writePage(back, BPlusTree.this, lockBackAndRemoveFromLeaf, this, 0);
             }
             finally {
-                if (canRelease(backId, back, 0))
+                if (canRelease(back, 0))
                     back.close();
             }
         }
@@ -2672,7 +2671,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         private Result doRemoveFromLeaf() throws IgniteCheckedException {
             assert page != null;
 
-            return writePage(pageId, page, BPlusTree.this, removeFromLeaf, this, 0);
+            return writePage(page, BPlusTree.this, removeFromLeaf, this, 0);
         }
 
         /**
@@ -2683,7 +2682,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         private Result doLockTail(int lvl) throws IgniteCheckedException {
             assert page != null;
 
-            return writePage(pageId, page, BPlusTree.this, lockTail, this, lvl);
+            return writePage(page, BPlusTree.this, lockTail, this, lvl);
         }
 
         /**
@@ -2711,10 +2710,10 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
             Page back = page(backId);
 
             try {
-                return writePage(backId, back, BPlusTree.this, lockBackAndTail, this, lvl);
+                return writePage(back, BPlusTree.this, lockBackAndTail, this, lvl);
             }
             finally {
-                if (canRelease(backId, back, lvl))
+                if (canRelease(back, lvl))
                     back.close();
             }
         }
@@ -2731,11 +2730,11 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
             Page fwd = page(fwdId);
 
             try {
-                return writePage(fwdId, fwd, BPlusTree.this, lockTailForward, this, lvl);
+                return writePage(fwd, BPlusTree.this, lockTailForward, this, lvl);
             }
             finally {
                 // If we were not able to lock forward page as tail, release the page.
-                if (canRelease(fwdId, fwd, lvl))
+                if (canRelease(fwd, lvl))
                     fwd.close();
             }
         }
@@ -2869,7 +2868,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
             if (right && cnt != 0)
                 idx++;
 
-            return inner(prnt.io).getLeft(prnt.buf, idx) == child.pageId;
+            return inner(prnt.io).getLeft(prnt.buf, idx) == child.page.id();
         }
 
         /**
@@ -2882,8 +2881,8 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         private boolean checkChildren(Tail<L> prnt, Tail<L> left, Tail<L> right, int idx) {
             assert idx >= 0 && idx < prnt.getCount(): idx;
 
-            return inner(prnt.io).getLeft(prnt.buf, idx) == left.pageId &&
-                inner(prnt.io).getRight(prnt.buf, idx) == right.pageId;
+            return inner(prnt.io).getLeft(prnt.buf, idx) == left.page.id() &&
+                inner(prnt.io).getRight(prnt.buf, idx) == right.page.id();
         }
 
         /**
@@ -2896,7 +2895,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         private boolean doMerge(Tail<L> prnt, Tail<L> left, Tail<L> right)
             throws IgniteCheckedException {
             assert right.io == left.io; // Otherwise incompatible.
-            assert left.io.getForward(left.buf) == right.pageId;
+            assert left.io.getForward(left.buf) == right.page.id();
 
             int prntCnt = prnt.getCount();
             int prntIdx = fix(insertionPoint(prnt));
@@ -2932,20 +2931,21 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                 doRemove(prnt.page, prnt.io, prnt.buf, prntCnt, prntIdx);
 
             // Forward page is now empty and has no links, can free and release it right away.
-            freePage(right.pageId, right.page, right.buf, true);
+            freePage(right.page, right.buf, true);
 
             return true;
         }
 
         /**
-         * @param pageId Page ID.
          * @param page Page.
          * @param buf Buffer.
          * @param release Release write lock and release page.
          * @throws IgniteCheckedException If failed.
          */
-        private void freePage(long pageId, Page page, ByteBuffer buf, boolean release)
+        private void freePage(Page page, ByteBuffer buf, boolean release)
             throws IgniteCheckedException {
+            long pageId = page.id();
+
             long effectivePageId = PageIdUtils.effectivePageId(pageId);
 
             pageId = recyclePage(pageId, page, buf);
@@ -2964,7 +2964,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
          * @throws IgniteCheckedException If failed.
          */
         private void cutRoot(int lvl) throws IgniteCheckedException {
-            writePage(metaPageId, meta, BPlusTree.this, cutRoot, null, lvl);
+            writePage(meta, BPlusTree.this, cutRoot, null, lvl);
         }
 
         /**
@@ -3101,8 +3101,8 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         }
 
         /** {@inheritDoc} */
-        @Override boolean canRelease(long pageId, Page page, int lvl) {
-            return page != null && !isTail(pageId, lvl);
+        @Override boolean canRelease(Page page, int lvl) {
+            return page != null && !isTail(page.id(), lvl);
         }
 
         /**
@@ -3118,12 +3118,12 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
                     return false;
 
                 if (t.lvl == lvl) {
-                    if (t.pageId == pageId)
+                    if (t.page.id() == pageId)
                         return true;
 
                     t = t.sibling;
 
-                    return t != null && t.pageId == pageId;
+                    return t != null && t.page.id() == pageId;
                 }
 
                 t = t.down;
@@ -3133,7 +3133,6 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         }
 
         /**
-         * @param pageId Page ID.
          * @param page Page.
          * @param buf Buffer.
          * @param io IO.
@@ -3141,8 +3140,8 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
          * @param type Type.
          * @return Added tail.
          */
-        private Tail<L> addTail(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, int lvl, byte type) {
-            final Tail<L> t = new Tail<>(pageId, page, buf, io, type, lvl);
+        private Tail<L> addTail(Page page, ByteBuffer buf, BPlusIO<L> io, int lvl, byte type) {
+            final Tail<L> t = new Tail<>(page, buf, io, type, lvl);
 
             if (tail == null)
                 tail = t;
@@ -3246,9 +3245,6 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         static final byte FORWARD = 2;
 
         /** */
-        private final long pageId;
-
-        /** */
         private final Page page;
 
         /** */
@@ -3273,20 +3269,17 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
         private Tail<L> down;
 
         /**
-         * @param pageId Page ID.
          * @param page Write locked page.
          * @param buf Buffer.
          * @param io IO.
          * @param type Type.
          * @param lvl Level.
          */
-        private Tail(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, byte type, int lvl) {
+        private Tail(Page page, ByteBuffer buf, BPlusIO<L> io, byte type, int lvl) {
             assert type == BACK || type == EXACT || type == FORWARD : type;
             assert lvl >= 0 && lvl <= Byte.MAX_VALUE : lvl;
             assert page != null;
-            assert pageId != 0;
 
-            this.pageId = pageId;
             this.page = page;
             this.buf = buf;
             this.io = io;
@@ -3303,7 +3296,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
 
         /** {@inheritDoc} */
         @Override public String toString() {
-            return new SB("Tail[").a("pageId=").appendHex(pageId).a(", cnt= ").a(getCount())
+            return new SB("Tail[").a("pageId=").appendHex(page.id()).a(", cnt= ").a(getCount())
                 .a(", lvl=" + lvl).a(", sibling=").a(sibling).a("]").toString();
         }
 
@@ -3611,11 +3604,9 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
     private abstract class GetPageHandler<G extends Get> extends PageHandler<G, Result> {
         /** {@inheritDoc} */
         @SuppressWarnings("unchecked")
-        @Override public final Result run(long pageId, Page page, PageIO iox, ByteBuffer buf, G g, int lvl)
+        @Override public final Result run(Page page, PageIO iox, ByteBuffer buf, G g, int lvl)
             throws IgniteCheckedException {
-            // The page was merged and removed.
-            if (PageIO.getPageId(buf) != pageId)
-                return RETRY;
+            assert PageIO.getPageId(buf) == page.id();
 
             // If we've passed the check for correct page ID, we can safely cast.
             BPlusIO<L> io = (BPlusIO<L>)iox;
@@ -3625,11 +3616,10 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
             if (lvl == 0 && g.rmvId < io.getRemoveId(buf))
                 return RETRY_ROOT;
 
-            return run0(pageId, page, buf, io, g, lvl);
+            return run0(page, buf, io, g, lvl);
         }
 
         /**
-         * @param pageId Page ID.
          * @param page Page.
          * @param buf Buffer.
          * @param io IO.
@@ -3638,12 +3628,12 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure {
          * @return Result code.
          * @throws IgniteCheckedException If failed.
          */
-        protected abstract Result run0(long pageId, Page page, ByteBuffer buf, BPlusIO<L> io, G g, int lvl)
+        protected abstract Result run0(Page page, ByteBuffer buf, BPlusIO<L> io, G g, int lvl)
             throws IgniteCheckedException;
 
         /** {@inheritDoc} */
-        @Override public final boolean releaseAfterWrite(long pageId, Page page, G g, int lvl) {
-            return g.canRelease(pageId, page, lvl);
+        @Override public final boolean releaseAfterWrite(Page page, G g, int lvl) {
+            return g.canRelease(page, lvl);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d05c09a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageHandler.java
index 40e877a..bc071d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageHandler.java
@@ -35,14 +35,13 @@ import static java.lang.Boolean.TRUE;
 public abstract class PageHandler<X, R> {
     /** */
     private static final PageHandler<Void, Void> NOOP = new PageHandler<Void, Void>() {
-        @Override public Void run(long pageId, Page page, PageIO io, ByteBuffer buf, Void arg, int intArg)
+        @Override public Void run( Page page, PageIO io, ByteBuffer buf, Void arg, int intArg)
             throws IgniteCheckedException {
             return null;
         }
     };
 
     /**
-     * @param pageId Page ID.
      * @param page Page.
      * @param io IO.
      * @param buf Page buffer.
@@ -51,22 +50,20 @@ public abstract class PageHandler<X, R> {
      * @return Result.
      * @throws IgniteCheckedException If failed.
      */
-    public abstract R run(long pageId, Page page, PageIO io, ByteBuffer buf, X arg, int intArg)
+    public abstract R run(Page page, PageIO io, ByteBuffer buf, X arg, int intArg)
         throws IgniteCheckedException;
 
     /**
-     * @param pageId Page ID.
      * @param page Page.
      * @param arg Argument.
      * @param intArg Argument of type {@code int}.
      * @return {@code true} If release.
      */
-    public boolean releaseAfterWrite(long pageId, Page page, X arg, int intArg) {
+    public boolean releaseAfterWrite(Page page, X arg, int intArg) {
         return true;
     }
 
     /**
-     * @param pageId Page ID.
      * @param page Page.
      * @param h Handler.
      * @param arg Argument.
@@ -75,14 +72,13 @@ public abstract class PageHandler<X, R> {
      * @throws IgniteCheckedException If failed.
      */
     public static <X, R> R readPage(
-        long pageId,
         Page page,
         PageLockListener lockListener,
         PageHandler<X, R> h,
         X arg,
         int intArg
     ) throws IgniteCheckedException {
-        lockListener.onBeforeReadLock(pageId, page);
+        lockListener.onBeforeReadLock(page);
 
         ByteBuffer buf = page.getForRead();
 
@@ -91,7 +87,7 @@ public abstract class PageHandler<X, R> {
 
             PageIO io = PageIO.getPageIO(buf);
 
-            return h.run(pageId, page, io, buf, arg, intArg);
+            return h.run(page, io, buf, arg, intArg);
         }
         finally {
             lockListener.onReadUnlock(page, buf);
@@ -101,7 +97,6 @@ public abstract class PageHandler<X, R> {
     }
 
     /**
-     * @param pageId Page ID.
      * @param page Page.
      * @param h Handler.
      * @param arg Argument.
@@ -110,35 +105,31 @@ public abstract class PageHandler<X, R> {
      * @throws IgniteCheckedException If failed.
      */
     public static <X, R> R writePage(
-        long pageId,
         Page page,
         PageLockListener lockListener,
         PageHandler<X, R> h,
         X arg,
         int intArg
     ) throws IgniteCheckedException {
-        return writePage(pageId, page, lockListener, h, null, null, arg, intArg);
+        return writePage(page, lockListener, h, null, null, arg, intArg);
     }
 
     /**
-     * @param pageId Page ID.
      * @param page Page.
      * @param lockListener Lock listener.
      * @param init IO for new page initialization or {@code null} if it is an existing page.
      * @throws IgniteCheckedException If failed.
      */
     public static void initPage(
-        long pageId,
         Page page,
         PageLockListener lockListener,
         PageIO init,
         IgniteWriteAheadLogManager wal
     ) throws IgniteCheckedException {
-        writePage(pageId, page, lockListener, NOOP, init, wal, null, 0);
+        writePage(page, lockListener, NOOP, init, wal, null, 0);
     }
 
     /**
-     * @param pageId Page ID.
      * @param page Page.
      * @param lockListener Lock listener.
      * @param h Handler.
@@ -149,7 +140,6 @@ public abstract class PageHandler<X, R> {
      * @throws IgniteCheckedException If failed.
      */
     public static <X, R> R writePage(
-        long pageId,
         Page page,
         PageLockListener lockListener,
         PageHandler<X, R> h,
@@ -158,7 +148,7 @@ public abstract class PageHandler<X, R> {
         X arg,
         int intArg
     ) throws IgniteCheckedException {
-        lockListener.onBeforeWriteLock(pageId, page);
+        lockListener.onBeforeWriteLock(page);
 
         R res;
 
@@ -172,18 +162,18 @@ public abstract class PageHandler<X, R> {
             lockListener.onWriteLock(page, buf);
 
             if (init != null) // It is a new page and we have to initialize it.
-                doInitPage(pageId, page, buf, init, wal);
+                doInitPage(page, buf, init, wal);
             else
                 init = PageIO.getPageIO(buf);
 
-            res = h.run(pageId, page, init, buf, arg, intArg);
+            res = h.run(page, init, buf, arg, intArg);
 
             ok = true;
         }
         finally {
             assert PageIO.getCrc(buf) == 0; //TODO GG-11480
 
-            if (h.releaseAfterWrite(pageId, page, arg, intArg)) {
+            if (h.releaseAfterWrite(page, arg, intArg)) {
                 lockListener.onWriteUnlock(page, buf);
 
                 page.releaseWrite(ok);
@@ -194,7 +184,6 @@ public abstract class PageHandler<X, R> {
     }
 
     /**
-     * @param pageId Page ID.
      * @param page Page.
      * @param buf Buffer.
      * @param init Initial IO.
@@ -202,7 +191,6 @@ public abstract class PageHandler<X, R> {
      * @throws IgniteCheckedException If failed.
      */
     private static void doInitPage(
-        long pageId,
         Page page,
         ByteBuffer buf,
         PageIO init,
@@ -210,6 +198,8 @@ public abstract class PageHandler<X, R> {
     ) throws IgniteCheckedException {
         assert PageIO.getCrc(buf) == 0; //TODO GG-11480
 
+        long pageId = page.id();
+
         init.initNewPage(buf, pageId);
 
         // Here we should never write full page, because it is known to be new.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d05c09a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageLockListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageLockListener.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageLockListener.java
index fe85e6b..216bdd3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageLockListener.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/util/PageLockListener.java
@@ -25,10 +25,9 @@ import org.apache.ignite.internal.pagemem.Page;
  */
 public interface PageLockListener {
     /**
-     * @param pageId Virtual page ID.
      * @param page Page.
      */
-    public void onBeforeWriteLock(long pageId, Page page);
+    public void onBeforeWriteLock(Page page);
 
     /**
      * @param page Page.
@@ -43,10 +42,9 @@ public interface PageLockListener {
     public void onWriteUnlock(Page page, ByteBuffer buf);
 
     /**
-     * @param pageId Virtual page ID.
      * @param page Page.
      */
-    public void onBeforeReadLock(long pageId, Page page);
+    public void onBeforeReadLock(Page page);
 
     /**
      * @param page Page.

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d05c09a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeReuseSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeReuseSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeReuseSelfTest.java
index fba653b..cfc58b0 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeReuseSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeReuseSelfTest.java
@@ -83,8 +83,8 @@ public class BPlusTreeReuseSelfTest extends BPlusTreeSelfTest {
         }
 
         /** {@inheritDoc} */
-        @Override public void onBeforeReadLock(long pageId, Page page) {
-            assertEquals(page.id(), effectivePageId(pageId));
+        @Override public void onBeforeReadLock(Page page) {
+            // No-op.
         }
 
         /** {@inheritDoc} */
@@ -102,8 +102,8 @@ public class BPlusTreeReuseSelfTest extends BPlusTreeSelfTest {
         }
 
         /** {@inheritDoc} */
-        @Override public void onBeforeWriteLock(long pageId, Page page) {
-            assertEquals(page.id(), effectivePageId(pageId));
+        @Override public void onBeforeWriteLock(Page page) {
+            // No-op.
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d05c09a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
index 561634a..ec37f39 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/BPlusTreeSelfTest.java
@@ -1201,10 +1201,8 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
         }
 
         /** {@inheritDoc} */
-        @Override public void onBeforeReadLock(long pageId, Page page) {
-            assertEquals(page.id(), pageId);
-
-            assertNull(beforeReadLock.put(threadId(), pageId));
+        @Override public void onBeforeReadLock(Page page) {
+            assertNull(beforeReadLock.put(threadId(), page.id()));
         }
 
         /** {@inheritDoc} */
@@ -1228,10 +1226,8 @@ public class BPlusTreeSelfTest extends GridCommonAbstractTest {
         }
 
         /** {@inheritDoc} */
-        @Override public void onBeforeWriteLock(long pageId, Page page) {
-            assertEquals(page.id(), pageId);
-
-            assertNull(beforeWriteLock.put(threadId(), pageId));
+        @Override public void onBeforeWriteLock(Page page) {
+            assertNull(beforeWriteLock.put(threadId(), page.id()));
         }
 
         /** {@inheritDoc} */


Mime
View raw message