ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [15/50] [abbrv] ignite git commit: GG-11547 - Fixing memory restore
Date Mon, 10 Oct 2016 14:57:20 GMT
GG-11547 - Fixing memory restore


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

Branch: refs/heads/ignite-gg-8-io2-park
Commit: 3126688e1e6952a23d93b7f4dbdd83dfac0cc20f
Parents: 9a666a8
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Wed Sep 28 10:32:11 2016 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Wed Sep 28 10:32:11 2016 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/internal/pagemem/Page.java   |  7 +++++++
 .../ignite/internal/pagemem/impl/PageNoStoreImpl.java   | 10 ++++++++++
 .../pagemem/wal/record/delta/InitNewPageRecord.java     |  2 +-
 .../pagemem/wal/record/delta/PageDeltaRecord.java       |  3 +--
 .../wal/record/delta/PagesListAddPageRecord.java        |  3 +--
 .../wal/record/delta/PagesListInitNewPageRecord.java    | 12 ++++++++++++
 .../wal/record/delta/PagesListRemovePageRecord.java     | 12 ++++++++++++
 .../processors/cache/database/tree/io/PageIO.java       | 10 +++++-----
 8 files changed, 49 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3126688e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/Page.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/Page.java b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/Page.java
index e08fad6..e953a1f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/Page.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/Page.java
@@ -54,6 +54,13 @@ public interface Page extends AutoCloseable {
     public ByteBuffer getForWrite();
 
     /**
+     * Gets page for write without conditional RWLock tag check.
+     *
+     * @return ByteBuffer for modifying the page.
+     */
+    public ByteBuffer getForWriteNoTagCheck();
+
+    /**
      * @return ByteBuffer for modifying the page of {@code null} if failed to get write lock.
      */
     @Nullable public ByteBuffer tryGetForWrite();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3126688e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageNoStoreImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageNoStoreImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageNoStoreImpl.java
index b80d843..76f8077 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageNoStoreImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/impl/PageNoStoreImpl.java
@@ -21,6 +21,7 @@ import org.apache.ignite.internal.pagemem.FullPageId;
 import org.apache.ignite.internal.pagemem.Page;
 import org.apache.ignite.internal.pagemem.PageIdUtils;
 import org.apache.ignite.internal.processors.cache.database.tree.io.PageIO;
+import org.apache.ignite.internal.util.OffheapReadWriteLock;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 
 import java.nio.ByteBuffer;
@@ -95,6 +96,15 @@ public class PageNoStoreImpl implements Page {
     }
 
     /** {@inheritDoc} */
+    @Override public ByteBuffer getForWriteNoTagCheck() {
+        boolean locked = pageMem.writeLockPage(absPtr, OffheapReadWriteLock.TAG_LOCK_ALWAYS);
+
+        assert locked;
+
+        return reset(buf);
+    }
+
+    /** {@inheritDoc} */
     @Override public ByteBuffer tryGetForWrite() {
         if (pageMem.tryWriteLockPage(absPtr, PageIdUtils.itemId(pageId)))
             return reset(buf);

http://git-wip-us.apache.org/repos/asf/ignite/blob/3126688e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java
index 59c4691..ca7515d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/InitNewPageRecord.java
@@ -93,7 +93,7 @@ public class InitNewPageRecord extends PageDeltaRecord {
         return S.toString(InitNewPageRecord.class, this,
             "ioType", ioType,
             "ioVer", ioVer,
-            "newPageId", U.hexLong(PageIdUtils.effectivePageId(newPageId)),
+            "newPageId", U.hexLong(newPageId),
             "super", super.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3126688e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PageDeltaRecord.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PageDeltaRecord.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PageDeltaRecord.java
index f4a6c74..8e2e827 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PageDeltaRecord.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PageDeltaRecord.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.pagemem.wal.record.delta;
 
 import java.nio.ByteBuffer;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.pagemem.PageIdUtils;
 import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -74,7 +73,7 @@ public abstract class PageDeltaRecord extends WALRecord {
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(PageDeltaRecord.class, this,
-            "pageId", U.hexLong(PageIdUtils.effectivePageId(pageId)),
+            "pageId", U.hexLong(pageId),
             "super", super.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3126688e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListAddPageRecord.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListAddPageRecord.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListAddPageRecord.java
index 72e1da5..0f31ef7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListAddPageRecord.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListAddPageRecord.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.pagemem.wal.record.delta;
 
 import java.nio.ByteBuffer;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.pagemem.PageIdUtils;
 import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.processors.cache.database.freelist.io.PagesListNodeIO;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
@@ -69,7 +68,7 @@ public class PagesListAddPageRecord extends PageDeltaRecord {
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(PagesListAddPageRecord.class, this,
-            "dataPageId", U.hexLong(PageIdUtils.effectivePageId(dataPageId)),
+            "dataPageId", U.hexLong(dataPageId),
             "super", super.toString());
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3126688e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListInitNewPageRecord.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListInitNewPageRecord.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListInitNewPageRecord.java
index 617fb2b..adc48ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListInitNewPageRecord.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListInitNewPageRecord.java
@@ -22,15 +22,20 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.processors.cache.database.freelist.io.PagesListNodeIO;
 import org.apache.ignite.internal.processors.cache.database.tree.io.PageIO;
+import org.apache.ignite.internal.util.tostring.GridToStringExclude;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
 
 /**
  *
  */
 public class PagesListInitNewPageRecord extends InitNewPageRecord {
     /** */
+    @GridToStringExclude
     private final long prevPageId;
 
     /** */
+    @GridToStringExclude
     private final long addDataPageId;
 
     /**
@@ -86,4 +91,11 @@ public class PagesListInitNewPageRecord extends InitNewPageRecord {
     @Override public RecordType type() {
         return RecordType.PAGES_LIST_INIT_NEW_PAGE;
     }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PagesListInitNewPageRecord.class, this,
+            "prevPageId", U.hexLong(prevPageId),
+            "addDataPageId", U.hexLong(addDataPageId));
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3126688e/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListRemovePageRecord.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListRemovePageRecord.java
b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListRemovePageRecord.java
index b660bb0..6e5251a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListRemovePageRecord.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/delta/PagesListRemovePageRecord.java
@@ -21,12 +21,16 @@ import java.nio.ByteBuffer;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.processors.cache.database.freelist.io.PagesListNodeIO;
+import org.apache.ignite.internal.util.tostring.GridToStringExclude;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
 
 /**
  *
  */
 public class PagesListRemovePageRecord extends PageDeltaRecord {
     /** */
+    @GridToStringExclude
     private final long rmvdPageId;
 
     /**
@@ -60,4 +64,12 @@ public class PagesListRemovePageRecord extends PageDeltaRecord {
     @Override public RecordType type() {
         return RecordType.PAGES_LIST_REMOVE_PAGE;
     }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PagesListRemovePageRecord.class, this,
+            "rmvdPageId", U.hexLong(rmvdPageId),
+            "pageId", U.hexLong(pageId()),
+            "cacheId", cacheId());
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3126688e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
index 8f281c8..efe3e68 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/io/PageIO.java
@@ -58,7 +58,7 @@ import org.apache.ignite.internal.processors.cache.database.tree.util.PageLockLi
  *
  * 7. It is almost always preferable to read or write (especially write) page contents using
  *    static methods on {@link PageHandler}. To just initialize new page use
- *    {@link PageHandler#initPage(long, Page, PageLockListener, PageIO, IgniteWriteAheadLogManager)}
+ *    {@link PageHandler#initPage(Page, PageLockListener, PageIO, IgniteWriteAheadLogManager)}
  *    method with needed IO instance.
  */
 public abstract class PageIO {
@@ -75,16 +75,16 @@ public abstract class PageIO {
     private static IOVersions<? extends BPlusLeafIO<?>> h2LeafIOs;
 
     /** */
-    private static final int TYPE_OFF = 0;
+    public static final int TYPE_OFF = 0;
 
     /** */
-    private static final int VER_OFF = TYPE_OFF + 2;
+    public static final int VER_OFF = TYPE_OFF + 2;
 
     /** */
-    private static final int CRC_OFF = VER_OFF + 2;
+    public static final int CRC_OFF = VER_OFF + 2;
 
     /** */
-    private static final int PAGE_ID_OFF = CRC_OFF + 4;
+    public static final int PAGE_ID_OFF = CRC_OFF + 4;
 
     /** */
     private static final int RESERVED_1_OFF = PAGE_ID_OFF + 8;


Mime
View raw message