ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [10/50] [abbrv] ignite git commit: IGNITE-6030 Allow enabling persistence per data region
Date Wed, 25 Oct 2017 09:40:44 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorDataRegionConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorDataRegionConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorDataRegionConfiguration.java
new file mode 100644
index 0000000..394e294
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorDataRegionConfiguration.java
@@ -0,0 +1,225 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.visor.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.configuration.DataPageEvictionMode;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+/**
+ * Data transfer object for data region configuration.
+ */
+public class VisorDataRegionConfiguration extends VisorDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Unique name of DataRegion. */
+    private String name;
+
+    /** Initial memory region size defined by this memory policy. */
+    private long initSize;
+
+    /** Maximum memory region size defined by this memory policy. */
+    private long maxSize;
+
+    /** Path for memory mapped file. */
+    private String swapPath;
+
+    /** An algorithm for memory pages eviction. */
+    private DataPageEvictionMode pageEvictionMode;
+
+    /** A threshold for memory pages eviction initiation. */
+    private double evictionThreshold;
+
+    /** Minimum number of empty pages in reuse lists. */
+    private int emptyPagesPoolSize;
+
+    /** Enable memory metrics collection for this data region. */
+    private boolean metricsEnabled;
+
+    /** Number of sub-intervals. */
+    private int metricsSubIntervalCount;
+
+    /** Time interval over which allocation rate is calculated. */
+    private long metricsRateTimeInterval;
+
+    /** Enable Ignite Native Persistence. */
+    private boolean persistenceEnabled;
+
+    /**
+     * Default constructor.
+     */
+    public VisorDataRegionConfiguration() {
+        // No-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param plc Data region configuration.
+     */
+    public VisorDataRegionConfiguration(DataRegionConfiguration plc) {
+        assert plc != null;
+
+        name = plc.getName();
+        initSize = plc.getInitialSize();
+        maxSize = plc.getMaxSize();
+        swapPath = plc.getSwapPath();
+        pageEvictionMode = plc.getPageEvictionMode();
+        evictionThreshold = plc.getEvictionThreshold();
+        emptyPagesPoolSize = plc.getEmptyPagesPoolSize();
+        metricsEnabled = plc.isMetricsEnabled();
+        metricsSubIntervalCount = plc.getMetricsSubIntervalCount();
+        metricsRateTimeInterval = plc.getMetricsRateTimeInterval();
+        persistenceEnabled = plc.isPersistenceEnabled();
+    }
+
+    /**
+     * @param regCfgs Array of data region configurations.
+     * @return Collection of DTO objects.
+     */
+    public static List<VisorDataRegionConfiguration> from(DataRegionConfiguration[] regCfgs) {
+        List<VisorDataRegionConfiguration> res = new ArrayList<>();
+
+        if (regCfgs != null) {
+            for (DataRegionConfiguration plc: regCfgs)
+                res.add(new VisorDataRegionConfiguration(plc));
+        }
+
+        return res;
+    }
+
+    /**
+     * @return Unique name of DataRegion.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * @return Maximum memory region size defined by this memory policy.
+     */
+    public long getMaxSize() {
+        return maxSize;
+    }
+
+    /**
+     * @return Initial memory region size defined by this memory policy.
+     */
+    public long getInitialSize() {
+        return initSize;
+    }
+
+    /**
+     * @return Path for memory mapped file.
+     */
+    public String getSwapPath() {
+        return swapPath;
+    }
+
+    /**
+     * @return Memory pages eviction algorithm. {@link DataPageEvictionMode#DISABLED} used by default.
+     */
+    public DataPageEvictionMode getPageEvictionMode() {
+        return pageEvictionMode;
+    }
+
+    /**
+     * @return Memory pages eviction threshold.
+     */
+    public double getEvictionThreshold() {
+        return evictionThreshold;
+    }
+
+    /**
+     * @return Minimum number of empty pages in reuse list.
+     */
+    public int getEmptyPagesPoolSize() {
+        return emptyPagesPoolSize;
+    }
+
+    /**
+     * @return Metrics enabled flag.
+     */
+    public boolean isMetricsEnabled() {
+        return metricsEnabled;
+    }
+
+    /**
+     * @return Number of sub intervals.
+     */
+    public int getMetricsSubIntervalCount() {
+        return metricsSubIntervalCount;
+    }
+
+    /**
+     * @return Time interval over which allocation rate is calculated.
+     */
+    public long getMetricsRateTimeInterval() {
+        return metricsRateTimeInterval;
+    }
+
+    /**
+     * @return Persistence enabled flag.
+     */
+    public boolean isPersistenceEnabled() {
+        return persistenceEnabled;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        U.writeString(out, name);
+        out.writeLong(initSize);
+        out.writeLong(maxSize);
+        U.writeString(out, swapPath);
+        U.writeEnum(out, pageEvictionMode);
+        out.writeDouble(evictionThreshold);
+        out.writeInt(emptyPagesPoolSize);
+        out.writeBoolean(metricsEnabled);
+        out.writeInt(metricsSubIntervalCount);
+        out.writeLong(metricsRateTimeInterval);
+        out.writeBoolean(persistenceEnabled);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        name = U.readString(in);
+        initSize = in.readLong();
+        maxSize = in.readLong();
+        swapPath = U.readString(in);
+        pageEvictionMode = DataPageEvictionMode.fromOrdinal(in.readByte());
+        evictionThreshold = in.readDouble();
+        emptyPagesPoolSize = in.readInt();
+        metricsEnabled = in.readBoolean();
+        metricsSubIntervalCount = in.readInt();
+        metricsRateTimeInterval = in.readLong();
+        persistenceEnabled = in.readBoolean();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorDataRegionConfiguration.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorDataStorageConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorDataStorageConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorDataStorageConfiguration.java
new file mode 100644
index 0000000..78bf1c5
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorDataStorageConfiguration.java
@@ -0,0 +1,453 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.visor.node;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.List;
+import org.apache.ignite.configuration.CheckpointWriteOrder;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.WALMode;
+import org.apache.ignite.internal.util.typedef.internal.S;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.internal.visor.VisorDataTransferObject;
+
+import static org.apache.ignite.internal.visor.util.VisorTaskUtils.compactClass;
+
+/**
+ * Data transfer object for data store configuration.
+ */
+public class VisorDataStorageConfiguration extends VisorDataTransferObject {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Size of a memory chunk reserved for system cache initially. */
+    private long sysRegionInitSize;
+
+    /** Size of memory for system cache. */
+    private long sysRegionMaxSize;
+
+    /** Page size. */
+    private int pageSize;
+
+    /** Concurrency level. */
+    private int concLvl;
+
+    /** Configuration of default data region. */
+    private VisorDataRegionConfiguration dfltDataRegCfg;
+
+    /** Memory policies. */
+    private List<VisorDataRegionConfiguration> dataRegCfgs;
+
+    /** */
+    private String storagePath;
+
+    /** Checkpointing frequency. */
+    private long checkpointFreq;
+
+    /** Lock wait time. */
+    private long lockWaitTime;
+
+    /** */
+    private long checkpointPageBufSize;
+
+    /** */
+    private int checkpointThreads;
+
+    /** Checkpoint write order. */
+    private CheckpointWriteOrder checkpointWriteOrder;
+
+    /** */
+    private int walHistSize;
+
+    /** Number of work WAL segments. */
+    private int walSegments;
+
+    /** Number of WAL segments to keep. */
+    private int walSegmentSize;
+
+    /** WAL persistence path. */
+    private String walPath;
+
+    /** WAL archive path. */
+    private String walArchivePath;
+
+    /** Metrics enabled flag. */
+    private boolean metricsEnabled;
+
+    /** Wal mode. */
+    private WALMode walMode;
+
+    /** WAl thread local buffer size. */
+    private int walTlbSize;
+
+    /** Wal flush frequency. */
+    private long walFlushFreq;
+
+    /** Wal fsync delay in nanoseconds. */
+    private long walFsyncDelay;
+
+    /** Wal record iterator buffer size. */
+    private int walRecordIterBuffSize;
+
+    /** Always write full pages. */
+    private boolean alwaysWriteFullPages;
+
+    /** Factory to provide I/O interface for files */
+    private String fileIOFactory;
+
+    /** Number of sub-intervals. */
+    private int metricsSubIntervalCount;
+
+    /** Time interval (in milliseconds) for rate-based metrics. */
+    private long metricsRateTimeInterval;
+
+    /** Time interval (in milliseconds) for running auto archiving for incompletely WAL segment */
+    private long walAutoArchiveAfterInactivity;
+
+    /** If true, threads that generate dirty pages too fast during ongoing checkpoint will be throttled. */
+    private boolean writeThrottlingEnabled;
+
+    /**
+     * Default constructor.
+     */
+    public VisorDataStorageConfiguration() {
+        // No-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param cfg Data storage configuration.
+     */
+    public VisorDataStorageConfiguration(DataStorageConfiguration cfg) {
+        assert cfg != null;
+
+        sysRegionInitSize = cfg.getSystemRegionInitialSize();
+        sysRegionMaxSize = cfg.getSystemRegionMaxSize();
+        pageSize = cfg.getPageSize();
+        concLvl = cfg.getConcurrencyLevel();
+
+        DataRegionConfiguration dfltRegion = cfg.getDefaultDataRegionConfiguration();
+
+        if (dfltRegion != null)
+            dfltDataRegCfg = new VisorDataRegionConfiguration(dfltRegion);
+
+        dataRegCfgs = VisorDataRegionConfiguration.from(cfg.getDataRegionConfigurations());
+
+        storagePath = cfg.getStoragePath();
+        checkpointFreq = cfg.getCheckpointFrequency();
+        lockWaitTime = cfg.getLockWaitTime();
+        checkpointPageBufSize = cfg.getCheckpointPageBufferSize();
+        checkpointThreads = cfg.getCheckpointThreads();
+        checkpointWriteOrder = cfg.getCheckpointWriteOrder();
+        walHistSize = cfg.getWalHistorySize();
+        walSegments = cfg.getWalSegments();
+        walSegmentSize = cfg.getWalSegmentSize();
+        walPath = cfg.getWalPath();
+        walArchivePath = cfg.getWalArchivePath();
+        metricsEnabled = cfg.isMetricsEnabled();
+        walMode = cfg.getWalMode();
+        walTlbSize = cfg.getWalThreadLocalBufferSize();
+        walFlushFreq = cfg.getWalFlushFrequency();
+        walFsyncDelay = cfg.getWalFsyncDelayNanos();
+        walRecordIterBuffSize = cfg.getWalRecordIteratorBufferSize();
+        alwaysWriteFullPages = cfg.isAlwaysWriteFullPages();
+        fileIOFactory = compactClass(cfg.getFileIOFactory());
+        metricsSubIntervalCount = cfg.getMetricsSubIntervalCount();
+        metricsRateTimeInterval = cfg.getMetricsRateTimeInterval();
+        walAutoArchiveAfterInactivity = cfg.getWalAutoArchiveAfterInactivity();
+        writeThrottlingEnabled = cfg.isWriteThrottlingEnabled();
+    }
+
+    /**
+     * @return Initial size in bytes.
+     */
+    public long getSystemRegionInitialSize() {
+        return sysRegionInitSize;
+    }
+
+    /**
+     * @return Maximum in bytes.
+     */
+    public long getSystemRegionMaxSize() {
+        return sysRegionMaxSize;
+    }
+
+    /**
+     * @return Page size in bytes.
+     */
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    /**
+     * @return Mapping table concurrency level.
+     */
+    public int getConcurrencyLevel() {
+        return concLvl;
+    }
+
+    /**
+     * @return Configuration of default data region.
+     */
+    public VisorDataRegionConfiguration getDefaultDataRegionConfiguration() {
+        return dfltDataRegCfg;
+    }
+
+    /**
+     * @return Array of configured data regions.
+     */
+    public List<VisorDataRegionConfiguration> getDataRegionConfigurations() {
+        return dataRegCfgs;
+    }
+
+    /**
+     * @return Path the root directory where the Persistent Store will persist data and indexes.
+     */
+    public String getStoragePath() {
+        return storagePath;
+    }
+
+    /**
+     * @return Checkpointing frequency in milliseconds.
+     */
+    public long getCheckpointFrequency() {
+        return checkpointFreq;
+    }
+
+    /**
+     * @return Checkpointing page buffer size in bytes.
+     */
+    public long getCheckpointPageBufferSize() {
+        return checkpointPageBufSize;
+    }
+
+    /**
+     * @return Number of checkpointing threads.
+     */
+    public int getCheckpointThreads() {
+        return checkpointThreads;
+    }
+
+    /**
+     * @return Checkpoint write order.
+     */
+    public CheckpointWriteOrder getCheckpointWriteOrder() {
+        return checkpointWriteOrder;
+    }
+
+    /**
+     * @return Time for wait.
+     */
+    public long getLockWaitTime() {
+        return lockWaitTime;
+    }
+
+    /**
+     * @return Number of WAL segments to keep after a checkpoint is finished.
+     */
+    public int getWalHistorySize() {
+        return walHistSize;
+    }
+
+    /**
+     * @return Number of work WAL segments.
+     */
+    public int getWalSegments() {
+        return walSegments;
+    }
+
+    /**
+     * @return WAL segment size.
+     */
+    public int getWalSegmentSize() {
+        return walSegmentSize;
+    }
+
+    /**
+     * @return WAL persistence path, absolute or relative to Ignite work directory.
+     */
+    public String getWalPath() {
+        return walPath;
+    }
+
+    /**
+     *  @return WAL archive directory.
+     */
+    public String getWalArchivePath() {
+        return walArchivePath;
+    }
+
+    /**
+     * @return Metrics enabled flag.
+     */
+    public boolean isMetricsEnabled() {
+        return metricsEnabled;
+    }
+
+    /**
+     * @return Time interval in milliseconds.
+     */
+    public long getMetricsRateTimeInterval() {
+        return metricsRateTimeInterval;
+    }
+
+    /**
+     * @return The number of sub-intervals for history tracking.
+     */
+    public int getMetricsSubIntervalCount() {
+        return metricsSubIntervalCount;
+    }
+
+    /**
+     * @return WAL mode.
+     */
+    public WALMode getWalMode() {
+        return walMode;
+    }
+
+    /**
+     * @return Thread local buffer size.
+     */
+    public int getWalThreadLocalBufferSize() {
+        return walTlbSize;
+    }
+
+    /**
+     * @return Flush frequency.
+     */
+    public long getWalFlushFrequency() {
+        return walFlushFreq;
+    }
+
+    /**
+     * @return Gets the fsync delay, in nanoseconds.
+     */
+    public long getWalFsyncDelayNanos() {
+        return walFsyncDelay;
+    }
+
+    /**
+     * @return Record iterator buffer size.
+     */
+    public int getWalRecordIteratorBufferSize() {
+        return walRecordIterBuffSize;
+    }
+
+    /**
+     * @return Flag indicating whether full pages should be always written.
+     */
+    public boolean isAlwaysWriteFullPages() {
+        return alwaysWriteFullPages;
+    }
+
+    /**
+     * @return File I/O factory class name.
+     */
+    public String getFileIOFactory() {
+        return fileIOFactory;
+    }
+
+    /**
+     * @return Time in millis.
+     */
+    public long getWalAutoArchiveAfterInactivity() {
+        return walAutoArchiveAfterInactivity;
+    }
+
+    /**
+     * @return Flag indicating whether write throttling is enabled.
+     */
+    public boolean isWriteThrottlingEnabled() {
+        return writeThrottlingEnabled;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeExternalData(ObjectOutput out) throws IOException {
+        out.writeLong(sysRegionInitSize);
+        out.writeLong(sysRegionMaxSize);
+        out.writeInt(pageSize);
+        out.writeInt(concLvl);
+        out.writeObject(dfltDataRegCfg);
+        U.writeCollection(out, dataRegCfgs);
+        U.writeString(out, storagePath);
+        out.writeLong(checkpointFreq);
+        out.writeLong(lockWaitTime);
+        out.writeLong(checkpointPageBufSize);
+        out.writeInt(checkpointThreads);
+        U.writeEnum(out, checkpointWriteOrder);
+        out.writeInt(walHistSize);
+        out.writeInt(walSegments);
+        out.writeInt(walSegmentSize);
+        U.writeString(out, walPath);
+        U.writeString(out, walArchivePath);
+        out.writeBoolean(metricsEnabled);
+        U.writeEnum(out, walMode);
+        out.writeInt(walTlbSize);
+        out.writeLong(walFlushFreq);
+        out.writeLong(walFsyncDelay);
+        out.writeInt(walRecordIterBuffSize);
+        out.writeBoolean(alwaysWriteFullPages);
+        U.writeString(out, fileIOFactory);
+        out.writeInt(metricsSubIntervalCount);
+        out.writeLong(metricsRateTimeInterval);
+        out.writeLong(walAutoArchiveAfterInactivity);
+        out.writeBoolean(writeThrottlingEnabled);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
+        sysRegionInitSize = in.readLong();
+        sysRegionMaxSize = in.readLong();
+        pageSize = in.readInt();
+        concLvl = in.readInt();
+        dfltDataRegCfg = (VisorDataRegionConfiguration)in.readObject();
+        dataRegCfgs = U.readList(in);
+        storagePath = U.readString(in);
+        checkpointFreq = in.readLong();
+        lockWaitTime = in.readLong();
+        checkpointPageBufSize = in.readLong();
+        checkpointThreads = in.readInt();
+        checkpointWriteOrder = CheckpointWriteOrder.fromOrdinal(in.readByte());
+        walHistSize = in.readInt();
+        walSegments = in.readInt();
+        walSegmentSize = in.readInt();
+        walPath = U.readString(in);
+        walArchivePath = U.readString(in);
+        metricsEnabled = in.readBoolean();
+        walMode = WALMode.fromOrdinal(in.readByte());
+        walTlbSize = in.readInt();
+        walFlushFreq = in.readLong();
+        walFsyncDelay = in.readLong();
+        walRecordIterBuffSize = in.readInt();
+        alwaysWriteFullPages = in.readBoolean();
+        fileIOFactory = U.readString(in);
+        metricsSubIntervalCount = in.readInt();
+        metricsRateTimeInterval = in.readLong();
+        walAutoArchiveAfterInactivity = in.readLong();
+        writeThrottlingEnabled = in.readBoolean();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(VisorDataStorageConfiguration.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java
index a716a76..99cce40 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorGridConfiguration.java
@@ -119,6 +119,9 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
     /** List of service configurations. */
     private List<VisorServiceConfiguration> srvcCfgs;
 
+    /** Configuration of data storage. */
+    private VisorDataStorageConfiguration dataStorage;
+
     /**
      * Default constructor.
      */
@@ -153,11 +156,11 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
         atomic = new VisorAtomicConfiguration(c.getAtomicConfiguration());
         txCfg = new VisorTransactionConfiguration(c.getTransactionConfiguration());
 
-        if (c.getMemoryConfiguration() != null)
-            memCfg = new VisorMemoryConfiguration(c.getMemoryConfiguration());
+        if (c.getDataStorageConfiguration() != null)
+            memCfg = null;
 
-        if (c.getPersistentStoreConfiguration() != null)
-            psCfg = new VisorPersistentStoreConfiguration(c.getPersistentStoreConfiguration());
+        if (c.getDataStorageConfiguration() != null)
+            psCfg = null;
 
         storeSesLsnrs = compactArray(c.getCacheStoreSessionListenerFactories());
         warmupClos = compactClass(c.getWarmupClosure());
@@ -180,6 +183,8 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
             sqlConnCfg = new VisorSqlConnectorConfiguration(scc);
 
         srvcCfgs = VisorServiceConfiguration.list(c.getServiceConfiguration());
+
+        dataStorage = new VisorDataStorageConfiguration(c.getDataStorageConfiguration());
     }
 
     /**
@@ -357,6 +362,18 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
         return srvcCfgs;
     }
 
+    /**
+     * @return Configuration of data storage.
+     */
+    public VisorDataStorageConfiguration getDataStorageConfiguration() {
+        return dataStorage;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte getProtocolVersion() {
+        return V2;
+    }
+
     /** {@inheritDoc} */
     @Override protected void writeExternalData(ObjectOutput out) throws IOException {
         out.writeObject(basic);
@@ -384,6 +401,7 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
         out.writeObject(hadoopCfg);
         out.writeObject(sqlConnCfg);
         U.writeCollection(out, srvcCfgs);
+        out.writeObject(dataStorage);
     }
 
     /** {@inheritDoc} */
@@ -413,6 +431,9 @@ public class VisorGridConfiguration extends VisorDataTransferObject {
         hadoopCfg = (VisorHadoopConfiguration)in.readObject();
         sqlConnCfg = (VisorSqlConnectorConfiguration) in.readObject();
         srvcCfgs = U.readList(in);
+
+        if (protoVer == V2)
+            dataStorage = (VisorDataStorageConfiguration)in.readObject();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryConfiguration.java
index ccb23ac..6708f9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryConfiguration.java
@@ -22,8 +22,8 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.ArrayList;
 import java.util.List;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -48,10 +48,10 @@ public class VisorMemoryConfiguration extends VisorDataTransferObject {
     /** Concurrency level. */
     private int concLvl;
 
-    /** Name of MemoryPolicy to be used as default. */
+    /** Name of DataRegion to be used as default. */
     private String dfltMemPlcName;
 
-    /** Size of memory (in bytes) to use for default MemoryPolicy. */
+    /** Size of memory (in bytes) to use for default DataRegion. */
     private long dfltMemPlcSize;
 
     /** Memory policies. */
@@ -69,22 +69,22 @@ public class VisorMemoryConfiguration extends VisorDataTransferObject {
      *
      * @param memCfg Memory configuration.
      */
-    public VisorMemoryConfiguration(MemoryConfiguration memCfg) {
+    public VisorMemoryConfiguration(DataStorageConfiguration memCfg) {
         assert memCfg != null;
 
-        sysCacheInitSize = memCfg.getSystemCacheInitialSize();
-        sysCacheMaxSize = memCfg.getSystemCacheMaxSize();
+        sysCacheInitSize = memCfg.getSystemRegionInitialSize();
+        sysCacheMaxSize = memCfg.getSystemRegionMaxSize();
         pageSize = memCfg.getPageSize();
         concLvl = memCfg.getConcurrencyLevel();
-        dfltMemPlcName = memCfg.getDefaultMemoryPolicyName();
-        dfltMemPlcSize = memCfg.getDefaultMemoryPolicySize();
+//        dfltMemPlcName = memCfg.getDefaultDataRegionName();
+        //dfltMemPlcSize = memCfg.getDefaultDataRegionSize();
 
-        MemoryPolicyConfiguration[] plcs = memCfg.getMemoryPolicies();
+        DataRegionConfiguration[] plcs = memCfg.getDataRegionConfigurations();
 
         if (!F.isEmpty(plcs)) {
             memPlcs = new ArrayList<>(plcs.length);
 
-            for (MemoryPolicyConfiguration plc : plcs)
+            for (DataRegionConfiguration plc : plcs)
                 memPlcs.add(new VisorMemoryPolicyConfiguration(plc));
         }
     }
@@ -118,7 +118,7 @@ public class VisorMemoryConfiguration extends VisorDataTransferObject {
     }
 
     /**
-     * @return Name of MemoryPolicy to be used as default.
+     * @return Name of DataRegion to be used as default.
      */
     public String getDefaultMemoryPolicyName() {
         return dfltMemPlcName;
@@ -132,7 +132,7 @@ public class VisorMemoryConfiguration extends VisorDataTransferObject {
     }
 
     /**
-     * @return Collection of MemoryPolicyConfiguration objects.
+     * @return Collection of DataRegionConfiguration objects.
      */
     public List<VisorMemoryPolicyConfiguration> getMemoryPolicies() {
         return memPlcs;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
index bed4c4b..92159a8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorMemoryPolicyConfiguration.java
@@ -21,7 +21,7 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import org.apache.ignite.configuration.DataPageEvictionMode;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorDataTransferObject;
@@ -33,7 +33,7 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** Unique name of MemoryPolicy. */
+    /** Unique name of DataRegion. */
     private String name;
 
     /** Maximum memory region size defined by this memory policy. */
@@ -69,20 +69,20 @@ public class VisorMemoryPolicyConfiguration extends VisorDataTransferObject {
      *
      * @param plc Memory policy configuration.
      */
-    public VisorMemoryPolicyConfiguration(MemoryPolicyConfiguration plc) {
+    public VisorMemoryPolicyConfiguration(DataRegionConfiguration plc) {
         assert plc != null;
 
         name = plc.getName();
         maxSize = plc.getMaxSize();
         initSize = plc.getInitialSize();
-        swapFilePath = plc.getSwapFilePath();
+        swapFilePath = plc.getSwapPath();
         pageEvictionMode = plc.getPageEvictionMode();
         evictionThreshold = plc.getEvictionThreshold();
         emptyPagesPoolSize = plc.getEmptyPagesPoolSize();
     }
 
     /**
-     * Unique name of MemoryPolicy.
+     * Unique name of DataRegion.
      */
     public String getName() {
         return name;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
index 3fd7b0d..99d1132 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
@@ -21,7 +21,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.ConcurrentMap;
 import org.apache.ignite.IgniteFileSystem;
-import org.apache.ignite.MemoryMetrics;
+import org.apache.ignite.DataRegionMetrics;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.FileSystemConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
@@ -157,7 +157,7 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
         try {
             List<VisorMemoryMetrics> memoryMetrics = res.getMemoryMetrics();
 
-            for (MemoryMetrics m : ignite.memoryMetrics())
+            for (DataRegionMetrics m : ignite.dataRegionMetrics())
                 memoryMetrics.add(new VisorMemoryMetrics(m));
         }
         catch (Exception e) {
@@ -257,7 +257,7 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
      */
     protected void persistenceMetrics(VisorNodeDataCollectorJobResult res) {
         try {
-            res.setPersistenceMetrics(new VisorPersistenceMetrics(ignite.persistentStoreMetrics()));
+            res.setPersistenceMetrics(new VisorPersistenceMetrics(ignite.dataStorageMetrics()));
         }
         catch (Exception e) {
             res.setPersistenceMetricsEx(new VisorExceptionWrapper(e));

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java
index 90ecf6e..0612c5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJobResult.java
@@ -54,7 +54,7 @@ public class VisorNodeDataCollectorJobResult extends VisorDataTransferObject {
     /** Exception while collecting node events. */
     private VisorExceptionWrapper evtsEx;
 
-    /** Node memory metrics. */
+    /** Node data region metrics. */
     private List<VisorMemoryMetrics> memoryMetrics = new ArrayList<>();
 
     /** Exception while collecting memory metrics. */
@@ -161,7 +161,7 @@ public class VisorNodeDataCollectorJobResult extends VisorDataTransferObject {
     }
 
     /**
-     * @return Collected memory metrics.
+     * @return Collected data region metrics.
      */
     public List<VisorMemoryMetrics> getMemoryMetrics() {
         return memoryMetrics;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java
index 6e10b84..ace964c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorTaskResult.java
@@ -67,7 +67,7 @@ public class VisorNodeDataCollectorTaskResult extends VisorDataTransferObject {
     /** Exceptions caught during collecting events from nodes. */
     private Map<UUID, VisorExceptionWrapper> evtsEx = new HashMap<>();
 
-    /** All memory metrics collected from nodes. */
+    /** All data region metrics collected from nodes. */
     private Map<UUID, Collection<VisorMemoryMetrics>> memoryMetrics = new HashMap<>();
 
     /** Exceptions caught during collecting memory metrics from nodes. */
@@ -188,7 +188,7 @@ public class VisorNodeDataCollectorTaskResult extends VisorDataTransferObject {
     }
 
     /**
-     * @return All memory metrics collected from nodes.
+     * @return All data region metrics collected from nodes.
      */
     public Map<UUID, Collection<VisorMemoryMetrics>> getMemoryMetrics() {
         return memoryMetrics;

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistenceMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistenceMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistenceMetrics.java
index c838161..165855c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistenceMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistenceMetrics.java
@@ -19,12 +19,12 @@ package org.apache.ignite.internal.visor.node;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import org.apache.ignite.PersistenceMetrics;
+import org.apache.ignite.DataStorageMetrics;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
 /**
- * DTO object for {@link PersistenceMetrics}.
+ * DTO object for {@link DataStorageMetrics}.
  */
 public class VisorPersistenceMetrics extends VisorDataTransferObject {
     /** */
@@ -76,7 +76,7 @@ public class VisorPersistenceMetrics extends VisorDataTransferObject {
     /**
      * @param metrics Persistence metrics.
      */
-    public VisorPersistenceMetrics(PersistenceMetrics metrics) {
+    public VisorPersistenceMetrics(DataStorageMetrics metrics) {
         walLoggingRate = metrics.getWalLoggingRate();
         walWritingRate = metrics.getWalWritingRate();
         walArchiveSegments = metrics.getWalArchiveSegments();

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java
index 128f43a..f9d7a64 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorPersistentStoreConfiguration.java
@@ -19,14 +19,14 @@ package org.apache.ignite.internal.visor.node;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.WALMode;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorDataTransferObject;
 
 /**
- * DTO object for {@link PersistentStoreConfiguration}.
+ * DTO object for {@link DataStorageConfiguration}.
  */
 public class VisorPersistentStoreConfiguration extends VisorDataTransferObject {
     /** */
@@ -99,26 +99,26 @@ public class VisorPersistentStoreConfiguration extends VisorDataTransferObject {
     /**
      * @param cfg Persistent store configuration.
      */
-    public VisorPersistentStoreConfiguration(PersistentStoreConfiguration cfg) {
-        persistenceStorePath = cfg.getPersistentStorePath();
-        checkpointingFreq = cfg.getCheckpointingFrequency();
+    public VisorPersistentStoreConfiguration(DataStorageConfiguration cfg) {
+        persistenceStorePath = cfg.getStoragePath();
+        checkpointingFreq = cfg.getCheckpointFrequency();
         lockWaitTime = cfg.getLockWaitTime();
-        checkpointingPageBufSize = cfg.getCheckpointingPageBufferSize();
-        checkpointingThreads = cfg.getCheckpointingThreads();
+        checkpointingPageBufSize = cfg.getCheckpointPageBufferSize();
+        checkpointingThreads = cfg.getCheckpointThreads();
         walHistSize = cfg.getWalHistorySize();
         walSegments = cfg.getWalSegments();
         walSegmentSize = cfg.getWalSegmentSize();
-        walStorePath = cfg.getWalStorePath();
+        walStorePath = cfg.getWalPath();
         walArchivePath = cfg.getWalArchivePath();
         metricsEnabled = cfg.isMetricsEnabled();
         walMode = cfg.getWalMode();
-        tlbSize = cfg.getTlbSize();
+        tlbSize = cfg.getWalThreadLocalBufferSize();
         walFlushFreq = cfg.getWalFlushFrequency();
         walFsyncDelay = cfg.getWalFsyncDelayNanos();
         walRecordIterBuffSize = cfg.getWalRecordIteratorBufferSize();
         alwaysWriteFullPages = cfg.isAlwaysWriteFullPages();
-        subIntervals = cfg.getSubIntervals();
-        rateTimeInterval = cfg.getRateTimeInterval();
+        subIntervals = cfg.getMetricsSubIntervalCount();
+        rateTimeInterval = cfg.getMetricsRateTimeInterval();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java
new file mode 100644
index 0000000..eeed496
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.mxbean;
+
+import org.apache.ignite.DataRegionMetrics;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+
+/**
+ * This interface defines a JMX view on {@link DataRegionMetrics}.
+ */
+@MXBeanDescription("MBean that provides access to DataRegionMetrics of a local Apache Ignite node.")
+public interface DataRegionMetricsMXBean extends DataRegionMetrics {
+    /** {@inheritDoc} */
+    @MXBeanDescription("A name of a memory region the metrics are collected for.")
+    @Override public String getName();
+
+    /**
+     * Gets initial memory region size defined by its {@link DataRegionConfiguration}.
+     *
+     * @return Initial size in MB.
+     */
+    @MXBeanDescription("Initial memory region size defined by its data region.")
+    public int getInitialSize();
+
+    /**
+     * Maximum memory region size defined by its {@link DataRegionConfiguration}.
+     *
+     * @return Maximum size in MB.
+     */
+    @MXBeanDescription("Maximum memory region size defined by its data region.")
+    public int getMaxSize();
+
+    /**
+     * A path to the memory-mapped files the memory region defined by {@link DataRegionConfiguration} will be
+     * mapped to.
+     *
+     * @return Path to the memory-mapped files.
+     */
+    @MXBeanDescription("Path to the memory-mapped files.")
+    public String getSwapPath();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Total number of allocated pages.")
+    @Override public long getTotalAllocatedPages();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Allocation rate (pages per second) averaged across rateTimeInternal.")
+    @Override public float getAllocationRate();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Eviction rate (pages per second).")
+    @Override public float getEvictionRate();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Percentage of pages that are fully occupied by large entries that go beyond page size.")
+    @Override public float getLargeEntriesPagesPercentage();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Percentage of space that is still free and can be filled in.")
+    @Override public float getPagesFillFactor();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Number of pages in memory not yet synchronized with persistent storage.")
+    @Override public long getDirtyPages();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Rate at which pages in memory are replaced with pages from persistent storage (pages per second).")
+    @Override public float getPagesReplaceRate();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Number of pages residing in physical RAM.")
+    @Override public long getPhysicalMemoryPages();
+
+    /**
+     * Enables memory metrics collection on an Apache Ignite node.
+     */
+    @MXBeanDescription("Enables memory metrics collection on an Apache Ignite node.")
+    public void enableMetrics();
+
+    /**
+     * Disables memory metrics collection on an Apache Ignite node.
+     */
+    @MXBeanDescription("Disables memory metrics collection on an Apache Ignite node.")
+    public void disableMetrics();
+
+    /**
+     * Sets time interval for {@link #getAllocationRate()} and {@link #getEvictionRate()} monitoring purposes.
+     * <p>
+     * For instance, after setting the interval to 60 seconds, subsequent calls to {@link #getAllocationRate()}
+     * will return average allocation rate (pages per second) for the last minute.
+     *
+     * @param rateTimeInterval Time interval (in milliseconds) used for allocation and eviction rates calculations.
+     */
+    @MXBeanDescription(
+        "Sets time interval for pages allocation and eviction monitoring purposes."
+    )
+    @MXBeanParametersNames(
+        "rateTimeInterval"
+    )
+    @MXBeanParametersDescriptions(
+        "Time interval (in milliseconds) to set."
+    )
+    public void rateTimeInterval(long rateTimeInterval);
+
+    /**
+     * Sets a number of sub-intervals the whole {@link #rateTimeInterval(long)} will be split into to calculate
+     * {@link #getAllocationRate()} and {@link #getEvictionRate()} rates (5 by default).
+     * <p>
+     * Setting it to a bigger value will result in more precise calculation and smaller drops of
+     * {@link #getAllocationRate()} metric when next sub-interval has to be recycled but introduces bigger
+     * calculation overhead.
+     *
+     * @param subInts A number of sub-intervals.
+     */
+    @MXBeanDescription(
+        "Sets a number of sub-intervals to calculate allocation and eviction rates metrics."
+    )
+    @MXBeanParametersNames(
+        "subInts"
+    )
+    @MXBeanParametersDescriptions(
+        "Number of subintervals to set."
+    )
+    public void subIntervals(int subInts);
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMetricsMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMetricsMXBean.java
new file mode 100644
index 0000000..f0fb631
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMetricsMXBean.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.mxbean;
+
+import org.apache.ignite.DataStorageMetrics;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+
+/**
+ * An MX bean allowing to monitor and tune persistence metrics.
+ */
+public interface DataStorageMetricsMXBean extends DataStorageMetrics {
+    /** {@inheritDoc} */
+    @MXBeanDescription("Average number of WAL records per second written during the last time interval.")
+    @Override float getWalLoggingRate();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Average number of bytes per second written during the last time interval.")
+    @Override float getWalWritingRate();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Current number of WAL segments in the WAL archive.")
+    @Override int getWalArchiveSegments();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Average WAL fsync duration in microseconds over the last time interval.")
+    @Override float getWalFsyncTimeAverage();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Duration of the last checkpoint in milliseconds.")
+    @Override long getLastCheckpointingDuration();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Duration of the checkpoint lock wait in milliseconds.")
+    @Override long getLastCheckpointLockWaitDuration();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Duration of the checkpoint mark in milliseconds.")
+    @Override long getLastCheckpointMarkDuration();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Duration of the checkpoint pages write in milliseconds.")
+    @Override long getLastCheckpointPagesWriteDuration();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Duration of the sync phase of the last checkpoint in milliseconds.")
+    @Override long getLastCheckpointFsyncDuration();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Total number of pages written during the last checkpoint.")
+    @Override long getLastCheckpointTotalPagesNumber();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Total number of data pages written during the last checkpoint.")
+    @Override long getLastCheckpointDataPagesNumber();
+
+    /** {@inheritDoc} */
+    @MXBeanDescription("Number of pages copied to a temporary checkpoint buffer during the last checkpoint.")
+    @Override long getLastCheckpointCopiedOnWritePagesNumber();
+
+    /**
+     * Enables persistence metrics collection on an Apache Ignite node.
+     */
+    @MXBeanDescription("Enables persistence metrics collection on an Apache Ignite node.")
+    public void enableMetrics();
+
+    /**
+     * Disables persistence metrics collection on an Apache Ignite node.
+     */
+    @MXBeanDescription("Disables persistence metrics collection on an Apache Ignite node.")
+    public void disableMetrics();
+
+    /**
+     * Sets time interval for rate-based metrics. Identical to setting
+     * {@link DataStorageConfiguration#setMetricsRateTimeInterval(long)} configuration property.
+     *
+     * @param rateTimeInterval Time interval (in milliseconds) used for allocation and eviction rates calculations.
+     */
+    @MXBeanDescription(
+        "Sets time interval for pages allocation and eviction monitoring purposes."
+    )
+    @MXBeanParametersNames(
+        "rateTimeInterval"
+    )
+    @MXBeanParametersDescriptions(
+        "Time interval (in milliseconds) to set."
+    )
+    public void rateTimeInterval(long rateTimeInterval);
+
+    /**
+     * Sets a number of sub-intervals the whole {@link #rateTimeInterval(long)} will be split into to calculate
+     * rate-based metrics. Identical to setting {@link DataStorageConfiguration#setMetricsSubIntervalCount(int)} configuration
+     * property.
+     *
+     * @param subInts A number of sub-intervals.
+     */
+    @MXBeanDescription(
+        "Sets a number of sub-intervals to calculate allocation and eviction rates metrics."
+    )
+    @MXBeanParametersNames(
+        "subInts"
+    )
+    @MXBeanParametersDescriptions(
+        "Number of subintervals to set."
+    )
+    public void subIntervals(int subInts);
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java
index 4d6c96a..e547536 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java
@@ -21,8 +21,10 @@ import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 
 /**
  * This interface defines a JMX view on {@link MemoryMetrics}.
+ * @deprecated Part of old API. Metrics are accessible through {@link DataRegionMetricsMXBean}.
  */
 @MXBeanDescription("MBean that provides access to MemoryMetrics of a local Apache Ignite node.")
+@Deprecated
 public interface MemoryMetricsMXBean extends MemoryMetrics {
     /** {@inheritDoc} */
     @MXBeanDescription("A name of a memory region the metrics are collected for.")

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java
index 40c2235..0c16640 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java
@@ -22,7 +22,9 @@ import org.apache.ignite.configuration.PersistentStoreConfiguration;
 
 /**
  * An MX bean allowing to monitor and tune persistence metrics.
+ * @deprecated Part of old API. Metrics are accessible through {@link DataStorageMetricsMXBean}.
  */
+@Deprecated
 public interface PersistenceMetricsMXBean extends PersistenceMetrics {
     /** {@inheritDoc} */
     @MXBeanDescription("Average number of WAL records per second written during the last time interval.")

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 2f795df..f3fc074 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -137,10 +137,10 @@ org.apache.ignite.configuration.CollectionConfiguration
 org.apache.ignite.configuration.DataPageEvictionMode
 org.apache.ignite.configuration.DeploymentMode
 org.apache.ignite.configuration.IgniteReflectionFactory
-org.apache.ignite.configuration.MemoryConfiguration
-org.apache.ignite.configuration.MemoryPolicyConfiguration
+org.apache.ignite.configuration.DataStorageConfiguration
+org.apache.ignite.configuration.DataRegionConfiguration
 org.apache.ignite.configuration.NearCacheConfiguration
-org.apache.ignite.configuration.PersistentStoreConfiguration
+org.apache.ignite.configuration.DataStorageConfiguration
 org.apache.ignite.configuration.TopologyValidator
 org.apache.ignite.configuration.TransactionConfiguration
 org.apache.ignite.configuration.WALMode

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/config/examples.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/test/config/examples.properties b/modules/core/src/test/config/examples.properties
index ea0d8ed..2144533 100644
--- a/modules/core/src/test/config/examples.properties
+++ b/modules/core/src/test/config/examples.properties
@@ -22,4 +22,4 @@ ScalarCacheExample=examples/config/example-ignite.xml
 ScalarCacheQueryExample=examples/config/example-ignite.xml
 ScalarCountGraphTrianglesExample=examples/config/example-ignite.xml
 ScalarPopularNumbersRealTimeExample=examples/config/example-ignite.xml
-MemoryPolicyExample=examples/config/example-memory-policies.xml
\ No newline at end of file
+DataRegionExample=examples/config/example-data-regions.xml
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/cache/LargeEntryUpdateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/LargeEntryUpdateTest.java b/modules/core/src/test/java/org/apache/ignite/cache/LargeEntryUpdateTest.java
index be92761..008da71 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/LargeEntryUpdateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/LargeEntryUpdateTest.java
@@ -25,8 +25,8 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteCompute;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
 import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.lang.IgniteRunnable;
 import org.apache.ignite.resources.IgniteInstanceResource;
@@ -71,11 +71,11 @@ public class LargeEntryUpdateTest extends GridCommonAbstractTest {
 
         cfg.setPublicThreadPoolSize(THREAD_COUNT);
 
-        MemoryConfiguration mem = new MemoryConfiguration();
+        DataStorageConfiguration mem = new DataStorageConfiguration();
 
         mem.setPageSize(PAGE_SIZE);
 
-        cfg.setMemoryConfiguration(mem);
+        cfg.setDataStorageConfiguration(mem);
 
         CacheConfiguration[] ccfgs = new CacheConfiguration[CACHE_COUNT];
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
index f842440..1352c37 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/ClusterNodeMetricsSelfTest.java
@@ -29,7 +29,7 @@ import org.apache.ignite.cluster.ClusterMetrics;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.events.Event;
-import org.apache.ignite.internal.processors.cache.persistence.MemoryMetricsImpl;
+import org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl;
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.lang.IgnitePredicate;
@@ -111,7 +111,7 @@ public class ClusterNodeMetricsSelfTest extends GridCommonAbstractTest {
 
         final IgniteCache cache = ignite.getOrCreateCache(CACHE_NAME);
 
-        MemoryMetricsImpl memMetrics = getDefaultMemoryPolicyMetrics(ignite);
+        DataRegionMetricsImpl memMetrics = getDefaultMemoryPolicyMetrics(ignite);
 
         memMetrics.enableMetrics();
 
@@ -128,8 +128,8 @@ public class ClusterNodeMetricsSelfTest extends GridCommonAbstractTest {
     /**
      * @param ignite Ignite instance.
      */
-    private MemoryMetricsImpl getDefaultMemoryPolicyMetrics(IgniteEx ignite) throws IgniteCheckedException {
-        return ignite.context().cache().context().database().memoryPolicy(null).memoryMetrics();
+    private DataRegionMetricsImpl getDefaultMemoryPolicyMetrics(IgniteEx ignite) throws IgniteCheckedException {
+        return ignite.context().cache().context().database().dataRegion(null).memoryMetrics();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java
index 3d6f116..9a923f3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java
@@ -25,7 +25,7 @@ import org.apache.ignite.IgniteState;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.cache.query.ContinuousQuery;
 import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.events.DiscoveryEvent;
 import org.apache.ignite.events.Event;
@@ -81,10 +81,10 @@ public class IgniteSlowClientDetectionSelfTest extends GridCommonAbstractTest {
 
         cfg.setCommunicationSpi(commSpi);
 
-        MemoryConfiguration dbCfg = new MemoryConfiguration();
+        DataStorageConfiguration dbCfg = new DataStorageConfiguration();
         dbCfg.setPageSize(16 * 1024);
 
-        cfg.setMemoryConfiguration(dbCfg);
+        cfg.setDataStorageConfiguration(dbCfg);
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
index 5bef372..3b9e393 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/pagemem/impl/PageMemoryNoLoadSelfTest.java
@@ -23,7 +23,7 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.internal.mem.DirectMemoryProvider;
 import org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
 import org.apache.ignite.internal.mem.file.MappedFileMemoryProvider;
@@ -32,7 +32,7 @@ import org.apache.ignite.internal.pagemem.PageIdAllocator;
 import org.apache.ignite.internal.pagemem.PageIdUtils;
 import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.pagemem.PageUtils;
-import org.apache.ignite.internal.processors.cache.persistence.MemoryMetricsImpl;
+import org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl;
 import org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
@@ -309,7 +309,7 @@ public class PageMemoryNoLoadSelfTest extends GridCommonAbstractTest {
     protected PageMemory memory() throws Exception {
         File memDir = U.resolveWorkDirectory(U.defaultWorkDirectory(), "pagemem", false);
 
-        MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration()
+        DataRegionConfiguration plcCfg = new DataRegionConfiguration()
             .setMaxSize(MAX_MEMORY_SIZE).setInitialSize(MAX_MEMORY_SIZE);
 
         DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), memDir);
@@ -320,7 +320,7 @@ public class PageMemoryNoLoadSelfTest extends GridCommonAbstractTest {
             null,
             PAGE_SIZE,
             plcCfg,
-            new MemoryMetricsImpl(plcCfg),
+            new DataRegionMetricsImpl(plcCfg),
             true);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
index 3a418f0..8703791 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
@@ -31,8 +31,8 @@ import org.apache.ignite.cache.CacheWriteSynchronizationMode;
 import org.apache.ignite.cache.store.CacheStore;
 import org.apache.ignite.cache.store.CacheStoreAdapter;
 import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.lang.IgniteBiInClosure;
@@ -75,7 +75,7 @@ public class CacheClientStoreSelfTest extends GridCommonAbstractTest {
         cfg.setClientMode(client);
 
         if (client)
-            cfg.setMemoryConfiguration(new MemoryConfiguration());
+            cfg.setDataStorageConfiguration(new DataStorageConfiguration());
 
         CacheConfiguration cc = new CacheConfiguration(DEFAULT_CACHE_NAME);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationLeakTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationLeakTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationLeakTest.java
index bf94d16..6b03867 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationLeakTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheConfigurationLeakTest.java
@@ -21,9 +21,9 @@ import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.eviction.lru.LruEvictionPolicy;
 import org.apache.ignite.configuration.CacheConfiguration;
+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.lang.IgniteInClosure;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
@@ -43,17 +43,16 @@ public class CacheConfigurationLeakTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration() throws Exception {
         IgniteConfiguration cfg = super.getConfiguration();
 
-        MemoryConfiguration memCfg = new MemoryConfiguration();
+        DataStorageConfiguration memCfg = new DataStorageConfiguration();
 
-        MemoryPolicyConfiguration plc = new MemoryPolicyConfiguration();
+        DataRegionConfiguration plc = new DataRegionConfiguration();
 
         plc.setName("dfltPlc");
-        plc.setMaxSize(MemoryConfiguration.DFLT_MEMORY_POLICY_MAX_SIZE * 10);
+        plc.setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_MAX_SIZE * 10);
 
-        memCfg.setDefaultMemoryPolicyName("dfltPlc");
-        memCfg.setMemoryPolicies(plc);
+        memCfg.setDefaultDataRegionConfiguration(plc);
 
-        cfg.setMemoryConfiguration(memCfg);
+        cfg.setDataStorageConfiguration(memCfg);
 
         return cfg;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
new file mode 100644
index 0000000..775aaa8
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDataRegionConfigurationTest.java
@@ -0,0 +1,172 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ *
+ */
+public class CacheDataRegionConfigurationTest extends GridCommonAbstractTest {
+    /** */
+    private volatile CacheConfiguration ccfg;
+
+    /** */
+    private volatile DataStorageConfiguration memCfg;
+
+    /** */
+    private static final long DFLT_MEM_PLC_SIZE = 10 * 1024 * 1024;
+
+    /** */
+    private static final long BIG_MEM_PLC_SIZE = 1024 * 1024 * 1024;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        if (memCfg != null)
+            cfg.setDataStorageConfiguration(memCfg);
+
+        if (ccfg != null)
+            cfg.setCacheConfiguration(ccfg);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * Verifies that proper exception is thrown when DataRegion is misconfigured for cache.
+     */
+    public void testMissingDataRegion() throws Exception {
+        ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
+
+        ccfg.setDataRegionName("nonExistingMemPlc");
+
+        try {
+            startGrid(0);
+        }
+        catch (IgniteCheckedException e) {
+            String msg = e.getMessage();
+
+            assertTrue("Not expected exception was thrown: " + e, msg.contains("Requested DataRegion is not configured"));
+
+            return;
+        }
+
+        fail("Expected exception was not thrown: missing DataRegion");
+    }
+
+    /**
+     * Verifies that {@link IgniteOutOfMemoryException} is thrown when cache is configured with too small DataRegion.
+     */
+    public void testTooSmallDataRegion() throws Exception {
+        memCfg = new DataStorageConfiguration();
+
+        DataRegionConfiguration dfltPlcCfg = new DataRegionConfiguration();
+        dfltPlcCfg.setName("dfltPlc");
+        dfltPlcCfg.setInitialSize(10 * 1024 * 1024);
+        dfltPlcCfg.setMaxSize(10 * 1024 * 1024);
+
+        DataRegionConfiguration bigPlcCfg = new DataRegionConfiguration();
+        bigPlcCfg.setName("bigPlc");
+        bigPlcCfg.setMaxSize(1024 * 1024 * 1024);
+
+        memCfg.setDataRegionConfigurations(bigPlcCfg);
+        memCfg.setDefaultDataRegionConfiguration(dfltPlcCfg);
+
+        ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
+
+        IgniteEx ignite0 = startGrid(0);
+
+        IgniteCache<Object, Object> cache = ignite0.cache(DEFAULT_CACHE_NAME);
+
+        boolean oomeThrown = false;
+
+        try {
+            for (int i = 0; i < 500_000; i++)
+                cache.put(i, "abc");
+        }
+        catch (Exception e) {
+            Throwable cause = e;
+
+            do {
+                if (cause instanceof IgniteOutOfMemoryException) {
+                    oomeThrown = true;
+                    break;
+                }
+
+                if (cause == null)
+                    break;
+
+                if (cause.getSuppressed() == null || cause.getSuppressed().length == 0)
+                    cause = cause.getCause();
+                else
+                    cause = cause.getSuppressed()[0];
+            }
+            while (true);
+        }
+
+        if (!oomeThrown)
+            fail("OutOfMemoryException hasn't been thrown");
+    }
+
+    /**
+     * Verifies that with enough memory allocated adding values to cache doesn't cause any exceptions.
+     */
+    public void testProperlySizedMemoryPolicy() throws Exception {
+        memCfg = new DataStorageConfiguration();
+
+        DataRegionConfiguration dfltPlcCfg = new DataRegionConfiguration();
+        dfltPlcCfg.setName("dfltPlc");
+        dfltPlcCfg.setInitialSize(DFLT_MEM_PLC_SIZE);
+        dfltPlcCfg.setMaxSize(DFLT_MEM_PLC_SIZE);
+
+        DataRegionConfiguration bigPlcCfg = new DataRegionConfiguration();
+        bigPlcCfg.setName("bigPlc");
+        bigPlcCfg.setMaxSize(BIG_MEM_PLC_SIZE);
+
+        memCfg.setDataRegionConfigurations(bigPlcCfg);
+        memCfg.setDefaultDataRegionConfiguration(dfltPlcCfg);
+
+        ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
+        ccfg.setDataRegionName("bigPlc");
+
+        IgniteEx ignite0 = startGrid(0);
+
+        IgniteCache<Object, Object> cache = ignite0.cache(DEFAULT_CACHE_NAME);
+
+        try {
+            for (int i = 0; i < 500_000; i++)
+                cache.put(i, "abc");
+        }
+        catch (Exception e) {
+            fail("With properly sized DataRegion no exceptions are expected to be thrown.");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMemoryPolicyConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMemoryPolicyConfigurationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMemoryPolicyConfigurationTest.java
deleted file mode 100644
index 0fb9c08..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMemoryPolicyConfigurationTest.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-/**
- *
- */
-public class CacheMemoryPolicyConfigurationTest extends GridCommonAbstractTest {
-    /** */
-    private volatile CacheConfiguration ccfg;
-
-    /** */
-    private volatile MemoryConfiguration memCfg;
-
-    /** */
-    private static final long DFLT_MEM_PLC_SIZE = 10 * 1024 * 1024;
-
-    /** */
-    private static final long BIG_MEM_PLC_SIZE = 1024 * 1024 * 1024;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        if (memCfg != null)
-            cfg.setMemoryConfiguration(memCfg);
-
-        if (ccfg != null)
-            cfg.setCacheConfiguration(ccfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-    }
-
-    /**
-     * Verifies that proper exception is thrown when MemoryPolicy is misconfigured for cache.
-     */
-    public void testMissingMemoryPolicy() throws Exception {
-        ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
-
-        ccfg.setMemoryPolicyName("nonExistingMemPlc");
-
-        try {
-            startGrid(0);
-        }
-        catch (IgniteCheckedException e) {
-            String msg = e.getMessage();
-
-            assertTrue("Not expected exception was thrown: " + e, msg.contains("Requested MemoryPolicy is not configured"));
-
-            return;
-        }
-
-        fail("Expected exception was not thrown: missing MemoryPolicy");
-    }
-
-    /**
-     * Verifies that {@link IgniteOutOfMemoryException} is thrown when cache is configured with too small MemoryPolicy.
-     */
-    public void testTooSmallMemoryPolicy() throws Exception {
-        memCfg = new MemoryConfiguration();
-
-        MemoryPolicyConfiguration dfltPlcCfg = new MemoryPolicyConfiguration();
-        dfltPlcCfg.setName("dfltPlc");
-        dfltPlcCfg.setInitialSize(10 * 1024 * 1024);
-        dfltPlcCfg.setMaxSize(10 * 1024 * 1024);
-
-        MemoryPolicyConfiguration bigPlcCfg = new MemoryPolicyConfiguration();
-        bigPlcCfg.setName("bigPlc");
-        bigPlcCfg.setMaxSize(1024 * 1024 * 1024);
-
-        memCfg.setMemoryPolicies(dfltPlcCfg, bigPlcCfg);
-        memCfg.setDefaultMemoryPolicyName("dfltPlc");
-
-        ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
-
-        IgniteEx ignite0 = startGrid(0);
-
-        IgniteCache<Object, Object> cache = ignite0.cache(DEFAULT_CACHE_NAME);
-
-        boolean oomeThrown = false;
-
-        try {
-            for (int i = 0; i < 500_000; i++)
-                cache.put(i, "abc");
-        }
-        catch (Exception e) {
-            Throwable cause = e;
-
-            do {
-                if (cause instanceof IgniteOutOfMemoryException) {
-                    oomeThrown = true;
-                    break;
-                }
-
-                if (cause == null)
-                    break;
-
-                if (cause.getSuppressed() == null || cause.getSuppressed().length == 0)
-                    cause = cause.getCause();
-                else
-                    cause = cause.getSuppressed()[0];
-            }
-            while (true);
-        }
-
-        if (!oomeThrown)
-            fail("OutOfMemoryException hasn't been thrown");
-    }
-
-    /**
-     * Verifies that with enough memory allocated adding values to cache doesn't cause any exceptions.
-     */
-    public void testProperlySizedMemoryPolicy() throws Exception {
-        memCfg = new MemoryConfiguration();
-
-        MemoryPolicyConfiguration dfltPlcCfg = new MemoryPolicyConfiguration();
-        dfltPlcCfg.setName("dfltPlc");
-        dfltPlcCfg.setInitialSize(DFLT_MEM_PLC_SIZE);
-        dfltPlcCfg.setMaxSize(DFLT_MEM_PLC_SIZE);
-
-        MemoryPolicyConfiguration bigPlcCfg = new MemoryPolicyConfiguration();
-        bigPlcCfg.setName("bigPlc");
-        bigPlcCfg.setMaxSize(BIG_MEM_PLC_SIZE);
-
-        memCfg.setMemoryPolicies(dfltPlcCfg, bigPlcCfg);
-        memCfg.setDefaultMemoryPolicyName("dfltPlc");
-
-        ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
-        ccfg.setMemoryPolicyName("bigPlc");
-
-        IgniteEx ignite0 = startGrid(0);
-
-        IgniteCache<Object, Object> cache = ignite0.cache(DEFAULT_CACHE_NAME);
-
-        try {
-            for (int i = 0; i < 500_000; i++)
-                cache.put(i, "abc");
-        }
-        catch (Exception e) {
-            fail("With properly sized MemoryPolicy no exceptions are expected to be thrown.");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
index c53bc4b..5eb8292 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStopAndDestroySelfTest.java
@@ -27,8 +27,8 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.MemoryConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.managers.communication.GridIoMessage;
@@ -72,7 +72,7 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
     private static String CACHE_NAME_LOC = "cache_local";
 
     /** Memory configuration to be used on client nodes with local caches. */
-    private static MemoryConfiguration memCfg;
+    private static DataStorageConfiguration memCfg;
 
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
@@ -97,7 +97,7 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
         if (getTestIgniteInstanceName(2).equals(igniteInstanceName)) {
             iCfg.setClientMode(true);
 
-            iCfg.setMemoryConfiguration(memCfg);
+            iCfg.setDataStorageConfiguration(memCfg);
         }
 
         ((TcpDiscoverySpi)iCfg.getDiscoverySpi()).setIpFinder(ipFinder);
@@ -670,7 +670,7 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testLocalClose() throws Exception {
-        memCfg = new MemoryConfiguration();
+        memCfg = new DataStorageConfiguration();
 
         startGridsMultiThreaded(gridCount());
 
@@ -721,7 +721,7 @@ public class CacheStopAndDestroySelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testLocalCloseWithTry() throws Exception {
-        memCfg = new MemoryConfiguration();
+        memCfg = new DataStorageConfiguration();
 
         startGridsMultiThreaded(gridCount());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec41370c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridDataStorageConfigurationConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridDataStorageConfigurationConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridDataStorageConfigurationConsistencySelfTest.java
new file mode 100644
index 0000000..3c728f7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridDataStorageConfigurationConsistencySelfTest.java
@@ -0,0 +1,79 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.util.concurrent.Callable;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ * Tests a check of memory configuration consistency.
+ */
+public class GridDataStorageConfigurationConsistencySelfTest extends GridCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+        discoSpi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(discoSpi);
+
+        DataStorageConfiguration memCfg = new DataStorageConfiguration();
+
+        // Nodes will have different page size.
+        memCfg.setPageSize(DataStorageConfiguration.DFLT_PAGE_SIZE * (1 + getTestIgniteInstanceIndex(gridName)));
+
+        cfg.setDataStorageConfiguration(memCfg);
+
+        return cfg;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testMemoryConfigurationConsistency() throws Exception {
+        GridTestUtils.assertThrows(log, new Callable<Void>() {
+            /** {@inheritDoc} */
+            @Override public Void call() throws Exception {
+                startGrids(2);
+
+                return null;
+            }
+        }, IgniteCheckedException.class, null);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        stopAllGrids();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopAllGrids();
+    }
+}


Mime
View raw message