ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [09/50] [abbrv] ignite git commit: wip
Date Mon, 05 Dec 2016 14:41:31 GMT
wip


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

Branch: refs/heads/ignite-comm-balance-master
Commit: 4ed9fee1fc71dbb2d1a74258bdc2e9c359843adb
Parents: 4a17ba1
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Tue Nov 8 01:21:56 2016 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Tue Nov 8 01:21:56 2016 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  2 ++
 .../ignite/internal/util/IgniteUtils.java       | 23 ++++++++++++++++++++
 2 files changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4ed9fee1/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 92bf8c5..4fbf4e5 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
@@ -1127,6 +1127,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable
{
             }, longOpDumpTimeout, longOpDumpTimeout);
         }
 
+        ctx.performance().add("Disable assertions (remove '-ea' from JVM options)", !U.assertionsEnabled());
+
         ctx.performance().logSuggestions(log, gridName);
 
         U.quietAndInfo(log, "To start Console Management & Monitoring run ignitevisorcmd.{sh|bat}");

http://git-wip-us.apache.org/repos/asf/ignite/blob/4ed9fee1/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index df67f7e..6e91d56 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -502,10 +502,26 @@ public abstract class IgniteUtils {
         }
     };
 
+    private static final boolean assertionsEnabled;
+
     /**
      * Initializes enterprise check.
      */
     static {
+        boolean assertionsEnabled0 = true;
+
+        try {
+            assert false;
+
+            assertionsEnabled0 = false;
+        }
+        catch (AssertionError ignored) {
+            assertionsEnabled0 = true;
+        }
+        finally {
+            assertionsEnabled = assertionsEnabled0;
+        }
+
         String osName = System.getProperty("os.name");
 
         String osLow = osName.toLowerCase();
@@ -6113,6 +6129,13 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * @return {@code True} if assertions enabled.
+     */
+    public static boolean assertionsEnabled() {
+        return assertionsEnabled;
+    }
+
+    /**
      * Gets OS JDK string.
      *
      * @return OS JDK string.


Mime
View raw message