You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/07/11 12:27:17 UTC

[2/8] ignite git commit: IGNITE-5479 - Changed default checkpoint buffer size

IGNITE-5479 - Changed default checkpoint buffer size


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

Branch: refs/heads/ignite-5479
Commit: e273e4d4aa28b339694fbfd0951ed5ff1b232cfb
Parents: b3df511
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Mon Jul 10 20:01:39 2017 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Mon Jul 10 20:01:39 2017 +0300

----------------------------------------------------------------------
 .../configuration/PersistentStoreConfiguration.java  | 15 ++++++++-------
 .../persistence/GridCacheDatabaseSharedManager.java  |  8 +++++---
 .../platform/utils/PlatformConfigurationUtils.java   |  4 +++-
 3 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e273e4d4/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java
index 1d4e2ec..aa34bba 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/PersistentStoreConfiguration.java
@@ -44,9 +44,8 @@ public class PersistentStoreConfiguration implements Serializable {
     /** Default length of interval over which rate-based metric is calculated. */
     public static final int DFLT_RATE_TIME_INTERVAL_MILLIS = 60_000;
 
-    /** */
-    @SuppressWarnings("UnnecessaryBoxing")
-    public static final Long DFLT_CHECKPOINTING_PAGE_BUFFER_SIZE = new Long(256L * 1024 * 1024);
+    /** Default checkpointing page buffer size (may be adjusted by Ignite). */
+    public static final Long DFLT_CHECKPOINTING_PAGE_BUFFER_SIZE = 256L * 1024 * 1024 * 1024;
 
     /** Default number of checkpointing threads. */
     public static final int DFLT_CHECKPOINTING_THREADS = 1;
@@ -94,7 +93,7 @@ public class PersistentStoreConfiguration implements Serializable {
     private long lockWaitTime = DFLT_LOCK_WAIT_TIME;
 
     /** */
-    private Long checkpointingPageBufSize = DFLT_CHECKPOINTING_PAGE_BUFFER_SIZE;
+    private Long checkpointingPageBufSize;
 
     /** */
     private int checkpointingThreads = DFLT_CHECKPOINTING_THREADS;
@@ -200,7 +199,8 @@ public class PersistentStoreConfiguration implements Serializable {
     /**
      * Gets amount of memory allocated for a checkpointing temporary buffer.
      *
-     * @return checkpointing page buffer size in bytes.
+     * @return Checkpointing page buffer size in bytes or {@code null} for Ignite
+     *      to choose the buffer size automatically.
      */
     public Long getCheckpointingPageBufferSize() {
         return checkpointingPageBufSize;
@@ -211,10 +211,11 @@ public class PersistentStoreConfiguration implements Serializable {
      * copies of pages that are being written to disk and being update in parallel while the checkpointing is in
      * progress.
      *
-     * @param checkpointingPageBufSize checkpointing page buffer size in bytes.
+     * @param checkpointingPageBufSize Checkpointing page buffer size in bytes or {@code null} for Ignite to
+     *      choose the buffer size automatically.
      * @return {@code this} for chaining.
      */
-    public PersistentStoreConfiguration setCheckpointingPageBufferSize(long checkpointingPageBufSize) {
+    public PersistentStoreConfiguration setCheckpointingPageBufferSize(Long checkpointingPageBufSize) {
         this.checkpointingPageBufSize = checkpointingPageBufSize;
 
         return this;

http://git-wip-us.apache.org/repos/asf/ignite/blob/e273e4d4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index cf395a0..08b55bb 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -374,9 +374,9 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
     }
 
     /**
-     * @throws IgniteCheckedException If failed.
+     *
      */
-    private void initDataBase() throws IgniteCheckedException {
+    private void initDataBase() {
         Long cpBufSize = persistenceCfg.getCheckpointingPageBufferSize();
 
         if (persistenceCfg.getCheckpointingThreads() > 1)
@@ -390,7 +390,9 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
         // Intentionally use identity comparison to check if configuration default has changed.
         //noinspection NumberEquality
-        if (cpBufSize == PersistentStoreConfiguration.DFLT_CHECKPOINTING_PAGE_BUFFER_SIZE) {
+        if (cpBufSize == null) {
+            cpBufSize = PersistentStoreConfiguration.DFLT_CHECKPOINTING_PAGE_BUFFER_SIZE;
+
             MemoryConfiguration memCfg = cctx.kernalContext().config().getMemoryConfiguration();
 
             assert memCfg != null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/e273e4d4/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
index 53d5d3b..fee9856 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java
@@ -1524,7 +1524,9 @@ public class PlatformConfigurationUtils {
 
             w.writeString(cfg.getPersistentStorePath());
             w.writeLong(cfg.getCheckpointingFrequency());
-            w.writeLong(cfg.getCheckpointingPageBufferSize());
+            w.writeLong(cfg.getCheckpointingPageBufferSize() == null ?
+                PersistentStoreConfiguration.DFLT_CHECKPOINTING_PAGE_BUFFER_SIZE :
+                cfg.getCheckpointingPageBufferSize());
             w.writeInt(cfg.getCheckpointingThreads());
             w.writeLong(cfg.getLockWaitTime());
             w.writeInt(cfg.getWalHistorySize());