This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 95180e4143 GEODE-10206: clean up product references to CMS (#7646)
95180e4143 is described below

commit 95180e414386afc94e730005adea40867f07298d
Author: Darrel Schneider <[email protected]>
AuthorDate: Fri May 6 09:17:55 2022 -0700

    GEODE-10206: clean up product references to CMS (#7646)
    
    * the command line validator no longer warns if CMS is not configured if 
the JDK does not support CMS
    * cleaned up comments that refer to CMS
---
 extensions/geode-modules/build.gradle                        |  1 +
 .../geode/modules/session/bootstrap/AbstractCache.java       |  5 ++---
 .../apache/geode/modules/util/ResourceManagerValidator.java  | 12 +++++++++++-
 extensions/geode-modules/src/test/resources/expected-pom.xml |  5 +++++
 .../main/java/org/apache/geode/cache/EvictionAttributes.java |  5 +++--
 .../java/org/apache/geode/cache/control/ResourceManager.java |  5 +++--
 6 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/extensions/geode-modules/build.gradle 
b/extensions/geode-modules/build.gradle
index 806dceddc9..d35dd544d4 100644
--- a/extensions/geode-modules/build.gradle
+++ b/extensions/geode-modules/build.gradle
@@ -37,6 +37,7 @@ dependencies {
   compileOnly('javax.servlet:javax.servlet-api')
   compileOnly('org.apache.tomcat:catalina-ha:' + 
DependencyConstraints.get('tomcat6.version'))
 
+  implementation('org.apache.commons:commons-lang3')
 
   // test
   testImplementation('org.apache.bcel:bcel')
diff --git 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/bootstrap/AbstractCache.java
 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/bootstrap/AbstractCache.java
index d1b7600427..1d9df9d538 100644
--- 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/bootstrap/AbstractCache.java
+++ 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/session/bootstrap/AbstractCache.java
@@ -363,9 +363,8 @@ public abstract class AbstractCache {
       }
     }
 
-    // Validate java startup parameters (done after setting the eviction and
-    // critical heap percentages so that the CMSInitiatingOccupancyFraction can
-    // be compared against them.
+    // Validate java startup parameters after setting the eviction and
+    // critical heap percentages so that they can be compared against them.
     ResourceManagerValidator.validateJavaStartupParameters(getCache());
   }
 
diff --git 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java
 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java
index 5541fdce3d..c9b40118d0 100644
--- 
a/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java
+++ 
b/extensions/geode-modules/src/main/java/org/apache/geode/modules/util/ResourceManagerValidator.java
@@ -14,6 +14,9 @@
  */
 package org.apache.geode.modules.util;
 
+import static org.apache.commons.lang3.JavaVersion.JAVA_13;
+import static org.apache.commons.lang3.SystemUtils.isJavaVersionAtMost;
+
 import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
 import java.util.ArrayList;
@@ -106,8 +109,12 @@ public class ResourceManagerValidator {
     }
   }
 
+  private static boolean isCMSAvailable() {
+    return isJavaVersionAtMost(JAVA_13);
+  }
+
   private static void verifyCMSGC(GemFireCache cache, String useCMS) {
-    if (useCMS == null) {
+    if (useCMS == null && isCMSAvailable()) {
       cache.getLogger().warning(
           "Using the concurrent garbage collector (configured using 
-XX:+UseConcMarkSweepGC) is recommended so that GemFire cache eviction is 
optimal");
     }
@@ -115,6 +122,9 @@ public class ResourceManagerValidator {
 
   private static void verifyCMSInitiatingOccupancyFraction(GemFireCache cache, 
ResourceManager rm,
       String cmsIOF) {
+    if (!isCMSAvailable()) {
+      return;
+    }
     if (cmsIOF == null) {
       cache.getLogger().warning(
           "Setting the CMS initiating occupancy fraction (configured using 
-XX:CMSInitiatingOccupancyFraction=N) is recommended so that GemFire cache 
eviction is optimal");
diff --git a/extensions/geode-modules/src/test/resources/expected-pom.xml 
b/extensions/geode-modules/src/test/resources/expected-pom.xml
index c8b2c2e9a6..4cd2646914 100644
--- a/extensions/geode-modules/src/test/resources/expected-pom.xml
+++ b/extensions/geode-modules/src/test/resources/expected-pom.xml
@@ -76,5 +76,10 @@
       <artifactId>slf4j-api</artifactId>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <scope>runtime</scope>
+    </dependency>
   </dependencies>
 </project>
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/EvictionAttributes.java 
b/geode-core/src/main/java/org/apache/geode/cache/EvictionAttributes.java
index 1029c2ac42..b2e340584f 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/EvictionAttributes.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/EvictionAttributes.java
@@ -155,8 +155,9 @@ public abstract class EvictionAttributes {
    * switches to control the behavior of the garbage collector. We suggest 
that you investigate
    * tuning the garbage collector when using this type of eviction controller. 
A collector that
    * frequently collects is needed to keep our heap usage up to date. In 
particular, on the Sun
-   * <A href="http://java.sun.com/docs/hotspot/gc/index.html";>HotSpot</a> JVM, 
the
-   * <code>-XX:+UseConcMarkSweepGC</code> flag needs to be set, and
+   * <A href="http://java.sun.com/docs/hotspot/gc/index.html";>HotSpot</a> JVM,
+   * before Java 14,
+   * the <code>-XX:+UseConcMarkSweepGC</code> flag needs to be set, and
    * <code>-XX:CMSInitiatingOccupancyFraction=N</code> should be set with N 
being a percentage that
    * is less than the {@link ResourceManager} eviction heap threshold.
    * <p>
diff --git 
a/geode-core/src/main/java/org/apache/geode/cache/control/ResourceManager.java 
b/geode-core/src/main/java/org/apache/geode/cache/control/ResourceManager.java
index 539259b3df..b231cf2e25 100644
--- 
a/geode-core/src/main/java/org/apache/geode/cache/control/ResourceManager.java
+++ 
b/geode-core/src/main/java/org/apache/geode/cache/control/ResourceManager.java
@@ -127,8 +127,9 @@ public interface ResourceManager {
    * additional VM switches to control the behavior of the garbage collector. 
We suggest that you
    * investigate tuning the garbage collector when using this type of eviction 
controller. A
    * collector that frequently collects is needed to keep our heap usage up to 
date. In particular,
-   * on the Sun <A 
href="http://java.sun.com/docs/hotspot/gc/index.html";>HotSpot</a> VM, the
-   * <code>-XX:+UseConcMarkSweepGC</code> flag needs to be set, and
+   * on the Sun <A 
href="http://java.sun.com/docs/hotspot/gc/index.html";>HotSpot</a> VM,
+   * before Java 14,
+   * the <code>-XX:+UseConcMarkSweepGC</code> flag needs to be set, and
    * <code>-XX:CMSInitiatingOccupancyFraction=N</code> should be set with N 
being a percentage that
    * is less than the {@link ResourceManager} critical and eviction heap 
thresholds.
    *

Reply via email to