ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [41/50] [abbrv] ignite git commit: Merge master into ignite-gg-12163 - fixing compilation
Date Mon, 22 May 2017 15:13:09 GMT
Merge master into ignite-gg-12163 - fixing compilation


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

Branch: refs/heads/ignite-5075-pds
Commit: 930c87c9dcdcc455858d39d534e88f631e598bdc
Parents: e809458
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Fri May 19 18:56:59 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Fri May 19 18:56:59 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/ExchangeActions.java       |  2 +-
 .../IgniteCacheDatabaseSharedManager.java       |  2 --
 .../GridDhtPartitionsExchangeFuture.java        | 27 ++++++++--------
 .../GridCacheDatabaseSharedManager.java         | 16 ++++++----
 .../cache/database/pagemem/PageMemoryImpl.java  | 33 +++++++++++++++-----
 ...istentStoreCacheRebalancingAbstractTest.java |  3 +-
 ...ersistentStoreContinuousRestartSelfTest.java |  3 +-
 .../IgnitePersistentStoreDynamicCacheTest.java  |  3 +-
 ...tentStoreMultiNodePutGetRestartSelfTest.java |  3 +-
 .../IgnitePersistentStorePageSizesTest.java     |  3 +-
 ...entStoreRecoveryAfterFileCorruptionTest.java |  3 +-
 ...entStoreRemoveDuringRebalancingSelfTest.java |  3 +-
 .../IgnitePersistentStoreWalTlbSelfTest.java    |  3 +-
 ...ageEvictionDuringPartitionClearSelfTest.java |  3 +-
 .../IgniteDbMultiNodePutGetRestartSelfTest.java |  3 +-
 .../db/IgniteDbPageEvictionSelfTest.java        |  3 +-
 .../db/IgniteDbWholeClusterRestartSelfTest.java |  3 +-
 .../db/RebalancingOnNotStableTopologyTest.java  |  3 +-
 .../cache/database/db/TransactionsHangTest.java |  3 +-
 ...IgniteCachePageStoreIntegrationSelfTest.java |  3 +-
 .../IgniteWalHistoryReservationsSelfTest.java   |  3 +-
 .../db/file/IgniteWalRecoverySelfTest.java      |  3 +-
 .../IgniteWalRecoverySeveralRestartsTest.java   |  3 +-
 .../db/file/PageStoreEvictionSelfTest.java      |  3 +-
 ...PlusTreeReuseListPageMemoryImplSelfTest.java | 30 ++++++++++--------
 ...BPlusTreeSelfTestPageMemoryImplSelfTest.java | 31 ++++++++++--------
 .../database/pagemem/FullPageIdTableTest.java   | 12 ++++---
 .../MetadataStoragePageMemoryImplSelfTest.java  | 30 ++++++++++--------
 .../pagemem/PageIdDistributionTest.java         | 22 +++++++------
 .../pagemem/PageMemoryImplNoLoadSelfTest.java   | 22 +++++++------
 .../database/pagemem/PageMemoryImplTest.java    | 31 ++++++++++--------
 .../GridChangeGlobalStateAbstractTest.java      |  3 +-
 .../extended/GridActivateExtensionTest.java     |  3 +-
 .../ignite/testsuites/IgnitePdsTestSuite.java   |  2 --
 34 files changed, 193 insertions(+), 130 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
index eac1120..ca103b1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
@@ -262,7 +262,7 @@ public class ExchangeActions {
      * @param req Request.
      * @param desc Cache descriptor.
      */
-    void addCacheToStop(DynamicCacheChangeRequest req, DynamicCacheDescriptor desc) {
+    public void addCacheToStop(DynamicCacheChangeRequest req, DynamicCacheDescriptor desc) {
         assert req.stop() : req;
 
         cachesToStop = add(cachesToStop, req, desc);

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
index b722465..9049a81 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/IgniteCacheDatabaseSharedManager.java
@@ -24,7 +24,6 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.UUID;
 import javax.management.JMException;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteLogger;
@@ -40,7 +39,6 @@ import org.apache.ignite.internal.mem.file.MappedFileMemoryProvider;
 import org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider;
 import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl;
-import org.apache.ignite.internal.pagemem.snapshot.SnapshotOperation;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheMapEntry;
 import org.apache.ignite.internal.processors.cache.GridCacheSharedManagerAdapter;

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index e64f0dd..c75b0a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -34,7 +34,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.locks.ReadWriteLock;
 import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.IgniteNeedReconnectException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.cache.PartitionLossPolicy;
@@ -47,21 +46,22 @@ import org.apache.ignite.internal.IgniteClientDisconnectedCheckedException;
 import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.internal.IgniteNeedReconnectException;
 import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException;
 import org.apache.ignite.internal.events.DiscoveryCustomEvent;
-import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
+import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
 import org.apache.ignite.internal.pagemem.snapshot.SnapshotOperation;
 import org.apache.ignite.internal.pagemem.snapshot.SnapshotOperationType;
 import org.apache.ignite.internal.pagemem.snapshot.StartSnapshotOperationAckDiscoveryMessage;
-import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.affinity.GridAffinityAssignmentCache;
 import org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage;
 import org.apache.ignite.internal.processors.cache.CacheInvalidStateException;
+import org.apache.ignite.internal.processors.cache.CachePartitionExchangeWorkerTask;
 import org.apache.ignite.internal.processors.cache.ClusterState;
 import org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch;
-import org.apache.ignite.internal.processors.cache.CachePartitionExchangeWorkerTask;
+import org.apache.ignite.internal.processors.cache.DynamicCacheChangeRequest;
 import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
 import org.apache.ignite.internal.processors.cache.ExchangeActions;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
@@ -546,19 +546,21 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
                         SnapshotOperation op = snapshotOperationMsg.snapshotOperation();
 
                         if (op.type() == SnapshotOperationType.RESTORE) {
-                            if (reqs != null)
-                                reqs = new ArrayList<>(reqs);
-                            else
-                                reqs = new ArrayList<>();
+                            assert exchActions == null;
+
+                            exchActions = new ExchangeActions();
 
                             List<DynamicCacheChangeRequest> destroyRequests = getStopCacheRequests(
                                 cctx.cache(), op.cacheNames(), cctx.localNodeId());
 
-                            reqs.addAll(destroyRequests);
+                            if (!F.isEmpty(destroyRequests)) { //Emulate destroy cache request
+                                for (DynamicCacheChangeRequest req : destroyRequests) {
+                                    exchActions.addCacheToStop(req, cctx.cache()
+                                        .cacheDescriptor(CU.cacheId(req.cacheName())));
+                                }
 
-                            if (!reqs.isEmpty()) { //Emulate destroy cache request
                                 if (op.type() == SnapshotOperationType.RESTORE)
-                                    cctx.cache().onCustomEvent(new DynamicCacheChangeBatch(reqs), topVer);
+                                    cctx.cache().onCustomEvent(new DynamicCacheChangeBatch(destroyRequests), topVer);
 
                                 onCacheChangeRequest(crdNode);
                             }
@@ -591,9 +593,6 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
 
             updateTopologies(crdNode);
 
-            if (exchActions != null && exchActions.hasStop())
-                cctx.cache().context().database().beforeCachesStop();
-
             switch (exchange) {
                 case ALL: {
                     distributedExchange();

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/GridCacheDatabaseSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/GridCacheDatabaseSharedManager.java b/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/GridCacheDatabaseSharedManager.java
index 632bdaf..0b20195 100755
--- a/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/GridCacheDatabaseSharedManager.java
+++ b/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/GridCacheDatabaseSharedManager.java
@@ -527,7 +527,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
     }
 
     /** {@inheritDoc} */
-    @Override protected long[] calculateFragmentSizes(int concLvl, long cacheSize) {
+    protected long[] calculateFragmentSizes(int concLvl, long cacheSize) {
         if (concLvl < 2)
             concLvl = Runtime.getRuntime().availableProcessors();
 
@@ -549,11 +549,15 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
     /** {@inheritDoc} */
     @Override protected PageMemory createPageMemory(
         DirectMemoryProvider memProvider,
-        int pageSize,
-        MemoryPolicyConfiguration cfg,
+        MemoryConfiguration memCfg,
+        MemoryPolicyConfiguration plcCfg,
         MemoryMetricsImpl memMetrics
     ) {
-        return new PageMemoryImpl(memProvider, cctx, pageSize,
+        return new PageMemoryImpl(
+            memProvider,
+            calculateFragmentSizes(memCfg.getConcurrencyLevel(), plcCfg.getMaxSize()),
+            cctx,
+            memCfg.getPageSize(),
             new GridInClosure3X<FullPageId, ByteBuffer, Integer>() {
                 @Override public void applyx(
                     FullPageId fullId,
@@ -659,7 +663,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
         if (cctx.kernalContext().query().moduleEnabled()) {
             for (GridCacheContext cacheCtx : (Collection<GridCacheContext>)cctx.cacheContexts()) {
-                if (fut.isCacheAdded(cacheCtx.cacheId(), fut.topologyVersion()) &&
+                if (fut.cacheAddedOnExchange(cacheCtx.cacheId(), cacheCtx.receivedFrom()) &&
                     !cctx.pageStore().hasIndexStore(cacheCtx.cacheId()) && cacheCtx.affinityNode()) {
                     final int cacheId = cacheCtx.cacheId();
 
@@ -876,7 +880,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
                 continue;
 
             for (GridDhtLocalPartition part : cacheCtx.topology().currentLocalPartitions()) {
-                if (part.state() != GridDhtPartitionState.OWNING || part.size() <= ggWalRebalanceThreshold)
+                if (part.state() != GridDhtPartitionState.OWNING || part.publicSize() <= ggWalRebalanceThreshold)
                     continue;
 
                 for (Long cpTs : checkpointHist.checkpoints()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/pagemem/PageMemoryImpl.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/pagemem/PageMemoryImpl.java b/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/pagemem/PageMemoryImpl.java
index af3418b..4a7f1c5 100755
--- a/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/pagemem/PageMemoryImpl.java
+++ b/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/pagemem/PageMemoryImpl.java
@@ -21,10 +21,12 @@ import java.io.Closeable;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ArrayBlockingQueue;
@@ -38,7 +40,6 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.internal.IgniteInternalFuture;
-import org.apache.ignite.internal.mem.DirectMemory;
 import org.apache.ignite.internal.mem.DirectMemoryProvider;
 import org.apache.ignite.internal.mem.DirectMemoryRegion;
 import org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
@@ -220,6 +221,9 @@ public class PageMemoryImpl implements PageMemoryEx {
     /**  */
     private boolean pageEvictWarned;
 
+    /** */
+    private long[] sizes;
+
     /**
      * @param directMemoryProvider Memory allocator to use.
      * @param sharedCtx Cache shared context.
@@ -229,6 +233,7 @@ public class PageMemoryImpl implements PageMemoryEx {
      */
     public PageMemoryImpl(
         DirectMemoryProvider directMemoryProvider,
+        long[] sizes,
         GridCacheSharedContext<?, ?> sharedCtx,
         int pageSize,
         GridInClosure3X<FullPageId, ByteBuffer, Integer> flushDirtyPage,
@@ -238,8 +243,10 @@ public class PageMemoryImpl implements PageMemoryEx {
         assert sharedCtx != null;
 
         log = sharedCtx.logger(PageMemoryImpl.class);
+
         this.sharedCtx = sharedCtx;
         this.directMemoryProvider = directMemoryProvider;
+        this.sizes = sizes;
         this.flushDirtyPage = flushDirtyPage;
         this.changeTracker = changeTracker;
         this.stateChecker = stateChecker;
@@ -257,18 +264,26 @@ public class PageMemoryImpl implements PageMemoryEx {
 
     /** {@inheritDoc} */
     @Override public void start() throws IgniteException {
-        if (directMemoryProvider instanceof LifecycleAware)
-            ((LifecycleAware)directMemoryProvider).start();
+        directMemoryProvider.initialize(sizes);
+
+        List<DirectMemoryRegion> regions = new ArrayList<>(sizes.length);
 
-        DirectMemory memory = directMemoryProvider.memory();
+        while (true) {
+            DirectMemoryRegion reg = directMemoryProvider.nextRegion();
+
+            if (reg == null)
+                break;
+
+            regions.add(reg);
+        }
 
         nioAccess = SharedSecrets.getJavaNioAccess();
 
-        int regs = memory.regions().size();
+        int regs = regions.size();
 
         segments = new Segment[regs - 1];
 
-        DirectMemoryRegion cpReg = memory.regions().get(regs - 1);
+        DirectMemoryRegion cpReg = regions.get(regs - 1);
 
         checkpointPool = new PagePool(regs - 1, cpReg);
 
@@ -281,11 +296,11 @@ public class PageMemoryImpl implements PageMemoryEx {
         for (int i = 0; i < regs - 1; i++) {
             assert i < segments.length;
 
-            DirectMemoryRegion reg = memory.regions().get(i);
+            DirectMemoryRegion reg = regions.get(i);
 
             totalAllocated += reg.size();
 
-            segments[i] = new Segment(i, memory.regions().get(i), checkpointPool.pages() / segments.length);
+            segments[i] = new Segment(i, regions.get(i), checkpointPool.pages() / segments.length);
 
             pages += segments[i].pages();
             totalTblSize += segments[i].tableSize();
@@ -305,6 +320,8 @@ public class PageMemoryImpl implements PageMemoryEx {
         if (log.isDebugEnabled())
             log.debug("Stopping page memory.");
 
+        directMemoryProvider.shutdown();
+
         if (directMemoryProvider instanceof LifecycleAware)
             ((LifecycleAware)directMemoryProvider).stop();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheRebalancingAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheRebalancingAbstractTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheRebalancingAbstractTest.java
index 663fe5b..cd09e89 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheRebalancingAbstractTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreCacheRebalancingAbstractTest.java
@@ -107,7 +107,8 @@ public abstract class IgnitePersistentStoreCacheRebalancingAbstractTest extends
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setMaxSize(100 * 1024 * 1024);
+        memPlcCfg.setInitialSize(100 * 1024 * 1024);
         memPlcCfg.setSwapFilePath("work/swap");
 
         dbCfg.setMemoryPolicies(memPlcCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreContinuousRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreContinuousRestartSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreContinuousRestartSelfTest.java
index ff577e5..f666a23 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreContinuousRestartSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreContinuousRestartSelfTest.java
@@ -63,7 +63,8 @@ public class IgnitePersistentStoreContinuousRestartSelfTest extends GridCommonAb
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(400 * 1024 * 1024);
+        memPlcCfg.setMaxSize(400 * 1024 * 1024);
+        memPlcCfg.setInitialSize(400 * 1024 * 1024);
 
         dbCfg.setMemoryPolicies(memPlcCfg);
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDynamicCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDynamicCacheTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDynamicCacheTest.java
index 548c9d4..cda2a4a 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDynamicCacheTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreDynamicCacheTest.java
@@ -73,7 +73,8 @@ public class IgnitePersistentStoreDynamicCacheTest extends IgniteDbDynamicCacheS
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(200 * 1024 * 1024);
+        memPlcCfg.setInitialSize(200 * 1024 * 1024);
+        memPlcCfg.setMaxSize(200 * 1024 * 1024);
 
         dbCfg.setMemoryPolicies(memPlcCfg);
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
index 45d5490..d67aafe 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreMultiNodePutGetRestartSelfTest.java
@@ -75,7 +75,8 @@ public class IgnitePersistentStoreMultiNodePutGetRestartSelfTest extends GridCom
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setInitialSize(100 * 1024 * 1024);
+        memPlcCfg.setMaxSize(100 * 1024 * 1024);
 
         memCfg.setDefaultMemoryPolicyName("dfltMemPlc");
         memCfg.setMemoryPolicies(memPlcCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStorePageSizesTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStorePageSizesTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStorePageSizesTest.java
index 9fc349b..697bc49 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStorePageSizesTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStorePageSizesTest.java
@@ -49,7 +49,8 @@ public class IgnitePersistentStorePageSizesTest extends GridCommonAbstractTest {
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setInitialSize(100 * 1024 * 1024);
+        memPlcCfg.setMaxSize(100 * 1024 * 1024);
 
         memCfg.setMemoryPolicies(memPlcCfg);
         memCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRecoveryAfterFileCorruptionTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRecoveryAfterFileCorruptionTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRecoveryAfterFileCorruptionTest.java
index af3ebe6..fbed6ee 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRecoveryAfterFileCorruptionTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRecoveryAfterFileCorruptionTest.java
@@ -72,7 +72,8 @@ public class IgnitePersistentStoreRecoveryAfterFileCorruptionTest extends GridCo
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(1024 * 1024 * 1024);
+        memPlcCfg.setInitialSize(1024 * 1024 * 1024);
+        memPlcCfg.setMaxSize(1024 * 1024 * 1024);
 
         dbCfg.setMemoryPolicies(memPlcCfg);
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRemoveDuringRebalancingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRemoveDuringRebalancingSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRemoveDuringRebalancingSelfTest.java
index 2423816..6b37a3a 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRemoveDuringRebalancingSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreRemoveDuringRebalancingSelfTest.java
@@ -63,7 +63,8 @@ public class IgnitePersistentStoreRemoveDuringRebalancingSelfTest extends GridCo
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setInitialSize(100 * 1024 * 1024);
+        memPlcCfg.setMaxSize(100 * 1024 * 1024);
         memPlcCfg.setSwapFilePath("db");
 
         dbCfg.setMemoryPolicies(memPlcCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreWalTlbSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreWalTlbSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreWalTlbSelfTest.java
index 89bab33..692117d 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreWalTlbSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/IgnitePersistentStoreWalTlbSelfTest.java
@@ -54,7 +54,8 @@ public class IgnitePersistentStoreWalTlbSelfTest extends GridCommonAbstractTest
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setInitialSize(100 * 1024 * 1024);
+        memPlcCfg.setMaxSize(100 * 1024 * 1024);
 
         memCfg.setMemoryPolicies(memPlcCfg);
         memCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/DbPageEvictionDuringPartitionClearSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/DbPageEvictionDuringPartitionClearSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/DbPageEvictionDuringPartitionClearSelfTest.java
index aac6097..dfbc548 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/DbPageEvictionDuringPartitionClearSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/DbPageEvictionDuringPartitionClearSelfTest.java
@@ -63,7 +63,8 @@ public class DbPageEvictionDuringPartitionClearSelfTest extends GridCommonAbstra
 
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
-        memPlcCfg.setSize(70 * 1024 * 1024);
+        memPlcCfg.setInitialSize(70 * 1024 * 1024);
+        memPlcCfg.setMaxSize(70 * 1024 * 1024);
 
         memPlcCfg.setName("dfltMemPlc");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbMultiNodePutGetRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbMultiNodePutGetRestartSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbMultiNodePutGetRestartSelfTest.java
index ca1d827..d9f9a54 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbMultiNodePutGetRestartSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbMultiNodePutGetRestartSelfTest.java
@@ -64,7 +64,8 @@ public class IgniteDbMultiNodePutGetRestartSelfTest extends GridCommonAbstractTe
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setInitialSize(100 * 1024 * 1024);
+        memPlcCfg.setMaxSize(100 * 1024 * 1024);
 
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");
         dbCfg.setMemoryPolicies(memPlcCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbPageEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbPageEvictionSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbPageEvictionSelfTest.java
index 697b26a..b7a5773 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbPageEvictionSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbPageEvictionSelfTest.java
@@ -63,7 +63,8 @@ public class IgniteDbPageEvictionSelfTest extends GridCommonAbstractTest {
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(50 * 1024 * 1024);
+        memPlcCfg.setInitialSize(50 * 1024 * 1024);
+        memPlcCfg.setMaxSize(50 * 1024 * 1024);
 
         dbCfg.setMemoryPolicies(memPlcCfg);
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
index 5765780..cce3b6e 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
@@ -58,7 +58,8 @@ public class IgniteDbWholeClusterRestartSelfTest extends GridCommonAbstractTest
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setInitialSize(100 * 1024 * 1024);
+        memPlcCfg.setMaxSize(100 * 1024 * 1024);
 
         dbCfg.setMemoryPolicies(memPlcCfg);
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/RebalancingOnNotStableTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/RebalancingOnNotStableTopologyTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/RebalancingOnNotStableTopologyTest.java
index 3cc02a2..d8df973 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/RebalancingOnNotStableTopologyTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/RebalancingOnNotStableTopologyTest.java
@@ -174,7 +174,8 @@ public class RebalancingOnNotStableTopologyTest extends GridCommonAbstractTest {
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(200 * 1024 * 1024);
+        memPlcCfg.setInitialSize(200 * 1024 * 1024);
+        memPlcCfg.setMaxSize(200 * 1024 * 1024);
 
         memCfg.setMemoryPolicies(memPlcCfg);
         memCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/TransactionsHangTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/TransactionsHangTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/TransactionsHangTest.java
index 99caf8c..60d7f70 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/TransactionsHangTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/TransactionsHangTest.java
@@ -134,7 +134,8 @@ public class TransactionsHangTest extends GridCommonAbstractTest {
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(PAGE_CACHE_SIZE * 1024 * 1024);
+        memPlcCfg.setInitialSize(PAGE_CACHE_SIZE * 1024 * 1024);
+        memPlcCfg.setMaxSize(PAGE_CACHE_SIZE * 1024 * 1024);
 
         memCfg.setMemoryPolicies(memPlcCfg);
         memCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteCachePageStoreIntegrationSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteCachePageStoreIntegrationSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteCachePageStoreIntegrationSelfTest.java
index 47fe4a5..9107b1c 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteCachePageStoreIntegrationSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteCachePageStoreIntegrationSelfTest.java
@@ -67,7 +67,8 @@ public class IgniteCachePageStoreIntegrationSelfTest extends GridCommonAbstractT
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(100 * 1024 * 1024);
+        memPlcCfg.setInitialSize(100 * 1024 * 1024);
+        memPlcCfg.setMaxSize(100 * 1024 * 1024);
 
         dbCfg.setMemoryPolicies(memPlcCfg);
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalHistoryReservationsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalHistoryReservationsSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalHistoryReservationsSelfTest.java
index af27ee1..a92a29f 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalHistoryReservationsSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalHistoryReservationsSelfTest.java
@@ -54,7 +54,8 @@ public class IgniteWalHistoryReservationsSelfTest extends GridCommonAbstractTest
 
         MemoryConfiguration memCfg = new MemoryConfiguration();
 
-        memCfg.setMemoryPolicies(new MemoryPolicyConfiguration().setSize(200 * 1024 * 1024).setName("dfltMemPlc"));
+        memCfg.setMemoryPolicies(new MemoryPolicyConfiguration().setInitialSize(200 * 1024 * 1024)
+            .setMaxSize(200 * 1024 * 1024).setName("dfltMemPlc"));
 
         memCfg.setDefaultMemoryPolicyName("dfltMemPlc");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySelfTest.java
index fd3ed75..b2b0348 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySelfTest.java
@@ -125,7 +125,8 @@ public class IgniteWalRecoverySelfTest extends GridCommonAbstractTest {
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(1024 * 1024 * 1024);
+        memPlcCfg.setInitialSize(1024 * 1024 * 1024);
+        memPlcCfg.setMaxSize(1024 * 1024 * 1024);
 
         dbCfg.setMemoryPolicies(memPlcCfg);
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySeveralRestartsTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySeveralRestartsTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySeveralRestartsTest.java
index f38e9f6..e5f1ec1 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySeveralRestartsTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/IgniteWalRecoverySeveralRestartsTest.java
@@ -85,7 +85,8 @@ public class IgniteWalRecoverySeveralRestartsTest extends GridCommonAbstractTest
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
         memPlcCfg.setName("dfltMemPlc");
-        memPlcCfg.setSize(500 * 1024 * 1024);
+        memPlcCfg.setInitialSize(500 * 1024 * 1024);
+        memPlcCfg.setMaxSize(500 * 1024 * 1024);
 
         dbCfg.setMemoryPolicies(memPlcCfg);
         dbCfg.setDefaultMemoryPolicyName("dfltMemPlc");

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/PageStoreEvictionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/PageStoreEvictionSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/PageStoreEvictionSelfTest.java
index c1ec4ed..275ed3f 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/PageStoreEvictionSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/file/PageStoreEvictionSelfTest.java
@@ -77,7 +77,8 @@ public class PageStoreEvictionSelfTest extends GridCommonAbstractTest {
         final MemoryConfiguration dbCfg = new MemoryConfiguration();
 
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-        memPlcCfg.setSize(MEMORY_LIMIT);
+        memPlcCfg.setInitialSize(MEMORY_LIMIT);
+        memPlcCfg.setMaxSize(MEMORY_LIMIT);
         memPlcCfg.setName("dfltMemPlc");
 
         dbCfg.setPageSize(PAGE_SIZE);

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeReuseListPageMemoryImplSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeReuseListPageMemoryImplSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeReuseListPageMemoryImplSelfTest.java
index 2b78233..4cfc14f 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeReuseListPageMemoryImplSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeReuseListPageMemoryImplSelfTest.java
@@ -60,7 +60,7 @@ public class BPlusTreeReuseListPageMemoryImplSelfTest extends BPlusTreeReuseSelf
 
         sizes[CPUS] = 10 * MB;
 
-        DirectMemoryProvider provider = new UnsafeMemoryProvider(sizes);
+        DirectMemoryProvider provider = new UnsafeMemoryProvider(log);
 
         GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(
             new GridTestKernalContext(log),
@@ -80,19 +80,23 @@ public class BPlusTreeReuseListPageMemoryImplSelfTest extends BPlusTreeReuseSelf
             null
         );
 
-        PageMemory mem = new PageMemoryImpl(provider, sharedCtx, PAGE_SIZE,
+        PageMemory mem = new PageMemoryImpl(
+            provider, sizes,
+            sharedCtx,
+            PAGE_SIZE,
             new CIX3<FullPageId, ByteBuffer, Integer>() {
-            @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuf, Integer tag) {
-                assert false : "No evictions should happen during the test";
-            }
-        }, new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {
-            @Override public void applyx(Long page, FullPageId fullPageId, PageMemoryEx pageMem) {
-            }
-        }, new CheckpointLockStateChecker() {
-            @Override public boolean checkpointLockIsHeldByThread() {
-                return true;
-            }
-        });
+                @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuf, Integer tag) {
+                    assert false : "No evictions should happen during the test";
+                }
+            },
+            new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {
+                @Override public void applyx(Long page, FullPageId fullPageId, PageMemoryEx pageMem) {
+                }
+            }, new CheckpointLockStateChecker() {
+                @Override public boolean checkpointLockIsHeldByThread() {
+                    return true;
+                }
+            });
 
         mem.start();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
index d629806..82b2de4 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/BPlusTreeSelfTestPageMemoryImplSelfTest.java
@@ -59,7 +59,7 @@ public class BPlusTreeSelfTestPageMemoryImplSelfTest extends BPlusTreeSelfTest {
 
         sizes[CPUS] = 10 * MB;
 
-        DirectMemoryProvider provider = new UnsafeMemoryProvider(sizes);
+        DirectMemoryProvider provider = new UnsafeMemoryProvider(log);
 
         GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(
             new GridTestKernalContext(log),
@@ -79,19 +79,24 @@ public class BPlusTreeSelfTestPageMemoryImplSelfTest extends BPlusTreeSelfTest {
             null
         );
 
-        PageMemory mem = new PageMemoryImpl(provider, sharedCtx, PAGE_SIZE,
+        PageMemory mem = new PageMemoryImpl(
+            provider, sizes,
+            sharedCtx,
+            PAGE_SIZE,
             new CIX3<FullPageId, ByteBuffer, Integer>() {
-            @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuf, Integer tag) {
-                assert false : "No evictions should happen during the test";
-            }
-        }, new CIX3<Long, FullPageId, PageMemoryEx>(){
-            @Override public void applyx(Long aLong, FullPageId fullPageId, PageMemoryEx ex) {
-            }
-        }, new CheckpointLockStateChecker() {
-            @Override public boolean checkpointLockIsHeldByThread() {
-                return true;
-            }
-        });
+                @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuf, Integer tag) {
+                    assert false : "No evictions should happen during the test";
+                }
+            },
+            new CIX3<Long, FullPageId, PageMemoryEx>(){
+                @Override public void applyx(Long aLong, FullPageId fullPageId, PageMemoryEx ex) {
+                }
+            },
+            new CheckpointLockStateChecker() {
+                @Override public boolean checkpointLockIsHeldByThread() {
+                    return true;
+                }
+            });
 
         mem.start();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
index c710164..df212be 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/FullPageIdTableTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.pagemem.FullPageId;
 import org.apache.ignite.internal.processors.cache.database.pagemem.FullPageIdTable;
 import org.apache.ignite.internal.util.typedef.CI2;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.logger.java.JavaLogger;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 /**
@@ -44,8 +45,11 @@ public class FullPageIdTableTest extends GridCommonAbstractTest {
     public void testRandomOperations() throws Exception {
         long mem = FullPageIdTable.requiredMemory(CACHE_ID_RANGE * PAGE_ID_RANGE);
 
-        UnsafeMemoryProvider prov = new UnsafeMemoryProvider(new long[] {mem});
-        prov.start();
+        UnsafeMemoryProvider prov = new UnsafeMemoryProvider(new JavaLogger());
+
+        prov.initialize(new long[] {mem});
+
+        DirectMemoryRegion region = prov.nextRegion();
 
         try {
             long seed = U.currentTimeMillis();
@@ -54,8 +58,6 @@ public class FullPageIdTableTest extends GridCommonAbstractTest {
 
             Random rnd = new Random(seed);
 
-            DirectMemoryRegion region = prov.memory().regions().get(0);
-
             FullPageIdTable tbl = new FullPageIdTable(region.address(), region.size(), true);
 
             Map<FullPageId, Long> check = new HashMap<>();
@@ -86,7 +88,7 @@ public class FullPageIdTableTest extends GridCommonAbstractTest {
             }
         }
         finally {
-            prov.stop();
+            prov.shutdown();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
index 270de23..11e0386 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/MetadataStoragePageMemoryImplSelfTest.java
@@ -60,7 +60,7 @@ public class MetadataStoragePageMemoryImplSelfTest extends MetadataStorageSelfTe
         for (int i = 0; i < sizes.length; i++)
             sizes[i] = 1024 * 1024;
 
-        DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), allocationPath, clean, sizes);
+        DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), allocationPath);
 
         GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(
             new GridTestKernalContext(log),
@@ -80,18 +80,22 @@ public class MetadataStoragePageMemoryImplSelfTest extends MetadataStorageSelfTe
             null
         );
 
-        return new PageMemoryImpl(provider, sharedCtx, PAGE_SIZE,
+        return new PageMemoryImpl(
+            provider, sizes,
+            sharedCtx,
+            PAGE_SIZE,
             new CIX3<FullPageId, ByteBuffer, Integer>() {
-            @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuf, Integer tag) {
-                assert false : "No evictions should happen during the test";
-            }
-        }, new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {
-            @Override public void applyx(Long page, FullPageId fullId, PageMemoryEx pageMem) {
-            }
-        }, new CheckpointLockStateChecker() {
-            @Override public boolean checkpointLockIsHeldByThread() {
-                return true;
-            }
-        });
+                @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuf, Integer tag) {
+                    assert false : "No evictions should happen during the test";
+                }
+            },
+            new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {
+                @Override public void applyx(Long page, FullPageId fullId, PageMemoryEx pageMem) {
+                }
+            }, new CheckpointLockStateChecker() {
+                @Override public boolean checkpointLockIsHeldByThread() {
+                    return true;
+                }
+            });
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
index e0fbcf4..a37f981 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageIdDistributionTest.java
@@ -34,6 +34,7 @@ import org.apache.ignite.internal.processors.cache.database.pagemem.PageMemoryIm
 import org.apache.ignite.internal.util.typedef.T2;
 import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.logger.java.JavaLogger;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 /**
@@ -151,16 +152,19 @@ public class PageIdDistributionTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void _testRealHistory() throws Exception {
-        int cap = CACHE_IDS.length * PARTS * PAGES;
+        int capacity = CACHE_IDS.length * PARTS * PAGES;
 
-        info("Capacity: " + cap);
+        info("Capacity: " + capacity);
 
-        long mem = FullPageIdTable.requiredMemory(cap);
+        long mem = FullPageIdTable.requiredMemory(capacity);
 
         info(U.readableSize(mem, true));
 
-        UnsafeMemoryProvider prov = new UnsafeMemoryProvider(new long[] {mem});
-        prov.start();
+        UnsafeMemoryProvider prov = new UnsafeMemoryProvider(new JavaLogger());
+
+        prov.initialize(new long[] {mem});
+
+        DirectMemoryRegion region = prov.nextRegion();
 
         try {
             long seed = U.currentTimeMillis();
@@ -169,13 +173,11 @@ public class PageIdDistributionTest extends GridCommonAbstractTest {
 
             Random rnd = new Random(seed);
 
-            DirectMemoryRegion region = prov.memory().regions().get(0);
-
             FullPageIdTable tbl = new FullPageIdTable(region.address(), region.size(), true);
 
             Map<T2<Integer, Integer>, Integer> allocated = new HashMap<>();
 
-            for (int i = 0; i < cap; i++) {
+            for (int i = 0; i < capacity; i++) {
                 int cacheId = CACHE_IDS[rnd.nextInt(CACHE_IDS.length)];
                 int partId = rnd.nextInt(PARTS);
 
@@ -196,7 +198,7 @@ public class PageIdDistributionTest extends GridCommonAbstractTest {
                     info("Done: " + i);
             }
 
-            int[] scans = new int[cap];
+            int[] scans = new int[capacity];
 
             int cur = 0;
 
@@ -226,7 +228,7 @@ public class PageIdDistributionTest extends GridCommonAbstractTest {
             }
         }
         finally {
-            prov.stop();
+            prov.shutdown();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
index 843aede..141ce82 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplNoLoadSelfTest.java
@@ -26,10 +26,10 @@ import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.pagemem.impl.PageMemoryNoLoadSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
 import org.apache.ignite.internal.processors.cache.database.CheckpointLockStateChecker;
-import org.apache.ignite.internal.processors.cache.database.IgniteCacheDatabaseSharedManager;
 import org.apache.ignite.internal.processors.cache.database.pagemem.PageMemoryEx;
 import org.apache.ignite.internal.processors.cache.database.pagemem.PageMemoryImpl;
 import org.apache.ignite.internal.util.lang.GridInClosure3X;
+import org.apache.ignite.internal.processors.cache.database.IgniteCacheDatabaseSharedManager;
 import org.apache.ignite.internal.util.typedef.CIX3;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.testframework.junits.GridTestKernalContext;
@@ -49,8 +49,7 @@ public class PageMemoryImplNoLoadSelfTest extends PageMemoryNoLoadSelfTest {
         for (int i = 0; i < sizes.length; i++)
             sizes[i] = 5 * 1024 * 1024;
 
-        DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), memDir, true,
-            sizes);
+        DirectMemoryProvider provider = new MappedFileMemoryProvider(log(), memDir);
 
         GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(
             new GridTestKernalContext(log),
@@ -70,7 +69,11 @@ public class PageMemoryImplNoLoadSelfTest extends PageMemoryNoLoadSelfTest {
             null
         );
 
-        return new PageMemoryImpl(provider, sharedCtx, PAGE_SIZE,
+        return new PageMemoryImpl(
+            provider,
+            sizes,
+            sharedCtx,
+            PAGE_SIZE,
             new CIX3<FullPageId, ByteBuffer, Integer>() {
                 @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuffer, Integer tag) {
                     assert false : "No evictions should happen during the test";
@@ -79,11 +82,12 @@ public class PageMemoryImplNoLoadSelfTest extends PageMemoryNoLoadSelfTest {
             new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {
                 @Override public void applyx(Long page, FullPageId fullId, PageMemoryEx pageMem) {
                 }
-            }, new CheckpointLockStateChecker() {
-            @Override public boolean checkpointLockIsHeldByThread() {
-                return true;
-            }
-        });
+            },
+            new CheckpointLockStateChecker() {
+                @Override public boolean checkpointLockIsHeldByThread() {
+                    return true;
+                }
+            });
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
index 9b879e2..bbcd383 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/pagemem/PageMemoryImplTest.java
@@ -72,7 +72,7 @@ public class PageMemoryImplTest extends GridCommonAbstractTest {
 
         sizes[4] = 10 * MB;
 
-        DirectMemoryProvider provider = new UnsafeMemoryProvider(sizes);
+        DirectMemoryProvider provider = new UnsafeMemoryProvider(log);
 
         GridCacheSharedContext<Object, Object> sharedCtx = new GridCacheSharedContext<>(
             new GridTestKernalContext(new GridTestLog4jLogger()),
@@ -92,19 +92,24 @@ public class PageMemoryImplTest extends GridCommonAbstractTest {
             null
         );
 
-        PageMemoryImpl mem = new PageMemoryImpl(provider, sharedCtx, PAGE_SIZE,
+        PageMemoryImpl mem = new PageMemoryImpl(
+            provider,
+            sizes,
+            sharedCtx,
+            PAGE_SIZE,
             new CIX3<FullPageId, ByteBuffer, Integer>() {
-            @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuf, Integer tag) {
-                assert false : "No evictions should happen during the test";
-            }
-        }, new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {
-            @Override public void applyx(Long page, FullPageId fullId, PageMemoryEx pageMem) {
-            }
-        }, new CheckpointLockStateChecker() {
-            @Override public boolean checkpointLockIsHeldByThread() {
-                return true;
-            }
-        });
+                @Override public void applyx(FullPageId fullPageId, ByteBuffer byteBuf, Integer tag) {
+                    assert false : "No evictions should happen during the test";
+                }
+            },
+            new GridInClosure3X<Long, FullPageId, PageMemoryEx>() {
+                @Override public void applyx(Long page, FullPageId fullId, PageMemoryEx pageMem) {
+                }
+            }, new CheckpointLockStateChecker() {
+                @Override public boolean checkpointLockIsHeldByThread() {
+                    return true;
+                }
+            });
 
         mem.start();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
index b2ca19a..801d519 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/GridChangeGlobalStateAbstractTest.java
@@ -344,7 +344,8 @@ public abstract class GridChangeGlobalStateAbstractTest extends GridCommonAbstra
         memCfg.setConcurrencyLevel(64);
 
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
-        memPlcCfg.setSize(5 * 1024 * 1024);
+        memPlcCfg.setInitialSize(5 * 1024 * 1024);
+        memPlcCfg.setMaxSize(5 * 1024 * 1024);
         memPlcCfg.setName("dfltMemPlc");
 
         memCfg.setMemoryPolicies(memPlcCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
index 8c9854a..02168bc 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/standbycluster/extended/GridActivateExtensionTest.java
@@ -73,7 +73,8 @@ public class GridActivateExtensionTest extends GridCacheAbstractFullApiSelfTest
 
         MemoryPolicyConfiguration memPlcCfg = new MemoryPolicyConfiguration();
 
-        memPlcCfg.setSize(5 * 1024 * 1024);
+        memPlcCfg.setInitialSize(5 * 1024 * 1024);
+        memPlcCfg.setMaxSize(5 * 1024 * 1024);
 
         memPlcCfg.setName("dfltMemPlc");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/930c87c9/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
index dd82dfa..c3e5a70 100644
--- a/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
+++ b/modules/pds/src/test/java/org/apache/ignite/testsuites/IgnitePdsTestSuite.java
@@ -32,7 +32,6 @@ import org.apache.ignite.cache.database.pagemem.BPlusTreeReuseListPageMemoryImpl
 import org.apache.ignite.cache.database.pagemem.BPlusTreeSelfTestPageMemoryImplSelfTest;
 import org.apache.ignite.cache.database.pagemem.MetadataStoragePageMemoryImplSelfTest;
 import org.apache.ignite.cache.database.pagemem.PageMemoryImplNoLoadSelfTest;
-import org.apache.ignite.cache.database.pagemem.PageMemoryImplReloadSelfTest;
 import org.apache.ignite.cache.database.pagemem.PageMemoryImplTest;
 import org.apache.ignite.internal.processors.database.IgniteDbClientNearCachePutGetTest;
 import org.apache.ignite.internal.processors.database.IgniteDbDynamicCacheSelfTest;
@@ -56,7 +55,6 @@ public class IgnitePdsTestSuite extends TestSuite {
 
         // Basic PageMemory tests.
         suite.addTestSuite(PageMemoryImplNoLoadSelfTest.class);
-        suite.addTestSuite(PageMemoryImplReloadSelfTest.class);
         suite.addTestSuite(MetadataStoragePageMemoryImplSelfTest.class);
         suite.addTestSuite(PageStoreEvictionSelfTest.class);
         suite.addTestSuite(PageMemoryImplTest.class);


Mime
View raw message