You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/28 12:40:16 UTC
[7/9] ignite git commit: fixed memory policies example
fixed memory policies example
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c0960598
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c0960598
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c0960598
Branch: refs/heads/ignite-5075-cacheStart
Commit: c0960598de1aaa4ea4798aa150c9bd764042ae17
Parents: e981f1d
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Apr 27 14:10:50 2017 -0700
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Apr 27 14:10:50 2017 -0700
----------------------------------------------------------------------
examples/config/example-memory-policies.xml | 6 +++---
.../examples/datagrid/MemoryPoliciesExample.java | 16 ++++++++--------
.../configuration/MemoryPolicyConfiguration.java | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/c0960598/examples/config/example-memory-policies.xml
----------------------------------------------------------------------
diff --git a/examples/config/example-memory-policies.xml b/examples/config/example-memory-policies.xml
index 86c7502..48a5383 100644
--- a/examples/config/example-memory-policies.xml
+++ b/examples/config/example-memory-policies.xml
@@ -55,10 +55,10 @@
</bean>
<!--
- Memory region of 20 MBs in size with an eviction enabled.
+ Memory region of 40 MBs in size with an eviction enabled.
-->
<bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
- <property name="name" value="20MB_Region_Eviction"/>
+ <property name="name" value="40MB_Region_Eviction"/>
<!-- Memory region of 20 MB initial size. -->
<property name="initialSize" value="#{20 * 1024 * 1024}"/>
<!-- Maximum size is 40 MB. -->
@@ -72,7 +72,7 @@
'swapFilePath' parameter.
-->
<bean class="org.apache.ignite.configuration.MemoryPolicyConfiguration">
- <property name="name" value="15MB_Region_Swapping"/>
+ <property name="name" value="30MB_Region_Swapping"/>
<!-- Memory region of 15 MB initial size. -->
<property name="initialSize" value="#{15 * 1024 * 1024}"/>
<!-- Maximum size is 30 MB. -->
http://git-wip-us.apache.org/repos/asf/ignite/blob/c0960598/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
index 52cda5f..045f88b 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/MemoryPoliciesExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/MemoryPoliciesExample.java
@@ -43,11 +43,11 @@ 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 20 MB with eviction enabled */
- public static final String POLICY_20MB_EVICTION = "20MB_Region_Eviction";
+ /** Name of the memory policy that creates a memory region limited by 40 MB with eviction enabled */
+ public static final String POLICY_40MB_EVICTION = "40MB_Region_Eviction";
/** Name of the memory policy that creates a memory region mapped to a memory-mapped file. */
- public static final String POLICY_15MB_MEMORY_MAPPED_FILE = "15MB_Region_Swapping";
+ public static final String POLICY_30MB_MEMORY_MAPPED_FILE = "30MB_Region_Swapping";
/**
* Executes example.
@@ -66,19 +66,19 @@ public class MemoryPoliciesExample {
*/
CacheConfiguration<Integer, Integer> firstCacheCfg = new CacheConfiguration<>("firstCache");
- firstCacheCfg.setMemoryPolicyName(POLICY_20MB_EVICTION);
+ firstCacheCfg.setMemoryPolicyName(POLICY_40MB_EVICTION);
firstCacheCfg.setCacheMode(CacheMode.PARTITIONED);
firstCacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
CacheConfiguration<Integer, Integer> secondCacheCfg = new CacheConfiguration<>("secondCache");
- secondCacheCfg.setMemoryPolicyName(POLICY_20MB_EVICTION);
+ secondCacheCfg.setMemoryPolicyName(POLICY_40MB_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_20MB_EVICTION + "' memory region.");
+ System.out.println(">>> Started two caches bound to '" + POLICY_40MB_EVICTION + "' memory region.");
/**
* Preparing a configuration for a cache that will be bound to the memory region defined by
@@ -86,11 +86,11 @@ public class MemoryPoliciesExample {
*/
CacheConfiguration<Integer, Integer> thirdCacheCfg = new CacheConfiguration<>("thirdCache");
- thirdCacheCfg.setMemoryPolicyName(POLICY_15MB_MEMORY_MAPPED_FILE);
+ thirdCacheCfg.setMemoryPolicyName(POLICY_30MB_MEMORY_MAPPED_FILE);
IgniteCache<Integer, Integer> thirdCache = ignite.createCache(thirdCacheCfg);
- System.out.println(">>> Started a cache bound to '" + POLICY_15MB_MEMORY_MAPPED_FILE + "' memory region.");
+ System.out.println(">>> Started a cache bound to '" + POLICY_30MB_MEMORY_MAPPED_FILE + "' memory region.");
/**
http://git-wip-us.apache.org/repos/asf/ignite/blob/c0960598/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 c93b423..8e4d30e 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
@@ -275,7 +275,7 @@ public final class MemoryPolicyConfiguration implements Serializable {
* Sets memory metrics enabled flag. If this flag is {@code true}, metrics will be enabled on node startup.
* Memory metrics can be enabled and disabled at runtime via memory metrics MX bean.
*
- * @param metricsEnabled Metrics enanabled flag.
+ * @param metricsEnabled Metrics enabled flag.
* @return {@code this} for chaining.
*/
public MemoryPolicyConfiguration setMetricsEnabled(boolean metricsEnabled) {