[08/11] ignite git commit: IGNITE-6030 Allow enabling persistence per data region
http://git-wip-us.apache.org/repos/asf/ignite/blob/74567763/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 a56b8f4..596b7b2 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 @@ -57,18 +57,17 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.management.ObjectName; +import org.apache.ignite.DataStorageMetrics; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.IgniteSystemProperties; -import org.apache.ignite.PersistenceMetrics; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CheckpointWriteOrder; import org.apache.ignite.configuration.DataPageEvictionMode; +import org.apache.ignite.configuration.DataRegionConfiguration; +import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.configuration.MemoryConfiguration; -import org.apache.ignite.configuration.MemoryPolicyConfiguration; -import org.apache.ignite.configuration.PersistentStoreConfiguration; import org.apache.ignite.events.DiscoveryEvent; import org.apache.ignite.events.EventType; import org.apache.ignite.internal.GridKernalContext; @@ -139,7 +138,7 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.internal.util.worker.GridWorker; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.lang.IgniteOutClosure; -import org.apache.ignite.mxbean.PersistenceMetricsMXBean; +import org.apache.ignite.mxbean.DataStorageMetricsMXBean; import org.apache.ignite.thread.IgniteThread; import org.apache.ignite.thread.IgniteThreadPoolExecutor; import org.jetbrains.annotations.NotNull; @@ -229,7 +228,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan }; /** */ -private static final String MBEAN_NAME = "PersistenceMetrics"; +private static final String MBEAN_NAME = "DataStorageMetrics"; /** */ private static final String MBEAN_GROUP = "Persistent Store"; @@ -262,7 +261,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan private volatile boolean printCheckpointStats = true; /** Database configuration. */ -private final PersistentStoreConfiguration persistenceCfg; +private final DataStorageConfiguration persistenceCfg; /** */ private final Collection lsnrs = new CopyOnWriteArrayList<>(); @@ -301,7 +300,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan private IgniteCacheSnapshotManager snapshotMgr; /** */ -private PersistenceMetricsImpl persStoreMetrics; +private DataStorageMetricsImpl persStoreMetrics; /** */ private ObjectName persistenceMetricsMbeanName; @@ -318,18 +317,18 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan public GridCacheDatabaseSharedManager(GridKernalContext ctx) { IgniteConfiguration cfg = ctx.config(); -persistenceCfg = cfg.getPersistentStoreConfiguration(); +persistenceCfg = cfg.getDataStorageConfiguration(); -assert persistenceCfg != null : "PageStore should not be created if persistence is disabled."; +assert persistenceCfg != null; -checkpointFreq = persistenceCfg.getCheckpointingFrequency(); +checkpointFreq = persistenceCfg.getCheckpointFrequency(); lockWaitTime = persistenceCfg.getLockWaitTime(); -persStoreMetrics = new PersistenceMetricsImpl( +persStoreMetrics = new DataStorageMetricsImpl( persistenceCfg.isMetricsEnabled(), -persistenceCfg.getRateTimeInterval(), -persistenceCfg.getSubIntervals() +persistenceCfg.getMetricsRateTimeInterval(), +persistenceCfg.getMetricsSubIntervalCount() ); } @@ -400,12 +399,12 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan * */ private void initDataBase() { -if (persistenceCfg.getCheckpointingThreads() > 1) +if (persistenceCfg.getCheckpointThreads() > 1) asyncRunner = new IgniteThreadPoolExecutor( "checkpoint-runner",
[08/11] ignite git commit: IGNITE-6030 Allow enabling persistence per data region
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/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 9a2e028..de3b60a 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 @@ -57,18 +57,17 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.management.ObjectName; +import org.apache.ignite.DataStorageMetrics; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.IgniteSystemProperties; -import org.apache.ignite.PersistenceMetrics; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.configuration.CheckpointWriteOrder; import org.apache.ignite.configuration.DataPageEvictionMode; +import org.apache.ignite.configuration.DataRegionConfiguration; +import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.configuration.MemoryConfiguration; -import org.apache.ignite.configuration.MemoryPolicyConfiguration; -import org.apache.ignite.configuration.PersistentStoreConfiguration; import org.apache.ignite.events.DiscoveryEvent; import org.apache.ignite.events.EventType; import org.apache.ignite.internal.GridKernalContext; @@ -139,7 +138,7 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.internal.util.worker.GridWorker; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.lang.IgniteOutClosure; -import org.apache.ignite.mxbean.PersistenceMetricsMXBean; +import org.apache.ignite.mxbean.DataStorageMetricsMXBean; import org.apache.ignite.thread.IgniteThread; import org.apache.ignite.thread.IgniteThreadPoolExecutor; import org.jetbrains.annotations.NotNull; @@ -229,7 +228,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan }; /** */ -private static final String MBEAN_NAME = "PersistenceMetrics"; +private static final String MBEAN_NAME = "DataStorageMetrics"; /** */ private static final String MBEAN_GROUP = "Persistent Store"; @@ -262,7 +261,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan private volatile boolean printCheckpointStats = true; /** Database configuration. */ -private final PersistentStoreConfiguration persistenceCfg; +private final DataStorageConfiguration persistenceCfg; /** */ private final Collection lsnrs = new CopyOnWriteArrayList<>(); @@ -301,7 +300,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan private IgniteCacheSnapshotManager snapshotMgr; /** */ -private PersistenceMetricsImpl persStoreMetrics; +private DataStorageMetricsImpl persStoreMetrics; /** */ private ObjectName persistenceMetricsMbeanName; @@ -318,18 +317,18 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan public GridCacheDatabaseSharedManager(GridKernalContext ctx) { IgniteConfiguration cfg = ctx.config(); -persistenceCfg = cfg.getPersistentStoreConfiguration(); +persistenceCfg = cfg.getDataStorageConfiguration(); -assert persistenceCfg != null : "PageStore should not be created if persistence is disabled."; +assert persistenceCfg != null; -checkpointFreq = persistenceCfg.getCheckpointingFrequency(); +checkpointFreq = persistenceCfg.getCheckpointFrequency(); lockWaitTime = persistenceCfg.getLockWaitTime(); -persStoreMetrics = new PersistenceMetricsImpl( +persStoreMetrics = new DataStorageMetricsImpl( persistenceCfg.isMetricsEnabled(), -persistenceCfg.getRateTimeInterval(), -persistenceCfg.getSubIntervals() +persistenceCfg.getMetricsRateTimeInterval(), +persistenceCfg.getMetricsSubIntervalCount() ); } @@ -400,12 +399,12 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan * */ private void initDataBase() { -if (persistenceCfg.getCheckpointingThreads() > 1) +if (persistenceCfg.getCheckpointThreads() > 1) asyncRunner = new IgniteThreadPoolExecutor( "checkpoint-runner",