Repository: asterixdb
Updated Branches:
  refs/heads/master 10351a747 -> c6ee017f5


Omit Managix [nc|cc].java.opts From HTTP Api, Ini > Env

- Managix options for cc / nc java opts are not used for NC service
  clusters, omit these from the cluster HTTP api.
- Ini jvm.args should take precedence over $JAVA_OPTS in environment
  when launching NCDriver

Change-Id: If52da9f5cc2a66b7c327f39a6e4ea51d4a8ccf89
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1301
Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>
Tested-by: Michael Blow <mb...@apache.org>
Integration-Tests: Michael Blow <mb...@apache.org>


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

Branch: refs/heads/master
Commit: c6ee017f57d0a1d095d5f7174f72427a2d03d274
Parents: 10351a7
Author: Michael Blow <mb...@apache.org>
Authored: Tue Oct 18 17:43:46 2016 -0400
Committer: Michael Blow <mb...@apache.org>
Committed: Tue Oct 18 20:17:53 2016 -0700

----------------------------------------------------------------------
 .../api/cluster_state_1/cluster_state_1.1.adm    |  2 --
 .../common/config/AsterixExternalProperties.java |  2 --
 .../hyracks/control/nc/service/NCService.java    | 19 +++++++++++--------
 3 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c6ee017f/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.adm
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.adm
index d076f74..0db4561 100644
--- 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.adm
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/api/cluster_state_1/cluster_state_1.1.adm
@@ -6,7 +6,6 @@
     },
     "config": {
         "api.port": 19002,
-        "cc.java.opts": "-Xmx1024m",
         "cluster.partitions": {
             "0": "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node: 
asterix_nc1",
             "1": "ID:1, Original Node: asterix_nc1, IODevice: 1, Active Node: 
asterix_nc1",
@@ -33,7 +32,6 @@
         "metadata.partition": "ID:0, Original Node: asterix_nc1, IODevice: 0, 
Active Node: asterix_nc1",
         "metadata.port": 0,
         "metadata.registration.timeout.secs": 60,
-        "nc.java.opts": "-Xmx1024m",
         "node.partitions": {
             "asterix_nc1": [
                 "ID:0, Original Node: asterix_nc1, IODevice: 0, Active Node: 
asterix_nc1",

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c6ee017f/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixExternalProperties.java
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixExternalProperties.java
 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixExternalProperties.java
index 1a9096d..15a1f39 100644
--- 
a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixExternalProperties.java
+++ 
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixExternalProperties.java
@@ -92,13 +92,11 @@ public class AsterixExternalProperties extends 
AbstractAsterixProperties {
                 PropertyInterpreters.getLevelPropertyInterpreter());
     }
 
-    @PropertyKey(EXTERNAL_NC_JAVA_OPTS_KEY)
     public String getNCJavaParams() {
         return accessor.getProperty(EXTERNAL_NC_JAVA_OPTS_KEY, 
EXTERNAL_NC_JAVA_OPTS_DEFAULT,
                 PropertyInterpreters.getStringPropertyInterpreter());
     }
 
-    @PropertyKey(EXTERNAL_CC_JAVA_OPTS_KEY)
     public String getCCJavaParams() {
         return accessor.getProperty(EXTERNAL_CC_JAVA_OPTS_KEY, 
EXTERNAL_CC_JAVA_OPTS_DEFAULT,
                 PropertyInterpreters.getStringPropertyInterpreter());

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c6ee017f/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
----------------------------------------------------------------------
diff --git 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
index 848bdd2..8ca61ad 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
@@ -105,17 +105,20 @@ public class NCService {
     }
 
     private static void configEnvironment(Map<String,String> env) {
-        if (env.containsKey("JAVA_OPTS")) {
-            if (LOGGER.isLoggable(Level.INFO)) {
-                LOGGER.info("Keeping JAVA_OPTS from environment");
+        String jvmargs = IniUtils.getString(ini, nodeSection, "jvm.args", 
null);
+        if (jvmargs != null) {
+            LOGGER.info("Using JAVA_OPTS from conf file (jvm.args)");
+        } else {
+            jvmargs = env.get("JAVA_OPTS");
+            if (jvmargs != null) {
+                LOGGER.info("Using JAVA_OPTS from environment");
+            } else {
+                LOGGER.info("Using default JAVA_OPTS");
+                jvmargs = "-Xmx1536m";
             }
-            return;
         }
-        String jvmargs = IniUtils.getString(ini, nodeSection, "jvm.args", 
"-Xmx1536m");
         env.put("JAVA_OPTS", jvmargs);
-        if (LOGGER.isLoggable(Level.INFO)) {
-            LOGGER.info("Setting JAVA_OPTS to " + jvmargs);
-        }
+        LOGGER.info("Setting JAVA_OPTS to " + jvmargs);
     }
 
     /**

Reply via email to