cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: By default cassandra will no longer start without jna patch by clardeur reviewed by dbrosius for cassandra 6575
Date Sat, 18 Jan 2014 00:36:33 GMT
Updated Branches:
  refs/heads/trunk 4e9d1aca0 -> 68baaedd6


By default cassandra will no longer start without jna
patch by clardeur reviewed by dbrosius for cassandra 6575


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

Branch: refs/heads/trunk
Commit: 68baaedd6f0adf4719f0c65296433d5f006c74c4
Parents: 4e9d1ac
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Fri Jan 17 19:34:52 2014 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Fri Jan 17 19:34:52 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../org/apache/cassandra/service/CassandraDaemon.java | 14 ++++++++++++++
 src/java/org/apache/cassandra/utils/CLibrary.java     |  4 ++--
 3 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/68baaedd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 58c2ad6..a4d9d47 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -23,6 +23,7 @@
  * Add cardinality estimator for key count estimation (CASSANDRA-5906)
  * CF id is changed to be non-deterministic. Data dir/key cache are created
    uniquely for CF id (CASSANDRA-5202)
+ * Cassandra won't start by default without jna (CASSANDRA-6575)
 
 
 2.0.5

http://git-wip-us.apache.org/repos/asf/cassandra/blob/68baaedd/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 7dd538c..a5c7df5 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -129,6 +129,20 @@ public class CassandraDaemon
      */
         logger.info("Heap size: {}/{}", Runtime.getRuntime().totalMemory(), Runtime.getRuntime().maxMemory());
         logger.info("Classpath: {}", System.getProperty("java.class.path"));
+
+        // Fail-fast if JNA is not available or failing to initialize properly
+        // except with -Dcassandra.boot_without_jna=true. See CASSANDRA-6575.
+        if (!CLibrary.jnaAvailable())
+        {
+            boolean jnaRequired = !Boolean.getBoolean("cassandra.boot_without_jna");
+
+            if (jnaRequired)
+            {
+                logger.error("JNA failing to initialize properly. Use -Dcassandra.boot_without_jna=true
to bootstrap even so.");
+                System.exit(3);
+            }
+        }
+
         CLibrary.tryMlockall();
 
         Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/68baaedd/src/java/org/apache/cassandra/utils/CLibrary.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/CLibrary.java b/src/java/org/apache/cassandra/utils/CLibrary.java
index a7ff815..4dd5223 100644
--- a/src/java/org/apache/cassandra/utils/CLibrary.java
+++ b/src/java/org/apache/cassandra/utils/CLibrary.java
@@ -60,11 +60,11 @@ public final class CLibrary
         }
         catch (NoClassDefFoundError e)
         {
-            logger.info("JNA not found. Native methods will be disabled.");
+            logger.warn("JNA not found. Native methods will be disabled.");
         }
         catch (UnsatisfiedLinkError e)
         {
-            logger.info("JNA link failure, one or more native method will be unavailable.");
+            logger.warn("JNA link failure, one or more native method will be unavailable.");
             logger.debug("JNA link failure details: {}", e.getMessage());
         }
         catch (NoSuchMethodError e)


Mime
View raw message