ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-3477 store single object per page
Date Tue, 24 Jan 2017 15:15:46 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3477-no-compact [created] cd338e8e6


ignite-3477 store single object per page


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

Branch: refs/heads/ignite-3477-no-compact
Commit: cd338e8e6b1c35ffc5326a036993e5b31b401be2
Parents: 4db65d2
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Jan 24 18:13:26 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Jan 24 18:13:26 2017 +0300

----------------------------------------------------------------------
 .../configuration/MemoryConfiguration.java      |  2 +-
 .../cache/database/freelist/FreeListImpl.java   | 43 +++++++++++---------
 2 files changed, 25 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cd338e8e/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
index 242354e..ed37784 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
@@ -29,7 +29,7 @@ public class MemoryConfiguration implements Serializable {
     private static final long serialVersionUID = 0L;
 
     /** Default cache size is 1Gb. */
-    public static final long DFLT_PAGE_CACHE_SIZE = 1024 * 1024 * 1024;
+    public static final long DFLT_PAGE_CACHE_SIZE = 4L * 1024 * 1024 * 1024;
 
     /** Default page size. */
     public static final int DFLT_PAGE_SIZE = 2 * 1024;

http://git-wip-us.apache.org/repos/asf/ignite/blob/cd338e8e/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 87d5e4d..f4bb082 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
@@ -115,18 +115,20 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList
{
 
                 assert oldFreeSpace > 0 : oldFreeSpace;
 
+                assert ((DataPageIO) iox).isEmpty(pageAddr);
+
                 // If the full row does not fit into this page write only a fragment.
                 written = (written == 0 && oldFreeSpace >= rowSize) ? addRow(page,
pageAddr, io, row, rowSize):
                     addRowFragment(page, pageAddr, io, row, written, rowSize);
 
-                // Reread free space after update.
-                int newFreeSpace = io.getFreeSpace(pageAddr);
-
-                if (newFreeSpace > MIN_PAGE_FREE_SPACE) {
-                    int bucket = bucket(newFreeSpace, false);
-
-                    put(null, page, pageAddr, bucket);
-                }
+//                // Reread free space after update.
+//                int newFreeSpace = io.getFreeSpace(pageAddr);
+//
+//                if (newFreeSpace > MIN_PAGE_FREE_SPACE) {
+//                    int bucket = bucket(newFreeSpace, false);
+//
+//                    put(null, page, pageAddr, bucket);
+//                }
 
                 // Avoid boxing with garbage generation for usual case.
                 return written == rowSize ? COMPLETE : written;
@@ -221,6 +223,8 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList
{
 
             long nextLink = io.removeRow(pageAddr, itemId, pageSize());
 
+            assert io.isEmpty(pageAddr);
+
             if (isWalDeltaRecordNeeded(wal, page))
                 wal.log(new DataPageRemoveRecord(cacheId, page.id(), itemId));
 
@@ -237,17 +241,18 @@ public class FreeListImpl extends PagesList implements FreeList, ReuseList
{
             if (newFreeSpace > MIN_PAGE_FREE_SPACE) {
                 int newBucket = bucket(newFreeSpace, false);
 
-                if (oldFreeSpace > MIN_PAGE_FREE_SPACE) {
-                    int oldBucket = bucket(oldFreeSpace, false);
-
-                    if (oldBucket != newBucket) {
-                        // It is possible that page was concurrently taken for put, in this
case put will handle bucket change.
-                        if (removeDataPage(page, pageAddr, io, oldBucket))
-                            put(null, page, pageAddr, newBucket);
-                    }
-                }
-                else
-                    put(null, page, pageAddr, newBucket);
+                put(null, page, pageAddr, newBucket);
+//                if (oldFreeSpace > MIN_PAGE_FREE_SPACE) {
+//                    int oldBucket = bucket(oldFreeSpace, false);
+//
+//                    if (oldBucket != newBucket) {
+//                        // It is possible that page was concurrently taken for put, in
this case put will handle bucket change.
+//                        if (removeDataPage(page, pageAddr, io, oldBucket))
+//                            put(null, page, pageAddr, newBucket);
+//                    }
+//                }
+//                else
+//                    put(null, page, pageAddr, newBucket);
             }
 
             // For common case boxed 0L will be cached inside of Long, so no garbage will
be produced.


Mime
View raw message