ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [06/50] [abbrv] ignite git commit: ignite-db-x - get rid of pageId
Date Mon, 10 Oct 2016 12:13:02 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/7be74e3c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7be74e3c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7be74e3c

Branch: refs/heads/ignite-gg-8-io2-selNow
Commit: 7be74e3c6d7f2f0797dffdbf8e6cacb0c71c2159
Parents: e4ef239
Author: Sergi Vladykin <sergi.vladykin@gmail.com>
Authored: Mon Sep 26 21:01:38 2016 +0300
Committer: Sergi Vladykin <sergi.vladykin@gmail.com>
Committed: Mon Sep 26 21:01:38 2016 +0300

----------------------------------------------------------------------
 .../cache/database/DataStructure.java           |  3 +--
 .../cache/database/freelist/PagesList.java      |  4 +--
 .../cache/database/tree/BPlusTree.java          | 26 ++++++++++----------
 3 files changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7be74e3c/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 490f009..dc3cc2c 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
@@ -171,11 +171,10 @@ public abstract class DataStructure implements PageLockListener {
     }
 
     /**
-     * @param pageId Virtual page ID.
      * @param page Page.
      * @return Buffer.
      */
-    protected final ByteBuffer readLock(long pageId, Page page) {
+    protected final ByteBuffer readLock(Page page) {
         onBeforeReadLock(page);
 
         ByteBuffer buf = page.getForRead();

http://git-wip-us.apache.org/repos/asf/ignite/blob/7be74e3c/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 9ee6746..bfbc68f 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
@@ -149,7 +149,7 @@ public abstract class PagesList extends DataStructure {
 
                 while (nextPageId != 0) {
                     try (Page page = page(nextPageId)) {
-                        ByteBuffer buf = readLock(nextPageId, page);
+                        ByteBuffer buf = readLock(page);
 
                         try {
                             PagesListMetaIO io = PagesListMetaIO.VERSIONS.forPage(buf);
@@ -460,7 +460,7 @@ public abstract class PagesList extends DataStructure {
                 long pageId = tail.tailId;
 
                 try (Page page = page(pageId)) {
-                    ByteBuffer buf = readLock(pageId, page);
+                    ByteBuffer buf = readLock(page);
 
                     try {
                         PagesListNodeIO io = PagesListNodeIO.VERSIONS.forPage(buf);

http://git-wip-us.apache.org/repos/asf/ignite/blob/7be74e3c/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 86d5b86..9e001df 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
@@ -127,7 +127,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
                 return null;
 
             try (Page page = page(pageId)) {
-                ByteBuffer buf = readLock(pageId, page); // No correctness guaranties.
+                ByteBuffer buf = readLock(page); // No correctness guaranties.
 
                 try {
                     BPlusIO io = io(buf);
@@ -174,7 +174,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
                 return "<Zero>";
 
             try (Page page = page(pageId)) {
-                ByteBuffer buf = readLock(pageId, page); // No correctness guaranties.
+                ByteBuffer buf = readLock(page); // No correctness guaranties.
 
                 try {
                     BPlusIO<L> io = io(buf);
@@ -656,7 +656,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
      * @return Root level.
      */
     private int getRootLevel(Page meta) {
-        ByteBuffer buf = readLock(metaPageId, meta); // Meta can't be removed.
+        ByteBuffer buf = readLock(meta); // Meta can't be removed.
 
         try {
             return BPlusMetaIO.VERSIONS.forPage(buf).getRootLevel(buf);
@@ -672,7 +672,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
      * @return Page ID.
      */
     private long getFirstPageId(Page meta, int lvl) {
-        ByteBuffer buf = readLock(metaPageId, meta); // Meta can't be removed.
+        ByteBuffer buf = readLock(meta); // Meta can't be removed.
 
         try {
             BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(buf);
@@ -704,7 +704,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
         }
 
         try (Page first = page(firstPageId)) {
-            ByteBuffer buf = readLock(firstPageId, first); // We always merge pages backwards,
the first page is never removed.
+            ByteBuffer buf = readLock(first); // We always merge pages backwards, the first
page is never removed.
 
             try {
                 cursor.fillFromBuffer(buf, io(buf), 0);
@@ -922,7 +922,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
      */
     private void validateDownKeys(long pageId, L minRow) throws IgniteCheckedException {
         try (Page page = page(pageId)) {
-            ByteBuffer buf = readLock(pageId, page);
+            ByteBuffer buf = readLock(page);
 
             try {
                 BPlusIO<L> io = io(buf);
@@ -983,7 +983,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
      */
     private L getGreatestRowInSubTree(long pageId) throws IgniteCheckedException {
         try (Page page = page(pageId)) {
-            ByteBuffer buf = readLock(pageId, page);
+            ByteBuffer buf = readLock(page);
 
             try {
                 BPlusIO<L> io = io(buf);
@@ -1038,7 +1038,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
         long leftmostChildId;
 
         try (Page page = page(pageId)) {
-            ByteBuffer buf = readLock(pageId, page); // No correctness guaranties.
+            ByteBuffer buf = readLock(page); // No correctness guaranties.
 
             try {
                 BPlusIO<L> io = io(buf);
@@ -1068,7 +1068,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
      */
     private void validateDownPages(Page meta, long pageId, long fwdId, final int lvl) throws
IgniteCheckedException {
         try (Page page = page(pageId)) {
-            ByteBuffer buf = readLock(pageId, page); // No correctness guaranties.
+            ByteBuffer buf = readLock(page); // No correctness guaranties.
 
             try {
                 long realPageId = BPlusIO.getPageId(buf);
@@ -1103,7 +1103,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
                     if (fwdId != 0) {
                         // For the rightmost child ask neighbor.
                         try (Page fwd = page(fwdId)) {
-                            ByteBuffer fwdBuf = readLock(fwdId, fwd); // No correctness guaranties.
+                            ByteBuffer fwdBuf = readLock(fwd); // No correctness guaranties.
 
                             try {
                                 if (io(fwdBuf) != io)
@@ -1484,7 +1484,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
 
         while (pageId != 0) {
             try (Page page = page(pageId)) {
-                ByteBuffer buf = readLock(pageId, page); // No correctness guaranties.
+                ByteBuffer buf = readLock(page); // No correctness guaranties.
 
                 try {
                     if (io == null) {
@@ -1926,7 +1926,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
             int rootLvl;
             long rootId;
 
-            ByteBuffer buf = readLock(metaPageId, meta); // Meta can't be removed.
+            ByteBuffer buf = readLock(meta); // Meta can't be removed.
 
             try {
                 BPlusMetaIO io = BPlusMetaIO.VERSIONS.forPage(buf);
@@ -3572,7 +3572,7 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure
{
             boolean reinitialize = false;
 
             try (Page next = page(nextPageId)) {
-                ByteBuffer buf = readLock(nextPageId, next); // Doing explicit page ID check.
+                ByteBuffer buf = readLock(next); // Doing explicit page ID check.
 
                 try {
                     // If concurrent merge occurred we have to reinitialize cursor from the
last returned row.


Mime
View raw message