You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2014/11/07 00:21:00 UTC
ambari git commit: AMBARI-8195. Slider App View is not replacing
JAVA_HOME (srimanth)
Repository: ambari
Updated Branches:
refs/heads/branch-1.7.0 830a4b3f0 -> 9502f0c9d
AMBARI-8195. Slider App View is not replacing JAVA_HOME (srimanth)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9502f0c9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9502f0c9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9502f0c9
Branch: refs/heads/branch-1.7.0
Commit: 9502f0c9dcc5e701a75b233ef12cee90adaf6aa5
Parents: 830a4b3
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Thu Nov 6 14:50:49 2014 -0800
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Thu Nov 6 14:50:58 2014 -0800
----------------------------------------------------------------------
.../view/slider/SliderAppsViewController.java | 1 +
.../slider/SliderAppsViewControllerImpl.java | 19 +++++++++++--------
.../ui/app/controllers/slider_controller.js | 4 ++++
.../src/main/resources/ui/app/translations.js | 2 +-
4 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9502f0c9/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewController.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewController.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewController.java
index 25b0b89..694a434 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewController.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewController.java
@@ -43,6 +43,7 @@ public interface SliderAppsViewController {
public static final String PROPERTY_GANGLIA_CUSTOM_CLUSTERS = "ganglia.additional.clusters";
public static final String PROPERTY_YARN_RM_WEBAPP_URL = "yarn.rm.webapp.url";
public static final String PROPERTY_SLIDER_USER = "view.slider.user";
+ public static final String PROPERTY_JAVA_HOME = "java.home";
public static final String PROPERTY_SLIDER_SECURITY_ENABLED = "slider.security.enabled";
public static final String METRICS_API_NAME = "Metrics API";
http://git-wip-us.apache.org/repos/asf/ambari/blob/9502f0c9/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
index c26c495..b1f8d2d 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
@@ -178,6 +178,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
Map<String, String> ambariServerConfigs = ambariClient.getAmbariServerConfigs();
if (ambariServerConfigs.containsKey("java.home")) {
newHadoopConfigs.put("java.home", ambariServerConfigs.get("java.home"));
+ status.getParameters().put(PROPERTY_JAVA_HOME, ambariServerConfigs.get("java.home"));
}
// Configs
if (cluster.getDesiredConfigs().containsKey("core-site")) {
@@ -307,14 +308,16 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
new ViewStatus.Validation(
"View parameters specifying Ambari details required"));
}
- if (!newHadoopConfigs.equals(viewContext.getInstanceData())) {
- Set<String> removeKeys = new HashSet<String>(viewContext.getInstanceData().keySet());
- for (Entry<String, String> e : newHadoopConfigs.entrySet()) {
- viewContext.putInstanceData(e.getKey(), e.getValue());
- removeKeys.remove(e.getKey());
- }
- for (String key : removeKeys) {
- viewContext.removeInstanceData(key);
+ synchronized (viewContext) {
+ if (!newHadoopConfigs.equals(viewContext.getInstanceData())) {
+ Set<String> removeKeys = new HashSet<String>(viewContext.getInstanceData().keySet());
+ for (Entry<String, String> e : newHadoopConfigs.entrySet()) {
+ viewContext.putInstanceData(e.getKey(), e.getValue());
+ removeKeys.remove(e.getKey());
+ }
+ for (String key : removeKeys) {
+ viewContext.removeInstanceData(key);
+ }
}
}
return status;
http://git-wip-us.apache.org/repos/asf/ambari/blob/9502f0c9/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
index 9e6d1c8..c64dc94 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
@@ -100,6 +100,10 @@ App.SliderController = Ember.Controller.extend(App.RunPeriodically, {
&& properties['view.slider.user'] != App.get('sliderUser')) {
App.set('sliderUser', properties['view.slider.user']);
}
+ if (properties['java.home'] != null
+ && properties['java.home'] != App.get('javaHome')) {
+ App.set('javaHome', properties['java.home']);
+ }
this.initGangliaProperties();
this.finishSliderConfiguration(data);
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/9502f0c9/contrib/views/slider/src/main/resources/ui/app/translations.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/translations.js b/contrib/views/slider/src/main/resources/ui/app/translations.js
index 15ccb36..98734f5 100644
--- a/contrib/views/slider/src/main/resources/ui/app/translations.js
+++ b/contrib/views/slider/src/main/resources/ui/app/translations.js
@@ -140,7 +140,7 @@ Em.I18n.translations = {
'wizard.step1.logAggregation.filePatterns.include': 'Include File Patterns',
'wizard.step1.logAggregation.filePatterns.exclude': 'Exclude File Patterns',
'wizard.step1.typeDescription': 'Deploys {0} cluster on YARN.',
- 'wizard.step1.nameFormatError': 'App Name should consist only of letters, numbers, \'-\', \'_\' and first character should be a letter.',
+ 'wizard.step1.nameFormatError': 'App Name should consist only of lower case letters, numbers, \'-\', and \'_\'. Also, first character should be a lower case letter.',
'wizard.step1.nameRepeatError': 'App with entered Name already exists.',
'wizard.step1.validateAppNameError': 'Application with name \'{0}\' already exists',
'wizard.step1.noAppTypesError': 'No Slider Application packages have been installed on this server. Please contact your Ambari server administrator to install Slider Application packages into /var/lib/ambari-server/resources/apps/ folder and restart Ambari server.',