cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [4/11] git commit: log warnings about java versions that you probably shouldn't be running patch by Joaquin Casares; reviewed by jbellis for CASSANDRA-4570
Date Thu, 07 Mar 2013 21:28:55 GMT
log warnings about java versions that you probably shouldn't be running
patch by Joaquin Casares; reviewed by jbellis for CASSANDRA-4570


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8daa5d2d
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8daa5d2d
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8daa5d2d

Branch: refs/heads/trunk
Commit: 8daa5d2df72c40e75efeaa32dba83e0cb49a8034
Parents: c3d75e4
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Mar 7 17:59:35 2013 +0000
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Mar 7 15:09:48 2013 -0600

----------------------------------------------------------------------
 .../apache/cassandra/service/CassandraDaemon.java  |   31 ++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8daa5d2d/src/java/org/apache/cassandra/service/CassandraDaemon.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index 7d78196..16a9e47 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -119,7 +119,36 @@ public class CassandraDaemon
      */
     protected void setup()
     {
-        logger.info("JVM vendor/version: {}/{}", System.getProperty("java.vm.name"), System.getProperty("java.version")
);
+        String javaVersion = System.getProperty("java.version");
+        String javaVmName = System.getProperty("java.vm.name");
+        logger.info("JVM vendor/version: {}/{}", javaVmName, javaVersion);
+        if (javaVmName.contains("OpenJDK"))
+        {
+            // There is essentially no QA done on OpenJDK builds, and
+            // clusters running OpenJDK have seen many heap and load issues.
+            logger.warn("OpenJDK is not recommended. Please upgrade to the newest Oracle
Java release");
+        }
+        else if (!javaVmName.contains("HotSpot"))
+        {
+            logger.warn("Non-Oracle JVM detected.  Some features, such as immediate unmap
of compacted SSTables, may not work as intended");
+        }
+        else
+        {
+            String[] java_version = javaVersion.split("_");
+            String java_major = java_version[0];
+            int java_minor = (java_version.length > 1) ? Integer.parseInt(java_version[1])
: 0;
+            if (java_major.equals("1.6.0"))
+            {
+                // These need to be updated from time to time, but these are currently valid
(12.18.2012)
+                if (java_minor < 29)
+                    // Seen to be a major contributing factor for heap and load issues
+                    logger.error("Your JVM is out of date. Please upgrade to the newest Oracle
Java 6.");
+                else if (java_minor < 32)
+                    // Updates 32+ have been seen to work well enough in the wild
+                    logger.warn("Your JVM is out of date. Please upgrade to the newest Oracle
Java 6.");
+            }
+        }
+
         logger.info("Heap size: {}/{}", Runtime.getRuntime().totalMemory(), Runtime.getRuntime().maxMemory());
         logger.info("Classpath: {}", System.getProperty("java.class.path"));
         CLibrary.tryMlockall();


Mime
View raw message