ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [14/54] [abbrv] ignite git commit: Memory policies example and documentation fixes.
Date Tue, 18 Apr 2017 05:25:29 GMT
Memory policies example and documentation fixes.


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

Branch: refs/heads/ignite-1561
Commit: 86c405873fd32ea859afa29ed1e403f7320631e6
Parents: 0c0cf2c
Author: Denis Magda <dmagda@gridgain.com>
Authored: Sun Apr 16 12:57:29 2017 -0700
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Sun Apr 16 12:57:29 2017 -0700

----------------------------------------------------------------------
 examples/config/example-memory-policies.xml     | 105 +++++++++++++++++
 .../datagrid/MemoryPoliciesExample.java         | 114 +++++++++++++++++++
 .../ignite/examples/CacheExamplesSelfTest.java  |   8 ++
 .../configuration/CacheConfiguration.java       |   5 +-
 .../configuration/IgniteConfiguration.java      |  18 +--
 .../configuration/MemoryConfiguration.java      |   4 +-
 .../MemoryPolicyConfiguration.java              |  22 ++--
 .../apache/ignite/internal/IgniteKernal.java    |   7 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |   6 +-
 .../processors/cache/GridCacheProcessor.java    |   3 +-
 .../IgniteCacheDatabaseSharedManager.java       |  14 +--
 11 files changed, 266 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/examples/config/example-memory-policies.xml
----------------------------------------------------------------------
diff --git a/examples/config/example-memory-policies.xml b/examples/config/example-memory-policies.xml
new file mode 100644
index 0000000..9390a20
--- /dev/null
+++ b/examples/config/example-memory-policies.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  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.
+-->
+
+<!--
+    Ignite configuration with all defaults, enabled p2p deployment and special memory policies.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util.xsd">
+    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
+        <!-- Set to true to enable distributed class loading for examples, default is
false. -->
+        <property name="peerClassLoadingEnabled" value="true"/>
+
+        <property name="memoryConfiguration">
+            <bean class="org.apache.ignite.configuration.MemoryConfiguration">
+                <!-- Setting a name of the default memory policy -->
+                <property name="defaultMemoryPolicyName" value="Default_Region"/>
+                <!-- Setting the page size to 4 KB -->
+                <property name="pageSize" value="4096"/>
+
+                <!-- Defining several memory policies for different memory regions -->
+                <property name="memoryPolicies">
+                    <list>
+                        <!--
+                            Default memory region that grows endlessly. A cache is bound
to this memory region
+                            unless it sets another one in its CacheConfiguration.
+                        -->
+                        <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
+                            <property name="name" value="Default_Region"/>
+                            <!-- 100 MB memory region with disabled eviction -->
+                            <property name="size" value="#{100 * 1024 * 1024}"/>
+                        </bean>
+
+                        <!--
+                            Memory region of 10 MBs in size with an eviction enabled.
+                        -->
+                        <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
+                            <property name="name" value="10MB_Region_Eviction"/>
+                            <!-- 10 MB memory region. -->
+                            <property name="size" value="#{10 * 1024 * 1024}"/>
+                            <!-- Enabling eviction for this memory region -->
+                            <property name="pageEvictionMode" value="RANDOM_2_LRU"/>
+                        </bean>
+
+                        <!--
+                            This memory region is backed by a memory-mapped file which names
is passed via
+                            'swapFilePath' parameter.
+                        -->
+                        <bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
+                            <property name="name" value="5MB_Region_Swapping"/>
+                            <!-- 5 MB memory region. -->
+                            <property name="size" value="#{5 * 1024 * 1024}"/>
+                            <!-- Setting a name of the swapping file. -->
+                            <property name="swapFilePath" value="memoryPolicyExampleSwap"/>
+                        </bean>
+                    </list>
+                </property>
+            </bean>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes.
-->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <!--
+                        Ignite provides several options for automatic discovery that can
be used
+                        instead os static IP based discovery. For information on all options
refer
+                        to our documentation: http://apacheignite.readme.io/docs/cluster-config
+                    -->
+                    <!-- Uncomment static IP finder to enable static-based discovery of
initial nodes. -->
+                    <!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <!-- In distributed environment, replace with actual host
IP address. -->
+                                <value>127.0.0.1:47500..47509</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/examples/src/main/java/org/apache/ignite/examples/datagrid/MemoryPoliciesExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/MemoryPoliciesExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/MemoryPoliciesExample.java
new file mode 100644
index 0000000..3f27d3e
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/MemoryPoliciesExample.java
@@ -0,0 +1,114 @@
+/*
+ * 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.examples.datagrid;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.MemoryConfiguration;
+import org.apache.ignite.configuration.MemoryPolicyConfiguration;
+import org.apache.ignite.examples.ExampleNodeStartup;
+
+/**
+ * This example demonstrates how to tweak particular settings of Apache Ignite page memory
using
+ * {@link MemoryConfiguration} and set up several memory policies for different caches with
+ * {@link MemoryPolicyConfiguration}.
+ * <p>
+ * Additional remote nodes can be started with special configuration file which
+ * enables P2P class loading: {@code 'ignite.{sh|bat} example-memory-policies.xml'}.
+ * <p>
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which passing
+ * {@code examples/config/example-memory-policies.xml} configuration to it.
+ */
+public class MemoryPoliciesExample {
+    /** Name of the default memory policy defined in 'example-memory-policies.xml'. */
+    public static final String POLICY_DEFAULT = "Default_Region";
+
+    /** Name of the memory policy that creates a memory region limited by 10 MB with eviction
enabled */
+    public static final String POLICY_10MB_EVICTION = "10MB_Region_Eviction";
+
+    /** Name of the memory policy that creates a memory region mapped to a memory-mapped
file. */
+    public static final String POLICY_5MB_MEMORY_MAPPED_FILE = "5MB_Region_Swapping";
+
+    /**
+     * Executes example.
+     *
+     * @param args Command line arguments, none required.
+     * @throws IgniteException If example execution failed.
+     */
+    public static void main(String[] args) throws IgniteException {
+        try (Ignite ignite = Ignition.start("examples/config/example-memory-policies.xml"))
{
+            System.out.println();
+            System.out.println(">>> Memory policies example started.");
+
+            /**
+             * Preparing configurations for 2 caches that will be bound to the memory region
defined by
+             * '10MB_Region_Eviction' memory policy from 'example-memory-policies.xml' configuration.
+             */
+            CacheConfiguration<Integer, Integer> firstCacheCfg = new CacheConfiguration<>("firstCache");
+
+            firstCacheCfg.setMemoryPolicyName(POLICY_10MB_EVICTION);
+            firstCacheCfg.setCacheMode(CacheMode.PARTITIONED);
+            firstCacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+
+            CacheConfiguration<Integer, Integer> secondCacheCfg = new CacheConfiguration<>("secondCache");
+            secondCacheCfg.setMemoryPolicyName(POLICY_10MB_EVICTION);
+            secondCacheCfg.setCacheMode(CacheMode.REPLICATED);
+            secondCacheCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
+
+            IgniteCache<Integer, Integer> firstCache = ignite.createCache(firstCacheCfg);
+            IgniteCache<Integer, Integer> secondCache = ignite.createCache(secondCacheCfg);
+
+            System.out.println(">>> Started two caches bound to '" + POLICY_10MB_EVICTION
+ "' memory region.");
+
+            /**
+             * Preparing a configuration for a cache that will be bound to the memory region
defined by
+             * '5MB_Region_Swapping' memory policy from 'example-memory-policies.xml' configuration.
+             */
+            CacheConfiguration<Integer, Integer> thirdCacheCfg = new CacheConfiguration<>("thirdCache");
+
+            thirdCacheCfg.setMemoryPolicyName(POLICY_5MB_MEMORY_MAPPED_FILE);
+
+            IgniteCache<Integer, Integer> thirdCache = ignite.createCache(thirdCacheCfg);
+
+            System.out.println(">>> Started a cache bound to '" + POLICY_5MB_MEMORY_MAPPED_FILE
+ "' memory region.");
+
+
+            /**
+             * Preparing a configuration for a cache that will be bound to the default memory
region defined by
+             * default 'Default_Region' memory policy from 'example-memory-policies.xml'
configuration.
+             */
+            CacheConfiguration<Integer, Integer> fourthCacheCfg = new CacheConfiguration<>("fourthCache");
+
+            IgniteCache<Integer, Integer> fourthCache = ignite.createCache(fourthCacheCfg);
+
+            System.out.println(">>> Started a cache bound to '" + POLICY_DEFAULT
+ "' memory region.");
+
+            System.out.println(">>> Destroying caches...");
+
+            firstCache.destroy();
+            secondCache.destroy();
+            thirdCache.destroy();
+            fourthCache.destroy();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
b/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
index 4bec419..3447dff 100644
--- a/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
+++ b/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.examples.datagrid.CachePutGetExample;
 import org.apache.ignite.examples.datagrid.CacheQueryDmlExample;
 import org.apache.ignite.examples.datagrid.CacheQueryExample;
 import org.apache.ignite.examples.datagrid.CacheTransactionExample;
+import org.apache.ignite.examples.datagrid.MemoryPoliciesExample;
 import org.apache.ignite.examples.datagrid.starschema.CacheStarSchemaExample;
 import org.apache.ignite.examples.datagrid.store.CacheLoadOnlyStoreExample;
 import org.apache.ignite.examples.datastructures.IgniteAtomicLongExample;
@@ -182,4 +183,11 @@ public class CacheExamplesSelfTest extends GridAbstractExamplesTest {
     public void testCacheLoadOnlyStoreExample() throws Exception {
         CacheLoadOnlyStoreExample.main(EMPTY_ARGS);
     }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testMemoryPolicyExample() throws Exception {
+        MemoryPoliciesExample.main(EMPTY_ARGS);
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 34b3951..dc64c26 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -494,9 +494,10 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K,
V> {
     }
 
     /**
-     * Sets name of {@link MemoryPolicyConfiguration} for this cache.
+     * Sets a name of {@link MemoryPolicyConfiguration} for this cache.
      *
-     * @param memPlcName MemoryPolicyConfiguration name. Can be null (default MemoryPolicyConfiguration
will be used) but should not be empty.
+     * @param memPlcName MemoryPolicyConfiguration name. Can be null (default MemoryPolicyConfiguration
will be used)
+     *                   but should not be empty.
      * @return {@code this} for chaining.
      */
     public CacheConfiguration<K, V> setMemoryPolicyName(String memPlcName) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index 5d29e0e..fe08ddf 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -440,8 +440,8 @@ public class IgniteConfiguration {
     /** */
     private boolean lateAffAssignment = DFLT_LATE_AFF_ASSIGNMENT;
 
-    /** Database configuration. */
-    private MemoryConfiguration dbCfg;
+    /** Page memory configuration. */
+    private MemoryConfiguration memCfg;
 
     /** Active on start flag. */
     private boolean activeOnStart = DFLT_ACTIVE_ON_START;
@@ -481,7 +481,7 @@ public class IgniteConfiguration {
         allResolversPassReq = cfg.isAllSegmentationResolversPassRequired();
         atomicCfg = cfg.getAtomicConfiguration();
         binaryCfg = cfg.getBinaryConfiguration();
-        dbCfg = cfg.getMemoryConfiguration();
+        memCfg = cfg.getMemoryConfiguration();
         cacheCfg = cfg.getCacheConfiguration();
         cacheKeyCfg = cfg.getCacheKeyConfiguration();
         cacheSanityCheckEnabled = cfg.isCacheSanityCheckEnabled();
@@ -2091,22 +2091,22 @@ public class IgniteConfiguration {
     }
 
     /**
-     * Gets memory configuration.
+     * Gets page memory configuration.
      *
      * @return Memory configuration.
      */
     public MemoryConfiguration getMemoryConfiguration() {
-        return dbCfg;
+        return memCfg;
     }
 
     /**
-     * Sets memory configuration.
+     * Sets page memory configuration.
      *
-     * @param dbCfg Memory configuration.
+     * @param memCfg Memory configuration.
      * @return {@code this} for chaining.
      */
-    public IgniteConfiguration setMemoryConfiguration(MemoryConfiguration dbCfg) {
-        this.dbCfg = dbCfg;
+    public IgniteConfiguration setMemoryConfiguration(MemoryConfiguration memCfg) {
+        this.memCfg = memCfg;
 
         return this;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
index 3ef876b..fce6894 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryConfiguration.java
@@ -22,9 +22,9 @@ import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.U;
 
 /**
- * Database configuration used to configure database and manage offheap memory of Ignite
Node.
+ * Page memory configuration of an Apache Ignite node.
  *
- * <p>It may be configured under {@link IgniteConfiguration XML configuration} as follows:</p>
+ * <p>It can be configured using {@link IgniteConfiguration} as follows:</p>
  * <pre>
  *     {@code
  *     <property name="memoryConfiguration">

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
index 6fe373d..c838756 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
@@ -22,28 +22,21 @@ import org.apache.ignite.internal.pagemem.PageMemory;
 import org.apache.ignite.internal.processors.cache.database.MemoryPolicy;
 
 /**
- * Configuration bean used for creating {@link MemoryPolicy} instances.
+ * This class defines {@code MemoryPolicy} configuration.
  */
 public final class MemoryPolicyConfiguration implements Serializable {
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** Unique name of MemoryPolicy. */
+    /** Memory policy name. */
     private String name;
 
-    /** Size in bytes of {@link PageMemory} in bytes that will be created for this configuration.
*/
+    /** Memory policy size. */
     private long size;
 
-    /** Path for memory mapped file (won't be created if not configured). */
+    /** An optional path to a memory mapped file for this memory policy. */
     private String swapFilePath;
 
-    /**
-     * Unique name of MemoryPolicy.
-     */
-    public String getName() {
-        return name;
-    }
-
     /** Algorithm for per-page eviction. If {@link DataPageEvictionMode#DISABLED} set, eviction
is not performed. */
     private DataPageEvictionMode pageEvictionMode = DataPageEvictionMode.DISABLED;
 
@@ -64,6 +57,13 @@ public final class MemoryPolicyConfiguration implements Serializable {
     private int emptyPagesPoolSize = 100;
 
     /**
+     * Unique name of MemoryPolicy.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
      * @param name Unique name of MemoryPolicy.
      */
     public MemoryPolicyConfiguration setName(String name) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index b35f9bb..eb2ae6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -2429,10 +2429,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
         if (memCfg == null)
             return;
 
-        U.log(log, "System cache MemoryPolicy size is configured to " +
-                (memCfg.getSystemCacheMemorySize() / (1024 * 1024)) +
-        "MB size. " +
-                "Use MemoryConfiguration.systemCacheMemorySize property to change it.");
+        U.log(log, "System cache's MemoryPolicy size is configured to " +
+            (memCfg.getSystemCacheMemorySize() / (1024 * 1024)) + " MB. " +
+            "Use MemoryConfiguration.systemCacheMemorySize property to change the setting.");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index d145374..61e93cf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -2103,11 +2103,11 @@ public class IgnitionEx {
             initializeDefaultCacheConfiguration(myCfg);
 
             if (!myCfg.isClientMode() && myCfg.getMemoryConfiguration() == null)
{
-                MemoryConfiguration dbCfg = new MemoryConfiguration();
+                MemoryConfiguration memCfg = new MemoryConfiguration();
 
-                dbCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
+                memCfg.setConcurrencyLevel(Runtime.getRuntime().availableProcessors() * 4);
 
-                myCfg.setMemoryConfiguration(dbCfg);
+                myCfg.setMemoryConfiguration(memCfg);
             }
 
             return myCfg;

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 3f7184e..7841f06 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -362,8 +362,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      */
     private boolean storesLocallyOnClient(IgniteConfiguration c,
                                           CacheConfiguration cc) {
-        if (c.isClientMode()
-                && c.getMemoryConfiguration() == null) {
+        if (c.isClientMode() && c.getMemoryConfiguration() == null) {
             if (cc.getCacheMode() == LOCAL)
                 return true;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/86c40587/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 2d2295c..a34aed2 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
@@ -98,20 +98,20 @@ public class IgniteCacheDatabaseSharedManager extends GridCacheSharedManagerAdap
      */
     public void init() throws IgniteCheckedException {
         if (memPlcMap == null) {
-            MemoryConfiguration dbCfg = cctx.kernalContext().config().getMemoryConfiguration();
+            MemoryConfiguration memCfg = cctx.kernalContext().config().getMemoryConfiguration();
 
-            if (dbCfg == null)
-                dbCfg = new MemoryConfiguration();
+            if (memCfg == null)
+                memCfg = new MemoryConfiguration();
 
-            validateConfiguration(dbCfg);
+            validateConfiguration(memCfg);
 
-            pageSize = dbCfg.getPageSize();
+            pageSize = memCfg.getPageSize();
 
-            initPageMemoryPolicies(dbCfg);
+            initPageMemoryPolicies(memCfg);
 
             startMemoryPolicies();
 
-            initPageMemoryDataStructures(dbCfg);
+            initPageMemoryDataStructures(memCfg);
         }
     }
 


Mime
View raw message