You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/09/11 21:02:21 UTC
[01/26] git commit: AMBARI-7241 Configs: actions should not appear
for non-operator cluster users. (ababiichuk)
Repository: ambari
Updated Branches:
refs/heads/branch-alerts-dev 05da121a5 -> 2262400c6
AMBARI-7241 Configs: actions should not appear for non-operator cluster users. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2b78d36e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2b78d36e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2b78d36e
Branch: refs/heads/branch-alerts-dev
Commit: 2b78d36ea2efd0cb4d1441399a00f5d196a0b2b2
Parents: c91fab7
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Sep 10 17:47:31 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Sep 10 17:47:31 2014 +0300
----------------------------------------------------------------------
ambari-web/app/app.js | 3 +++
.../templates/common/configs/config_history_flow.hbs | 12 ++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2b78d36e/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index a690e82..4cca237 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -34,6 +34,9 @@ module.exports = Em.Application.create({
}),
isAdmin: false,
isOperator: false,
+ isManager: function() {
+ return this.get('isAdmin') || this.get('isOperator');
+ }.property('isAdmin','isOperator'),
/**
* return url prefix with number value of version of HDP stack
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/2b78d36e/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index 0dfbe2e..4c79c57 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -49,8 +49,10 @@
</div>
<div class="version-operations-buttons">
<button {{bindAttr disabled="serviceVersion.disabledActionAttr.view" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.view"}} {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i> {{t common.view}}</button>
- <button {{bindAttr disabled="serviceVersion.disabledActionAttr.compare" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.compare"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i> {{t common.compare}}</button>
- <button {{bindAttr disabled="serviceVersion.disabledActionAttr.revert" class=":btn serviceVersion.isCurrent:not-allowed-cursor" title="serviceVersion.disabledActionMessages.revert"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
+ {{#if App.isManager}}
+ <button {{bindAttr disabled="serviceVersion.disabledActionAttr.compare" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.compare"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i> {{t common.compare}}</button>
+ <button {{bindAttr disabled="serviceVersion.disabledActionAttr.revert" class=":btn serviceVersion.isCurrent:not-allowed-cursor" title="serviceVersion.disabledActionMessages.revert"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
+ {{/if}}
</div>
</div>
</div>
@@ -60,6 +62,7 @@
{{translateAttr data-original-title="services.service.config.configHistory.rightArrow.tooltip"}}><i class="icon-chevron-right icon-3x"></i></div>
</div>
<div class="version-info-bar-wrapper">
+ {{#if App.isManager}}
<div {{bindAttr class="view.showCompareVersionBar::hidden :version-info-bar"}}>
<div class="row-fluid">
<div class="span1 remove-compare-bar" {{action removeCompareVersionBar target="view"}} data-toggle="arrow-tooltip" {{translateAttr data-original-title="services.service.config.configHistory.dismissIcon.tooltip"}}>
@@ -82,8 +85,10 @@
</div>
</div>
</div>
+ {{/if}}
<div class="version-info-bar">
<div class="row-fluid">
+ {{#if App.isManager}}
<div class="btn-group pull-left">
<button id="toggle-dropdown-button" class="btn dropdown-toggle" data-toggle="dropdown" href="#" {{action hideFullList target="view"}} {{bindAttr disabled="view.versionActionsDisabled"}}>
<i class="icon-random"></i>
@@ -122,6 +127,7 @@
{{/unless}}
</ul>
</div>
+ {{/if}}
<div class="label-wrapper span8" data-toggle="tooltip" {{bindAttr data-original-title="view.displayedServiceVersion.briefNotes"}}>
<span class="label label-info">{{view.displayedServiceVersion.versionText}}</span>
{{#if view.displayedServiceVersion.isCurrent}}
@@ -129,6 +135,7 @@
{{/if}}
<strong>{{view.displayedServiceVersion.author}}</strong> {{t dashboard.configHistory.info-bar.authoredOn}} <strong>{{view.displayedServiceVersion.createdDate}}</strong>
</div>
+ {{#if App.isManager}}
<div class="pull-right operations-button">
<div {{bindAttr class="view.displayedServiceVersion.isCurrent::hidden"}}>
<button class="btn" {{action doCancel target="controller"}} {{bindAttr disabled="view.isDiscardDisabled"}}>{{t common.discard}}</button>
@@ -136,6 +143,7 @@
</div>
<button class="btn btn-success" {{action revert view.serviceVersionsReferences.displayed target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.displayedServiceVersion.isCurrent:hidden"}}>{{view.displayedServiceVersion.makeCurrentButtonText}}</button>
</div>
+ {{/if}}
</div>
</div>
</div>
[23/26] git commit: AMBARI-7264. Dashboard widgets on moving
strangeness. (akovalenko)
Posted by jo...@apache.org.
AMBARI-7264. Dashboard widgets on moving strangeness. (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/701165b6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/701165b6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/701165b6
Branch: refs/heads/branch-alerts-dev
Commit: 701165b66eff9214ed22d65f0e2c2b8c62f0137c
Parents: b0fee6d
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Thu Sep 11 19:39:15 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Thu Sep 11 19:43:06 2014 +0300
----------------------------------------------------------------------
.../main/dashboard/widgets/cluster_metrics.hbs | 2 +-
.../templates/main/dashboard/widgets/hbase_links.hbs | 2 +-
.../templates/main/dashboard/widgets/hdfs_links.hbs | 2 +-
.../main/dashboard/widgets/mapreduce_links.hbs | 2 +-
.../main/dashboard/widgets/mapreduce_slots.hbs | 2 +-
.../templates/main/dashboard/widgets/pie_chart.hbs | 2 +-
.../templates/main/dashboard/widgets/simple_text.hbs | 2 +-
.../app/templates/main/dashboard/widgets/uptime.hbs | 2 +-
ambari-web/app/views/main/dashboard/widget.js | 4 ++--
ambari-web/app/views/main/dashboard/widgets.js | 14 ++++++++++++++
10 files changed, 24 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs b/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
index eef559d..6156906 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
@@ -19,7 +19,7 @@
<div class="cluster-metrics">
<ul>
<li class="thumbnail row">
- <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+ <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
<i class="icon-remove-sign icon-large"></i>
</a>
<div class="caption span10">{{view.title}}</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
index d7501f4..66d5d23 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
@@ -19,7 +19,7 @@
<div class="links">
<ul>
<li class="thumbnail row">
- <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}><i class="icon-remove-sign icon-large"></i></a>
+ <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}><i class="icon-remove-sign icon-large"></i></a>
<div class="caption span10"> {{view.title}}</div>
<div class="widget-content" >
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
index 2d26c3a..9be5ba4 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
@@ -19,7 +19,7 @@
<div class="links">
<ul>
<li class="thumbnail row">
- <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+ <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
<i class="icon-remove-sign icon-large"></i>
</a>
<div class="caption span10"> {{view.title}}</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
index 15c8a18..13d6f41 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_links.hbs
@@ -19,7 +19,7 @@
<div class="links">
<ul>
<li class="thumbnail row">
- <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+ <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
<i class="icon-remove-sign icon-large"></i>
</a>
<div class="caption span10"> {{view.title}}</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs
index 26f61ba..90b8c27 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/mapreduce_slots.hbs
@@ -19,7 +19,7 @@
<div class="has-hidden-info">
<ul>
<li class="thumbnail row" >
- <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}><i class="icon-remove-sign icon-large"></i></a>
+ <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} {{action deleteWidget target="view"}}><i class="icon-remove-sign icon-large"></i></a>
<div class="caption span10 slots-caption"> {{view.title}}</div>
<div {{bindAttr class=":hidden-info-general view.hiddenInfoClass"}}>
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs b/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
index b73a77c..6af3a01 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
@@ -19,7 +19,7 @@
<div class="has-hidden-info">
<ul>
<li class="thumbnail row">
- <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+ <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
<i class="icon-remove-sign icon-large"></i>
</a>
<div class="caption span10">{{view.title}}</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs b/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
index 845a938..4b14113 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
@@ -19,7 +19,7 @@
<div class="has-hidden-info">
<ul>
<li class="thumbnail row" >
- <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+ <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
<i class="icon-remove-sign icon-large"></i>
</a>
<div class="caption span10"> {{view.title}}</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs b/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
index ce356a1..9ea9e8b 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
@@ -19,7 +19,7 @@
<div class="has-hidden-info">
<ul>
<li class="thumbnail row" >
- <a class="corner-icon span1" href="#" {{action deleteWidget target="view"}}>
+ <a {{bindAttr class=":corner-icon :span1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
<i class="icon-remove-sign icon-large"></i>
</a>
<div class="caption span11"> {{view.title}} </div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/views/main/dashboard/widget.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widget.js b/ambari-web/app/views/main/dashboard/widget.js
index 7561a99..95fc5fb 100644
--- a/ambari-web/app/views/main/dashboard/widget.js
+++ b/ambari-web/app/views/main/dashboard/widget.js
@@ -139,7 +139,7 @@ App.DashboardWidgetView = Em.View.extend({
});
- var browserVerion = this.getInternetExplorerVersion();
+ var browserVersion = this.getInternetExplorerVersion();
App.ModalPopup.show({
header: Em.I18n.t('dashboard.widgets.popupHeader'),
classNames: [ 'sixty-percent-width-modal-edit-widget' ],
@@ -172,7 +172,7 @@ App.DashboardWidgetView = Em.View.extend({
var handlers = [configObj.get('thresh1'), configObj.get('thresh2')];
var colors = ['#95A800', '#FF8E00', '#B80000']; //color green, orange ,red
- if (browserVerion == -1 || browserVerion > 9) {
+ if (browserVersion == -1 || browserVersion > 9) {
configObj.set('isIE9', false);
configObj.set('isGreenOrangeRed', true);
$("#slider-range").slider({
http://git-wip-us.apache.org/repos/asf/ambari/blob/701165b6/ambari-web/app/views/main/dashboard/widgets.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets.js b/ambari-web/app/views/main/dashboard/widgets.js
index 01c229c..374793b 100644
--- a/ambari-web/app/views/main/dashboard/widgets.js
+++ b/ambari-web/app/views/main/dashboard/widgets.js
@@ -45,6 +45,12 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
isDataLoaded: false,
/**
+ * Define if some widget is currently moving
+ * @type {bool}
+ */
+ isMoving: false,
+
+ /**
* Make widgets' list sortable on New Dashboard style
*/
makeSortable: function () {
@@ -53,6 +59,8 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
items: "> div",
//placeholder: "sortable-placeholder",
cursor: "move",
+ tolerance: "pointer",
+ scroll: false,
update: function (event, ui) {
if (!App.get('testMode')) {
// update persist then translate to real
@@ -76,6 +84,12 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
//self.translateToReal(newValue);
});
}
+ },
+ activate: function(event, ui) {
+ self.set('isMoving', true);
+ },
+ deactivate: function(event, ui) {
+ self.set('isMoving', false);
}
}).disableSelection();
},
[13/26] git commit: AMBARI-7252. Decouple Slider View from
ambari-server dependency (srimanth)
Posted by jo...@apache.org.
AMBARI-7252. Decouple Slider View from ambari-server dependency (srimanth)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/11146fb6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/11146fb6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/11146fb6
Branch: refs/heads/branch-alerts-dev
Commit: 11146fb67456a40aeab9fc3f3e6973fd3cf9facd
Parents: 475d458
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Sep 10 12:25:28 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Sep 10 13:02:19 2014 -0700
----------------------------------------------------------------------
contrib/views/slider/pom.xml | 8 -
.../view/slider/SliderAppsViewController.java | 5 +
.../slider/SliderAppsViewControllerImpl.java | 262 +++++------------
.../apache/ambari/view/slider/ViewStatus.java | 33 +--
.../view/slider/clients/AmbariClient.java | 3 -
.../slider/clients/AmbariInternalClient.java | 292 -------------------
.../slider/rest/client/JMXMetricHolder.java | 50 ++++
.../slider/rest/client/SliderAppJmxHelper.java | 1 -
.../app/controllers/slider_apps_controller.js | 8 +-
.../src/main/resources/ui/app/initialize.js | 19 +-
.../views/slider/src/main/resources/view.xml | 23 +-
11 files changed, 174 insertions(+), 530 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml
index 31a7c7e..ec4089f 100644
--- a/contrib/views/slider/pom.xml
+++ b/contrib/views/slider/pom.xml
@@ -105,12 +105,6 @@
<artifactId>gson</artifactId>
<version>2.2.2</version>
</dependency>
- <dependency>
- <groupId>org.apache.ambari</groupId>
- <artifactId>ambari-server</artifactId>
- <version>${ambari.version}</version>
- <scope>provided</scope>
- </dependency>
<!-- ==================================================================== -->
<!-- Slider Dependencies (to be removed when Slider has Maven repository) -->
@@ -398,8 +392,6 @@
<nodejs.directory>${basedir}/target/nodejs</nodejs.directory>
<npm.version>1.4.3</npm.version>
<ui.directory>${basedir}/src/main/resources/ui</ui.directory>
- <!-- deprecated, moved to top component -->
- <!-- <ambari.version>1.3.0-SNAPSHOT</ambari.version> -->
<hadoop.version>2.6.0-SNAPSHOT</hadoop.version>
<avro.version>1.7.4</avro.version>
<bigtop.version>0.7.0</bigtop.version>
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/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 823fea6..70e333f 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
@@ -30,6 +30,11 @@ import com.google.inject.ImplementedBy;
@ImplementedBy(SliderAppsViewControllerImpl.class)
public interface SliderAppsViewController {
+ public static final String PROPERTY_HDFS_ADDRESS = "hdfs.address";
+ public static final String PROPERTY_YARN_RM_ADDRESS = "yarn.resourcemanager.address";
+ public static final String PROPERTY_YARN_RM_SCHEDULER_ADDRESS = "yarn.resourcemanager.scheduler.address";
+ public static final String PROPERTY_ZK_QUOROM = "zookeeper.quorum";
+
public ViewStatus getViewStatus();
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/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 6b3b3f5..f17b66d 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
@@ -35,12 +35,6 @@ import java.util.Set;
import java.util.zip.ZipException;
import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.slider.clients.AmbariClient;
-import org.apache.ambari.view.slider.clients.AmbariCluster;
-import org.apache.ambari.view.slider.clients.AmbariClusterInfo;
-import org.apache.ambari.view.slider.clients.AmbariHostComponent;
-import org.apache.ambari.view.slider.clients.AmbariService;
-import org.apache.ambari.view.slider.clients.AmbariServiceInfo;
import org.apache.ambari.view.slider.rest.client.Metric;
import org.apache.ambari.view.slider.rest.client.SliderAppMasterClient;
import org.apache.ambari.view.slider.rest.client.SliderAppMasterClient.SliderAppMasterData;
@@ -90,15 +84,11 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
.getLogger(SliderAppsViewControllerImpl.class);
@Inject
private ViewContext viewContext;
- @Inject
- private AmbariClient ambariClient;
private List<SliderAppType> appTypes;
private Integer createAppCounter = -1;
private String getAppsFolderPath() {
- return viewContext
- .getAmbariProperty(org.apache.ambari.server.configuration.Configuration.RESOURCES_DIR_KEY)
- + "/apps";
+ return viewContext.getAmbariProperty("resources.dir") + "/apps";
}
private String getAppsCreateFolderPath() {
@@ -108,91 +98,13 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
@Override
public ViewStatus getViewStatus() {
ViewStatus status = new ViewStatus();
- List<String> viewErrors = new ArrayList<String>();
-
- AmbariClusterInfo clusterInfo = ambariClient.getClusterInfo();
- if (clusterInfo != null) {
- AmbariCluster cluster = ambariClient.getCluster(clusterInfo);
- List<AmbariServiceInfo> services = cluster.getServices();
- if (services != null && !services.isEmpty()) {
- AmbariServiceInfo hdfsService = null, yarnService = null, zkService = null;
- for (AmbariServiceInfo service : services) {
- if ("HDFS".equals(service.getId())) {
- hdfsService = service;
- } else if ("YARN".equals(service.getId())) {
- yarnService = service;
- } else if ("ZOOKEEPER".equals(service.getId())) {
- zkService = service;
- }
- }
- if (hdfsService == null) {
- viewErrors.add("Slider applications view requires HDFS service");
- } else {
- if (!hdfsService.isStarted()) {
- viewErrors
- .add("Slider applications view requires HDFS service to be started");
- }
- }
- if (yarnService == null) {
- viewErrors.add("Slider applications view requires YARN service");
- } else {
- if (!yarnService.isStarted()) {
- viewErrors
- .add("Slider applications view requires YARN service to be started");
- }
- }
- if (zkService == null) {
- viewErrors.add("Slider applications view requires ZooKeeper service");
- } else {
- if (!zkService.isStarted()) {
- viewErrors
- .add("Slider applications view requires ZooKeeper service to be started");
- }
- }
- } else {
- viewErrors
- .add("Slider applications view is unable to locate any services");
- }
- // Check security
- if (cluster.getDesiredConfigs() != null
- && cluster.getDesiredConfigs().containsKey("hadoop-env")) {
- Map<String, String> globalConfig = ambariClient.getConfiguration(
- clusterInfo, "hadoop-env", cluster.getDesiredConfigs().get("hadoop-env"));
- if (globalConfig != null
- && globalConfig.containsKey("security_enabled")) {
- String securityValue = globalConfig.get("security_enabled");
- if (Boolean.valueOf(securityValue)) {
- viewErrors
- .add("Slider applications view cannot be rendered in secure mode");
- }
- } else {
- viewErrors
- .add("Slider applications view is unable to determine the security status of the cluster");
- }
- } else {
- viewErrors
- .add("Slider applications view is unable to determine the security status of the cluster");
- }
- } else {
- viewErrors.add("Slider applications view requires a cluster");
- }
status.setVersion(SliderAppsConfiguration.INSTANCE.getVersion());
- status.setViewEnabled(viewErrors.size() < 1);
- status.setViewErrors(viewErrors);
return status;
}
- private AmbariCluster getAmbariCluster() {
- AmbariClusterInfo clusterInfo = ambariClient.getClusterInfo();
- if (clusterInfo != null) {
- return ambariClient.getCluster(clusterInfo);
- }
- return null;
- }
-
private String getApplicationIdString(ApplicationId appId) {
return Long.toString(appId.getClusterTimestamp()) + "_"
- + Integer.toString(appId.getId());
+ + Integer.toString(appId.getId());
}
private ApplicationId getApplicationId(String appIdString) {
@@ -228,7 +140,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
}
private SliderApp createSliderAppObject(ApplicationReport yarnApp,
- Set<String> properties, SliderClient sliderClient) {
+ Set<String> properties, SliderClient sliderClient) {
if (yarnApp == null) {
return null;
}
@@ -311,13 +223,17 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
List<SliderAppType> appTypes = getSliderAppTypes(null);
if (appTypes != null && appTypes.size() > 0) {
for (SliderAppType appType : appTypes) {
- logger.info("TYPE: " + appType.getTypeName() + " " + app.getType());
- logger.info("VERSION: " + appType.getTypeVersion() + " " + app.getAppVersion());
- if ((appType.getTypeName() != null && appType.getTypeName().equalsIgnoreCase(app.getType())) &&
- (appType.getTypeVersion() != null
- && appType.getTypeVersion().equalsIgnoreCase(app.getAppVersion()))) {
+ logger.info("TYPE: " + appType.getTypeName() + " "
+ + app.getType());
+ logger.info("VERSION: " + appType.getTypeVersion() + " "
+ + app.getAppVersion());
+ if ((appType.getTypeName() != null && appType.getTypeName()
+ .equalsIgnoreCase(app.getType()))
+ && (appType.getTypeVersion() != null && appType
+ .getTypeVersion().equalsIgnoreCase(
+ app.getAppVersion()))) {
app.setJmx(sliderAppClient.getJmx(jmxUrl, viewContext,
- appType));
+ appType));
break;
}
}
@@ -336,10 +252,8 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
Map<String, SliderAppComponent> componentTypeMap = new HashMap<String, SliderAppComponent>();
for (Entry<String, Object> e : description.status.entrySet()) {
@SuppressWarnings("unchecked")
- Map<String, Map<String, Map<String, Object>>>
- componentsObj =
- (Map<String, Map<String, Map<String, Object>>>) e
- .getValue();
+ Map<String, Map<String, Map<String, Object>>> componentsObj = (Map<String, Map<String, Map<String, Object>>>) e
+ .getValue();
boolean isLive = "live".equals(e.getKey());
for (Entry<String, Map<String, Map<String, Object>>> componentEntry : componentsObj
.entrySet()) {
@@ -353,7 +267,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
appComponent
.setCompletedContainers(new HashMap<String, Map<String, String>>());
componentTypeMap.put(componentEntry.getKey(),
- appComponent);
+ appComponent);
}
for (Entry<String, Map<String, Object>> containerEntry : componentEntry
.getValue().entrySet()) {
@@ -366,19 +280,19 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
Object containerPropertyValue = containerValues
.get(containerProperty);
containerDataMap.put(containerProperty,
- containerPropertyValue.toString());
+ containerPropertyValue.toString());
}
if (isLive) {
appComponent.getActiveContainers().put(containerId,
- containerDataMap);
+ containerDataMap);
} else {
appComponent.getCompletedContainers().put(
containerId, containerDataMap);
}
}
appComponent.setInstanceCount(appComponent
- .getActiveContainers().size()
- + appComponent.getCompletedContainers().size());
+ .getActiveContainers().size()
+ + appComponent.getCompletedContainers().size());
}
}
app.setComponents(componentTypeMap);
@@ -386,16 +300,16 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
} catch (UnknownApplicationInstanceException e) {
logger.warn(
"Unable to determine app components for "
- + yarnApp.getName(), e);
+ + yarnApp.getName(), e);
} catch (YarnException e) {
logger.warn(
"Unable to determine app components for "
- + yarnApp.getName(), e);
+ + yarnApp.getName(), e);
throw new RuntimeException(e.getMessage(), e);
} catch (IOException e) {
logger.warn(
"Unable to determine app components for "
- + yarnApp.getName(), e);
+ + yarnApp.getName(), e);
throw new RuntimeException(e.getMessage(), e);
}
}
@@ -407,9 +321,10 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
}
/**
- * Creates a new {@link SliderClient} initialized with appropriate configuration. If configuration was not determined,
- * <code>null</code> is returned.
- *
+ * Creates a new {@link SliderClient} initialized with appropriate
+ * configuration. If configuration was not determined, <code>null</code> is
+ * returned.
+ *
* @return
*/
protected SliderClient getSliderClient() {
@@ -426,7 +341,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
super.serviceInit(conf);
// Override the default FS client to set the super user.
FileSystem fs = FileSystem.get(FileSystem.getDefaultUri(getConfig()),
- getConfig(), "yarn");
+ getConfig(), "yarn");
SliderFileSystem fileSystem = new SliderFileSystem(fs, getConfig());
Field fsField = SliderClient.class
.getDeclaredField("sliderFileSystem");
@@ -436,7 +351,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
};
try {
sliderClientConfiguration = client.bindArgs(sliderClientConfiguration,
- new String[]{"usage"});
+ new String[] { "usage" });
} catch (Exception e) {
logger.warn("Unable to set SliderClient configs", e);
throw new RuntimeException(e.getMessage(), e);
@@ -449,60 +364,28 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
}
/**
- * Dynamically determines Slider client configuration. If unable to determine, <code>null</code> is returned.
- *
+ * Dynamically determines Slider client configuration. If unable to determine,
+ * <code>null</code> is returned.
+ *
* @return
*/
private Configuration getSliderClientConfiguration() {
- AmbariCluster ambariCluster = getAmbariCluster();
- if (ambariCluster != null) {
- AmbariService zkService = ambariClient.getService(ambariCluster,
- "ZOOKEEPER");
- if (zkService != null && ambariCluster.getDesiredConfigs() != null
- && ambariCluster.getDesiredConfigs().containsKey("zookeeper-env")
- && ambariCluster.getDesiredConfigs().containsKey("yarn-site")
- && ambariCluster.getDesiredConfigs().containsKey("core-site")) {
- Map<String, String> zkConfigs = ambariClient.getConfiguration(
- ambariCluster, "zookeeper-env",
- ambariCluster.getDesiredConfigs().get("zookeeper-env"));
- Map<String, String> yarnSiteConfigs = ambariClient.getConfiguration(
- ambariCluster, "yarn-site",
- ambariCluster.getDesiredConfigs().get("yarn-site"));
- Map<String, String> coreSiteConfigs = ambariClient.getConfiguration(
- ambariCluster, "core-site",
- ambariCluster.getDesiredConfigs().get("core-site"));
- String zkPort = zkConfigs.get("clientPort");
- String hdfsPath = coreSiteConfigs.get("fs.defaultFS");
- String rmAddress = yarnSiteConfigs.get("yarn.resourcemanager.address");
- String rmSchedulerAddress = yarnSiteConfigs
- .get("yarn.resourcemanager.scheduler.address");
- StringBuilder zkQuorum = new StringBuilder();
- List<AmbariHostComponent> zkHosts = zkService
- .getComponentsToHostComponentsMap().get("ZOOKEEPER_SERVER");
- for (AmbariHostComponent zkHost : zkHosts) {
- if (zkQuorum.length() > 0) {
- zkQuorum.append(',');
- }
- zkQuorum.append(zkHost.getHostName() + ":" + zkPort);
- }
- HdfsConfiguration hdfsConfig = new HdfsConfiguration();
- YarnConfiguration yarnConfig = new YarnConfiguration(hdfsConfig);
-
- yarnConfig.set("slider.yarn.queue", "default");
- yarnConfig.set("yarn.log-aggregation-enable", "true");
- yarnConfig.set("yarn.resourcemanager.address", rmAddress);
- yarnConfig.set("yarn.resourcemanager.scheduler.address",
- rmSchedulerAddress);
- yarnConfig.set("fs.defaultFS", hdfsPath);
- yarnConfig.set("slider.zookeeper.quorum", zkQuorum.toString());
- yarnConfig
- .set(
- "yarn.application.classpath",
- "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*");
- return yarnConfig;
- }
- }
- return null;
+ String hdfsPath = viewContext.getProperties().get(PROPERTY_HDFS_ADDRESS);
+ String rmAddress = viewContext.getProperties().get(PROPERTY_YARN_RM_ADDRESS);
+ String rmSchedulerAddress = viewContext.getProperties().get(PROPERTY_YARN_RM_SCHEDULER_ADDRESS);
+ String zkQuorum = viewContext.getProperties().get(PROPERTY_ZK_QUOROM);
+ HdfsConfiguration hdfsConfig = new HdfsConfiguration();
+ YarnConfiguration yarnConfig = new YarnConfiguration(hdfsConfig);
+
+ yarnConfig.set("slider.yarn.queue", "default");
+ yarnConfig.set("yarn.log-aggregation-enable", "true");
+ yarnConfig.set("yarn.resourcemanager.address", rmAddress);
+ yarnConfig.set("yarn.resourcemanager.scheduler.address", rmSchedulerAddress);
+ yarnConfig.set("fs.defaultFS", hdfsPath);
+ yarnConfig.set("slider.zookeeper.quorum", zkQuorum.toString());
+ yarnConfig.set("yarn.application.classpath",
+ "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*");
+ return yarnConfig;
}
@Override
@@ -518,7 +401,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
List<ApplicationReport> yarnApps = sliderClient.listSliderInstances(null);
for (ApplicationReport yarnApp : yarnApps) {
SliderApp sliderAppObject = createSliderAppObject(yarnApp, properties,
- sliderClient);
+ sliderClient);
if (sliderAppObject != null) {
if (sliderAppsMap.containsKey(sliderAppObject.getName())) {
if (sliderAppsMap.get(sliderAppObject.getName()).getId()
@@ -594,7 +477,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
try {
ZipFile zipFile = new ZipFile(appZip);
Metainfo metainfo = new MetainfoParser().parse(zipFile
- .getInputStream(zipFile.getEntry("metainfo.xml")));
+ .getInputStream(zipFile.getEntry("metainfo.xml")));
// Create app type object
if (metainfo.getApplication() != null) {
Application application = metainfo.getApplication();
@@ -637,11 +520,11 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
// appTypeComponent.setPriority(component.);
if (component.getMinInstanceCount() != null) {
appTypeComponent.setInstanceCount(Integer.parseInt(component
- .getMinInstanceCount()));
+ .getMinInstanceCount()));
}
if (component.getMaxInstanceCount() != null) {
appTypeComponent.setMaxInstanceCount(Integer
- .parseInt(component.getMaxInstanceCount()));
+ .parseInt(component.getMaxInstanceCount()));
}
if (resourcesJson != null) {
JsonElement componentJson = resourcesJson.getAsJsonObject()
@@ -649,10 +532,10 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
.get(component.getName());
if (componentJson != null
&& componentJson.getAsJsonObject().has(
- "yarn.role.priority")) {
+ "yarn.role.priority")) {
appTypeComponent.setPriority(Integer.parseInt(componentJson
- .getAsJsonObject().get("yarn.role.priority")
- .getAsString()));
+ .getAsJsonObject().get("yarn.role.priority")
+ .getAsString()));
}
}
appTypeComponent.setCategory(component.getCategory());
@@ -661,7 +544,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
appType.setJmxMetrics(readMetrics(zipFile, "jmx_metrics.json"));
appType.setGangliaMetrics(readMetrics(zipFile,
- "ganglia_metrics.json"));
+ "ganglia_metrics.json"));
appType.setTypeComponents(appTypeComponentList);
appTypes.add(appType);
@@ -678,16 +561,16 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
}
Map<String, Map<String, Map<String, Metric>>> readMetrics(ZipFile zipFile,
- String fileName) {
+ String fileName) {
Map<String, Map<String, Map<String, Metric>>> metrics = null;
try {
InputStream inputStream = zipFile.getInputStream(zipFile
- .getEntry("jmx_metrics.json"));
+ .getEntry("jmx_metrics.json"));
ObjectMapper mapper = new ObjectMapper();
metrics = mapper.readValue(inputStream,
- new TypeReference<Map<String, Map<String, Map<String, Metric>>>>() {
- });
+ new TypeReference<Map<String, Map<String, Map<String, Metric>>>>() {
+ });
} catch (IOException e) {
logger.info("Error reading metrics. " + e.getMessage());
}
@@ -727,31 +610,26 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
appCount = ++createAppCounter;
}
File appCreateFolder = new File(appsCreateFolder,
- Integer.toString(appCount));
+ Integer.toString(appCount));
appCreateFolder.mkdirs();
File appConfigJsonFile = new File(appCreateFolder, "appConfig.json");
File resourcesJsonFile = new File(appCreateFolder, "resources.json");
saveAppConfigs(configs, componentsArray, appConfigJsonFile);
saveAppResources(componentsArray, resourcesJsonFile);
- AmbariClusterInfo clusterInfo = ambariClient.getClusterInfo();
- AmbariCluster cluster = ambariClient.getCluster(clusterInfo);
- Map<String, String> coreSiteConfigs = ambariClient.getConfiguration(
- clusterInfo, "core-site", cluster.getDesiredConfigs()
- .get("core-site"));
- String hdfsLocation = coreSiteConfigs.get("fs.defaultFS");
+ String hdfsLocation = viewContext.getProperties().get(PROPERTY_HDFS_ADDRESS);
final ActionCreateArgs createArgs = new ActionCreateArgs();
createArgs.template = appConfigJsonFile;
createArgs.resources = resourcesJsonFile;
createArgs.image = new Path(hdfsLocation
- + "/user/yarn/agent/slider-agent.tar.gz");
+ + "/user/yarn/agent/slider-agent.tar.gz");
ClassLoader currentClassLoader = Thread.currentThread()
.getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
try {
ApplicationId applicationId = UserGroupInformation.getBestUGI(null,
- "yarn").doAs(new PrivilegedExceptionAction<ApplicationId>() {
+ "yarn").doAs(new PrivilegedExceptionAction<ApplicationId>() {
public ApplicationId run() throws IOException, YarnException {
SliderClient sliderClient = getSliderClient();
sliderClient.actionCreate(appName, createArgs);
@@ -769,10 +647,10 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
}
private void saveAppResources(JsonArray componentsArray,
- File resourcesJsonFile) throws IOException {
+ File resourcesJsonFile) throws IOException {
JsonObject resourcesObj = new JsonObject();
resourcesObj.addProperty("schema",
- "http://example.org/specification/v2.0.0");
+ "http://example.org/specification/v2.0.0");
resourcesObj.add("metadata", new JsonObject());
resourcesObj.add("global", new JsonObject());
JsonObject componentsObj = new JsonObject();
@@ -782,11 +660,11 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
if (inputComponent.has("id")) {
JsonObject componentValue = new JsonObject();
componentValue.addProperty("yarn.role.priority",
- inputComponent.get("priority").getAsString());
+ inputComponent.get("priority").getAsString());
componentValue.addProperty("yarn.component.instances", inputComponent
.get("instanceCount").getAsString());
componentsObj.add(inputComponent.get("id").getAsString(),
- componentValue);
+ componentValue);
}
}
}
@@ -804,7 +682,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
}
private void saveAppConfigs(JsonObject configs, JsonArray componentsArray,
- File appConfigJsonFile) throws IOException {
+ File appConfigJsonFile) throws IOException {
JsonObject appConfigs = new JsonObject();
appConfigs.addProperty("schema", "http://example.org/specification/v2.0.0");
appConfigs.add("metadata", new JsonObject());
@@ -815,7 +693,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
JsonObject inputComponent = componentsArray.get(i).getAsJsonObject();
if (inputComponent.has("id")) {
componentsObj.add(inputComponent.get("id").getAsString(),
- new JsonObject());
+ new JsonObject());
}
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/ViewStatus.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/ViewStatus.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/ViewStatus.java
index 134f400..b9dbbbd 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/ViewStatus.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/ViewStatus.java
@@ -18,34 +18,15 @@
package org.apache.ambari.view.slider;
-import java.util.List;
public class ViewStatus {
- private String version;
- private boolean viewEnabled;
- private List<String> viewErrors;
+ private String version;
- public String getVersion() {
- return version;
- }
+ public String getVersion() {
+ return version;
+ }
- public void setVersion(String version) {
- this.version = version;
- }
-
- public boolean isViewEnabled() {
- return viewEnabled;
- }
-
- public void setViewEnabled(boolean viewEnabled) {
- this.viewEnabled = viewEnabled;
- }
-
- public List<String> getViewErrors() {
- return viewErrors;
- }
-
- public void setViewErrors(List<String> viewErrors) {
- this.viewErrors = viewErrors;
- }
+ public void setVersion(String version) {
+ this.version = version;
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariClient.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariClient.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariClient.java
index a53afe4..b77e340 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariClient.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariClient.java
@@ -20,9 +20,6 @@ package org.apache.ambari.view.slider.clients;
import java.util.Map;
-import com.google.inject.ImplementedBy;
-
-@ImplementedBy(AmbariInternalClient.class)
public interface AmbariClient {
/**
* Provides the first cluster defined on this Ambari server.
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariInternalClient.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariInternalClient.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariInternalClient.java
deleted file mode 100644
index 529af9d..0000000
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/clients/AmbariInternalClient.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ambari.view.slider.clients;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.ambari.server.controller.predicate.AndPredicate;
-import org.apache.ambari.server.controller.predicate.EqualsPredicate;
-import org.apache.ambari.server.controller.spi.ClusterController;
-import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
-import org.apache.ambari.server.controller.spi.NoSuchResourceException;
-import org.apache.ambari.server.controller.spi.Resource;
-import org.apache.ambari.server.controller.spi.SystemException;
-import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
-import org.apache.ambari.server.controller.utilities.ClusterControllerHelper;
-import org.apache.ambari.server.controller.utilities.PropertyHelper;
-import org.apache.ambari.server.state.DesiredConfig;
-import org.apache.ambari.server.state.State;
-import org.apache.log4j.Logger;
-
-import com.google.inject.Singleton;
-
-@Singleton
-public class AmbariInternalClient implements AmbariClient {
-
- private static final Logger logger = Logger
- .getLogger(AmbariInternalClient.class);
-
- @Override
- public AmbariCluster getCluster(AmbariClusterInfo clusterInfo) {
- ClusterController clusterController = ClusterControllerHelper
- .getClusterController();
- try {
- EqualsPredicate<String> clusterPredicate = new EqualsPredicate<String>(
- "Clusters/cluster_name", clusterInfo.getName());
- Set<Resource> clusterResources = clusterController.getResources(
- Resource.Type.Cluster, PropertyHelper.getReadRequest(),
- clusterPredicate);
- if (!clusterResources.isEmpty()) {
- Resource clusterResource = clusterResources.iterator().next();
- AmbariCluster cluster = new AmbariCluster();
- cluster.setName(clusterResource.getPropertyValue(
- "Clusters/cluster_name").toString());
- cluster.setVersion(clusterResource.getPropertyValue("Clusters/version")
- .toString());
- Map<String, String> desiredConfigsMap = new HashMap<String, String>();
- Map<String, Object> desiredConfigsMapResource = clusterResource
- .getPropertiesMap().get("Clusters/desired_configs");
- for (Map.Entry<String, Object> siteEntry : desiredConfigsMapResource
- .entrySet()) {
- desiredConfigsMap.put(siteEntry.getKey(),
- ((DesiredConfig) siteEntry.getValue()).getTag());
- }
- cluster.setDesiredConfigs(desiredConfigsMap);
-
- EqualsPredicate<String> serviceClusterPredicate = new EqualsPredicate<String>(
- "ServiceInfo/cluster_name", cluster.getName());
- EqualsPredicate<String> hostClusterPredicate = new EqualsPredicate<String>(
- "Hosts/cluster_name", cluster.getName());
- Set<Resource> serviceResources = clusterController.getResources(
- Resource.Type.Service, PropertyHelper.getReadRequest(),
- serviceClusterPredicate);
- Set<Resource> hostResources = clusterController.getResources(
- Resource.Type.Host, PropertyHelper.getReadRequest(),
- hostClusterPredicate);
- List<AmbariServiceInfo> servicesList = new ArrayList<AmbariServiceInfo>();
- List<AmbariHostInfo> hostsList = new ArrayList<AmbariHostInfo>();
- for (Resource serviceResource : serviceResources) {
- AmbariServiceInfo service = new AmbariServiceInfo();
- service.setId(serviceResource.getPropertyValue(
- "ServiceInfo/service_name").toString());
- service.setStarted(State.STARTED.toString().equals(
- serviceResource.getPropertyValue("ServiceInfo/state")));
- service.setMaintenanceMode("ON".equals(serviceResource
- .getPropertyValue("ServiceInfo/maintenance_state")));
- servicesList.add(service);
- }
- for (Resource hostResource : hostResources) {
- AmbariHostInfo host = new AmbariHostInfo();
- host.setHostName(hostResource.getPropertyValue("Hosts/host_name")
- .toString());
- hostsList.add(host);
- }
- cluster.setServices(servicesList);
- cluster.setHosts(hostsList);
- return cluster;
- }
- } catch (UnsupportedPropertyException e) {
- logger.warn(
- "Unable to determine Ambari cluster details - "
- + clusterInfo.getName(), e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (NoSuchResourceException e) {
- logger.warn(
- "Unable to determine Ambari cluster details - "
- + clusterInfo.getName(), e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (NoSuchParentResourceException e) {
- logger.warn(
- "Unable to determine Ambari cluster details - "
- + clusterInfo.getName(), e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (SystemException e) {
- logger.warn(
- "Unable to determine Ambari cluster details - "
- + clusterInfo.getName(), e);
- throw new RuntimeException(e.getMessage(), e);
- }
- return null;
- }
-
- @Override
- public AmbariClusterInfo getClusterInfo() {
- ClusterController clusterController = ClusterControllerHelper
- .getClusterController();
- try {
- Set<Resource> resources = clusterController.getResources(
- Resource.Type.Cluster, PropertyHelper.getReadRequest(), null);
- if (resources.size() > 0) {
- Resource clusterResource = resources.iterator().next();
- AmbariClusterInfo clusterInfo = new AmbariClusterInfo();
- clusterInfo.setName(clusterResource.getPropertyValue(
- "Clusters/cluster_name").toString());
- clusterInfo.setVersion(clusterResource.getPropertyValue(
- "Clusters/version").toString());
- return clusterInfo;
- }
- } catch (UnsupportedPropertyException e) {
- logger.warn("Unable to determine Ambari cluster", e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (NoSuchResourceException e) {
- logger.warn("Unable to determine Ambari cluster", e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (NoSuchParentResourceException e) {
- logger.warn("Unable to determine Ambari cluster", e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (SystemException e) {
- logger.warn("Unable to determine Ambari cluster", e);
- throw new RuntimeException(e.getMessage(), e);
- }
- return null;
- }
-
- @Override
- public Map<String, String> getConfiguration(AmbariClusterInfo cluster,
- String configType, String configTag) {
- ClusterController clusterController = ClusterControllerHelper
- .getClusterController();
- try {
- EqualsPredicate<String> clusterPredicate = new EqualsPredicate<String>(
- "Config/cluster_name", cluster.getName());
- EqualsPredicate<String> typePredicate = new EqualsPredicate<String>(
- "type", configType);
- EqualsPredicate<String> tagPredicate = new EqualsPredicate<String>("tag",
- configTag);
- AndPredicate typeTagPredicate = new AndPredicate(typePredicate,
- tagPredicate);
- AndPredicate configsPredicate = new AndPredicate(clusterPredicate,
- typeTagPredicate);
-
- Set<Resource> configResources = clusterController.getResources(
- Resource.Type.Configuration, PropertyHelper.getReadRequest(),
- configsPredicate);
- if (!configResources.isEmpty()) {
- Resource configResource = configResources.iterator().next();
- Map<String, String> configs = new HashMap<String, String>();
- Object props = configResource.getPropertiesMap().get("properties");
- if (props instanceof Map) {
- @SuppressWarnings("unchecked")
- Map<String, String> propsMap = (Map<String, String>) props;
- configs.putAll(propsMap);
- }
- return configs;
- }
- } catch (UnsupportedPropertyException e) {
- logger.warn("Unable to determine Ambari cluster configuration", e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (NoSuchResourceException e) {
- logger.warn("Unable to determine Ambari cluster configuration", e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (NoSuchParentResourceException e) {
- logger.warn("Unable to determine Ambari cluster configuration", e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (SystemException e) {
- logger.warn("Unable to determine Ambari cluster configuration", e);
- throw new RuntimeException(e.getMessage(), e);
- }
- return null;
- }
-
- @Override
- public AmbariService getService(AmbariClusterInfo clusterInfo,
- String serviceId) {
- ClusterController clusterController = ClusterControllerHelper
- .getClusterController();
- try {
- EqualsPredicate<String> clusterPredicate = new EqualsPredicate<String>(
- "ServiceInfo/cluster_name", clusterInfo.getName());
- EqualsPredicate<String> servicePredicate = new EqualsPredicate<String>(
- "ServiceInfo/service_name", serviceId);
- AndPredicate andPredicate = new AndPredicate(clusterPredicate,
- servicePredicate);
- Set<Resource> serviceResources = clusterController.getResources(
- Resource.Type.Service, PropertyHelper.getReadRequest(), andPredicate);
- if (!serviceResources.isEmpty()) {
- Resource serviceResource = serviceResources.iterator().next();
- AmbariService service = new AmbariService();
- service.setId(serviceResource.getPropertyValue(
- "ServiceInfo/service_name").toString());
- service.setStarted(State.STARTED.toString().equals(
- serviceResource.getPropertyValue("ServiceInfo/state")));
- service.setMaintenanceMode("ON".equals(serviceResource
- .getPropertyValue("ServiceInfo/maintenance_state")));
- // Components
- Map<String, List<AmbariHostComponent>> componentsMap = new HashMap<String, List<AmbariHostComponent>>();
- service.setComponentsToHostComponentsMap(componentsMap);
- clusterPredicate = new EqualsPredicate<String>(
- "ServiceComponentInfo/cluster_name", clusterInfo.getName());
- servicePredicate = new EqualsPredicate<String>(
- "ServiceComponentInfo/service_name", serviceId);
- andPredicate = new AndPredicate(clusterPredicate, servicePredicate);
- Set<Resource> componentResources = clusterController.getResources(
- Resource.Type.Component, PropertyHelper.getReadRequest(),
- andPredicate);
- if (!componentResources.isEmpty()) {
- for (Resource componentResouce : componentResources) {
- List<AmbariHostComponent> hostComponents = new ArrayList<AmbariHostComponent>();
- String componentName = componentResouce.getPropertyValue(
- "ServiceComponentInfo/component_name").toString();
- componentsMap.put(componentName, hostComponents);
- clusterPredicate = new EqualsPredicate<String>(
- "HostRoles/cluster_name", clusterInfo.getName());
- EqualsPredicate<String> componentPredicate = new EqualsPredicate<String>(
- "HostRoles/component_name", componentName);
- andPredicate = new AndPredicate(clusterPredicate,
- componentPredicate);
- Set<Resource> hostComponentResources = clusterController
- .getResources(Resource.Type.HostComponent,
- PropertyHelper.getReadRequest(), andPredicate);
- if (!hostComponentResources.isEmpty()) {
- for (Resource hostComponentResource : hostComponentResources) {
- AmbariHostComponent hc = new AmbariHostComponent();
- hc.setHostName(hostComponentResource.getPropertyValue(
- "HostRoles/host_name").toString());
- hc.setName(hostComponentResource.getPropertyValue(
- "HostRoles/component_name").toString());
- hc.setStarted(State.STARTED.toString().equals(
- hostComponentResource.getPropertyValue("HostRoles/state")
- .toString()));
- hostComponents.add(hc);
- }
- }
- }
- }
- return service;
- }
- } catch (UnsupportedPropertyException e) {
- logger.warn("Unable to determine service details - " + serviceId, e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (NoSuchResourceException e) {
- logger.warn("Unable to determine service details - " + serviceId, e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (NoSuchParentResourceException e) {
- logger.warn("Unable to determine service details - " + serviceId, e);
- throw new RuntimeException(e.getMessage(), e);
- } catch (SystemException e) {
- logger.warn("Unable to determine service details - " + serviceId, e);
- throw new RuntimeException(e.getMessage(), e);
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/JMXMetricHolder.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/JMXMetricHolder.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/JMXMetricHolder.java
new file mode 100644
index 0000000..04b824a
--- /dev/null
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/JMXMetricHolder.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.slider.rest.client;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ */
+public final class JMXMetricHolder {
+
+ private List<Map<String, Object>> beans;
+
+ public List<Map<String, Object>> getBeans() {
+ return beans;
+ }
+
+ public void setBeans(List<Map<String, Object>> beans) {
+ this.beans = beans;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder stringBuilder = new StringBuilder();
+
+ for (Map<String, Object> map : beans) {
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
+ stringBuilder.append(" ").append(entry.toString()).append("\n");
+ }
+ }
+ return stringBuilder.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppJmxHelper.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppJmxHelper.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppJmxHelper.java
index e0a8072..d3ca1e4 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppJmxHelper.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppJmxHelper.java
@@ -18,7 +18,6 @@
package org.apache.ambari.view.slider.rest.client;
-import org.apache.ambari.server.controller.jmx.JMXMetricHolder;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.codehaus.jackson.map.DeserializationConfig;
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
index 7199777..2f422f1 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
@@ -146,13 +146,19 @@ App.SliderAppsController = Ember.ArrayController.extend({
* @method sendInitialValues
*/
sendInitialValues: function () {
+ var initialValues = this.get('initialValuesToLoad');
return App.ajax.send({
name: 'saveInitialValues',
sender: this,
data: {
data: {
ViewInstanceInfo: {
- properties: this.get('initialValuesToLoad')
+ properties: {
+ 'hdfs.address': initialValues.get('hdfsAddress'),
+ 'yarn.resourcemanager.address': initialValues.get('yarnRMAddress'),
+ 'yarn.resourcemanager.scheduler.address': initialValues.get('yarnRMSchedulerAddress'),
+ 'zookeeper.quorum': initialValues.get('zookeeperQuorum')
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/src/main/resources/ui/app/initialize.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/initialize.js b/contrib/views/slider/src/main/resources/ui/app/initialize.js
index a9df6ad..4fc797a 100755
--- a/contrib/views/slider/src/main/resources/ui/app/initialize.js
+++ b/contrib/views/slider/src/main/resources/ui/app/initialize.js
@@ -29,7 +29,18 @@ App.initializer({
name: "preload",
initialize: function(container, application) {
-
+ var viewId = 'SLIDER';
+ var viewVersion = '1.0.0';
+ var instanceName = 'SLIDER_1';
+ if (location.pathname != null) {
+ var splits = location.pathname.split('/');
+ if (splits != null && splits.length > 4) {
+ viewId = splits[2];
+ viewVersion = splits[3];
+ instanceName = splits[4];
+ }
+ }
+
application.reopen({
/**
* Test mode is automatically enabled if running on brunch server
@@ -40,13 +51,13 @@ App.initializer({
/**
* @type {string}
*/
- name: 'SLIDER',
+ name: viewId,
/**
* Slider version
* @type {string}
*/
- version: '1.0.0',
+ version: viewVersion,
/**
* Version of SLIDER_1 resource
@@ -57,7 +68,7 @@ App.initializer({
/**
* @type {string}
*/
- instance: 'SLIDER_1',
+ instance: instanceName,
/**
* API url for Slider
http://git-wip-us.apache.org/repos/asf/ambari/blob/11146fb6/contrib/views/slider/src/main/resources/view.xml
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/view.xml b/contrib/views/slider/src/main/resources/view.xml
index 57499ce..87dfbe7 100644
--- a/contrib/views/slider/src/main/resources/view.xml
+++ b/contrib/views/slider/src/main/resources/view.xml
@@ -18,9 +18,26 @@ limitations under the License. Kerberos, LDAP, Custom. Binary/Htt
<name>SLIDER</name>
<label>Slider Apps View</label>
<version>1.0.0</version>
- <instance>
- <name>SLIDER_1</name>
- </instance>
+ <parameter>
+ <name>hdfs.address</name>
+ <description>The URL to access HDFS service via its protocol. Typically this is the fs.defaultFS property in the core-site.xml configuration. For example: hdfs://hdfs.namenode.host:8020.</description>
+ <required>false</required>
+ </parameter>
+ <parameter>
+ <name>yarn.resourcemanager.address</name>
+ <description>The URL to the YARN ResourceManager, used to provide YARN Application data. For example: http://yarn.resourcemanager.host:8050</description>
+ <required>false</required>
+ </parameter>
+ <parameter>
+ <name>yarn.resourcemanager.scheduler.address</name>
+ <description>The URL to the YARN ResourceManager Scheduler, which schedules YARN Applications. For example: http://yarn.resourcemanager.host:8030</description>
+ <required>false</required>
+ </parameter>
+ <parameter>
+ <name>zookeeper.quorum</name>
+ <description>ZooKeeper quorum location. Typically this is a comma separated list of ZooKeeper hostnames and port numbers. The port number can be got from the clientPort property in the zookeeper-env configuration. For example: zookeeper.host1:2181,zookeeper.host2:2181.</description>
+ <required>false</required>
+ </parameter>
<resource>
<name>status</name>
<service-class>org.apache.ambari.view.slider.rest.ViewStatusResource</service-class>
[11/26] git commit: AMBARI-7249. Slider View: On Create app wizard's
'Allocate Resources' page inputs are updated,
and changes are removed (alexantonenko)
Posted by jo...@apache.org.
AMBARI-7249. Slider View: On Create app wizard's 'Allocate Resources' page inputs are updated, and changes are removed (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a3724c69
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a3724c69
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a3724c69
Branch: refs/heads/branch-alerts-dev
Commit: a3724c69ccf0533b20befeef330c389abb64dc3c
Parents: 3c9bb86
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed Sep 10 20:37:57 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Sep 10 21:06:27 2014 +0300
----------------------------------------------------------------------
.../ui/app/controllers/createAppWizard/step2_controller.js | 3 ++-
.../slider/src/main/resources/ui/app/models/slider_app_type.js | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a3724c69/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js
index c9e57ff..c1ff3fe 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js
@@ -72,6 +72,7 @@ App.CreateAppWizardStep2Controller = Ember.ArrayController.extend({
initializeNewApp: function () {
var newApp = this.get('appWizardController.newApp');
this.set('newApp', newApp);
+ this.loadTypeComponents();
},
/**
@@ -94,7 +95,7 @@ App.CreateAppWizardStep2Controller = Ember.ArrayController.extend({
});
this.set('content', content);
}
- }.observes('newApp.appType.components.length'),
+ },
/**
* Check if param is integer
http://git-wip-us.apache.org/repos/asf/ambari/blob/a3724c69/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js
index fd58384..d161037 100644
--- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js
+++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app_type.js
@@ -31,7 +31,7 @@ App.SliderAppType = DS.Model.extend({
/**
* @type {App.SliderAppTypeComponent[]}
*/
- components: DS.hasMany('sliderAppTypeComponent', {async:true}),
+ components: DS.hasMany('sliderAppTypeComponent'),
/**
* @type {string}
[05/26] git commit: AMBARI-7243. Admin View: no way to link to
instance if you create w/o a label via API. (akovalenko)
Posted by jo...@apache.org.
AMBARI-7243. Admin View: no way to link to instance if you create w/o a label via API. (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3f9d5a53
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3f9d5a53
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3f9d5a53
Branch: refs/heads/branch-alerts-dev
Commit: 3f9d5a53f31f2bab0907f0c88cf5fdb1b5e8d5d6
Parents: dcc00b6
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Wed Sep 10 19:02:57 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Wed Sep 10 19:03:16 2014 +0300
----------------------------------------------------------------------
.../main/resources/ui/admin-web/app/scripts/services/View.js | 6 +++---
.../ui/admin-web/app/views/ambariViews/listTable.html | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f9d5a53/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
index 0634a25..8f3b376 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
@@ -59,9 +59,9 @@ angular.module('ambariAdminConsole')
angular.forEach(item.versions, function(version) {
versions[version.ViewVersionInfo.version] = version.instances.length;
- angular.forEach(version.instances, function(isntance) {
- isntance.label = version.ViewVersionInfo.label;
- })
+ angular.forEach(version.instances, function(instance) {
+ instance.label = instance.ViewInstanceInfo.label || version.ViewVersionInfo.label || instance.ViewInstanceInfo.view_name;
+ });
self.instances = self.instances.concat(version.instances);
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f9d5a53/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
index 13c6118..e27c5e5 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
@@ -54,7 +54,7 @@
<tr ng-repeat="instance in view.instances">
<td class="col-sm-3"></td>
<td class="col-sm-3">
- <a href="#/views/{{view.view_name}}/versions/{{instance.ViewInstanceInfo.version}}/instances/{{instance.ViewInstanceInfo.instance_name}}/edit" class="instance-link">{{instance.ViewInstanceInfo.label}}</a>
+ <a href="#/views/{{view.view_name}}/versions/{{instance.ViewInstanceInfo.version}}/instances/{{instance.ViewInstanceInfo.instance_name}}/edit" class="instance-link">{{instance.label}}</a>
</td>
<td class="col-sm-1">{{instance.ViewInstanceInfo.version}}</td>
<td class="col-sm-5 " ><div class="description-column" tooltip="{{instance.ViewInstanceInfo.description}}">{{instance.ViewInstanceInfo.description || 'No description'}}</div>
[08/26] git commit: AMBARI-7247. Slider View: App configs look
inconsistent from Ambari's configs. (onechiporenko)
Posted by jo...@apache.org.
AMBARI-7247. Slider View: App configs look inconsistent from Ambari's configs. (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9588d2a9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9588d2a9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9588d2a9
Branch: refs/heads/branch-alerts-dev
Commit: 9588d2a9cd899193250cdc22c3cbd13dd1be969f
Parents: 015e6ab
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Wed Sep 10 19:48:17 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Wed Sep 10 19:48:17 2014 +0300
----------------------------------------------------------------------
.../main/resources/ui/app/mixins/with_panels.js | 50 +++++++++++++++++
.../main/resources/ui/app/models/slider_app.js | 24 ++-------
.../resources/ui/app/styles/application.less | 16 ++++++
.../ui/app/templates/slider_app/configs.hbs | 36 ++++++-------
.../ui/app/templates/slider_app/summary.hbs | 10 ++--
.../src/main/resources/ui/app/translations.js | 3 +-
.../ui/app/views/slider_app/configs_view.js | 57 ++++++++++++++++++++
7 files changed, 152 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9588d2a9/contrib/views/slider/src/main/resources/ui/app/mixins/with_panels.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/mixins/with_panels.js b/contrib/views/slider/src/main/resources/ui/app/mixins/with_panels.js
new file mode 100644
index 0000000..b1358be
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/mixins/with_panels.js
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Mixin for views that use Bootstrap.BsPanelComponent component
+ * Add caret for collapsed/expanded panels at the left of panel's title
+ * Usage:
+ * <code>
+ * App.SomeView = Em.View.extend(App.WithPanels, {
+ * didInsertElement: function() {
+ * this.addCarets();
+ * }
+ * });
+ * </code>
+ * @type {Em.Mixin}
+ */
+App.WithPanels = Ember.Mixin.create({
+
+ /**
+ * Add caret before panel's title and add handlers for expand/collapse events
+ * Set caret-down when panel is expanded
+ * Set caret-right when panel is collapsed
+ * @method addArrows
+ */
+ addCarets: function() {
+ var panel = $('.panel');
+ panel.find('.panel-heading').prepend('<span class="pull-left icon icon-caret-down"></span>');
+ panel.on('hidden.bs.collapse', function (e) {
+ $(e.delegateTarget).find('span.icon').addClass('icon-caret-right').removeClass('icon-caret-down');
+ }).on('shown.bs.collapse', function (e) {
+ $(e.delegateTarget).find('span.icon').addClass('icon-caret-down').removeClass('icon-caret-right');
+ });
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/9588d2a9/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
index 6d6bfcc..bf02f30 100644
--- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
+++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js
@@ -108,24 +108,6 @@ App.SliderApp = DS.Model.extend({
hiddenCategories: ['yarn-site', 'global'],
/**
- * Configs grouped to categories by site-objects
- * @type {Array}
- */
- configsByCategories: function () {
- var configs = this.get('configs'),
- hiddenCategories = this.get('hiddenCategories'),
- groupedConfigs = [];
- Ember.keys(configs).forEach(function (site) {
- groupedConfigs.push({
- name: site,
- configs: this.mapObject(configs[site]),
- isVisible: !hiddenCategories.contains(site)
- });
- }, this);
- return groupedConfigs;
- }.property('configs.@each'),
-
- /**
* Display metrics only for running apps
* @type {boolean}
*/
@@ -141,7 +123,11 @@ App.SliderApp = DS.Model.extend({
mapObject: function(o) {
if (Ember.typeOf(o) !== 'object') return [];
return Ember.keys(o).map(function(key) {
- return {key: key, value: o[key]};
+ return {
+ key: key,
+ value: o[key],
+ isMultiline: o[key].indexOf("\n") !== -1 || o[key].length > 100
+ };
});
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/9588d2a9/contrib/views/slider/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/application.less b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
index 11ec39b..f5024a1 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
@@ -609,6 +609,22 @@ a {
}
}
+
+.app_configs {
+ a.accordion-toggle {
+ display: block;
+ }
+ .row {
+ margin: 10px 0;
+ textarea {
+ height: 200px;
+ padding-left: 5px;
+ padding-right: 5px;
+ resize: none;
+ }
+ }
+}
+
.app-alerts {
overflow-y: auto;
ul {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9588d2a9/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/configs.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/configs.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/configs.hbs
index c3597d7..6eddc8d 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/configs.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/configs.hbs
@@ -16,27 +16,25 @@
* limitations under the License.
}}
-{{#if model.configsByCategories.length}}
- {{#each configCategory in configsByCategories}}
+<div class="app_configs">
+ {{#each configCategory in view.configsByCategories}}
{{#if configCategory.isVisible}}
{{#bs-panel heading=configCategory.name collapsible=true}}
- <table class="table table-striped table-bordered table-condensed">
- <thead>
- <tr>
- <th class="col-sm-4">{{t common.name}}</th>
- <th>{{t common.value}}</th>
- </tr>
- </thead>
- <tbody>
- {{#each configCategory.configs}}
- <tr>
- <td>{{key}}</td>
- <td>{{formatWordBreak value}}</td>
- </tr>
- {{/each}}
- </tbody>
- </table>
+ <div class="container-fluid">
+ {{#each configCategory.configs}}
+ <div class="row">
+ <div class="col-md-3">{{formatWordBreak key devider="."}}</div>
+ <div>
+ {{#if isMultiline}}
+ {{textarea disabled=true value=value classNames="col-md-6"}}
+ {{else}}
+ <input type="text" {{bind-attr value=value}} disabled="disabled" class="col-md-6" />
+ {{/if}}
+ </div>
+ </div>
+ {{/each}}
+ </div>
{{/bs-panel}}
{{/if}}
{{/each}}
-{{/if}}
\ No newline at end of file
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9588d2a9/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
index 0ba3998..cf86dc5 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
@@ -67,11 +67,11 @@
{{/bs-panel}}
<div class="panel panel-default panel-alerts">
<div class="panel-heading">
- Alerts
+ {{t common.alerts}}
<div class="btn-group pull-right panel-link">
{{!-- <a class="btn btn-default btn-sm" target="_blank" rel="tooltip"
{{translateAttr title="sliderApp.summary.go_to_nagios"}}
- {{bindAttr href="view.nagiosUrl"}}>
+ {{bind-attr href="view.nagiosUrl"}}>
<i class="icon-link"></i>
</a>--}}
</div>
@@ -83,7 +83,7 @@
<div class="container-fluid">
<div class="row">
<div class="col-md-1 status-icon">
- <i {{bindAttr class="iconClass :icon-large"}}></i>
+ <i {{bind-attr class="iconClass :icon-large"}}></i>
</div>
<div class="col-md-11">
<div class="row">
@@ -105,11 +105,11 @@
{{#if controller.model.showMetrics}}
<div class="panel panel-default">
<div class="panel-heading">
- Metrics
+ {{t common.metrics}}
<div class="btn-group pull-right panel-link">
<a class="btn btn-default btn-sm" target="_blank" rel="tooltip"
{{translateAttr title="sliderApp.summary.go_to_ganglia"}}
- {{bindAttr href="view.gangliaUrl"}}>
+ {{bind-attr href="view.gangliaUrl"}}>
<i class="icon-link"></i>
</a>
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/9588d2a9/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 e5e6a79..efa3979 100644
--- a/contrib/views/slider/src/main/resources/ui/app/translations.js
+++ b/contrib/views/slider/src/main/resources/ui/app/translations.js
@@ -46,7 +46,8 @@ Em.I18n.translations = {
'started': 'Started',
'finished': 'Finished',
'diagnostics': 'Diagnostics',
- 'description': 'Description'
+ 'description': 'Description',
+ 'alerts': 'Alerts'
},
'error.noHDFS': 'Slider applications view requires HDFS service.',
http://git-wip-us.apache.org/repos/asf/ambari/blob/9588d2a9/contrib/views/slider/src/main/resources/ui/app/views/slider_app/configs_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider_app/configs_view.js b/contrib/views/slider/src/main/resources/ui/app/views/slider_app/configs_view.js
new file mode 100644
index 0000000..5093fb9
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/views/slider_app/configs_view.js
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.SliderAppConfigsView = Ember.View.extend(App.WithPanels, {
+
+ /**
+ * List of configs group by categories
+ * @type {Object[]}
+ */
+ configsByCategories: Em.A([]),
+
+ /**
+ * Observer for model's configs
+ * Updates <code>configsByCategories</code>
+ * @method configsObserver
+ */
+ configsObserver: function() {
+ var model = this.get('controller.content'),
+ configs = model.get('.configs'),
+ configsByCategories = this.get('configsByCategories'),
+ hiddenCategories = model.get('hiddenCategories');
+ Em.keys(configs).forEach(function (site) {
+ if (configsByCategories.mapBy('name').contains(site)) {
+ var c = configsByCategories.findBy('name', site);
+ c.set('configs', model.mapObject(configs[site]));
+ c.set('isVisible', !hiddenCategories.contains(site));
+ }
+ else {
+ configsByCategories.pushObject(Em.Object.create({
+ name: site,
+ configs: model.mapObject(configs[site]),
+ isVisible: !hiddenCategories.contains(site)
+ }));
+ }
+ });
+ }.observes('controller.content.configs.@each'),
+
+ didInsertElement: function() {
+ this.addCarets();
+ }
+
+});
[14/26] git commit: AMBARI-7251.Configs: hover dialog needs a
delay(XIWANG)
Posted by jo...@apache.org.
AMBARI-7251.Configs: hover dialog needs a delay(XIWANG)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/24a486a5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/24a486a5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/24a486a5
Branch: refs/heads/branch-alerts-dev
Commit: 24a486a5340d58f7fe459d7bcd613a5f90b01894
Parents: 11146fb
Author: Xi Wang <xi...@apache.org>
Authored: Wed Sep 10 12:14:09 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Sep 10 13:44:19 2014 -0700
----------------------------------------------------------------------
ambari-web/app/styles/application.less | 9 +-
.../views/common/configs/config_history_flow.js | 5 +
ambari-web/vendor/scripts/jquery.hoverIntent.js | 115 +++++++++++++++++++
3 files changed, 123 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/24a486a5/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index eb33e6d..31ddc76 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -4964,7 +4964,7 @@ ul.inline li {
margin-top: -5px;
.version-slider {
width: 100%;
- height: 64px;
+ height: 58px;
margin: 5px 0;
.flow-element {
width: 18.5%;
@@ -4985,7 +4985,7 @@ ul.inline li {
font-size: 11px;
.top-label {
min-width: 20px;
- padding: 3px 2px;
+ padding: 0px 2px;
}
.author,
.content {
@@ -5011,7 +5011,7 @@ ul.inline li {
.version-box .version-popover {
display: none;
position: absolute;
- bottom: 58px;
+ bottom: 50px;
left: -45px;
z-index: 1000;
float: left;
@@ -5044,9 +5044,6 @@ ul.inline li {
}
}
.version-box:hover{
- .version-popover {
- display: block;
- }
.box {
background-color: #e6f1f6;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/24a486a5/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index d7d8d3f..1fe7d23 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -142,6 +142,11 @@ App.ConfigHistoryFlowView = Em.View.extend({
},
didInsertElement: function () {
+ $('.version-box').hoverIntent(function() {
+ $(this).find('.version-popover').delay(800).fadeIn(400);
+ }, function() {
+ $(this).find('.version-popover').hide();
+ });
App.tooltip(this.$('[data-toggle=tooltip]'),{
placement: 'bottom'
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/24a486a5/ambari-web/vendor/scripts/jquery.hoverIntent.js
----------------------------------------------------------------------
diff --git a/ambari-web/vendor/scripts/jquery.hoverIntent.js b/ambari-web/vendor/scripts/jquery.hoverIntent.js
new file mode 100644
index 0000000..ae2544c
--- /dev/null
+++ b/ambari-web/vendor/scripts/jquery.hoverIntent.js
@@ -0,0 +1,115 @@
+/*!
+ * hoverIntent v1.8.0 // 2014.06.29 // jQuery v1.9.1+
+ * http://cherne.net/brian/resources/jquery.hoverIntent.html
+ *
+ * You may use hoverIntent under the terms of the MIT license. Basically that
+ * means you are free to use hoverIntent as long as this header is left intact.
+ * Copyright 2007, 2014 Brian Cherne
+ */
+
+/* hoverIntent is similar to jQuery's built-in "hover" method except that
+ * instead of firing the handlerIn function immediately, hoverIntent checks
+ * to see if the user's mouse has slowed down (beneath the sensitivity
+ * threshold) before firing the event. The handlerOut function is only
+ * called after a matching handlerIn.
+ *
+ * // basic usage ... just like .hover()
+ * .hoverIntent( handlerIn, handlerOut )
+ * .hoverIntent( handlerInOut )
+ *
+ * // basic usage ... with event delegation!
+ * .hoverIntent( handlerIn, handlerOut, selector )
+ * .hoverIntent( handlerInOut, selector )
+ *
+ * // using a basic configuration object
+ * .hoverIntent( config )
+ *
+ * @param handlerIn function OR configuration object
+ * @param handlerOut function OR selector for delegation OR undefined
+ * @param selector selector OR undefined
+ * @author Brian Cherne <brian(at)cherne(dot)net>
+ */
+(function($) {
+ $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
+
+ // default configuration values
+ var cfg = {
+ interval: 100,
+ sensitivity: 6,
+ timeout: 0
+ };
+
+ if ( typeof handlerIn === "object" ) {
+ cfg = $.extend(cfg, handlerIn );
+ } else if ($.isFunction(handlerOut)) {
+ cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
+ } else {
+ cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
+ }
+
+ // instantiate variables
+ // cX, cY = current X and Y position of mouse, updated by mousemove event
+ // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
+ var cX, cY, pX, pY;
+
+ // A private function for getting mouse position
+ var track = function(ev) {
+ cX = ev.pageX;
+ cY = ev.pageY;
+ };
+
+ // A private function for comparing current and previous mouse position
+ var compare = function(ev,ob) {
+ ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
+ // compare mouse positions to see if they've crossed the threshold
+ if ( Math.sqrt( (pX-cX)*(pX-cX) + (pY-cY)*(pY-cY) ) < cfg.sensitivity ) {
+ $(ob).off("mousemove.hoverIntent",track);
+ // set hoverIntent state to true (so mouseOut can be called)
+ ob.hoverIntent_s = true;
+ return cfg.over.apply(ob,[ev]);
+ } else {
+ // set previous coordinates for next time
+ pX = cX; pY = cY;
+ // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
+ ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
+ }
+ };
+
+ // A private function for delaying the mouseOut function
+ var delay = function(ev,ob) {
+ ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
+ ob.hoverIntent_s = false;
+ return cfg.out.apply(ob,[ev]);
+ };
+
+ // A private function for handling mouse 'hovering'
+ var handleHover = function(e) {
+ // copy objects to be passed into t (required for event object to be passed in IE)
+ var ev = $.extend({},e);
+ var ob = this;
+
+ // cancel hoverIntent timer if it exists
+ if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
+
+ // if e.type === "mouseenter"
+ if (e.type === "mouseenter") {
+ // set "previous" X and Y position based on initial entry point
+ pX = ev.pageX; pY = ev.pageY;
+ // update "current" X and Y position based on mousemove
+ $(ob).on("mousemove.hoverIntent",track);
+ // start polling interval (self-calling timeout) to compare mouse coordinates over time
+ if (!ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
+
+ // else e.type == "mouseleave"
+ } else {
+ // unbind expensive mousemove event
+ $(ob).off("mousemove.hoverIntent",track);
+ // if hoverIntent state is true, then call the mouseOut function after the specified delay
+ if (ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
+ }
+ };
+
+ // listen for mouseenter and mouseleave
+ return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
+ };
+})(jQuery);
[07/26] git commit: AMBARI-7244. Could not start Oozie after upgrade
from 1.5.1 due to oozie_pid_dir not found (aonishuk)
Posted by jo...@apache.org.
AMBARI-7244. Could not start Oozie after upgrade from 1.5.1 due to oozie_pid_dir not found (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/015e6abf
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/015e6abf
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/015e6abf
Branch: refs/heads/branch-alerts-dev
Commit: 015e6abfd19a9b2759e63df29d99c2f06c387479
Parents: adb87a4
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 10 19:28:12 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 10 19:28:12 2014 +0300
----------------------------------------------------------------------
.../java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java | 2 +-
.../org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/015e6abf/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
index c018f6c..62b4e35 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
@@ -289,7 +289,7 @@ public class UpgradeCatalog161 extends AbstractUpgradeCatalog {
protected void addMissingConfigs() throws AmbariException {
updateConfigurationProperties("hbase-site", Collections.singletonMap("hbase.regionserver.info.port", "60030"), false, false);
updateConfigurationProperties("hbase-site", Collections.singletonMap("hbase.master.info.port", "60010"), false, false);
- updateConfigurationProperties("global", Collections.singletonMap("oozie_admin_port", "11001"), false, false);
+ updateConfigurationProperties("oozie-env", Collections.singletonMap("oozie_admin_port", "11001"), false, false);
updateConfigurationProperties("hive-site", Collections.singletonMap("hive.heapsize", "1024"), false, false);
updateConfigurationProperties("pig-properties", Collections.singletonMap("pig-content", "\n# Licensed to the Apache " +
"Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# " +
http://git-wip-us.apache.org/repos/asf/ambari/blob/015e6abf/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
index c5a02cb..1d12ea0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
@@ -147,7 +147,7 @@ public class UpgradeCatalog161Test {
Collections.singletonMap("hbase.master.info.port", "60010"), false, false);
expectLastCall();
- upgradeCatalog.updateConfigurationProperties("global",
+ upgradeCatalog.updateConfigurationProperties("oozie-env",
Collections.singletonMap("oozie_admin_port", "11001"), false, false);
expectLastCall();
[17/26] git commit: AMBARI-7248. No deprecation warning after
creating blueprint with global configs (aonishuk)
Posted by jo...@apache.org.
AMBARI-7248. No deprecation warning after creating blueprint with global configs (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/da78f178
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/da78f178
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/da78f178
Branch: refs/heads/branch-alerts-dev
Commit: da78f17816e9fa30d8d7dc9decea642ebfe5e37a
Parents: 71c9845
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Sep 11 14:28:44 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Sep 11 14:28:44 2014 +0300
----------------------------------------------------------------------
.../server/controller/RequestStatusResponse.java | 12 ++++++++++++
.../internal/AbstractResourceProvider.java | 3 +++
.../internal/ClusterResourceProvider.java | 17 ++++++++++++++++-
.../internal/ClusterResourceProviderTest.java | 13 +++++++------
.../internal/RequestResourceProviderTest.java | 16 +++++++++++-----
5 files changed, 49 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/da78f178/ambari-server/src/main/java/org/apache/ambari/server/controller/RequestStatusResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/RequestStatusResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/RequestStatusResponse.java
index d6eabf4..26d866d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/RequestStatusResponse.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/RequestStatusResponse.java
@@ -31,6 +31,11 @@ public class RequestStatusResponse {
private String logs;
/**
+ * Request message
+ */
+ private String message;
+
+ /**
* Request context
*/
private String requestContext;
@@ -78,4 +83,11 @@ public class RequestStatusResponse {
this.requestContext = requestContext;
}
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/da78f178/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
index d14cdf3..2c25623 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractResourceProvider.java
@@ -206,6 +206,9 @@ public abstract class AbstractResourceProvider extends BaseProvider implements R
protected RequestStatus getRequestStatus(RequestStatusResponse response, Set<Resource> associatedResources) {
if (response != null){
Resource requestResource = new ResourceImpl(Resource.Type.Request);
+ if (response.getMessage() != null){
+ requestResource.setProperty(PropertyHelper.getPropertyId("Requests", "message"), response.getMessage());
+ }
requestResource.setProperty(PropertyHelper.getPropertyId("Requests", "id"), response.getRequestId());
requestResource.setProperty(PropertyHelper.getPropertyId("Requests", "status"), "InProgress");
return new RequestStatusImpl(requestResource, associatedResources);
http://git-wip-us.apache.org/repos/asf/ambari/blob/da78f178/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
index 3307b59..f40979c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterResourceProvider.java
@@ -43,6 +43,7 @@ import org.apache.ambari.server.controller.spi.SystemException;
import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
import org.apache.ambari.server.controller.utilities.PropertyHelper;
import org.apache.ambari.server.orm.dao.BlueprintDAO;
+import org.apache.ambari.server.orm.entities.BlueprintConfigEntity;
import org.apache.ambari.server.orm.entities.BlueprintEntity;
import org.apache.ambari.server.orm.entities.HostGroupEntity;
import org.apache.ambari.server.state.Config;
@@ -420,6 +421,15 @@ public class ClusterResourceProvider extends BaseBlueprintProcessor {
Map<String, HostGroupImpl> blueprintHostGroups = parseBlueprintHostGroups(blueprint, stack);
applyRequestInfoToHostGroups(properties, blueprintHostGroups);
Collection<Map<String, String>> configOverrides = (Collection<Map<String, String>>)properties.get("configurations");
+
+ String message = null;
+ for (BlueprintConfigEntity blueprintConfig: blueprint.getConfigurations()){
+ if(blueprintConfig.getType().equals("global")){
+ message = "WARNING: Global configurations are deprecated, please use *-env";
+ break;
+ }
+ }
+
processConfigurations(processBlueprintConfigurations(blueprint, configOverrides),
processBlueprintAttributes(blueprint), stack, blueprintHostGroups);
validatePasswordProperties(blueprint, blueprintHostGroups, (String) properties.get("default_password"));
@@ -436,8 +446,13 @@ public class ClusterResourceProvider extends BaseBlueprintProcessor {
registerConfigGroups(clusterName, blueprintHostGroups, stack);
persistInstallStateForUI();
- return ((ServiceResourceProvider) getResourceProvider(Resource.Type.Service)).
+
+ RequestStatusResponse request = ((ServiceResourceProvider) getResourceProvider(Resource.Type.Service)).
installAndStart(clusterName);
+
+ request.setMessage(message);
+
+ return request;
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/da78f178/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
index b7430c8..3adebf0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
@@ -34,6 +34,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -327,7 +328,7 @@ public class ClusterResourceProviderTest {
expect(blueprintDAO.findByName(blueprintName)).andReturn(blueprint);
expect(blueprint.getStackName()).andReturn(stackName);
expect(blueprint.getStackVersion()).andReturn(stackVersion);
- expect(blueprint.getConfigurations()).andReturn(configurations);
+ expect(blueprint.getConfigurations()).andReturn(configurations).anyTimes();
expect(blueprint.validateConfigurations(metaInfo, true)).andReturn(
Collections.<String, Map<String, Collection<String>>>emptyMap());
@@ -393,10 +394,10 @@ public class ClusterResourceProviderTest {
expect(blueprintConfig4.getType()).andReturn("falcon-env").anyTimes();
expect(blueprintConfig4.getConfigData()).andReturn(new Gson().toJson(falconEnvConfigProperties)).anyTimes();
expect(blueprintConfig5.getBlueprintName()).andReturn("test-blueprint").anyTimes();
- expect(blueprintConfig5.getType()).andReturn("hbase-env").anyTimes();
+ expect(blueprintConfig5.getType()).andReturn("global").anyTimes();
expect(blueprintConfig5.getConfigData()).andReturn(new Gson().toJson(hbaseEnvConfigProperties)).anyTimes();
-
+
expect(blueprint.getHostGroups()).andReturn(Collections.singleton(hostGroup)).anyTimes();
expect(hostGroup.getName()).andReturn("group1").anyTimes();
expect(hostGroup.getComponents()).andReturn(hostGroupComponents).anyTimes();
@@ -764,7 +765,7 @@ public class ClusterResourceProviderTest {
expect(blueprintDAO.findByName(blueprintName)).andReturn(blueprint);
expect(blueprint.getStackName()).andReturn(stackName);
expect(blueprint.getStackVersion()).andReturn(stackVersion);
- expect(blueprint.getConfigurations()).andReturn(Collections.<BlueprintConfigEntity>singletonList(blueprintConfig));
+ expect(blueprint.getConfigurations()).andReturn(Collections.<BlueprintConfigEntity>singletonList(blueprintConfig)).anyTimes();
expect(blueprint.validateConfigurations(metaInfo, true)).andReturn(allMissingPasswords);
expect(metaInfo.getComponentDependencies("test", "1.23", "service1", "component1")).
@@ -1549,7 +1550,7 @@ public class ClusterResourceProviderTest {
expect(blueprintDAO.findByName(blueprintName)).andReturn(blueprint);
expect(blueprint.getStackName()).andReturn(stackName);
expect(blueprint.getStackVersion()).andReturn(stackVersion);
- expect(blueprint.getConfigurations()).andReturn(Collections.<BlueprintConfigEntity>singletonList(blueprintConfig));
+ expect(blueprint.getConfigurations()).andReturn(Collections.<BlueprintConfigEntity>singletonList(blueprintConfig)).anyTimes();
expect(blueprint.validateConfigurations(metaInfo, true)).andReturn(allMissingPasswords);
expect(metaInfo.getComponentDependencies("test", "1.23", "service1", "component1")).
@@ -2226,7 +2227,7 @@ public class ClusterResourceProviderTest {
expect(blueprintDAO.findByName(blueprintName)).andReturn(blueprint);
expect(blueprint.getStackName()).andReturn(stackName);
expect(blueprint.getStackVersion()).andReturn(stackVersion);
- expect(blueprint.getConfigurations()).andReturn(configurations).times(2);
+ expect(blueprint.getConfigurations()).andReturn(configurations).times(3);
expect(blueprint.validateConfigurations(metaInfo, true)).andReturn(
Collections.<String, Map<String, Collection<String>>>emptyMap());
http://git-wip-us.apache.org/repos/asf/ambari/blob/da78f178/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
index f5d8227..66a04b9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
@@ -897,9 +897,10 @@ public class RequestResourceProviderTest {
expect(managementController.createAction(capture(actionRequest), capture(propertyMap)))
.andReturn(response).anyTimes();
+ expect(response.getMessage()).andReturn("Message").anyTimes();
// replay
- replay(managementController);
+ replay(managementController, response);
// add the property map to a set for the request. add more maps for multiple creates
Set<Map<String, Object>> propertySet = new LinkedHashSet<Map<String, Object>>();
@@ -920,6 +921,8 @@ public class RequestResourceProviderTest {
Map<String, String> requestInfoProperties = new HashMap<String, String>();
requestInfoProperties.put(RequestResourceProvider.COMMAND_ID, "HDFS_SERVICE_CHECK");
+
+
// create the request
Request request = PropertyHelper.getCreateRequest(propertySet, requestInfoProperties);
ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider(
@@ -927,6 +930,7 @@ public class RequestResourceProviderTest {
PropertyHelper.getPropertyIds(type),
PropertyHelper.getKeyPropertyIds(type),
managementController);
+
provider.createResources(request);
ExecuteActionRequest capturedRequest = actionRequest.getValue();
@@ -956,9 +960,9 @@ public class RequestResourceProviderTest {
expect(managementController.createAction(capture(actionRequest), capture(propertyMap)))
.andReturn(response).anyTimes();
-
+ expect(response.getMessage()).andReturn("Message").anyTimes();
// replay
- replay(managementController);
+ replay(managementController, response);
// add the property map to a set for the request. add more maps for multiple creates
Set<Map<String, Object>> propertySet = new LinkedHashSet<Map<String, Object>>();
@@ -1043,9 +1047,10 @@ public class RequestResourceProviderTest {
expect(managementController.createAction(capture(actionRequest), capture(propertyMap)))
.andReturn(response).anyTimes();
+ expect(response.getMessage()).andReturn("Message").anyTimes();
// replay
- replay(managementController);
+ replay(managementController, response);
// add the property map to a set for the request. add more maps for multiple creates
Set<Map<String, Object>> propertySet = new LinkedHashSet<Map<String, Object>>();
@@ -1116,9 +1121,10 @@ public class RequestResourceProviderTest {
expect(managementController.createAction(capture(actionRequest), capture(propertyMap)))
.andReturn(response).anyTimes();
+ expect(response.getMessage()).andReturn("Message").anyTimes();
// replay
- replay(managementController);
+ replay(managementController, response);
// add the property map to a set for the request. add more maps for multiple creates
Set<Map<String, Object>> propertySet = new LinkedHashSet<Map<String, Object>>();
[19/26] git commit: AMBARI-7258 Slider View: FE - Make ganglia
monitoring optional when creating app. (atkach)
Posted by jo...@apache.org.
AMBARI-7258 Slider View: FE - Make ganglia monitoring optional when creating app. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/43a4283b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/43a4283b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/43a4283b
Branch: refs/heads/branch-alerts-dev
Commit: 43a4283bbd1c4cec6ae26b104ab99be43d93a1ff
Parents: daefe5d
Author: atkach <at...@hortonworks.com>
Authored: Thu Sep 11 17:34:18 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Thu Sep 11 17:34:18 2014 +0300
----------------------------------------------------------------------
.../assets/data/resource/service_configs.json | 38 ++++++
.../ui/app/components/configSection.js | 4 +
.../createAppWizard/step1_controller.js | 41 ++++++-
.../createAppWizard/step3_controller.js | 123 +++++++++++++++++--
.../src/main/resources/ui/app/helpers/ajax.js | 9 ++
.../resources/ui/app/models/config_property.js | 44 +++++++
.../ui/app/templates/common/config.hbs | 37 ++++++
.../app/templates/components/configSection.hbs | 29 +++--
.../src/main/resources/ui/app/translations.js | 1 +
.../ui/app/views/common/config_set_view.js | 56 +++++++++
10 files changed, 358 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json b/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json
new file mode 100644
index 0000000..f255bec
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json
@@ -0,0 +1,38 @@
+{
+ "items" : [
+ {
+ "cluster_name" : "cl",
+ "configurations" : [
+ {
+ "Config" : {
+ "cluster_name" : "cl"
+ },
+ "type" : "ganglia-env",
+ "tag" : "version1410432304443",
+ "version" : 1,
+ "properties" : {
+ "rrdcached_timeout" : "3600",
+ "gmetad_user" : "nobody",
+ "rrdcached_base_dir" : "/var/lib/ganglia/rrds",
+ "rrdcached_write_threads" : "4",
+ "rrdcached_delay" : "1800",
+ "rrdcached_flush_timeout" : "7200",
+ "gmond_user" : "nobody",
+ "ganglia_runtime_dir" : "/var/run/ganglia/hdp",
+ "ganglia_custom_clusters": "'HBaseCluster1','7000','AccumuloCluster1','7001','HBaseCluster2','7002'"
+ },
+ "properties_attributes" : { }
+ }
+ ],
+ "createtime" : 1410432307174,
+ "group_id" : -1,
+ "group_name" : "default",
+ "hosts" : [ ],
+ "is_current" : true,
+ "service_config_version" : 1,
+ "service_config_version_note" : "Initial configurations for Ganglia",
+ "service_name" : "GANGLIA",
+ "user" : "admin"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
index 43a2427..bcdff12 100644
--- a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
+++ b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
@@ -46,8 +46,12 @@ App.ConfigSectionComponent = Em.Component.extend({
/**
* Filtered configs for current section
+ * @type {Array}
*/
sectionConfigs: Ember.computed.filter('config', function (item) {
+ if (item.isSet) {
+ return item.section === this.get('section');
+ }
if (this.get('isGeneral')) {
return !item.name.match('^site.') && this.get('predefinedConfigNames').contains(item.name);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
index b267170..9faaa32 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
@@ -82,6 +82,7 @@ App.CreateAppWizardStep1Controller = Ember.Controller.extend({
*/
loadStep: function () {
this.loadGangliaHost();
+ this.loadGangliaClusters();
this.initializeNewApp();
this.loadAvailableTypes();
},
@@ -100,7 +101,6 @@ App.CreateAppWizardStep1Controller = Ember.Controller.extend({
},
success: 'loadGangliaHostSuccessCallback'
});
-
},
/**
@@ -116,6 +116,45 @@ App.CreateAppWizardStep1Controller = Ember.Controller.extend({
},
/**
+ * Load ganglia clusters
+ * @method loadGangliaClusters
+ */
+ loadGangliaClusters: function () {
+ return App.ajax.send({
+ name: 'service_current_configs',
+ sender: this,
+ data: {
+ serviceName: "GANGLIA",
+ urlPrefix: '/api/v1/'
+ },
+ success: 'loadGangliaClustersSuccessCallback'
+ });
+ },
+
+ /**
+ * Success callback for config property
+ * Save cluster to gangliaClusters
+ * @param {Object} data
+ * @method loadGangliaClustersSuccessCallback
+ */
+ loadGangliaClustersSuccessCallback: function (data) {
+ var gangliaCustomClusters = [];
+ if (data.items[0]) {
+ //parse CSV string with cluster names and ports
+ Em.get(data.items[0].configurations[0].properties, 'ganglia_custom_clusters').replace(/\'/g, "").split(',').forEach(function(item, index){
+ if (index % 2 === 0) {
+ gangliaCustomClusters.push({
+ name: item
+ })
+ } else {
+ gangliaCustomClusters[gangliaCustomClusters.length - 1].port = parseInt(item);
+ }
+ });
+ App.set('gangliaClusters', gangliaCustomClusters);
+ }
+ },
+
+ /**
* Initialize new App and set it to <code>newApp</code>
* @method initializeNewApp
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
index 1018314..0377388 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
@@ -31,6 +31,18 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
configs: Em.A(),
/**
+ * predefined settings of configuration properties
+ */
+ configSettings: {
+ 'site.global.ganglia_server_id': {
+ viewType: 'select'
+ },
+ 'site.global.ganglia_server_port': {
+ readOnly: true
+ }
+ },
+
+ /**
* Convert configs to array of unique section names
* @type {Array}
*/
@@ -60,6 +72,31 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
configsObject: {},
/**
+ * config that describe configurations set
+ */
+ configsSet: [
+ {
+ trigger: {value: false, label: Em.I18n.t('configs.enable.metrics'), viewType: 'checkbox'},
+ isSet: true,
+ section: 'global',
+ configNames: ["site.global.ganglia_server_host", "site.global.ganglia_server_id", "site.global.ganglia_server_port"],
+ configs: [],
+ dependencies: [
+ {
+ name: 'App.gangliaClusters',
+ map: [],
+ mapFunction: function (origin, dependent) {
+ if (!origin || !dependent) return false;
+ dependent.set('value', this.map.findBy('name', origin.get('value')).port);
+ },
+ origin: "site.global.ganglia_server_id",
+ dependent: "site.global.ganglia_server_port"
+ }
+ ]
+ }
+ ],
+
+ /**
* Load all data required for step
* @method loadStep
*/
@@ -73,23 +110,71 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
* @param {bool} setDefaults
* @method initConfigs
*/
- initConfigs: function(setDefaults) {
- setDefaults = setDefaults === true ? setDefaults : false;
- var configs = this.get('newAppConfigs') || {},
- c = Em.A();
+ initConfigs: function (setDefaults) {
+ var newAppConfigs = this.get('newAppConfigs') || {},
+ configs = Em.A(),
+ configsSet = $.extend(true, [], this.get('configsSet')),
+ allSetConfigs = {},
+ configSettings = this.get('configSettings'),
+ gangliaClusters = App.get('gangliaClusters');
+
+ configsSet.forEach(function (item) {
+ item.configNames.forEach(function (configName) {
+ allSetConfigs[configName] = item;
+ });
+ });
- Object.keys(configs).forEach(function (key) {
- var label = (!!key.match('^site.'))?key.substr(5):key;
- if(key === "site.global.ganglia_server_host" && setDefaults) {
- configs[key] = App.get('gangliaHost') ? App.get('gangliaHost') : configs[key];
+ Object.keys(newAppConfigs).forEach(function (key) {
+ var label = (!!key.match('^site.')) ? key.substr(5) : key;
+ var configSetting = (configSettings[key]) ?
+ $.extend({name: key, value: configs[key], label: label}, configSettings[key]) :
+ {name: key, value: configs[key], label: label};
+
+ if (key === "site.global.ganglia_server_host" && !!setDefaults && App.get('gangliaHost')) {
+ configSetting.value = App.get('gangliaHost');
+ }
+
+ if (key === "site.global.ganglia_server_id" && gangliaClusters) {
+ configSetting.options = gangliaClusters.mapProperty('name');
+ configSetting.value = gangliaClusters.mapProperty('name')[0];
+ }
+ if (key === "site.global.ganglia_server_port" && gangliaClusters) {
+ configSetting.value = gangliaClusters.mapProperty('port')[0];
+ }
+
+ if (allSetConfigs[key]) {
+ allSetConfigs[key].configs.push(App.ConfigProperty.create(configSetting));
+ } else {
+ configs.push(App.ConfigProperty.create(configSetting));
}
- c.push({name:key,value:configs[key],label:label})
});
- this.set('configs', c);
+ configsSet.forEach(function (configSet) {
+ if (configSet.configs.length === configSet.configNames.length) {
+ delete configSet.configNames;
+ configSet.trigger = App.ConfigProperty.create(configSet.trigger);
+ this.initConfigSetDependecies(configSet);
+ configs.unshift(configSet);
+ }
+ }, this);
+
+ this.set('configs', configs);
}.observes('newAppConfigs'),
/**
+ * initialize dependecies map for config set by name
+ * configSet map changed by reference
+ *
+ * @param {object} configSet
+ * @method initConfigSetDependecies
+ */
+ initConfigSetDependecies: function (configSet) {
+ configSet.dependencies.forEach(function (item) {
+ item.map = Em.get(item.name);
+ })
+ },
+
+ /**
* Clear all initial data
* @method clearStep
*/
@@ -105,7 +190,7 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
validateConfigs: function () {
var self = this;
var result = true;
- var configs = this.get('configs');
+ var configs = this.addConfigSetProperties(this.get('configs'));
var configsObject = {};
try {
@@ -121,6 +206,22 @@ App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
},
/**
+ * add config properties from config sets to general configs array
+ * @param configs
+ * @return {Array}
+ */
+ addConfigSetProperties: function (configs) {
+ var configSets = configs.filterBy('isSet');
+ var newConfigs = [];
+ configs.filterBy('isSet').forEach(function (item) {
+ if (item.trigger.value) {
+ newConfigs.pushObjects(item.configs);
+ }
+ });
+ return configs.filterBy('isSet', false).concat(newConfigs);
+ },
+
+ /**
* Save converted configs to new App configs
* @method saveConfigs
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
index f19f4eb..6d7e4a1 100644
--- a/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
+++ b/contrib/views/slider/src/main/resources/ui/app/helpers/ajax.js
@@ -135,6 +135,15 @@ var urls = {
}
},
+ 'service_current_configs': {
+ real: 'clusters/{clusterName}/configurations/service_config_versions?service_name={serviceName}&is_current=true',
+ mock: '/data/resource/service_configs.json',
+ headers: {
+ Accept : "text/plain; charset=utf-8",
+ "Content-Type": "text/plain; charset=utf-8"
+ }
+ },
+
'config.tags': {
'real': 'clusters/{clusterName}?fields=Clusters/desired_configs',
headers: {
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/models/config_property.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/models/config_property.js b/contrib/views/slider/src/main/resources/ui/app/models/config_property.js
new file mode 100644
index 0000000..aa7bbc8
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/models/config_property.js
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * Config property
+ * @type {object}
+ */
+App.ConfigProperty = Em.Object.extend({
+ name: null,
+ value: null,
+ label: "",
+ viewType: null,
+ view: function () {
+ switch (this.get('viewType')) {
+ case 'checkbox':
+ return Em.Checkbox;
+ case 'select':
+ return Em.Select;
+ default:
+ return Em.TextField;
+ }
+ }.property('viewType'),
+ readOnly: false,
+ //used for config with "select" view
+ options: [],
+ //indicate whether it single config or set of configs
+ isSet: false
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/templates/common/config.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/common/config.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/common/config.hbs
new file mode 100644
index 0000000..348cae0
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/common/config.hbs
@@ -0,0 +1,37 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div class="form-group">
+
+ <label class="col-sm-4 control-label">{{formatWordBreak config.label devider='.'}}</label>
+
+ <div class="col-sm-6">
+ {{view config.view
+ value=config.value
+ content=config.options
+ class="form-control"
+ disabled=config.readOnly
+ }}
+ </div>
+
+ {{#if isCustom}}
+ <div class="col-sm-2">
+ {{#bs-button clicked="deleteConfig" clickedParamBinding="config" type="danger"}}{{t common.delete}}{{/bs-button}}
+ </div>
+ {{/if}}
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
index b0d1db7..dca8f9d 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
@@ -19,19 +19,24 @@
{{#bs-panel heading=sectionLabel collapsible=true dismiss=false open=isGeneral }}
<form class="form-horizontal" role="form">
{{#each config in sectionConfigs}}
- <div class="form-group">
- <label class="col-sm-4 control-label">{{formatWordBreak config.label devider='.'}}</label>
- <div class="col-sm-6">
- {{input value=config.value class="form-control"}}
- </div>
- {{#if isCustom}}
- <div class="col-sm-2">
- {{#bs-button clicked="deleteConfig" clickedParamBinding="config"}}
- <i {{bs-bind-tooltip content=tooltipRemove}} class="icon-minus-sign"></i>{{/bs-button}}
- </div>
- {{/if}}
+ {{#if config.isSet}}
+ {{#view "configSet" configSet=config}}
+ <div class="form-group">
+ <label class="col-sm-4 control-label">{{formatWordBreak view.configSet.trigger.label devider='.'}}</label>
- </div>
+ <div class="col-sm-6">
+ {{view view.configSet.trigger.view
+ checked=view.configSet.trigger.value
+ }}
+ </div>
+ </div>
+ {{#each config in view.configs}}
+ {{partial "common/config"}}
+ {{/each}}
+ {{/view}}
+ {{else}}
+ {{partial "common/config"}}
+ {{/if}}
{{/each}}
</form>
{{#if isCustom}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/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 8957c29..056b21f 100644
--- a/contrib/views/slider/src/main/resources/ui/app/translations.js
+++ b/contrib/views/slider/src/main/resources/ui/app/translations.js
@@ -74,6 +74,7 @@ Em.I18n.translations = {
'configs.add_property': 'Add Property',
'configs.add_property.invalid_name': 'Config name should consists only of letters, numbers, \'-\', \'_\', \'.\' and first character should be a letter.',
'configs.add_property.name_exists': 'Config name already exists',
+ 'configs.enable.metrics': 'Enable Metrics',
'slider.apps.title': 'Slider Apps',
'slider.apps.create': 'Create App',
http://git-wip-us.apache.org/repos/asf/ambari/blob/43a4283b/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js b/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js
new file mode 100644
index 0000000..b421129
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/views/common/config_set_view.js
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+/**
+ * view that display set of configs united into group
+ * which can be excluded from/included into general config array via trigger(special config property)
+ * @type {Em.View}
+ */
+App.ConfigSetView = Ember.View.extend({
+
+ /**
+ * config set data
+ */
+ configSet: null,
+
+ /**
+ * configs which can be included/excluded
+ * @type {Array}
+ */
+ configs: function () {
+ if (this.get('configSet.trigger.value')) {
+ return this.get('configSet.configs');
+ }
+ return [];
+ }.property('configSet.trigger.value'),
+
+ /**
+ * observe change of config values to resolve their dependecies
+ */
+ changeConfigValues: function () {
+ var configs = this.get('configs');
+ var dependecies = this.get('configSet.dependencies');
+
+ if (configs.length > 0) {
+ dependecies.forEach(function (item) {
+ var origin = configs.findBy('name', item.origin);
+ var dependent = configs.findBy('name', item.dependent);
+ item.mapFunction(origin, dependent);
+ })
+ }
+ }.observes('configs.@each.value')
+});
[18/26] git commit: AMBARI-7256. Slider View: Create app wizard's
'Allocate Resources' page should have smaller text boxes (alexantonenko)
Posted by jo...@apache.org.
AMBARI-7256. Slider View: Create app wizard's 'Allocate Resources' page should have smaller text boxes (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/daefe5da
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/daefe5da
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/daefe5da
Branch: refs/heads/branch-alerts-dev
Commit: daefe5daaa5c3c3e6b4586db2a7e2ed55c9e61a1
Parents: da78f17
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Sep 11 16:04:34 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Sep 11 16:04:34 2014 +0300
----------------------------------------------------------------------
.../slider/src/main/resources/ui/app/styles/application.less | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/daefe5da/contrib/views/slider/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/application.less b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
index eb71c9a..b7f385a 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
@@ -359,16 +359,18 @@ a {
}
#step2 {
.table-container {
- max-height: 225px;
+ max-height: 248px;
border: 1px solid #e3e3e3;
padding: 5px;
- margin-bottom: 20px;
- overflow-y: auto;
border-radius: 4px;
+ overflow: hidden;
.components-table {
width: 100%;
border-spacing: 10px;
border-collapse: separate;
+ input{
+ width: 124px;
+ }
}
margin-bottom: 30px;
}
[12/26] git commit: AMBARI-7250 Hive and ATS properties are not
available on backend but available on UI(upgrade stack 2.0 -> 2.1). (Buzhor
Denys via atkach)
Posted by jo...@apache.org.
AMBARI-7250 Hive and ATS properties are not available on backend but available on UI(upgrade stack 2.0 -> 2.1). (Buzhor Denys via atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/475d4589
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/475d4589
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/475d4589
Branch: refs/heads/branch-alerts-dev
Commit: 475d458973bf52870d6d13aa5ee5566e05c6f66c
Parents: a3724c6
Author: atkach <at...@hortonworks.com>
Authored: Wed Sep 10 21:18:44 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Wed Sep 10 21:18:44 2014 +0300
----------------------------------------------------------------------
ambari-web/app/data/site_properties.js | 2 +-
ambari-web/app/utils/config.js | 19 +++++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/475d4589/ambari-web/app/data/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/site_properties.js b/ambari-web/app/data/site_properties.js
index cf837f0..02fa670 100644
--- a/ambari-web/app/data/site_properties.js
+++ b/ambari-web/app/data/site_properties.js
@@ -2528,7 +2528,7 @@ module.exports =
"isVisible": true,
"serviceName": "MISC",
"filename": "cluster-env.xml",
- "category": "Users and Groups",
+ "category": "Users and Groups"
}
]
};
http://git-wip-us.apache.org/repos/asf/ambari/blob/475d4589/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 1119287..16089d9 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -206,7 +206,7 @@ App.config = Em.Object.create({
/**
* Function should be used post-install as precondition check should not be done only after installer wizard
- * @param siteNames {string|array}
+ * @param siteNames {String|Array}
* @returns {Array}
*/
getBySitename: function (siteNames) {
@@ -360,6 +360,13 @@ App.config = Em.Object.create({
if (configsPropertyDef) {
this.setServiceConfigUiAttributes(serviceConfigObj, configsPropertyDef);
+ // check if defined UI config present in config list obtained from server.
+ // in case when config is absent on server and defined UI config is required
+ // by server, this config should be ignored
+ var serverProperty = properties[serviceConfigObj.get('name')];
+ if (!serverProperty && serviceConfigObj.get('isRequiredByAgent')) {
+ continue;
+ }
}
if (!this.getBySitename(serviceConfigObj.get('filename')).someProperty('name', index)) {
@@ -470,7 +477,7 @@ App.config = Em.Object.create({
* @param storedConfigs
* @param advancedConfigs
* @param selectedServiceNames
- * @return {array}
+ * @return {Array}
*/
mergePreDefinedWithStored: function (storedConfigs, advancedConfigs, selectedServiceNames) {
var mergedConfigs = [];
@@ -584,6 +591,14 @@ App.config = Em.Object.create({
addAdvancedConfigs: function (serviceConfigs, advancedConfigs, serviceName) {
var miscConfigs = serviceConfigs.filterProperty('serviceName', 'MISC');
var configsToVerifying = (serviceName) ? serviceConfigs.filterProperty('serviceName', serviceName).concat(miscConfigs) : serviceConfigs.slice();
+ var definedConfigs = (serviceName) ? this.get('preDefinedServiceConfigs').findProperty('serviceName', serviceName).get('configs') : [];
+
+ if (definedConfigs.length) {
+ advancedConfigs = advancedConfigs.filter(function(property) {
+ return !(definedConfigs.someProperty('name', property.name) && !serviceConfigs.someProperty('name', property.name));
+ }, this);
+ }
+
advancedConfigs.forEach(function (_config) {
var configType = this.getConfigTagFromFileName(_config.filename);
var configCategory = 'Advanced ' + configType;
[21/26] git commit: AMBARI-7261. Slider View: Remove gray background
on pages of create app wizard (alexantonenko)
Posted by jo...@apache.org.
AMBARI-7261. Slider View: Remove gray background on pages of create app wizard (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a2f0bcd1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a2f0bcd1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a2f0bcd1
Branch: refs/heads/branch-alerts-dev
Commit: a2f0bcd1afec0859ceab263a140fdce93a123ac3
Parents: c405d5f
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Sep 11 17:57:53 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Sep 11 17:57:53 2014 +0300
----------------------------------------------------------------------
.../slider/src/main/resources/ui/app/styles/application.less | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a2f0bcd1/contrib/views/slider/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/application.less b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
index 891c991..c0988f2 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
@@ -334,6 +334,9 @@ a {
}
.slider-modal-body {
max-height: 505px;
+ .wizard-content{
+ background-color: #ffffff;
+ }
}
.next-btn {
margin-left: 5px;
[06/26] git commit: AMBARI-7239. Ambari items in /tmp (aonishuk)
Posted by jo...@apache.org.
AMBARI-7239. Ambari items in /tmp (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/adb87a44
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/adb87a44
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/adb87a44
Branch: refs/heads/branch-alerts-dev
Commit: adb87a44792eaa588ace009ac92e68926ba0cc37
Parents: 3f9d5a5
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 10 19:25:27 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 10 19:25:27 2014 +0300
----------------------------------------------------------------------
ambari-server/conf/unix/ambari.properties | 1 +
.../server/api/services/ComponentService.java | 5 +++-
.../api/services/HostComponentService.java | 5 +++-
.../server/configuration/Configuration.java | 4 +++
.../internal/ClientConfigResourceProvider.java | 5 ++--
ambari-server/src/main/python/bootstrap.py | 24 ++++++++++++++--
.../ClientConfigResourceProviderTest.java | 16 +++++++----
ambari-server/src/test/python/TestBootstrap.py | 29 ++++++++++++++++----
8 files changed, 71 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/adb87a44/ambari-server/conf/unix/ambari.properties
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties
index b77ae32..41cada7 100644
--- a/ambari-server/conf/unix/ambari.properties
+++ b/ambari-server/conf/unix/ambari.properties
@@ -31,6 +31,7 @@ bootstrap.script=/usr/lib/python2.6/site-packages/ambari_server/bootstrap.py
bootstrap.setup_agent.script=/usr/lib/python2.6/site-packages/ambari_server/setupAgent.py
recommendations.dir=/var/run/ambari-server/stack-recommendations
stackadvisor.script=/var/lib/ambari-server/resources/scripts/stack_advisor.py
+server.tmp.dir=/var/lib/ambari-server/tmp
api.authenticate=true
server.connection.max.idle.millis=900000
http://git-wip-us.apache.org/repos/asf/ambari/blob/adb87a44/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
index 16a8ffa..5510697 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
@@ -20,6 +20,7 @@ package org.apache.ambari.server.api.services;
import com.google.inject.Inject;
import org.apache.ambari.server.api.resources.ResourceInstance;
+import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.controller.spi.ClusterController;
import org.apache.ambari.server.controller.spi.Resource;
import org.apache.ambari.server.controller.utilities.ClusterControllerHelper;
@@ -231,7 +232,9 @@ public class ComponentService extends BaseService {
}
Response.ResponseBuilder rb = Response.status(Response.Status.OK);
- File file = new File("/tmp/ambari-server/"+componentName+"-configs.tar.gz");
+ Configuration configs = new Configuration();
+ String tmpDir = configs.getProperty(Configuration.SERVER_TMP_DIR_KEY);
+ File file = new File(tmpDir+File.separator+componentName+"-configs.tar.gz");
InputStream resultInputStream = null;
try {
resultInputStream = new FileInputStream(file);
http://git-wip-us.apache.org/repos/asf/ambari/blob/adb87a44/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
index 35c7826..4990ad7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
@@ -32,6 +32,7 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import org.apache.ambari.server.api.resources.ResourceInstance;
+import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.controller.spi.Resource;
/**
@@ -270,7 +271,9 @@ public class HostComponentService extends BaseService {
}
Response.ResponseBuilder rb = Response.status(Response.Status.OK);
- File file = new File("/tmp/ambari-server/"+hostComponentName+"-configs.tar.gz");
+ Configuration configs = new Configuration();
+ String tmpDir = configs.getProperty(Configuration.SERVER_TMP_DIR_KEY);
+ File file = new File(tmpDir+File.separator+hostComponentName+"-configs.tar.gz");
InputStream resultInputStream = null;
try {
resultInputStream = new FileInputStream(file);
http://git-wip-us.apache.org/repos/asf/ambari/blob/adb87a44/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index a21f98c..a3a07b0 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -231,6 +231,8 @@ public class Configuration {
public static final String DEFAULT_SCHEDULER_MAX_CONNECTIONS = "5";
public static final String DEFAULT_EXECUTION_SCHEDULER_MISFIRE_TOLERATION = "480";
public static final String DEFAULT_SCHEDULER_START_DELAY_SECONDS = "120";
+ public static final String SERVER_TMP_DIR_KEY = "server.tmp.dir";
+ public static final String SERVER_TMP_DIR_DEFAULT = "/var/lib/ambari-server/tmp";
/**
* This key defines whether stages of parallel requests are executed in
* parallel or sequentally. Only stages from different requests
@@ -372,6 +374,8 @@ public class Configuration {
JAVA_HOME_KEY));
configsMap.put(PARALLEL_STAGE_EXECUTION_KEY, properties.getProperty(
PARALLEL_STAGE_EXECUTION_KEY, PARALLEL_STAGE_EXECUTION_DEFAULT));
+ configsMap.put(SERVER_TMP_DIR_KEY, properties.getProperty(
+ SERVER_TMP_DIR_KEY, SERVER_TMP_DIR_DEFAULT));
File passFile = new File(configsMap.get(SRVR_KSTR_DIR_KEY) + File.separator
+ configsMap.get(SRVR_CRT_PASS_FILE_KEY));
http://git-wip-us.apache.org/repos/asf/ambari/blob/adb87a44/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index cc97eba..366b5e1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -55,7 +55,6 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
protected static final String COMPONENT_COMPONENT_NAME_PROPERTY_ID = "ServiceComponentInfo/component_name";
protected static final String HOST_COMPONENT_HOST_NAME_PROPERTY_ID =
PropertyHelper.getPropertyId("HostRoles", "host_name");
- protected static final String TMP_PATH = "/tmp/ambari-server";
private final Gson gson;
@@ -121,6 +120,8 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
throw new SystemException("Failed to get components ", e);
}
+ Configuration configs = new Configuration();
+ String TMP_PATH = configs.getProperty(Configuration.SERVER_TMP_DIR_KEY);
AmbariManagementController managementController = getManagementController();
ConfigHelper configHelper = managementController.getConfigHelper();
Cluster cluster = null;
@@ -289,7 +290,7 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
File tmpDirectory = new File(jsonFileName.getParent());
if (!tmpDirectory.exists()) {
try {
- tmpDirectory.mkdir();
+ tmpDirectory.mkdirs();
tmpDirectory.setWritable(true, true);
tmpDirectory.setReadable(true, true);
} catch (SecurityException se) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/adb87a44/ambari-server/src/main/python/bootstrap.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/bootstrap.py b/ambari-server/src/main/python/bootstrap.py
index b981572..5ebfbf2 100755
--- a/ambari-server/src/main/python/bootstrap.py
+++ b/ambari-server/src/main/python/bootstrap.py
@@ -39,7 +39,8 @@ MAX_PARALLEL_BOOTSTRAPS = 20
# How many seconds to wait between polling parallel bootstraps
POLL_INTERVAL_SEC = 1
DEBUG = False
-PYTHON_ENV="env PYTHONPATH=$PYTHONPATH:/tmp "
+DEFAULT_AGENT_TEMP_FOLDER = "/var/lib/ambari-agent/data/tmp"
+PYTHON_ENV="env PYTHONPATH=$PYTHONPATH:{0} ".format(DEFAULT_AGENT_TEMP_FOLDER)
class HostLog:
@@ -142,7 +143,7 @@ class SSH:
class Bootstrap(threading.Thread):
""" Bootstrap the agent on a separate host"""
- TEMP_FOLDER = "/tmp"
+ TEMP_FOLDER = DEFAULT_AGENT_TEMP_FOLDER
OS_CHECK_SCRIPT_FILENAME = "os_check_type.py"
AMBARI_REPO_FILENAME = "ambari"
SETUP_SCRIPT_FILENAME = "setupAgent.py"
@@ -235,6 +236,22 @@ class Bootstrap(threading.Thread):
return password_file is not None and password_file != 'null'
+ def createTargetDir(self):
+ # Creating target dir
+ self.host_log.write("==========================\n")
+ self.host_log.write("Creating target directory...")
+ params = self.shared_state
+ user = params.user
+
+ command = "[ -d {0} ] || sudo mkdir -p {0} ; sudo chown {1} {0}".format(self.TEMP_FOLDER,params.user)
+
+ ssh = SSH(params.user, params.sshkey_file, self.host, command,
+ params.bootdir, self.host_log)
+ retcode = ssh.run()
+ self.host_log.write("\n")
+ return retcode
+
+
def copyOsCheckScript(self):
# Copying the os check script file
fileToCopy = self.getOsCheckScript()
@@ -489,7 +506,8 @@ class Bootstrap(threading.Thread):
""" Copy files and run commands on remote host """
self.status["start_time"] = time.time()
# Population of action queue
- action_queue = [self.copyCommonFunctions,
+ action_queue = [self.createTargetDir,
+ self.copyCommonFunctions,
self.copyOsCheckScript,
self.runOsCheckScript,
self.checkSudoPackage
http://git-wip-us.apache.org/repos/asf/ambari/blob/adb87a44/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
index e7ecb88..214bf10 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
@@ -26,6 +26,7 @@ import org.apache.ambari.server.controller.utilities.PredicateBuilder;
import org.apache.ambari.server.controller.utilities.PropertyHelper;
import org.apache.ambari.server.state.*;
import org.apache.ambari.server.state.PropertyInfo;
+import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -109,8 +110,8 @@ public class ClientConfigResourceProviderTest {
// create the request
Request request = PropertyHelper.getUpdateRequest(properties, null);
- Predicate predicate = new PredicateBuilder().property(ClientConfigResourceProvider.COMPONENT_CLUSTER_NAME_PROPERTY_ID).equals("c1").
- toPredicate();
+ Predicate predicate = new PredicateBuilder().property(
+ ClientConfigResourceProvider.COMPONENT_CLUSTER_NAME_PROPERTY_ID).equals("c1").toPredicate();
try {
provider.updateResources(request, predicate);
@@ -143,13 +144,13 @@ public class ClientConfigResourceProviderTest {
ServiceComponentHost serviceComponentHost = createNiceMock(ServiceComponentHost.class);
ServiceOsSpecific serviceOsSpecific = createNiceMock(ServiceOsSpecific.class);
ConfigHelper configHelper = createNiceMock(ConfigHelper.class);
+ Configuration configuration = PowerMock.createStrictMockAndExpectNew(Configuration.class);
File mockFile = PowerMock.createNiceMock(File.class);
Runtime runtime = createMock(Runtime.class);
Process process = createNiceMock(Process.class);
Collection<Config> clusterConfigs = new HashSet<Config>();
- //Config clusterConfig = new ConfigImpl("config");
clusterConfigs.add(clusterConfig);
Map<String, Map<String, String>> allConfigTags = new HashMap<String, Map<String, String>>();
Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();
@@ -216,6 +217,7 @@ public class ClientConfigResourceProviderTest {
expect(configHelper.getEffectiveConfigProperties(cluster, configTags)).andReturn(properties);
expect(clusterConfig.getType()).andReturn(Configuration.HIVE_CONFIG_TAG).anyTimes();
expect(configHelper.getEffectiveConfigAttributes(cluster, configTags)).andReturn(attributes);
+ expect(configuration.getProperty("server.tmp.dir")).andReturn(Configuration.SERVER_TMP_DIR_DEFAULT);
//!!!!
Map<String,String> props = new HashMap<String, String>();
props.put(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY, "pass");
@@ -261,7 +263,8 @@ public class ClientConfigResourceProviderTest {
expect(Runtime.getRuntime()).andReturn(runtime);
expect(mockFile.exists()).andReturn(true);
expect(runtime.exec("ambari-python-wrap /tmp/stacks/S1/V1/PIG/package/null generate_configs null " +
- "/tmp/stacks/S1/V1/PIG/package /tmp/ambari-server/structured-out.json INFO /tmp/ambari-server"))
+ "/tmp/stacks/S1/V1/PIG/package /var/lib/ambari-server/tmp/structured-out.json " +
+ "INFO /var/lib/ambari-server/tmp"))
.andReturn(process).once();
// replay
@@ -278,6 +281,7 @@ public class ClientConfigResourceProviderTest {
verify(managementController, clusters, cluster, ambariMetaInfo, stackId, componentInfo,commandScriptDefinition,
clusterConfig, host, service, serviceComponent, serviceComponentHost, serviceInfo, configHelper,
runtime, process);
+ PowerMock.verifyAll();
}
@Test
@@ -295,8 +299,8 @@ public class ClientConfigResourceProviderTest {
PropertyHelper.getKeyPropertyIds(type),
managementController);
- Predicate predicate = new PredicateBuilder().property(ClientConfigResourceProvider.COMPONENT_COMPONENT_NAME_PROPERTY_ID).equals("HDFS_CLIENT").
- toPredicate();
+ Predicate predicate = new PredicateBuilder().property(
+ ClientConfigResourceProvider.COMPONENT_COMPONENT_NAME_PROPERTY_ID).equals("HDFS_CLIENT").toPredicate();
try {
provider.deleteResources(predicate);
Assert.fail("Expected an UnsupportedOperationException");
http://git-wip-us.apache.org/repos/asf/ambari/blob/adb87a44/ambari-server/src/test/python/TestBootstrap.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestBootstrap.py b/ambari-server/src/test/python/TestBootstrap.py
index d511222..6bcc94f 100644
--- a/ambari-server/src/test/python/TestBootstrap.py
+++ b/ambari-server/src/test/python/TestBootstrap.py
@@ -109,8 +109,8 @@ class TestBootstrap(TestCase):
utime = 1234
bootstrap_obj.getUtime = MagicMock(return_value=utime)
ret = bootstrap_obj.getRunSetupWithPasswordCommand("hostname")
- expected = "sudo -S python /tmp/setupAgent{0}.py hostname TEST_PASSPHRASE " \
- "ambariServer 8440 < /tmp/host_pass{0}".format(utime)
+ expected = "sudo -S python /var/lib/ambari-agent/data/tmp/setupAgent{0}.py hostname TEST_PASSPHRASE " \
+ "ambariServer 8440 < /var/lib/ambari-agent/data/tmp/host_pass{0}".format(utime)
self.assertEquals(ret, expected)
@@ -343,6 +343,25 @@ class TestBootstrap(TestCase):
self.assertEquals(rf, "/etc/yum.repos.d/ambari.repo")
+ @patch.object(SSH, "__init__")
+ @patch.object(SSH, "run")
+ @patch.object(HostLog, "write")
+ def test_createTargetDir(self, write_mock, run_mock,
+ init_mock):
+ shared_state = SharedState("root", "sshkey_file", "scriptDir", "bootdir",
+ "setupAgentFile", "ambariServer", "centos6",
+ None, "8440")
+ bootstrap_obj = Bootstrap("hostname", shared_state)
+ expected = 42
+ init_mock.return_value = None
+ run_mock.return_value = expected
+ res = bootstrap_obj.createTargetDir()
+ self.assertEquals(res, expected)
+ command = str(init_mock.call_args[0][3])
+ self.assertEqual(command,
+ "[ -d /var/lib/ambari-agent/data/tmp ] || sudo mkdir -p /var/lib/ambari-agent/data/tmp ; "
+ "sudo chown root /var/lib/ambari-agent/data/tmp")
+
@patch.object(Bootstrap, "getOsCheckScript")
@patch.object(Bootstrap, "getOsCheckScriptRemoteLocation")
@patch.object(SCP, "__init__")
@@ -460,7 +479,7 @@ class TestBootstrap(TestCase):
command = str(init_mock.call_args[0][3])
self.assertEqual(command,
"chmod a+x OsCheckScriptRemoteLocation && "
- "env PYTHONPATH=$PYTHONPATH:/tmp OsCheckScriptRemoteLocation centos6")
+ "env PYTHONPATH=$PYTHONPATH:/var/lib/ambari-agent/data/tmp OsCheckScriptRemoteLocation centos6")
@patch.object(SSH, "__init__")
@@ -678,7 +697,7 @@ class TestBootstrap(TestCase):
hasPassword_mock.return_value = False
try_to_execute_mock.return_value = {"exitstatus": 0, "log":"log0", "errormsg":"errormsg0"}
bootstrap_obj.run()
- self.assertEqual(try_to_execute_mock.call_count, 6) # <- Adjust if changed
+ self.assertEqual(try_to_execute_mock.call_count, 7) # <- Adjust if changed
self.assertTrue(createDoneFile_mock.called)
self.assertEqual(bootstrap_obj.getStatus()["return_code"], 0)
@@ -689,7 +708,7 @@ class TestBootstrap(TestCase):
hasPassword_mock.return_value = True
try_to_execute_mock.return_value = {"exitstatus": 0, "log":"log0", "errormsg":"errormsg0"}
bootstrap_obj.run()
- self.assertEqual(try_to_execute_mock.call_count, 9) # <- Adjust if changed
+ self.assertEqual(try_to_execute_mock.call_count, 10) # <- Adjust if changed
self.assertTrue(createDoneFile_mock.called)
self.assertEqual(bootstrap_obj.getStatus()["return_code"], 0)
[24/26] git commit: AMBARI-7265. Error message present at UI after
Install by Blueprints or after Upgrade (aonishuk)
Posted by jo...@apache.org.
AMBARI-7265. Error message present at UI after Install by Blueprints or after Upgrade (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e293b67f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e293b67f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e293b67f
Branch: refs/heads/branch-alerts-dev
Commit: e293b67f6b1893596046c1153483ceb56c1aa1dd
Parents: 701165b
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Sep 11 20:46:59 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Sep 11 20:46:59 2014 +0300
----------------------------------------------------------------------
.../internal/BaseBlueprintProcessor.java | 7 +-
.../internal/BlueprintResourceProviderTest.java | 15 ++
.../internal/ClusterResourceProviderTest.java | 226 ++++++++++++++++---
3 files changed, 216 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e293b67f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseBlueprintProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseBlueprintProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseBlueprintProcessor.java
index c9f0124..9c10ac1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseBlueprintProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseBlueprintProcessor.java
@@ -26,6 +26,7 @@ import org.apache.ambari.server.api.services.AmbariMetaInfo;
import org.apache.ambari.server.controller.AmbariManagementController;
import org.apache.ambari.server.controller.StackConfigurationRequest;
import org.apache.ambari.server.controller.StackConfigurationResponse;
+import org.apache.ambari.server.controller.StackLevelConfigurationRequest;
import org.apache.ambari.server.controller.StackServiceComponentRequest;
import org.apache.ambari.server.controller.StackServiceComponentResponse;
import org.apache.ambari.server.controller.StackServiceRequest;
@@ -41,6 +42,7 @@ import org.apache.ambari.server.orm.entities.HostGroupEntity;
import org.apache.ambari.server.state.AutoDeployInfo;
import org.apache.ambari.server.state.ConfigHelper;
import org.apache.ambari.server.state.DependencyInfo;
+import org.apache.ambari.server.state.PropertyInfo;
import java.util.Collection;
import java.util.Collections;
@@ -816,7 +818,10 @@ public abstract class BaseBlueprintProcessor extends AbstractControllerResourceP
Set<StackConfigurationResponse> serviceConfigs = ambariManagementController.getStackConfigurations(
Collections.singleton(new StackConfigurationRequest(name, version, service, null)));
-
+ Set<StackConfigurationResponse> stackLevelConfigs = ambariManagementController.getStackLevelConfigurations(
+ Collections.singleton(new StackLevelConfigurationRequest(name, version, null)));
+ serviceConfigs.addAll(stackLevelConfigs);
+
for (StackConfigurationResponse config : serviceConfigs) {
String type = config.getType();
//strip .xml from type
http://git-wip-us.apache.org/repos/asf/ambari/blob/e293b67f/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
index 84cc2a9..3b3ec5f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
@@ -19,11 +19,13 @@
package org.apache.ambari.server.controller.internal;
import com.google.gson.Gson;
+
import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.api.services.AmbariMetaInfo;
import org.apache.ambari.server.controller.AmbariManagementController;
import org.apache.ambari.server.controller.StackConfigurationRequest;
import org.apache.ambari.server.controller.StackConfigurationResponse;
+import org.apache.ambari.server.controller.StackLevelConfigurationRequest;
import org.apache.ambari.server.controller.StackServiceComponentRequest;
import org.apache.ambari.server.controller.StackServiceComponentResponse;
import org.apache.ambari.server.controller.StackServiceRequest;
@@ -60,6 +62,7 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertNotNull;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -606,6 +609,7 @@ public class BlueprintResourceProviderTest {
Capture<Set<StackServiceRequest>> stackServiceRequestCapture = new Capture<Set<StackServiceRequest>>();
Capture<Set<StackServiceComponentRequest>> serviceComponentRequestCapture = new Capture<Set<StackServiceComponentRequest>>();
Capture<StackConfigurationRequest> stackConfigurationRequestCapture = new Capture<StackConfigurationRequest>();
+ Capture<StackLevelConfigurationRequest> stackLevelConfigurationRequestCapture = new Capture<StackLevelConfigurationRequest>();
Request request = createMock(Request.class);
StackServiceResponse stackServiceResponse = createMock(StackServiceResponse.class);
StackServiceComponentResponse stackServiceComponentResponse = createNiceMock(StackServiceComponentResponse.class);
@@ -650,6 +654,8 @@ public class BlueprintResourceProviderTest {
expect(managementController.getStackConfigurations(Collections.singleton(capture(stackConfigurationRequestCapture)))).
andReturn(Collections.<StackConfigurationResponse>emptySet());
+ expect(managementController.getStackLevelConfigurations(Collections.singleton(capture(stackLevelConfigurationRequestCapture)))).
+ andReturn(Collections.<StackConfigurationResponse>emptySet());
expect(metaInfo.getComponentDependencies("test-stack-name", "test-stack-version", "test-service", "MYSQL_SERVER")).
andReturn(Collections.<DependencyInfo>emptyList()).anyTimes();
@@ -707,6 +713,7 @@ public class BlueprintResourceProviderTest {
Capture<Set<StackServiceRequest>> stackServiceRequestCapture = new Capture<Set<StackServiceRequest>>();
Capture<Set<StackServiceComponentRequest>> serviceComponentRequestCapture = new Capture<Set<StackServiceComponentRequest>>();
Capture<StackConfigurationRequest> stackConfigurationRequestCapture = new Capture<StackConfigurationRequest>();
+ Capture<StackLevelConfigurationRequest> stackLevelConfigurationRequestCapture = new Capture<StackLevelConfigurationRequest>();
Request request = createMock(Request.class);
StackServiceResponse stackServiceResponse = createMock(StackServiceResponse.class);
StackServiceComponentResponse stackServiceComponentResponse = createNiceMock(StackServiceComponentResponse.class);
@@ -758,6 +765,8 @@ public class BlueprintResourceProviderTest {
expect(managementController.getStackConfigurations(Collections.singleton(capture(stackConfigurationRequestCapture)))).
andReturn(Collections.<StackConfigurationResponse>emptySet());
+ expect(managementController.getStackLevelConfigurations(Collections.singleton(capture(stackLevelConfigurationRequestCapture)))).
+ andReturn(Collections.<StackConfigurationResponse>emptySet());
expect(metaInfo.getComponentDependencies("test-stack-name", "test-stack-version", "test-service", "component2")).
andReturn(Collections.<DependencyInfo>singletonList(dependencyInfo)).anyTimes();
@@ -822,6 +831,7 @@ public class BlueprintResourceProviderTest {
Capture<Set<StackServiceRequest>> stackServiceRequestCapture = new Capture<Set<StackServiceRequest>>();
Capture<Set<StackServiceComponentRequest>> serviceComponentRequestCapture = new Capture<Set<StackServiceComponentRequest>>();
Capture<StackConfigurationRequest> stackConfigurationRequestCapture = new Capture<StackConfigurationRequest>();
+ Capture<StackLevelConfigurationRequest> stackLevelConfigurationRequestCapture = new Capture<StackLevelConfigurationRequest>();
Request request = createMock(Request.class);
StackServiceResponse stackServiceResponse = createMock(StackServiceResponse.class);
StackServiceComponentResponse stackServiceComponentResponse = createNiceMock(StackServiceComponentResponse.class);
@@ -874,6 +884,8 @@ public class BlueprintResourceProviderTest {
expect(managementController.getStackConfigurations(Collections.singleton(capture(stackConfigurationRequestCapture)))).
andReturn(Collections.<StackConfigurationResponse>emptySet());
+ expect(managementController.getStackLevelConfigurations(Collections.singleton(capture(stackLevelConfigurationRequestCapture)))).
+ andReturn(Collections.<StackConfigurationResponse>emptySet());
expect(metaInfo.getComponentDependencies("test-stack-name", "test-stack-version", "test-service", "component2")).
andReturn(Collections.<DependencyInfo>emptyList()).anyTimes();
@@ -937,6 +949,7 @@ public class BlueprintResourceProviderTest {
Capture<Set<StackServiceRequest>> stackServiceRequestCapture = new Capture<Set<StackServiceRequest>>();
Capture<Set<StackServiceComponentRequest>> serviceComponentRequestCapture = new Capture<Set<StackServiceComponentRequest>>();
Capture<StackConfigurationRequest> stackConfigurationRequestCapture = new Capture<StackConfigurationRequest>();
+ Capture<StackLevelConfigurationRequest> stackLevelConfigurationRequestCapture = new Capture<StackLevelConfigurationRequest>();
Request request = createMock(Request.class);
StackServiceResponse stackServiceResponse = createMock(StackServiceResponse.class);
StackServiceComponentResponse stackServiceComponentResponse = createNiceMock(StackServiceComponentResponse.class);
@@ -979,6 +992,8 @@ public class BlueprintResourceProviderTest {
expect(managementController.getStackConfigurations(Collections.singleton(capture(stackConfigurationRequestCapture)))).
andReturn(Collections.<StackConfigurationResponse>emptySet());
+ expect(managementController.getStackLevelConfigurations(Collections.singleton(capture(stackLevelConfigurationRequestCapture)))).
+ andReturn(Collections.<StackConfigurationResponse>emptySet());
expect(metaInfo.getComponentDependencies("test-stack-name", "test-stack-version", "test-service", "MYSQL_SERVER")).
andReturn(Collections.<DependencyInfo>emptyList()).anyTimes();
http://git-wip-us.apache.org/repos/asf/ambari/blob/e293b67f/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
index 3adebf0..d5f575a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterResourceProviderTest.java
@@ -56,6 +56,7 @@ import org.apache.ambari.server.controller.ConfigurationRequest;
import org.apache.ambari.server.controller.RequestStatusResponse;
import org.apache.ambari.server.controller.StackConfigurationRequest;
import org.apache.ambari.server.controller.StackConfigurationResponse;
+import org.apache.ambari.server.controller.StackLevelConfigurationRequest;
import org.apache.ambari.server.controller.StackServiceComponentRequest;
import org.apache.ambari.server.controller.StackServiceComponentResponse;
import org.apache.ambari.server.controller.StackServiceRequest;
@@ -196,8 +197,10 @@ public class ClusterResourceProviderTest {
StackConfigurationResponse stackConfigurationResponse3 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse4 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse5 = createNiceMock(StackConfigurationResponse.class);
+ StackConfigurationResponse stackConfigurationResponse6 = createNiceMock(StackConfigurationResponse.class);
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture1 = new Capture<Set<StackConfigurationRequest>>();
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture2 = new Capture<Set<StackConfigurationRequest>>();
+ Capture<Set<StackLevelConfigurationRequest>> serviceLevelConfigurationRequestCapture1 = new Capture<Set<StackLevelConfigurationRequest>>();
Map<String, String> coreSiteAttributes = new HashMap<String, String>();
coreSiteAttributes.put("final", "true");
@@ -209,6 +212,7 @@ public class ClusterResourceProviderTest {
BlueprintConfigEntity blueprintConfig3 = createNiceMock(BlueprintConfigEntity.class);
BlueprintConfigEntity blueprintConfig4 = createNiceMock(BlueprintConfigEntity.class);
BlueprintConfigEntity blueprintConfig5 = createNiceMock(BlueprintConfigEntity.class);
+ BlueprintConfigEntity blueprintConfig6 = createNiceMock(BlueprintConfigEntity.class);
HostGroupEntity hostGroup = createNiceMock(HostGroupEntity.class);
HostGroupComponentEntity hostGroupComponent1 = createNiceMock(HostGroupComponentEntity.class);
@@ -240,6 +244,8 @@ public class ClusterResourceProviderTest {
Capture<Map<String, String>> updateClusterPropertyMapCapture6 = new Capture<Map<String, String>>();
Capture<Set<ClusterRequest>> updateClusterRequestCapture7 = new Capture<Set<ClusterRequest>>();
Capture<Map<String, String>> updateClusterPropertyMapCapture7 = new Capture<Map<String, String>>();
+ Capture<Set<ClusterRequest>> updateClusterRequestCapture8 = new Capture<Set<ClusterRequest>>();
+ Capture<Map<String, String>> updateClusterPropertyMapCapture8 = new Capture<Map<String, String>>();
Capture<Request> serviceRequestCapture = new Capture<Request>();
Capture<Request> componentRequestCapture = new Capture<Request>();
@@ -272,7 +278,10 @@ public class ClusterResourceProviderTest {
stackConfigurationResponses2.add(stackConfigurationResponse2);
stackConfigurationResponses2.add(stackConfigurationResponse3);
stackConfigurationResponses2.add(stackConfigurationResponse4);
-
+
+ Set<StackConfigurationResponse> stackConfigurationResponses3 = new LinkedHashSet<StackConfigurationResponse>();
+ stackConfigurationResponses3.add(stackConfigurationResponse6);
+
Collection<HostGroupComponentEntity> hostGroupComponents = new LinkedHashSet<HostGroupComponentEntity>();
hostGroupComponents.add(hostGroupComponent1);
hostGroupComponents.add(hostGroupComponent2);
@@ -322,6 +331,7 @@ public class ClusterResourceProviderTest {
configurations.add(blueprintConfig3);
configurations.add(blueprintConfig4);
configurations.add(blueprintConfig5);
+ configurations.add(blueprintConfig6);
// expectations
expect(request.getProperties()).andReturn(propertySet).anyTimes();
@@ -353,6 +363,10 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture1))).
andReturn(stackConfigurationResponses1);
+
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse1.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse1.getPropertyName()).andReturn("property1");
expect(stackConfigurationResponse1.getPropertyValue()).andReturn("value1");
@@ -360,10 +374,15 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackComponents(capture(serviceComponentRequestCapture2))).
andReturn(stackServiceComponentResponses2);
+
expect(stackServiceComponentResponse3.getComponentName()).andReturn("component3");
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture2))).
andReturn(stackConfigurationResponses2);
+
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse2.getType()).andReturn("hdfs-site.xml");
expect(stackConfigurationResponse2.getPropertyName()).andReturn("property2");
expect(stackConfigurationResponse2.getPropertyValue()).andReturn("value2");
@@ -380,6 +399,10 @@ public class ClusterResourceProviderTest {
expect(stackConfigurationResponse5.getType()).andReturn("hive-site.xml");
expect(stackConfigurationResponse5.getPropertyName()).andReturn("javax.jdo.option.ConnectionURL");
expect(stackConfigurationResponse5.getPropertyValue()).andReturn("localhost:12345");
+
+ expect(stackConfigurationResponse6.getType()).andReturn("cluster-env.xml").anyTimes();
+ expect(stackConfigurationResponse6.getPropertyName()).andReturn("rqw").anyTimes();
+ expect(stackConfigurationResponse6.getPropertyValue()).andReturn("aaaa").anyTimes();
expect(blueprintConfig.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig.getType()).andReturn("core-site").anyTimes();
@@ -396,6 +419,9 @@ public class ClusterResourceProviderTest {
expect(blueprintConfig5.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig5.getType()).andReturn("global").anyTimes();
expect(blueprintConfig5.getConfigData()).andReturn(new Gson().toJson(hbaseEnvConfigProperties)).anyTimes();
+ expect(blueprintConfig6.getBlueprintName()).andReturn("test-blueprint").anyTimes();
+ expect(blueprintConfig6.getType()).andReturn("cluster-env").anyTimes();
+ expect(blueprintConfig6.getConfigData()).andReturn(new Gson().toJson(hbaseEnvConfigProperties)).anyTimes();
expect(blueprint.getHostGroups()).andReturn(Collections.singleton(hostGroup)).anyTimes();
@@ -426,6 +452,8 @@ public class ClusterResourceProviderTest {
capture(updateClusterPropertyMapCapture6))).andReturn(null);
expect(managementController.updateClusters(capture(updateClusterRequestCapture7),
capture(updateClusterPropertyMapCapture7))).andReturn(null);
+ expect(managementController.updateClusters(capture(updateClusterRequestCapture8),
+ capture(updateClusterPropertyMapCapture8))).andReturn(null);
expect(serviceResourceProvider.createResources(capture(serviceRequestCapture))).andReturn(null);
expect(componentResourceProvider.createResources(capture(componentRequestCapture))).andReturn(null);
@@ -443,8 +471,8 @@ public class ClusterResourceProviderTest {
replay(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
stackServiceComponentResponse4, stackConfigurationResponse1, stackConfigurationResponse2,
- stackConfigurationResponse3, stackConfigurationResponse4, stackConfigurationResponse5, blueprintConfig,
- blueprintConfig2, blueprintConfig3, blueprintConfig4, blueprintConfig5, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupComponent4,
+ stackConfigurationResponse3, stackConfigurationResponse4, stackConfigurationResponse5, stackConfigurationResponse6, blueprintConfig,
+ blueprintConfig2, blueprintConfig3, blueprintConfig4, blueprintConfig5, blueprintConfig6, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupComponent4,
hostGroupConfig, serviceResourceProvider, componentResourceProvider, hostResourceProvider,
hostComponentResourceProvider, configGroupResourceProvider, persistKeyValue, metaInfo);
@@ -514,6 +542,7 @@ public class ClusterResourceProviderTest {
Set<ClusterRequest> updateClusterRequest5 = updateClusterRequestCapture5.getValue();
Set<ClusterRequest> updateClusterRequest6 = updateClusterRequestCapture6.getValue();
Set<ClusterRequest> updateClusterRequest7 = updateClusterRequestCapture7.getValue();
+ Set<ClusterRequest> updateClusterRequest8 = updateClusterRequestCapture8.getValue();
assertEquals(1, updateClusterRequest1.size());
assertEquals(1, updateClusterRequest2.size());
assertEquals(1, updateClusterRequest3.size());
@@ -521,6 +550,7 @@ public class ClusterResourceProviderTest {
assertEquals(1, updateClusterRequest5.size());
assertEquals(1, updateClusterRequest6.size());
assertEquals(1, updateClusterRequest7.size());
+ assertEquals(1, updateClusterRequest8.size());
ClusterRequest ucr1 = updateClusterRequest1.iterator().next();
ClusterRequest ucr2 = updateClusterRequest2.iterator().next();
ClusterRequest ucr3 = updateClusterRequest3.iterator().next();
@@ -528,6 +558,7 @@ public class ClusterResourceProviderTest {
ClusterRequest ucr5 = updateClusterRequest5.iterator().next();
ClusterRequest ucr6 = updateClusterRequest6.iterator().next();
ClusterRequest ucr7 = updateClusterRequest7.iterator().next();
+ ClusterRequest ucr8 = updateClusterRequest8.iterator().next();
assertEquals(clusterName, ucr1.getClusterName());
assertEquals(clusterName, ucr2.getClusterName());
assertEquals(clusterName, ucr3.getClusterName());
@@ -535,6 +566,7 @@ public class ClusterResourceProviderTest {
assertEquals(clusterName, ucr5.getClusterName());
assertEquals(clusterName, ucr6.getClusterName());
assertEquals(clusterName, ucr7.getClusterName());
+ assertEquals(clusterName, ucr8.getClusterName());
ConfigurationRequest cr1 = ucr1.getDesiredConfig().get(0);
ConfigurationRequest cr2 = ucr2.getDesiredConfig().get(0);
ConfigurationRequest cr3 = ucr3.getDesiredConfig().get(0);
@@ -542,6 +574,7 @@ public class ClusterResourceProviderTest {
ConfigurationRequest cr5 = ucr5.getDesiredConfig().get(0);
ConfigurationRequest cr6 = ucr6.getDesiredConfig().get(0);
ConfigurationRequest cr7 = ucr7.getDesiredConfig().get(0);
+ ConfigurationRequest cr8 = ucr8.getDesiredConfig().get(0);
assertEquals("1", cr1.getVersionTag());
assertEquals("1", cr2.getVersionTag());
assertEquals("1", cr3.getVersionTag());
@@ -557,7 +590,8 @@ public class ClusterResourceProviderTest {
mapConfigRequests.put(cr5.getType(), cr5);
mapConfigRequests.put(cr6.getType(), cr6);
mapConfigRequests.put(cr7.getType(), cr7);
- assertEquals(7, mapConfigRequests.size());
+ mapConfigRequests.put(cr8.getType(), cr8);
+ assertEquals(8, mapConfigRequests.size());
ConfigurationRequest hiveEnvConfigRequest = mapConfigRequests.get("hive-env");
assertEquals("New MySQL Database", hiveEnvConfigRequest.getProperties().get("hive_database"));
ConfigurationRequest hdfsConfigRequest = mapConfigRequests.get("hdfs-site");
@@ -637,7 +671,7 @@ public class ClusterResourceProviderTest {
verify(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
stackServiceComponentResponse4, stackConfigurationResponse1, stackConfigurationResponse2,
- stackConfigurationResponse3, stackConfigurationResponse4, stackConfigurationResponse5, blueprintConfig,
+ stackConfigurationResponse3, stackConfigurationResponse4, stackConfigurationResponse5, stackConfigurationResponse6, blueprintConfig,
blueprintConfig2, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupComponent4,
hostGroupConfig, serviceResourceProvider, componentResourceProvider, hostResourceProvider,
hostComponentResourceProvider, configGroupResourceProvider, persistKeyValue, metaInfo);
@@ -675,8 +709,10 @@ public class ClusterResourceProviderTest {
StackConfigurationResponse stackConfigurationResponse5 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse6 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse7 = createNiceMock(StackConfigurationResponse.class);
+ StackConfigurationResponse stackConfigurationResponse8 = createNiceMock(StackConfigurationResponse.class);
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture1 = new Capture<Set<StackConfigurationRequest>>();
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture2 = new Capture<Set<StackConfigurationRequest>>();
+ Capture<Set<StackLevelConfigurationRequest>> serviceLevelConfigurationRequestCapture1 = new Capture<Set<StackLevelConfigurationRequest>>();
BlueprintConfigEntity blueprintConfig = createNiceMock(BlueprintConfigEntity.class);
@@ -721,6 +757,9 @@ public class ClusterResourceProviderTest {
stackConfigurationResponses2.add(stackConfigurationResponse6);
stackConfigurationResponses2.add(stackConfigurationResponse7);
+ Set<StackConfigurationResponse> stackConfigurationResponses3 = new LinkedHashSet<StackConfigurationResponse>();
+ stackConfigurationResponses2.add(stackConfigurationResponse8);
+
Collection<HostGroupComponentEntity> hostGroupComponents = new LinkedHashSet<HostGroupComponentEntity>();
hostGroupComponents.add(hostGroupComponent1);
hostGroupComponents.add(hostGroupComponent2);
@@ -786,6 +825,10 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture1))).
andReturn(stackConfigurationResponses1);
+
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse1.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse1.getPropertyName()).andReturn("property1");
expect(stackConfigurationResponse1.getPropertyValue()).andReturn("value1");
@@ -796,6 +839,14 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture2))).
andReturn(stackConfigurationResponses2);
+
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
+ expect(stackConfigurationResponse8.getType()).andReturn("cluster-env.xml").anyTimes();
+ expect(stackConfigurationResponse8.getPropertyName()).andReturn("rqw").anyTimes();
+ expect(stackConfigurationResponse8.getPropertyValue()).andReturn("aaaa").anyTimes();
+
expect(stackConfigurationResponse2.getType()).andReturn("hdfs-site.xml");
expect(stackConfigurationResponse2.getPropertyName()).andReturn("property2");
expect(stackConfigurationResponse2.getPropertyValue()).andReturn("value2");
@@ -820,7 +871,6 @@ public class ClusterResourceProviderTest {
expect(stackConfigurationResponse7.getPropertyName()).andReturn("property3");
expect(stackConfigurationResponse7.getPropertyValue()).andReturn("value3");
-
expect(blueprintConfig.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig.getType()).andReturn("core-site").anyTimes();
expect(blueprintConfig.getConfigData()).andReturn(new Gson().toJson(blueprintConfigProperties));
@@ -840,7 +890,7 @@ public class ClusterResourceProviderTest {
replay(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,
- stackConfigurationResponse5, stackConfigurationResponse6, stackConfigurationResponse7,
+ stackConfigurationResponse5, stackConfigurationResponse6, stackConfigurationResponse7, stackConfigurationResponse8,
blueprintConfig, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupConfig,
serviceResourceProvider, componentResourceProvider, hostResourceProvider, hostComponentResourceProvider,
configGroupResourceProvider, persistKeyValue, metaInfo);
@@ -894,8 +944,11 @@ public class ClusterResourceProviderTest {
StackConfigurationResponse stackConfigurationResponse2 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse3 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse4 = createNiceMock(StackConfigurationResponse.class);
+ StackConfigurationResponse stackConfigurationResponse5 = createNiceMock(StackConfigurationResponse.class);
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture1 = new Capture<Set<StackConfigurationRequest>>();
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture2 = new Capture<Set<StackConfigurationRequest>>();
+ Capture<Set<StackLevelConfigurationRequest>> serviceLevelConfigurationRequestCapture1 = new Capture<Set<StackLevelConfigurationRequest>>();
+
BlueprintConfigEntity blueprintConfig = createNiceMock(BlueprintConfigEntity.class);
@@ -935,6 +988,9 @@ public class ClusterResourceProviderTest {
stackConfigurationResponses2.add(stackConfigurationResponse2);
stackConfigurationResponses2.add(stackConfigurationResponse3);
stackConfigurationResponses2.add(stackConfigurationResponse4);
+
+ Set<StackConfigurationResponse> stackConfigurationResponses3 = new LinkedHashSet<StackConfigurationResponse>();
+ stackConfigurationResponses2.add(stackConfigurationResponse5);
Collection<HostGroupComponentEntity> hostGroupComponents = new LinkedHashSet<HostGroupComponentEntity>();
hostGroupComponents.add(hostGroupComponent1);
@@ -981,6 +1037,10 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture1))).
andReturn(stackConfigurationResponses1);
+
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse1.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse1.getPropertyName()).andReturn("property1");
expect(stackConfigurationResponse1.getPropertyValue()).andReturn("value1");
@@ -991,6 +1051,9 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture2))).
andReturn(stackConfigurationResponses2);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse2.getType()).andReturn("hdfs-site.xml");
expect(stackConfigurationResponse2.getPropertyName()).andReturn("property2");
expect(stackConfigurationResponse2.getPropertyValue()).andReturn("value2");
@@ -1002,6 +1065,11 @@ public class ClusterResourceProviderTest {
expect(stackConfigurationResponse4.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse4.getPropertyName()).andReturn("property3");
expect(stackConfigurationResponse4.getPropertyValue()).andReturn("value3");
+
+ expect(stackConfigurationResponse5.getType()).andReturn("cluster-env.xml").anyTimes();
+ expect(stackConfigurationResponse5.getPropertyName()).andReturn("rqw").anyTimes();
+ expect(stackConfigurationResponse5.getPropertyValue()).andReturn("aaaa").anyTimes();
+
expect(blueprintConfig.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig.getType()).andReturn("core-site").anyTimes();
@@ -1020,7 +1088,7 @@ public class ClusterResourceProviderTest {
replay(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
- stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,
+ stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,stackConfigurationResponse5,
blueprintConfig, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupConfig,
serviceResourceProvider, componentResourceProvider, hostResourceProvider, hostComponentResourceProvider,
configGroupResourceProvider, persistKeyValue, metaInfo);
@@ -1067,9 +1135,11 @@ public class ClusterResourceProviderTest {
StackConfigurationResponse stackConfigurationResponse2 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse3 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse4 = createNiceMock(StackConfigurationResponse.class);
+ StackConfigurationResponse stackConfigurationResponse5 = createNiceMock(StackConfigurationResponse.class);
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture1 = new Capture<Set<StackConfigurationRequest>>();
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture2 = new Capture<Set<StackConfigurationRequest>>();
-
+ Capture<Set<StackLevelConfigurationRequest>> serviceLevelConfigurationRequestCapture1 = new Capture<Set<StackLevelConfigurationRequest>>();
+
BlueprintConfigEntity blueprintConfig = createNiceMock(BlueprintConfigEntity.class);
HostGroupEntity hostGroup = createNiceMock(HostGroupEntity.class);
@@ -1108,6 +1178,9 @@ public class ClusterResourceProviderTest {
stackConfigurationResponses2.add(stackConfigurationResponse2);
stackConfigurationResponses2.add(stackConfigurationResponse3);
stackConfigurationResponses2.add(stackConfigurationResponse4);
+
+ Set<StackConfigurationResponse> stackConfigurationResponses3 = new LinkedHashSet<StackConfigurationResponse>();
+ stackConfigurationResponses2.add(stackConfigurationResponse5);
Collection<HostGroupComponentEntity> hostGroupComponents = new LinkedHashSet<HostGroupComponentEntity>();
hostGroupComponents.add(hostGroupComponent1);
@@ -1164,6 +1237,10 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture1))).
andReturn(stackConfigurationResponses1);
+
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse1.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse1.getPropertyName()).andReturn("property1");
expect(stackConfigurationResponse1.getPropertyValue()).andReturn("value1");
@@ -1174,6 +1251,9 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture2))).
andReturn(stackConfigurationResponses2);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse2.getType()).andReturn("hdfs-site.xml");
expect(stackConfigurationResponse2.getPropertyName()).andReturn("property2");
expect(stackConfigurationResponse2.getPropertyValue()).andReturn("value2");
@@ -1185,6 +1265,10 @@ public class ClusterResourceProviderTest {
expect(stackConfigurationResponse4.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse4.getPropertyName()).andReturn("property3");
expect(stackConfigurationResponse4.getPropertyValue()).andReturn("value3");
+
+ expect(stackConfigurationResponse5.getType()).andReturn("cluster-env.xml").anyTimes();
+ expect(stackConfigurationResponse5.getPropertyName()).andReturn("rqw").anyTimes();
+ expect(stackConfigurationResponse5.getPropertyValue()).andReturn("aaaa").anyTimes();
expect(blueprintConfig.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig.getType()).andReturn("core-site").anyTimes();
@@ -1203,7 +1287,7 @@ public class ClusterResourceProviderTest {
replay(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
- stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,
+ stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,stackConfigurationResponse5,
blueprintConfig, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupConfig,
serviceResourceProvider, componentResourceProvider, hostResourceProvider, hostComponentResourceProvider,
configGroupResourceProvider, persistKeyValue, metaInfo);
@@ -1250,9 +1334,11 @@ public class ClusterResourceProviderTest {
StackConfigurationResponse stackConfigurationResponse2 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse3 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse4 = createNiceMock(StackConfigurationResponse.class);
+ StackConfigurationResponse stackConfigurationResponse5 = createNiceMock(StackConfigurationResponse.class);
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture1 = new Capture<Set<StackConfigurationRequest>>();
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture2 = new Capture<Set<StackConfigurationRequest>>();
-
+ Capture<Set<StackLevelConfigurationRequest>> serviceLevelConfigurationRequestCapture1 = new Capture<Set<StackLevelConfigurationRequest>>();
+
BlueprintConfigEntity blueprintConfig = createNiceMock(BlueprintConfigEntity.class);
HostGroupEntity hostGroup = createNiceMock(HostGroupEntity.class);
@@ -1291,6 +1377,9 @@ public class ClusterResourceProviderTest {
stackConfigurationResponses2.add(stackConfigurationResponse2);
stackConfigurationResponses2.add(stackConfigurationResponse3);
stackConfigurationResponses2.add(stackConfigurationResponse4);
+
+ Set<StackConfigurationResponse> stackConfigurationResponses3 = new LinkedHashSet<StackConfigurationResponse>();
+ stackConfigurationResponses3.add(stackConfigurationResponse5);
Collection<HostGroupComponentEntity> hostGroupComponents = new LinkedHashSet<HostGroupComponentEntity>();
hostGroupComponents.add(hostGroupComponent1);
@@ -1347,6 +1436,9 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture1))).
andReturn(stackConfigurationResponses1);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse1.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse1.getPropertyName()).andReturn("property1");
expect(stackConfigurationResponse1.getPropertyValue()).andReturn("value1");
@@ -1357,6 +1449,8 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture2))).
andReturn(stackConfigurationResponses2);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
expect(stackConfigurationResponse2.getType()).andReturn("hdfs-site.xml");
expect(stackConfigurationResponse2.getPropertyName()).andReturn("property2");
expect(stackConfigurationResponse2.getPropertyValue()).andReturn("value2");
@@ -1368,6 +1462,10 @@ public class ClusterResourceProviderTest {
expect(stackConfigurationResponse4.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse4.getPropertyName()).andReturn("property3");
expect(stackConfigurationResponse4.getPropertyValue()).andReturn("value3");
+
+ expect(stackConfigurationResponse5.getType()).andReturn("cluster-env.xml").anyTimes();
+ expect(stackConfigurationResponse5.getPropertyName()).andReturn("rqw").anyTimes();
+ expect(stackConfigurationResponse5.getPropertyValue()).andReturn("aaaa").anyTimes();
expect(blueprintConfig.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig.getType()).andReturn("core-site").anyTimes();
@@ -1386,7 +1484,7 @@ public class ClusterResourceProviderTest {
replay(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
- stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,
+ stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,stackConfigurationResponse5,
blueprintConfig, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupConfig,
serviceResourceProvider, componentResourceProvider, hostResourceProvider, hostComponentResourceProvider,
configGroupResourceProvider, persistKeyValue, metaInfo);
@@ -1429,9 +1527,11 @@ public class ClusterResourceProviderTest {
StackConfigurationResponse stackConfigurationResponse5 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse6 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse7 = createNiceMock(StackConfigurationResponse.class);
+ StackConfigurationResponse stackConfigurationResponse8 = createNiceMock(StackConfigurationResponse.class);
Capture<Set<StackServiceComponentRequest>> serviceComponentRequestCapture1 = new Capture<Set<StackServiceComponentRequest>>();
Capture<Set<StackServiceComponentRequest>> serviceComponentRequestCapture2 = new Capture<Set<StackServiceComponentRequest>>();
-
+ Capture<Set<StackLevelConfigurationRequest>> serviceLevelConfigurationRequestCapture1 = new Capture<Set<StackLevelConfigurationRequest>>();
+
StackConfigurationResponse stackConfigurationResponse1 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse2 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse3 = createNiceMock(StackConfigurationResponse.class);
@@ -1468,7 +1568,8 @@ public class ClusterResourceProviderTest {
Capture<Map<String, String>> updateClusterPropertyMapCapture5 = new Capture<Map<String, String>>();
Capture<Set<ClusterRequest>> updateClusterRequestCapture6 = new Capture<Set<ClusterRequest>>();
Capture<Map<String, String>> updateClusterPropertyMapCapture6 = new Capture<Map<String, String>>();
-
+ Capture<Set<ClusterRequest>> updateClusterRequestCapture7 = new Capture<Set<ClusterRequest>>();
+ Capture<Map<String, String>> updateClusterPropertyMapCapture7 = new Capture<Map<String, String>>();
Capture<Request> serviceRequestCapture = new Capture<Request>();
Capture<Request> componentRequestCapture = new Capture<Request>();
@@ -1503,7 +1604,9 @@ public class ClusterResourceProviderTest {
stackConfigurationResponses2.add(stackConfigurationResponse6);
stackConfigurationResponses2.add(stackConfigurationResponse7);
-
+ Set<StackConfigurationResponse> stackConfigurationResponses3 = new LinkedHashSet<StackConfigurationResponse>();
+ stackConfigurationResponses3.add(stackConfigurationResponse8);
+
Collection<HostGroupComponentEntity> hostGroupComponents = new LinkedHashSet<HostGroupComponentEntity>();
hostGroupComponents.add(hostGroupComponent1);
hostGroupComponents.add(hostGroupComponent2);
@@ -1571,6 +1674,9 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture1))).
andReturn(stackConfigurationResponses1);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse1.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse1.getPropertyName()).andReturn("property1");
expect(stackConfigurationResponse1.getPropertyValue()).andReturn("value1");
@@ -1581,6 +1687,8 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture2))).
andReturn(stackConfigurationResponses2);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
expect(stackConfigurationResponse2.getType()).andReturn("hdfs-site.xml");
expect(stackConfigurationResponse2.getPropertyName()).andReturn("property2");
expect(stackConfigurationResponse2.getPropertyValue()).andReturn("value2");
@@ -1604,6 +1712,10 @@ public class ClusterResourceProviderTest {
expect(stackConfigurationResponse7.getType()).andReturn("oozie-env.xml");
expect(stackConfigurationResponse7.getPropertyName()).andReturn("oozie_user");
expect(stackConfigurationResponse7.getPropertyValue()).andReturn("oozie");
+
+ expect(stackConfigurationResponse8.getType()).andReturn("cluster-env.xml").anyTimes();
+ expect(stackConfigurationResponse8.getPropertyName()).andReturn("rqw").anyTimes();
+ expect(stackConfigurationResponse8.getPropertyValue()).andReturn("aaaa").anyTimes();
expect(blueprintConfig.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig.getType()).andReturn("core-site").anyTimes();
@@ -1634,7 +1746,8 @@ public class ClusterResourceProviderTest {
capture(updateClusterPropertyMapCapture5))).andReturn(null);
expect(managementController.updateClusters(capture(updateClusterRequestCapture6),
capture(updateClusterPropertyMapCapture6))).andReturn(null);
-
+ expect(managementController.updateClusters(capture(updateClusterRequestCapture7),
+ capture(updateClusterPropertyMapCapture7))).andReturn(null);
expect(serviceResourceProvider.createResources(capture(serviceRequestCapture))).andReturn(null);
expect(componentResourceProvider.createResources(capture(componentRequestCapture))).andReturn(null);
@@ -1652,7 +1765,7 @@ public class ClusterResourceProviderTest {
replay(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,
- stackConfigurationResponse5, stackConfigurationResponse6, stackConfigurationResponse7,
+ stackConfigurationResponse5, stackConfigurationResponse6, stackConfigurationResponse7, stackConfigurationResponse8,
blueprintConfig, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupConfig,
serviceResourceProvider, componentResourceProvider, hostResourceProvider, hostComponentResourceProvider,
configGroupResourceProvider, persistKeyValue, metaInfo);
@@ -1722,31 +1835,36 @@ public class ClusterResourceProviderTest {
Set<ClusterRequest> updateClusterRequest4 = updateClusterRequestCapture4.getValue();
Set<ClusterRequest> updateClusterRequest5 = updateClusterRequestCapture5.getValue();
Set<ClusterRequest> updateClusterRequest6 = updateClusterRequestCapture6.getValue();
-
+ Set<ClusterRequest> updateClusterRequest7 = updateClusterRequestCapture7.getValue();
+
assertEquals(1, updateClusterRequest1.size());
assertEquals(1, updateClusterRequest2.size());
assertEquals(1, updateClusterRequest3.size());
assertEquals(1, updateClusterRequest4.size());
assertEquals(1, updateClusterRequest5.size());
assertEquals(1, updateClusterRequest6.size());
+ assertEquals(1, updateClusterRequest7.size());
ClusterRequest ucr1 = updateClusterRequest1.iterator().next();
ClusterRequest ucr2 = updateClusterRequest2.iterator().next();
ClusterRequest ucr3 = updateClusterRequest3.iterator().next();
ClusterRequest ucr4 = updateClusterRequest4.iterator().next();
ClusterRequest ucr5 = updateClusterRequest5.iterator().next();
ClusterRequest ucr6 = updateClusterRequest6.iterator().next();
+ ClusterRequest ucr7 = updateClusterRequest7.iterator().next();
assertEquals(clusterName, ucr1.getClusterName());
assertEquals(clusterName, ucr2.getClusterName());
assertEquals(clusterName, ucr3.getClusterName());
assertEquals(clusterName, ucr4.getClusterName());
assertEquals(clusterName, ucr5.getClusterName());
assertEquals(clusterName, ucr6.getClusterName());
+ assertEquals(clusterName, ucr7.getClusterName());
ConfigurationRequest cr1 = ucr1.getDesiredConfig().get(0);
ConfigurationRequest cr2 = ucr2.getDesiredConfig().get(0);
ConfigurationRequest cr3 = ucr3.getDesiredConfig().get(0);
ConfigurationRequest cr4 = ucr4.getDesiredConfig().get(0);
ConfigurationRequest cr5 = ucr5.getDesiredConfig().get(0);
ConfigurationRequest cr6 = ucr6.getDesiredConfig().get(0);
+ ConfigurationRequest cr7 = ucr7.getDesiredConfig().get(0);
assertEquals("1", cr1.getVersionTag());
assertEquals("1", cr2.getVersionTag());
@@ -1754,6 +1872,7 @@ public class ClusterResourceProviderTest {
assertEquals("1", cr4.getVersionTag());
assertEquals("1", cr5.getVersionTag());
assertEquals("1", cr6.getVersionTag());
+ assertEquals("1", cr7.getVersionTag());
Map<String, ConfigurationRequest> mapConfigRequests = new HashMap<String, ConfigurationRequest>();
mapConfigRequests.put(cr1.getType(), cr1);
@@ -1762,7 +1881,9 @@ public class ClusterResourceProviderTest {
mapConfigRequests.put(cr4.getType(), cr4);
mapConfigRequests.put(cr5.getType(), cr5);
mapConfigRequests.put(cr6.getType(), cr6);
- assertEquals(6, mapConfigRequests.size());
+ mapConfigRequests.put(cr7.getType(), cr7);
+ assertEquals(7, mapConfigRequests.size());
+
ConfigurationRequest hdfsConfigRequest = mapConfigRequests.get("hdfs-site");
assertEquals(1, hdfsConfigRequest.getProperties().size());
assertEquals("value2", hdfsConfigRequest.getProperties().get("property2"));
@@ -1862,8 +1983,10 @@ public class ClusterResourceProviderTest {
StackConfigurationResponse stackConfigurationResponse2 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse3 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse4 = createNiceMock(StackConfigurationResponse.class);
+ StackConfigurationResponse stackConfigurationResponse5 = createNiceMock(StackConfigurationResponse.class);
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture1 = new Capture<Set<StackConfigurationRequest>>();
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture2 = new Capture<Set<StackConfigurationRequest>>();
+ Capture<Set<StackLevelConfigurationRequest>> serviceLevelConfigurationRequestCapture1 = new Capture<Set<StackLevelConfigurationRequest>>();
BlueprintConfigEntity blueprintConfig = createNiceMock(BlueprintConfigEntity.class);
@@ -1887,7 +2010,7 @@ public class ClusterResourceProviderTest {
Capture<Map<String, String>> updateClusterPropertyMapCapture2 = new Capture<Map<String, String>>();
Capture<Set<ClusterRequest>> updateClusterRequestCapture3 = new Capture<Set<ClusterRequest>>();
Capture<Map<String, String>> updateClusterPropertyMapCapture3 = new Capture<Map<String, String>>();
-
+
Capture<Request> serviceRequestCapture = new Capture<Request>();
Capture<Request> componentRequestCapture = new Capture<Request>();
Capture<Request> componentRequestCapture2 = new Capture<Request>();
@@ -1917,6 +2040,9 @@ public class ClusterResourceProviderTest {
stackConfigurationResponses2.add(stackConfigurationResponse2);
stackConfigurationResponses2.add(stackConfigurationResponse3);
stackConfigurationResponses2.add(stackConfigurationResponse4);
+
+ Set<StackConfigurationResponse> stackConfigurationResponses3 = new LinkedHashSet<StackConfigurationResponse>();
+ stackConfigurationResponses3.add(stackConfigurationResponse5);
Collection<HostGroupComponentEntity> hostGroupComponents = new LinkedHashSet<HostGroupComponentEntity>();
hostGroupComponents.add(hostGroupComponent1);
@@ -1981,6 +2107,8 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture1))).
andReturn(stackConfigurationResponses1);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
expect(stackConfigurationResponse1.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse1.getPropertyName()).andReturn("property1");
expect(stackConfigurationResponse1.getPropertyValue()).andReturn("value1");
@@ -1991,6 +2119,8 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture2))).
andReturn(stackConfigurationResponses2);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
expect(stackConfigurationResponse2.getType()).andReturn("hdfs-site.xml");
expect(stackConfigurationResponse2.getPropertyName()).andReturn("property2");
expect(stackConfigurationResponse2.getPropertyValue()).andReturn("value2");
@@ -2002,6 +2132,11 @@ public class ClusterResourceProviderTest {
expect(stackConfigurationResponse4.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse4.getPropertyName()).andReturn("property3");
expect(stackConfigurationResponse4.getPropertyValue()).andReturn("value3");
+
+ expect(stackConfigurationResponse5.getType()).andReturn("cluster-env.xml").anyTimes();
+ expect(stackConfigurationResponse5.getPropertyName()).andReturn("rqw").anyTimes();
+ expect(stackConfigurationResponse5.getPropertyValue()).andReturn("aaaa").anyTimes();
+
expect(blueprintConfig.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig.getType()).andReturn("core-site").anyTimes();
@@ -2040,7 +2175,7 @@ public class ClusterResourceProviderTest {
replay(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
- stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,
+ stackConfigurationResponse1, stackConfigurationResponse2, stackConfigurationResponse3, stackConfigurationResponse4,stackConfigurationResponse5,
blueprintConfig, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupConfig,
serviceResourceProvider, componentResourceProvider, hostResourceProvider, hostComponentResourceProvider,
configGroupResourceProvider, metaInfo);
@@ -2092,8 +2227,10 @@ public class ClusterResourceProviderTest {
StackConfigurationResponse stackConfigurationResponse6 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse7 = createNiceMock(StackConfigurationResponse.class);
StackConfigurationResponse stackConfigurationResponse8 = createNiceMock(StackConfigurationResponse.class);
+ StackConfigurationResponse stackConfigurationResponse9 = createNiceMock(StackConfigurationResponse.class);
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture1 = new Capture<Set<StackConfigurationRequest>>();
Capture<Set<StackConfigurationRequest>> serviceConfigurationRequestCapture2 = new Capture<Set<StackConfigurationRequest>>();
+ Capture<Set<StackLevelConfigurationRequest>> serviceLevelConfigurationRequestCapture1 = new Capture<Set<StackLevelConfigurationRequest>>();
Map<String, String> coreSiteAttributes = new HashMap<String, String>();
coreSiteAttributes.put("final", "true");
@@ -2133,7 +2270,8 @@ public class ClusterResourceProviderTest {
Capture<Map<String, String>> updateClusterPropertyMapCapture6 = new Capture<Map<String, String>>();
Capture<Set<ClusterRequest>> updateClusterRequestCapture7 = new Capture<Set<ClusterRequest>>();
Capture<Map<String, String>> updateClusterPropertyMapCapture7 = new Capture<Map<String, String>>();
-
+ Capture<Set<ClusterRequest>> updateClusterRequestCapture8 = new Capture<Set<ClusterRequest>>();
+ Capture<Map<String, String>> updateClusterPropertyMapCapture8 = new Capture<Map<String, String>>();
Capture<Request> serviceRequestCapture = new Capture<Request>();
Capture<Request> componentRequestCapture = new Capture<Request>();
@@ -2169,6 +2307,9 @@ public class ClusterResourceProviderTest {
stackConfigurationResponses2.add(stackConfigurationResponse6);
stackConfigurationResponses2.add(stackConfigurationResponse7);
stackConfigurationResponses2.add(stackConfigurationResponse8);
+
+ Set<StackConfigurationResponse> stackConfigurationResponses3 = new LinkedHashSet<StackConfigurationResponse>();
+ stackConfigurationResponses3.add(stackConfigurationResponse9);
Collection<HostGroupComponentEntity> hostGroupComponents = new LinkedHashSet<HostGroupComponentEntity>();
hostGroupComponents.add(hostGroupComponent1);
@@ -2252,6 +2393,9 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture1))).
andReturn(stackConfigurationResponses1);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
+
expect(stackConfigurationResponse1.getType()).andReturn("core-site.xml");
expect(stackConfigurationResponse1.getPropertyName()).andReturn("property1");
expect(stackConfigurationResponse1.getPropertyValue()).andReturn("value1");
@@ -2263,6 +2407,8 @@ public class ClusterResourceProviderTest {
expect(managementController.getStackConfigurations(capture(serviceConfigurationRequestCapture2))).
andReturn(stackConfigurationResponses2);
+ expect(managementController.getStackLevelConfigurations(capture(serviceLevelConfigurationRequestCapture1))).
+ andReturn(stackConfigurationResponses3);
expect(stackConfigurationResponse2.getType()).andReturn("hdfs-site.xml");
expect(stackConfigurationResponse2.getPropertyName()).andReturn("property2");
expect(stackConfigurationResponse2.getPropertyValue()).andReturn("value2");
@@ -2291,8 +2437,10 @@ public class ClusterResourceProviderTest {
expect(stackConfigurationResponse8.getType()).andReturn("hive-env.xml");
expect(stackConfigurationResponse8.getPropertyName()).andReturn("property3");
expect(stackConfigurationResponse8.getPropertyValue()).andReturn("value3");
-
-
+
+ expect(stackConfigurationResponse9.getType()).andReturn("cluster-env.xml").anyTimes();
+ expect(stackConfigurationResponse9.getPropertyName()).andReturn("rqw").anyTimes();
+ expect(stackConfigurationResponse9.getPropertyValue()).andReturn("aaaa").anyTimes();
expect(blueprintConfig.getBlueprintName()).andReturn("test-blueprint").anyTimes();
expect(blueprintConfig.getType()).andReturn("core-site").anyTimes();
@@ -2331,6 +2479,8 @@ public class ClusterResourceProviderTest {
capture(updateClusterPropertyMapCapture6))).andReturn(null);
expect(managementController.updateClusters(capture(updateClusterRequestCapture7),
capture(updateClusterPropertyMapCapture7))).andReturn(null);
+ expect(managementController.updateClusters(capture(updateClusterRequestCapture8),
+ capture(updateClusterPropertyMapCapture8))).andReturn(null);
expect(serviceResourceProvider.createResources(capture(serviceRequestCapture))).andReturn(null);
@@ -2349,7 +2499,8 @@ public class ClusterResourceProviderTest {
replay(blueprintDAO, managementController, request, response, blueprint, stackServiceResponse1, stackServiceResponse2,
stackServiceComponentResponse1, stackServiceComponentResponse2, stackServiceComponentResponse3,
stackServiceComponentResponse4, stackConfigurationResponse1, stackConfigurationResponse2,
- stackConfigurationResponse3, stackConfigurationResponse4, stackConfigurationResponse5, stackConfigurationResponse6, stackConfigurationResponse7, stackConfigurationResponse8, blueprintConfig,
+ stackConfigurationResponse3, stackConfigurationResponse4, stackConfigurationResponse5, stackConfigurationResponse6,
+ stackConfigurationResponse7, stackConfigurationResponse8, stackConfigurationResponse9, blueprintConfig,
blueprintConfig2, hostGroup, hostGroupComponent1, hostGroupComponent2, hostGroupComponent3, hostGroupComponent4,
hostGroupConfig, serviceResourceProvider, componentResourceProvider, hostResourceProvider,
hostComponentResourceProvider, configGroupResourceProvider, persistKeyValue, metaInfo);
@@ -2420,6 +2571,7 @@ public class ClusterResourceProviderTest {
Set<ClusterRequest> updateClusterRequest5 = updateClusterRequestCapture5.getValue();
Set<ClusterRequest> updateClusterRequest6 = updateClusterRequestCapture6.getValue();
Set<ClusterRequest> updateClusterRequest7 = updateClusterRequestCapture7.getValue();
+ Set<ClusterRequest> updateClusterRequest8 = updateClusterRequestCapture8.getValue();
assertEquals(1, updateClusterRequest1.size());
assertEquals(1, updateClusterRequest2.size());
assertEquals(1, updateClusterRequest3.size());
@@ -2427,6 +2579,7 @@ public class ClusterResourceProviderTest {
assertEquals(1, updateClusterRequest5.size());
assertEquals(1, updateClusterRequest6.size());
assertEquals(1, updateClusterRequest7.size());
+ assertEquals(1, updateClusterRequest8.size());
ClusterRequest ucr1 = updateClusterRequest1.iterator().next();
ClusterRequest ucr2 = updateClusterRequest2.iterator().next();
ClusterRequest ucr3 = updateClusterRequest3.iterator().next();
@@ -2434,6 +2587,7 @@ public class ClusterResourceProviderTest {
ClusterRequest ucr5 = updateClusterRequest5.iterator().next();
ClusterRequest ucr6 = updateClusterRequest6.iterator().next();
ClusterRequest ucr7 = updateClusterRequest7.iterator().next();
+ ClusterRequest ucr8 = updateClusterRequest8.iterator().next();
assertEquals(clusterName, ucr1.getClusterName());
assertEquals(clusterName, ucr2.getClusterName());
assertEquals(clusterName, ucr3.getClusterName());
@@ -2441,6 +2595,7 @@ public class ClusterResourceProviderTest {
assertEquals(clusterName, ucr5.getClusterName());
assertEquals(clusterName, ucr6.getClusterName());
assertEquals(clusterName, ucr7.getClusterName());
+ assertEquals(clusterName, ucr8.getClusterName());
ConfigurationRequest cr1 = ucr1.getDesiredConfig().get(0);
ConfigurationRequest cr2 = ucr2.getDesiredConfig().get(0);
ConfigurationRequest cr3 = ucr3.getDesiredConfig().get(0);
@@ -2448,6 +2603,7 @@ public class ClusterResourceProviderTest {
ConfigurationRequest cr5 = ucr5.getDesiredConfig().get(0);
ConfigurationRequest cr6 = ucr6.getDesiredConfig().get(0);
ConfigurationRequest cr7 = ucr7.getDesiredConfig().get(0);
+ ConfigurationRequest cr8 = ucr8.getDesiredConfig().get(0);
assertEquals("1", cr1.getVersionTag());
assertEquals("1", cr2.getVersionTag());
assertEquals("1", cr3.getVersionTag());
@@ -2455,6 +2611,7 @@ public class ClusterResourceProviderTest {
assertEquals("1", cr5.getVersionTag());
assertEquals("1", cr6.getVersionTag());
assertEquals("1", cr7.getVersionTag());
+ assertEquals("1", cr8.getVersionTag());
Map<String, ConfigurationRequest> mapConfigRequests = new HashMap<String, ConfigurationRequest>();
mapConfigRequests.put(cr1.getType(), cr1);
mapConfigRequests.put(cr2.getType(), cr2);
@@ -2463,7 +2620,8 @@ public class ClusterResourceProviderTest {
mapConfigRequests.put(cr5.getType(), cr5);
mapConfigRequests.put(cr6.getType(), cr6);
mapConfigRequests.put(cr7.getType(), cr7);
- assertEquals(7, mapConfigRequests.size());
+ mapConfigRequests.put(cr8.getType(), cr8);
+ assertEquals(8, mapConfigRequests.size());
ConfigurationRequest hiveEnvConfigRequest = mapConfigRequests.get("hive-env");
assertEquals("New MySQL Database", hiveEnvConfigRequest.getProperties().get("hive_database"));
assertNotNull(hiveEnvConfigRequest.getPropertiesAttributes());
@@ -2888,6 +3046,7 @@ public class ClusterResourceProviderTest {
expect(mockManagementController.getStackServices(isA(Set.class))).andReturn(Collections.singleton(mockStackServiceResponseOne));
expect(mockManagementController.getStackComponents(isA(Set.class))).andReturn(Collections.singleton(mockStackComponentResponse));
expect(mockManagementController.getStackConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
+ expect(mockManagementController.getStackLevelConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
expect(mockAmbariMetaInfo.getComponentDependencies("HDP", "2.1", "OOZIE", "OOZIE_SERVER")).andReturn(Collections.<DependencyInfo>emptyList());
@@ -2970,7 +3129,8 @@ public class ClusterResourceProviderTest {
expect(mockManagementController.getStackServices(isA(Set.class))).andReturn(Collections.singleton(mockStackServiceResponseOne));
expect(mockManagementController.getStackComponents(isA(Set.class))).andReturn(Collections.singleton(mockStackComponentResponse));
expect(mockManagementController.getStackConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
-
+ expect(mockManagementController.getStackLevelConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
+
expect(mockAmbariMetaInfo.getComponentDependencies("HDP", "2.1", "FALCON", "FALCON_SERVER")).andReturn(Collections.<DependencyInfo>emptyList());
mockSupport.replayAll();
@@ -3050,7 +3210,8 @@ public class ClusterResourceProviderTest {
expect(mockManagementController.getStackServices(isA(Set.class))).andReturn(Collections.singleton(mockStackServiceResponseOne));
expect(mockManagementController.getStackComponents(isA(Set.class))).andReturn(Collections.singleton(mockStackComponentResponse));
expect(mockManagementController.getStackConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
-
+ expect(mockManagementController.getStackLevelConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
+
expect(mockAmbariMetaInfo.getComponentDependencies("HDP", "2.1", "OOZIE", "OOZIE_SERVER")).andReturn(Collections.<DependencyInfo>emptyList());
mockSupport.replayAll();
@@ -3126,7 +3287,8 @@ public class ClusterResourceProviderTest {
expect(mockManagementController.getStackServices(isA(Set.class))).andReturn(Collections.singleton(mockStackServiceResponseOne));
expect(mockManagementController.getStackComponents(isA(Set.class))).andReturn(Collections.singleton(mockStackComponentResponse));
expect(mockManagementController.getStackConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
-
+ expect(mockManagementController.getStackLevelConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
+
expect(mockAmbariMetaInfo.getComponentDependencies("HDP", "2.1", "FALCON", "FALCON_SERVER")).andReturn(Collections.<DependencyInfo>emptyList());
mockSupport.replayAll();
@@ -3201,7 +3363,8 @@ public class ClusterResourceProviderTest {
expect(mockManagementController.getStackServices(isA(Set.class))).andReturn(Collections.singleton(mockStackServiceResponseOne));
expect(mockManagementController.getStackComponents(isA(Set.class))).andReturn(Collections.singleton(mockStackComponentResponse));
expect(mockManagementController.getStackConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
-
+ expect(mockManagementController.getStackLevelConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
+
expect(mockAmbariMetaInfo.getComponentDependencies("HDP", "2.1", "HIVE", "HIVE_SERVER")).andReturn(Collections.<DependencyInfo>emptyList());
mockSupport.replayAll();
@@ -3276,7 +3439,8 @@ public class ClusterResourceProviderTest {
expect(mockManagementController.getStackServices(isA(Set.class))).andReturn(Collections.singleton(mockStackServiceResponseOne));
expect(mockManagementController.getStackComponents(isA(Set.class))).andReturn(Collections.singleton(mockStackComponentResponse));
expect(mockManagementController.getStackConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
-
+ expect(mockManagementController.getStackLevelConfigurations(isA(Set.class))).andReturn(Collections.<StackConfigurationResponse>emptySet());
+
expect(mockAmbariMetaInfo.getComponentDependencies("HDP", "2.1", "HBASE", "HBASE_SERVER")).andReturn(Collections.<DependencyInfo>emptyList());
mockSupport.replayAll();
[04/26] git commit: AMBARI-7237. No start action for stopped service
in MM mode Stack 1.3 (dlysnichenko)
Posted by jo...@apache.org.
AMBARI-7237. No start action for stopped service in MM mode Stack 1.3 (dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dcc00b69
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dcc00b69
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dcc00b69
Branch: refs/heads/branch-alerts-dev
Commit: dcc00b69b3350729123cbf43dd80cf0da314bae6
Parents: dc15b77
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Tue Sep 9 16:50:18 2014 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Wed Sep 10 18:27:21 2014 +0300
----------------------------------------------------------------------
.../internal/ServiceResourceProvider.java | 14 ++-
.../internal/ServiceResourceProviderTest.java | 122 ++++++++++++++++++-
2 files changed, 133 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc00b69/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index aec91fd..31c6c37 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@ -981,11 +981,13 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
State masterState = null;
State clientState = null;
State otherState = null;
+ State maxMMState = null; // The worst state among components in MM
boolean hasDisabled = false;
boolean hasMaster = false;
boolean hasOther = false;
boolean hasClient = false;
+ boolean hasMM = false;
for (ServiceComponentHostResponse hostComponentResponse : hostComponentResponses ) {
ComponentInfo componentInfo = ambariMetaInfo.getComponentCategory(stackId.getStackName(),
@@ -999,10 +1001,17 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
boolean isInMaintenance = ! MaintenanceState.OFF.toString().
equals(hostComponentResponse.getMaintenanceState());
- if (state.equals(State.DISABLED) || isInMaintenance) {
+ if (state.equals(State.DISABLED)) {
hasDisabled = true;
}
+ if (isInMaintenance & !componentInfo.isClient()) {
+ hasMM = true;
+ if ( maxMMState == null || state.ordinal() > maxMMState.ordinal()) {
+ maxMMState = state;
+ }
+ }
+
if (componentInfo.isMaster()) {
if (state.equals(State.STARTED) || ! isInMaintenance) {
// We rely on master's state to determine service state
@@ -1037,7 +1046,8 @@ public class ServiceResourceProvider extends AbstractControllerResourceProvider
return hasMaster ? masterState == null ? State.STARTED : masterState :
hasOther ? otherState == null ? State.STARTED : otherState :
hasClient ? clientState == null ? State.INSTALLED : clientState :
- hasDisabled ? State.DISABLED : State.UNKNOWN;
+ hasDisabled ? State.DISABLED :
+ hasMM ? maxMMState : State.UNKNOWN;
}
} catch (AmbariException e) {
LOG.error("Can't determine service state.", e);
http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc00b69/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
index 7dbc38b..05f2e01 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
@@ -28,6 +28,7 @@ import static org.easymock.EasyMock.eq;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.isNull;
import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
import static org.easymock.EasyMock.verify;
import java.lang.reflect.Field;
@@ -1149,6 +1150,7 @@ public class ServiceResourceProviderTest {
ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "PIG", "PIG", "Host100", "INSTALLED", "", null, null, null);
+ shr1.setMaintenanceState(MaintenanceState.OFF.toString());
Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
responses.add(shr1);
@@ -1191,6 +1193,7 @@ public class ServiceResourceProviderTest {
ComponentInfo componentInfo = createNiceMock(ComponentInfo.class);
ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "PIG", "PIG", "Host100", "INSTALL_FAILED", "", null, null, null);
+ shr1.setMaintenanceState(MaintenanceState.OFF.toString());
Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
responses.add(shr1);
@@ -1316,7 +1319,13 @@ public class ServiceResourceProviderTest {
expect(ambariMetaInfo.getComponentCategory((String) anyObject(), (String) anyObject(),
(String) anyObject(), (String) anyObject())).andReturn(componentInfo).anyTimes();
- expect(componentInfo.isMaster()).andReturn(true).times(2);
+ expect(componentInfo.isClient()).andReturn(false).anyTimes();
+ expect(componentInfo.isMaster()).andReturn(true);
+
+ expect(componentInfo.isClient()).andReturn(false).anyTimes();
+ expect(componentInfo.isMaster()).andReturn(true);
+
+ expect(componentInfo.isClient()).andReturn(false).anyTimes();
expect(componentInfo.isMaster()).andReturn(false);
expect(componentInfo.isClient()).andReturn(false);
@@ -1383,6 +1392,117 @@ public class ServiceResourceProviderTest {
}
+ @Test
+ @SuppressWarnings("unchecked")
+ /**
+ * Tests the case when all service components are in MM (so we base on MM
+ * components state when calculating entire service state)
+ */
+ public void testDefaultServiceState_All_Components_In_MM() throws Exception{
+ AmbariManagementController managementController = createMock(AmbariManagementController.class);
+ Clusters clusters = createNiceMock(Clusters.class);
+ Cluster cluster = createNiceMock(Cluster.class);
+ AmbariMetaInfo ambariMetaInfo = createNiceMock(AmbariMetaInfo.class);
+ StackId stackId = createNiceMock(StackId.class);
+ ComponentInfo componentInfo = createStrictMock(ComponentInfo.class);
+
+ /*
+ * Any component is started, all other are stopped - service is considered STARTED
+ */
+ ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("C1", "YARN", "RESOURCEMANAGER", "Host100", "INSTALLED", "", null, null, null);
+ shr1.setMaintenanceState(MaintenanceState.ON.toString());
+ ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("C1", "YARN", "RESOURCEMANAGER", "Host101", "INSTALLED", "", null, null, null);
+ shr2.setMaintenanceState(MaintenanceState.ON.toString());
+ ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("C1", "YARN", "NODEMANAGER", "Host100", "STARTED", "", null, null, null);
+ shr3.setMaintenanceState(MaintenanceState.ON.toString());
+ ServiceComponentHostResponse shr4 = new ServiceComponentHostResponse("C1", "YARN", "YARN_CLIENT", "Host100", "INSTALLED", "", null, null, null);
+ shr4.setMaintenanceState(MaintenanceState.ON.toString());
+
+
+ Set<ServiceComponentHostResponse> responses = new LinkedHashSet<ServiceComponentHostResponse>();
+ responses.add(shr1);
+ responses.add(shr2);
+ responses.add(shr3);
+ responses.add(shr4);
+
+ // set expectations
+ expect(managementController.getAmbariMetaInfo()).andReturn(ambariMetaInfo).anyTimes();
+ expect(managementController.getClusters()).andReturn(clusters).anyTimes();
+ expect(clusters.getCluster("C1")).andReturn(cluster).anyTimes();
+ expect(managementController.getHostComponents((Set<ServiceComponentHostRequest>) anyObject())).andReturn(responses).anyTimes();
+ expect(cluster.getDesiredStackVersion()).andReturn(stackId).anyTimes();
+
+ expect(stackId.getStackName()).andReturn("S1").anyTimes();
+ expect(stackId.getStackVersion()).andReturn("V1").anyTimes();
+
+
+ expect(ambariMetaInfo.getComponentCategory((String) anyObject(), (String) anyObject(),
+ (String) anyObject(), (String) anyObject())).andReturn(componentInfo).anyTimes();
+
+ expect(componentInfo.isClient()).andReturn(false);
+ expect(componentInfo.isMaster()).andReturn(true);
+
+ expect(componentInfo.isClient()).andReturn(false);
+ expect(componentInfo.isMaster()).andReturn(true);
+
+ expect(componentInfo.isClient()).andReturn(false);
+ expect(componentInfo.isMaster()).andReturn(false);
+ expect(componentInfo.isClient()).andReturn(false);
+
+ expect(componentInfo.isClient()).andReturn(true);
+ expect(componentInfo.isMaster()).andReturn(false);
+
+ expect(componentInfo.isClient()).andReturn(true).times(2);
+
+ // replay
+ replay(managementController, clusters, cluster, ambariMetaInfo, stackId, componentInfo);
+
+ ServiceResourceProvider.ServiceState serviceState = new ServiceResourceProvider.DefaultServiceState();
+
+ State state = serviceState.getState(managementController, "C1", "YARN");
+ Assert.assertEquals(State.STARTED, state);
+
+ /*
+ * All components are stopped, service is considered INSTALLED
+ */
+ reset(componentInfo);
+
+ responses.clear();
+ shr1 = new ServiceComponentHostResponse("C1", "YARN", "RESOURCEMANAGER", "Host100", "INSTALLED", "", null, null, null);
+ shr1.setMaintenanceState(MaintenanceState.ON.toString());
+ shr2 = new ServiceComponentHostResponse("C1", "YARN", "RESOURCEMANAGER", "Host101", "INSTALLED", "", null, null, null);
+ shr2.setMaintenanceState(MaintenanceState.ON.toString());
+ shr3 = new ServiceComponentHostResponse("C1", "YARN", "NODEMANAGER", "Host100", "INSTALLED", "", null, null, null);
+ shr3.setMaintenanceState(MaintenanceState.ON.toString());
+ shr4 = new ServiceComponentHostResponse("C1", "YARN", "YARN_CLIENT", "Host100", "INSTALLED", "", null, null, null);
+ shr4.setMaintenanceState(MaintenanceState.ON.toString());
+ responses.add(shr1);
+ responses.add(shr2);
+ responses.add(shr3);
+ responses.add(shr4);
+
+ expect(componentInfo.isClient()).andReturn(false);
+ expect(componentInfo.isMaster()).andReturn(true);
+
+ expect(componentInfo.isClient()).andReturn(false);
+ expect(componentInfo.isMaster()).andReturn(true);
+
+ expect(componentInfo.isClient()).andReturn(false);
+ expect(componentInfo.isMaster()).andReturn(false);
+ expect(componentInfo.isClient()).andReturn(false);
+
+ expect(componentInfo.isClient()).andReturn(true);
+ expect(componentInfo.isMaster()).andReturn(false);
+
+ expect(componentInfo.isClient()).andReturn(true).times(2);
+
+ replay(componentInfo);
+
+ state = serviceState.getState(managementController, "C1", "YARN");
+ Assert.assertEquals(State.INSTALLED, state);
+ }
+
+
/**
* This factory method creates default MaintenanceStateHelper mock.
* It's useful in most cases (when we don't care about Maintenance State)
[03/26] git commit: AMBARI-7211 - Views : support for a
property
Posted by jo...@apache.org.
AMBARI-7211 - Views : support for a <system> property
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dc15b770
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dc15b770
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dc15b770
Branch: refs/heads/branch-alerts-dev
Commit: dc15b7706294371444c455f40f2792d8fea4c0bc
Parents: 1ef2af3
Author: tbeerbower <tb...@hortonworks.com>
Authored: Tue Sep 9 13:55:18 2014 -0400
Committer: tbeerbower <tb...@hortonworks.com>
Committed: Wed Sep 10 11:02:03 2014 -0400
----------------------------------------------------------------------
.../AmbariPrivilegeResourceProvider.java | 8 ++++--
.../internal/ViewVersionResourceProvider.java | 3 ++
.../ambari/server/orm/entities/ViewEntity.java | 29 +++++++++++++++++++-
.../server/upgrade/UpgradeCatalog170.java | 2 ++
.../server/view/configuration/ViewConfig.java | 14 ++++++++++
.../main/resources/Ambari-DDL-MySQL-CREATE.sql | 2 +-
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 2 +-
.../resources/Ambari-DDL-Postgres-CREATE.sql | 2 +-
.../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql | 2 +-
.../AmbariPrivilegeResourceProviderTest.java | 1 +
.../server/orm/entities/ViewEntityTest.java | 11 ++++++++
.../server/upgrade/UpgradeCatalog170Test.java | 20 +++++++++++---
.../view/configuration/ViewConfigTest.java | 23 ++++++++++++++++
13 files changed, 107 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProvider.java
index d7c6a8f..85e5906 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProvider.java
@@ -122,11 +122,13 @@ public class AmbariPrivilegeResourceProvider extends PrivilegeResourceProvider<O
resourceEntities.put(clusterEntity.getResource().getId(), clusterEntity);
}
}
- //add view entites
+ //add view entities
ViewRegistry viewRegistry = ViewRegistry.getInstance();
for (ViewEntity viewEntity : viewRegistry.getDefinitions()) {
- for (ViewInstanceEntity viewInstanceEntity : viewEntity.getInstances()) {
- resourceEntities.put(viewInstanceEntity.getResource().getId(), viewInstanceEntity);
+ if (viewEntity.isLoaded()) {
+ for (ViewInstanceEntity viewInstanceEntity : viewEntity.getInstances()) {
+ resourceEntities.put(viewInstanceEntity.getResource().getId(), viewInstanceEntity);
+ }
}
}
return resourceEntities;
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewVersionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewVersionResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewVersionResourceProvider.java
index ed9f06a..58cf774 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewVersionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewVersionResourceProvider.java
@@ -54,6 +54,7 @@ public class ViewVersionResourceProvider extends AbstractResourceProvider {
public static final String MASKER_CLASS_PROPERTY_ID = "ViewVersionInfo/masker_class";
public static final String VIEW_STATUS_PROPERTY_ID = "ViewVersionInfo/status";
public static final String VIEW_STATUS_DETAIL_PROPERTY_ID = "ViewVersionInfo/status_detail";
+ public static final String SYSTEM_PROPERTY_ID = "ViewVersionInfo/system";
/**
* The key property ids for a view resource.
@@ -79,6 +80,7 @@ public class ViewVersionResourceProvider extends AbstractResourceProvider {
propertyIds.add(MASKER_CLASS_PROPERTY_ID);
propertyIds.add(VIEW_STATUS_PROPERTY_ID);
propertyIds.add(VIEW_STATUS_DETAIL_PROPERTY_ID);
+ propertyIds.add(SYSTEM_PROPERTY_ID);
}
@@ -135,6 +137,7 @@ public class ViewVersionResourceProvider extends AbstractResourceProvider {
setResourceProperty(resource, MASKER_CLASS_PROPERTY_ID, viewDefinition.getMask(), requestedIds);
setResourceProperty(resource, VIEW_STATUS_PROPERTY_ID, viewDefinition.getStatus().toString(), requestedIds);
setResourceProperty(resource, VIEW_STATUS_DETAIL_PROPERTY_ID, viewDefinition.getStatusDetail(), requestedIds);
+ setResourceProperty(resource, SYSTEM_PROPERTY_ID, viewDefinition.isSystem(), requestedIds);
resources.add(resource);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewEntity.java
index 073451d..b6ec922 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewEntity.java
@@ -112,8 +112,15 @@ public class ViewEntity implements ViewDefinition {
private String mask;
/**
- * The list of view parameters.
+ * Indicates whether or not this is a system view.
*/
+ @Column(name = "system_view")
+ @Basic
+ private Integer system;
+
+ /**
+ * The list of view parameters.
+ */
@OneToMany(cascade = CascadeType.ALL, mappedBy = "view")
private Collection<ViewParameterEntity> parameters = new HashSet<ViewParameterEntity>();
@@ -226,6 +233,7 @@ public class ViewEntity implements ViewDefinition {
this.ambariConfiguration = null;
this.archive = null;
this.externalResourceType = null;
+ this.system = 0;
}
/**
@@ -251,6 +259,7 @@ public class ViewEntity implements ViewDefinition {
this.mask = configuration.getMasker();
this.icon = configuration.getIcon();
this.icon64 = configuration.getIcon64();
+ this.system = configuration.isSystem() ? 1 : 0;
this.externalResourceType =
new Resource.Type(getQualifiedResourceTypeName(ResourceConfig.EXTERNAL_RESOURCE_PLURAL_NAME));
@@ -714,6 +723,24 @@ public class ViewEntity implements ViewDefinition {
}
/**
+ * Determine whether or not the view is a system view.
+ *
+ * @return true if the view is a system view
+ */
+ public boolean isSystem() {
+ return system == 1;
+ }
+
+ /**
+ * Set the flag which indicates whether or not the view is a system view.
+ *
+ * @param required the system flag; true if the view is a system view
+ */
+ public void setSystem(boolean required) {
+ this.system = required ? 1 : 0;
+ }
+
+ /**
* Get the admin resource type entity.
*
* @return the resource type entity
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index 801249f..ee67330 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -231,6 +231,8 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
// Add columns
dbAccessor.addColumn("viewmain", new DBColumnInfo("mask",
String.class, 255, null, true));
+ dbAccessor.addColumn("viewmain", new DBColumnInfo("system_view",
+ Character.class, 1, null, true));
dbAccessor.addColumn("viewparameter", new DBColumnInfo("masked",
Character.class, 1, null, true));
dbAccessor.addColumn("users", new DBColumnInfo("active",
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java
index 816c178..3a23ea7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/configuration/ViewConfig.java
@@ -68,6 +68,11 @@ public class ViewConfig {
private String icon64;
/**
+ * Indicates whether or not this is a system view.
+ */
+ private boolean system;
+
+ /**
* The main view class name.
*/
@XmlElement(name="view-class")
@@ -174,6 +179,15 @@ public class ViewConfig {
}
/**
+ * Determine whether or not this is a system view.
+ *
+ * @return true if this is a system view
+ */
+ public boolean isSystem() {
+ return system;
+ }
+
+ /**
* Get the view class name.
*
* @return the view class name
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index 59d972e..356ef0c 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -65,7 +65,7 @@ CREATE TABLE hostgroup (blueprint_name VARCHAR(255) NOT NULL, name VARCHAR(255)
CREATE TABLE hostgroup_component (blueprint_name VARCHAR(255) NOT NULL, hostgroup_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(blueprint_name, hostgroup_name, name));
CREATE TABLE blueprint_configuration (blueprint_name VARCHAR(255) NOT NULL, type_name VARCHAR(255) NOT NULL, config_data VARCHAR(32000) NOT NULL, config_attributes VARCHAR(32000), PRIMARY KEY(blueprint_name, type_name));
CREATE TABLE hostgroup_configuration (blueprint_name VARCHAR(255) NOT NULL, hostgroup_name VARCHAR(255) NOT NULL, type_name VARCHAR(255) NOT NULL, config_data TEXT NOT NULL, config_attributes TEXT, PRIMARY KEY(blueprint_name, hostgroup_name, type_name));
-CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), PRIMARY KEY(view_name));
+CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
CREATE TABLE viewinstancedata (view_instance_id BIGINT, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, user_name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(VIEW_INSTANCE_ID, NAME, USER_NAME));
CREATE TABLE viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
CREATE TABLE viewinstanceproperty (view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_name, view_instance_name, name));
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index 52ca857..ecaf220 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -56,7 +56,7 @@ CREATE TABLE hostgroup (blueprint_name VARCHAR2(255) NOT NULL, name VARCHAR2(255
CREATE TABLE hostgroup_component (blueprint_name VARCHAR2(255) NOT NULL, hostgroup_name VARCHAR2(255) NOT NULL, name VARCHAR2(255) NOT NULL, PRIMARY KEY(blueprint_name, hostgroup_name, name));
CREATE TABLE blueprint_configuration (blueprint_name VARCHAR2(255) NOT NULL, type_name VARCHAR2(255) NOT NULL, config_data CLOB NOT NULL, config_attributes CLOB, PRIMARY KEY(blueprint_name, type_name));
CREATE TABLE hostgroup_configuration (blueprint_name VARCHAR2(255) NOT NULL, hostgroup_name VARCHAR2(255) NOT NULL, type_name VARCHAR2(255) NOT NULL, config_data CLOB NOT NULL, config_attributes CLOB, PRIMARY KEY(blueprint_name, hostgroup_name, type_name));
-CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id NUMBER(10) NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), PRIMARY KEY(view_name));
+CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id NUMBER(10) NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view NUMBER(1) DEFAULT 0 NOT NULL, PRIMARY KEY(view_name));
CREATE TABLE viewinstancedata (view_instance_id NUMBER(19), view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, user_name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_instance_id, name, user_name));
CREATE TABLE viewinstance (view_instance_id NUMBER(19), resource_id NUMBER(19) NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
CREATE TABLE viewinstanceproperty (view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_name, view_instance_name, name));
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 39d3ecf..f0ac53a 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -91,7 +91,7 @@ CREATE TABLE hostgroup_component (blueprint_name VARCHAR(255) NOT NULL, hostgrou
CREATE TABLE blueprint_configuration (blueprint_name varchar(255) NOT NULL, type_name varchar(255) NOT NULL, config_data varchar(32000) NOT NULL , config_attributes varchar(32000), PRIMARY KEY(blueprint_name, type_name));
CREATE TABLE hostgroup_configuration (blueprint_name VARCHAR(255) NOT NULL, hostgroup_name VARCHAR(255) NOT NULL, type_name VARCHAR(255) NOT NULL, config_data TEXT NOT NULL, config_attributes varchar(32000), PRIMARY KEY(blueprint_name, hostgroup_name, type_name));
-CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), PRIMARY KEY(view_name));
+CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
CREATE TABLE viewinstancedata (view_instance_id BIGINT, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, user_name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_instance_id, name, user_name));
CREATE TABLE viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
CREATE TABLE viewinstanceproperty (view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_name, view_instance_name, name));
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
index 196d298..6e82ae1 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
@@ -141,7 +141,7 @@ GRANT ALL PRIVILEGES ON TABLE ambari.hostgroup_component TO :username;
GRANT ALL PRIVILEGES ON TABLE ambari.blueprint_configuration TO :username;
GRANT ALL PRIVILEGES ON TABLE ambari.hostgroup_configuration TO :username;
-CREATE TABLE ambari.viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), PRIMARY KEY(view_name));
+CREATE TABLE ambari.viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
CREATE TABLE ambari.viewinstancedata (view_instance_id BIGINT, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, user_name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_instance_id, name, user_name));
CREATE TABLE ambari.viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
CREATE TABLE ambari.viewinstanceproperty (view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_name, view_instance_name, name));
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java
index fbeb0cc..f6a49cf 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java
@@ -203,6 +203,7 @@ public class AmbariPrivilegeResourceProviderTest {
expect(viewInstanceEntity.getViewEntity()).andReturn(viewEntity).anyTimes();
expect(viewEntity.getCommonName()).andReturn("view").anyTimes();
expect(viewEntity.getVersion()).andReturn("1.0.1").anyTimes();
+ expect(viewEntity.isLoaded()).andReturn(true).anyTimes();
expect(viewInstanceEntity.getName()).andReturn("inst1").anyTimes();
expect(viewInstanceEntity.getResource()).andReturn(viewResourceEntity).anyTimes();
expect(viewUserEntity.getPrincipal()).andReturn(viewPrincipalEntity).anyTimes();
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ViewEntityTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ViewEntityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ViewEntityTest.java
index 977e01d..be0d3a6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ViewEntityTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ViewEntityTest.java
@@ -283,4 +283,15 @@ public class ViewEntityTest {
viewDefinition.setStatus(ViewDefinition.ViewStatus.ERROR);
Assert.assertFalse(viewDefinition.isLoaded());
}
+
+ @Test
+ public void testSetIsSystem() throws Exception {
+ ViewEntity viewDefinition = getViewEntity();
+
+ viewDefinition.setSystem(false);
+ Assert.assertFalse(viewDefinition.isSystem());
+
+ viewDefinition.setSystem(true);
+ Assert.assertTrue(viewDefinition.isSystem());
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index 9668ed5..abd97d6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -133,6 +133,7 @@ public class UpgradeCatalog170Test {
Capture<DBAccessor.DBColumnInfo> clusterConfigAttributesColumnCapture = new Capture<DBAccessor.DBColumnInfo>();
Capture<DBAccessor.DBColumnInfo> maskColumnCapture = new Capture<DBAccessor.DBColumnInfo>();
+ Capture<DBAccessor.DBColumnInfo> systemColumnCapture = new Capture<DBAccessor.DBColumnInfo>();
Capture<DBAccessor.DBColumnInfo> maskedColumnCapture = new Capture<DBAccessor.DBColumnInfo>();
Capture<DBAccessor.DBColumnInfo> stageCommandParamsColumnCapture = new Capture<DBAccessor.DBColumnInfo>();
Capture<DBAccessor.DBColumnInfo> stageHostParamsColumnCapture = new Capture<DBAccessor.DBColumnInfo>();
@@ -147,7 +148,7 @@ public class UpgradeCatalog170Test {
Capture<List<DBAccessor.DBColumnInfo>> serviceConfigCapture = new Capture<List<DBAccessor.DBColumnInfo>>();
Capture<List<DBAccessor.DBColumnInfo>> serviceConfigMappingCapture = new Capture<List<DBAccessor.DBColumnInfo>>();
- setViewExpectations(dbAccessor, maskColumnCapture);
+ setViewExpectations(dbAccessor, maskColumnCapture, systemColumnCapture);
setViewParameterExpectations(dbAccessor, maskedColumnCapture);
setClusterConfigExpectations(dbAccessor, clusterConfigAttributesColumnCapture);
setStageExpectations(dbAccessor, stageCommandParamsColumnCapture, stageHostParamsColumnCapture);
@@ -201,7 +202,7 @@ public class UpgradeCatalog170Test {
verify(dbAccessor, configuration, resultSet, connection, stmt);
assertClusterConfigColumns(clusterConfigAttributesColumnCapture);
- assertViewColumns(maskColumnCapture);
+ assertViewColumns(maskColumnCapture, systemColumnCapture);
assertViewParameterColumns(maskedColumnCapture);
assertStageColumns(stageCommandParamsColumnCapture, stageHostParamsColumnCapture);
@@ -456,10 +457,12 @@ public class UpgradeCatalog170Test {
}
private void setViewExpectations(DBAccessor dbAccessor,
- Capture<DBAccessor.DBColumnInfo> maskColumnCapture)
+ Capture<DBAccessor.DBColumnInfo> maskColumnCapture,
+ Capture<DBAccessor.DBColumnInfo> systemColumnCapture)
throws SQLException {
dbAccessor.addColumn(eq("viewmain"), capture(maskColumnCapture));
+ dbAccessor.addColumn(eq("viewmain"), capture(systemColumnCapture));
}
private void setViewParameterExpectations(DBAccessor dbAccessor,
@@ -470,13 +473,22 @@ public class UpgradeCatalog170Test {
}
private void assertViewColumns(
- Capture<DBAccessor.DBColumnInfo> maskColumnCapture) {
+ Capture<DBAccessor.DBColumnInfo> maskColumnCapture,
+ Capture<DBAccessor.DBColumnInfo> systemColumnCapture) {
+
DBAccessor.DBColumnInfo column = maskColumnCapture.getValue();
assertEquals("mask", column.getName());
assertEquals(255, (int) column.getLength());
assertEquals(String.class, column.getType());
assertNull(column.getDefaultValue());
assertTrue(column.isNullable());
+
+ column = systemColumnCapture.getValue();
+ assertEquals("system_view", column.getName());
+ assertEquals(1, (int) column.getLength());
+ assertEquals(Character.class, column.getType());
+ assertNull(column.getDefaultValue());
+ assertTrue(column.isNullable());
}
private void assertViewParameterColumns(
http://git-wip-us.apache.org/repos/asf/ambari/blob/dc15b770/ambari-server/src/test/java/org/apache/ambari/server/view/configuration/ViewConfigTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/view/configuration/ViewConfigTest.java b/ambari-server/src/test/java/org/apache/ambari/server/view/configuration/ViewConfigTest.java
index 2ed365e..0e0ace8 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/view/configuration/ViewConfigTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/view/configuration/ViewConfigTest.java
@@ -117,6 +117,20 @@ public class ViewConfigTest {
" <view-class>ViewImpl</view-class>\n" +
"</view>";
+ private static String system_xml = "<view>\n" +
+ " <name>MY_VIEW</name>\n" +
+ " <label>My View!</label>\n" +
+ " <version>1.0.0</version>\n" +
+ " <system>true</system>\n" +
+ "</view>";
+
+ private static String non_system_xml = "<view>\n" +
+ " <name>MY_VIEW</name>\n" +
+ " <label>My View!</label>\n" +
+ " <version>1.0.0</version>\n" +
+ " <system>false</system>\n" +
+ "</view>";
+
@Test
public void testGetName() throws Exception {
ViewConfig config = getConfig();
@@ -210,6 +224,15 @@ public class ViewConfigTest {
Assert.assertEquals(0, instances.size());
}
+ @Test
+ public void testIsSystem() throws Exception {
+ ViewConfig config = getConfig(system_xml);
+ Assert.assertTrue(config.isSystem());
+
+ config = getConfig(non_system_xml);
+ Assert.assertFalse(config.isSystem());
+ }
+
public static ViewConfig getConfig() throws JAXBException {
return getConfig(xml);
}
[15/26] git commit: AMBARI-7254. Slider View: Slider view not
initializing due to long parameter description (srimanth)
Posted by jo...@apache.org.
AMBARI-7254. Slider View: Slider view not initializing due to long parameter description (srimanth)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/11c057d6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/11c057d6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/11c057d6
Branch: refs/heads/branch-alerts-dev
Commit: 11c057d6d144eec02cb71fa8fe74d0103cf6ffad
Parents: 24a486a
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Sep 10 18:55:56 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Sep 10 18:55:56 2014 -0700
----------------------------------------------------------------------
contrib/views/slider/src/main/resources/view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/11c057d6/contrib/views/slider/src/main/resources/view.xml
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/view.xml b/contrib/views/slider/src/main/resources/view.xml
index 87dfbe7..62258d5 100644
--- a/contrib/views/slider/src/main/resources/view.xml
+++ b/contrib/views/slider/src/main/resources/view.xml
@@ -35,7 +35,7 @@ limitations under the License. Kerberos, LDAP, Custom. Binary/Htt
</parameter>
<parameter>
<name>zookeeper.quorum</name>
- <description>ZooKeeper quorum location. Typically this is a comma separated list of ZooKeeper hostnames and port numbers. The port number can be got from the clientPort property in the zookeeper-env configuration. For example: zookeeper.host1:2181,zookeeper.host2:2181.</description>
+ <description>ZooKeeper quorum location. Typically this is a comma separated list of ZooKeeper hostnames and port numbers (clientPort property in the zookeeper-env). For example: zookeeper.host1:2181,zookeeper.host2:2181.</description>
<required>false</required>
</parameter>
<resource>
[26/26] git commit: Merge branch 'trunk' into branch-alerts-dev
Posted by jo...@apache.org.
Merge branch 'trunk' into branch-alerts-dev
Conflicts:
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2262400c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2262400c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2262400c
Branch: refs/heads/branch-alerts-dev
Commit: 2262400c6057aec451027f432b83f2c88ac1d8c3
Parents: 05da121 3035978
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Sep 11 15:02:05 2014 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Sep 11 15:02:05 2014 -0400
----------------------------------------------------------------------
.../ui/admin-web/app/scripts/services/View.js | 6 +-
.../app/views/ambariViews/listTable.html | 2 +-
ambari-server/conf/unix/ambari.properties | 1 +
.../server/api/services/ComponentService.java | 5 +-
.../api/services/HostComponentService.java | 5 +-
.../server/configuration/Configuration.java | 4 +
.../controller/RequestStatusResponse.java | 12 +
.../internal/AbstractResourceProvider.java | 3 +
.../AmbariPrivilegeResourceProvider.java | 8 +-
.../internal/BaseBlueprintProcessor.java | 7 +-
.../internal/ClientConfigResourceProvider.java | 5 +-
.../internal/ClusterResourceProvider.java | 17 +-
.../internal/ServiceResourceProvider.java | 14 +-
.../internal/ViewVersionResourceProvider.java | 3 +
.../server/orm/entities/AlertCurrentEntity.java | 19 ++
.../ambari/server/orm/entities/ViewEntity.java | 29 +-
.../server/upgrade/UpgradeCatalog161.java | 2 +-
.../server/upgrade/UpgradeCatalog170.java | 86 ++++++
.../server/view/configuration/ViewConfig.java | 14 +
ambari-server/src/main/python/bootstrap.py | 24 +-
.../main/resources/Ambari-DDL-MySQL-CREATE.sql | 3 +-
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 3 +-
.../resources/Ambari-DDL-Postgres-CREATE.sql | 3 +-
.../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql | 3 +-
.../services/HIVE/package/scripts/params.py | 6 +-
.../services/OOZIE/package/scripts/oozie.py | 2 +-
.../OOZIE/package/scripts/oozie_service.py | 2 +-
.../services/OOZIE/package/scripts/params.py | 10 +
.../2.1.GlusterFS/services/STORM/metainfo.xml | 5 +
.../2.1.GlusterFS/services/YARN/metainfo.xml | 1 +
.../AmbariPrivilegeResourceProviderTest.java | 1 +
.../internal/BlueprintResourceProviderTest.java | 15 +
.../ClientConfigResourceProviderTest.java | 16 +-
.../internal/ClusterResourceProviderTest.java | 239 ++++++++++++---
.../internal/RequestResourceProviderTest.java | 16 +-
.../internal/ServiceResourceProviderTest.java | 122 +++++++-
.../server/orm/entities/ViewEntityTest.java | 11 +
.../server/upgrade/UpgradeCatalog161Test.java | 2 +-
.../server/upgrade/UpgradeCatalog170Test.java | 49 +++-
.../view/configuration/ViewConfigTest.java | 23 ++
ambari-server/src/test/python/TestBootstrap.py | 29 +-
ambari-web/app/app.js | 3 +
.../app/controllers/wizard/step5_controller.js | 2 +-
.../app/controllers/wizard/step6_controller.js | 2 +-
.../app/controllers/wizard/step8_controller.js | 2 +-
ambari-web/app/data/HDP2/config_mapping.js | 4 +-
ambari-web/app/data/config_mapping.js | 4 +-
ambari-web/app/data/site_properties.js | 2 +-
ambari-web/app/styles/application.less | 9 +-
.../common/configs/config_history_flow.hbs | 12 +-
.../main/dashboard/widgets/cluster_metrics.hbs | 2 +-
.../main/dashboard/widgets/hbase_links.hbs | 2 +-
.../main/dashboard/widgets/hdfs_links.hbs | 2 +-
.../main/dashboard/widgets/mapreduce_links.hbs | 2 +-
.../main/dashboard/widgets/mapreduce_slots.hbs | 2 +-
.../main/dashboard/widgets/pie_chart.hbs | 2 +-
.../main/dashboard/widgets/simple_text.hbs | 2 +-
.../templates/main/dashboard/widgets/uptime.hbs | 2 +-
ambari-web/app/utils/config.js | 19 +-
.../views/common/configs/config_history_flow.js | 5 +
ambari-web/app/views/main/dashboard/widget.js | 4 +-
ambari-web/app/views/main/dashboard/widgets.js | 14 +
ambari-web/vendor/scripts/jquery.hoverIntent.js | 115 ++++++++
contrib/views/slider/pom.xml | 8 -
.../view/slider/SliderAppsViewController.java | 5 +
.../slider/SliderAppsViewControllerImpl.java | 262 +++++------------
.../apache/ambari/view/slider/ViewStatus.java | 33 +--
.../view/slider/clients/AmbariClient.java | 3 -
.../slider/clients/AmbariInternalClient.java | 292 -------------------
.../slider/rest/client/JMXMetricHolder.java | 50 ++++
.../slider/rest/client/SliderAppJmxHelper.java | 1 -
.../resources/ui/app/assets/data/apps/apps.json | 16 +-
.../assets/data/resource/service_configs.json | 38 +++
.../ui/app/components/configSection.js | 16 +-
.../createAppWizard/step1_controller.js | 41 ++-
.../createAppWizard/step2_controller.js | 3 +-
.../createAppWizard/step3_controller.js | 123 +++++++-
.../ui/app/controllers/slider_app_controller.js | 127 ++++++--
.../app/controllers/slider_apps_controller.js | 8 +-
.../src/main/resources/ui/app/helpers/ajax.js | 9 +
.../src/main/resources/ui/app/initialize.js | 19 +-
.../ui/app/mappers/slider_apps_mapper.js | 4 +-
.../main/resources/ui/app/mixins/with_panels.js | 50 ++++
.../resources/ui/app/models/config_property.js | 44 +++
.../main/resources/ui/app/models/slider_app.js | 24 +-
.../resources/ui/app/models/slider_app_type.js | 2 +-
.../resources/ui/app/styles/application.less | 46 ++-
.../ui/app/templates/common/config.hbs | 37 +++
.../app/templates/components/configSection.hbs | 95 +++---
.../ui/app/templates/slider_app/configs.hbs | 36 ++-
.../ui/app/templates/slider_app/flex_popup.hbs | 39 +++
.../ui/app/templates/slider_app/summary.hbs | 10 +-
.../src/main/resources/ui/app/translations.js | 9 +-
.../ui/app/views/common/config_set_view.js | 56 ++++
.../ui/app/views/slider_app/configs_view.js | 57 ++++
.../views/slider/src/main/resources/view.xml | 23 +-
96 files changed, 1846 insertions(+), 780 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2262400c/ambari-server/conf/unix/ambari.properties
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2262400c/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2262400c/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2262400c/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --cc ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index 71cd2d7,0e8aea5..145096d
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@@ -73,7 -80,7 +80,8 @@@ import org.apache.ambari.server.state.C
import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.Config;
import org.apache.ambari.server.state.ConfigHelper;
+import org.apache.ambari.server.state.alert.Scope;
+ import org.apache.ambari.server.utils.StageUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/ambari/blob/2262400c/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2262400c/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2262400c/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2262400c/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------
[09/26] git commit: AMBARI-7245. Can not get HDFS configs tab to load
(just spinners)(vbrodetskyi)
Posted by jo...@apache.org.
AMBARI-7245. Can not get HDFS configs tab to load (just spinners)(vbrodetskyi)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6722aba8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6722aba8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6722aba8
Branch: refs/heads/branch-alerts-dev
Commit: 6722aba8299d1d50a067928388102653b954f907
Parents: 9588d2a
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Wed Sep 10 20:45:57 2014 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Wed Sep 10 20:45:57 2014 +0300
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog170.java | 83 ++++++++++++++++++++
.../server/upgrade/UpgradeCatalog170Test.java | 27 ++++++-
2 files changed, 108 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/6722aba8/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index ee67330..17750f9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -18,6 +18,8 @@
package org.apache.ambari.server.upgrade;
+import java.lang.reflect.Type;
+
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -30,6 +32,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import java.util.Date;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
@@ -39,6 +42,7 @@ import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
+import com.google.common.reflect.TypeToken;
import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.controller.AmbariManagementController;
@@ -53,11 +57,14 @@ import org.apache.ambari.server.orm.dao.PrincipalTypeDAO;
import org.apache.ambari.server.orm.dao.PrivilegeDAO;
import org.apache.ambari.server.orm.dao.ResourceDAO;
import org.apache.ambari.server.orm.dao.ResourceTypeDAO;
+import org.apache.ambari.server.orm.dao.ConfigGroupConfigMappingDAO;
import org.apache.ambari.server.orm.dao.UserDAO;
import org.apache.ambari.server.orm.dao.ViewDAO;
import org.apache.ambari.server.orm.dao.ViewInstanceDAO;
import org.apache.ambari.server.orm.entities.ClusterEntity;
import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
+import org.apache.ambari.server.orm.entities.ConfigGroupConfigMappingEntity;
+import org.apache.ambari.server.orm.entities.ClusterConfigEntity;
import org.apache.ambari.server.orm.entities.HostRoleCommandEntity_;
import org.apache.ambari.server.orm.entities.KeyValueEntity;
import org.apache.ambari.server.orm.entities.PermissionEntity;
@@ -73,6 +80,7 @@ import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.Config;
import org.apache.ambari.server.state.ConfigHelper;
+import org.apache.ambari.server.utils.StageUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -586,6 +594,81 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
renamePigProperties();
upgradePermissionModel();
addJobsViewPermissions();
+ moveConfigGroupsGlobalToEnv();
+ }
+
+ private void moveConfigGroupsGlobalToEnv() throws AmbariException {
+ final ConfigGroupConfigMappingDAO confGroupConfMappingDAO = injector.getInstance(ConfigGroupConfigMappingDAO.class);
+ ConfigHelper configHelper = injector.getInstance(ConfigHelper.class);
+ final ClusterDAO clusterDAO = injector.getInstance(ClusterDAO.class);
+ AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
+ List<ConfigGroupConfigMappingEntity> configGroupConfigMappingEntities = confGroupConfMappingDAO.findAll();
+ List<ConfigGroupConfigMappingEntity> configGroupsWithGlobalConfigs = new ArrayList<ConfigGroupConfigMappingEntity>();
+ Type type = new TypeToken<Map<String, String>>() {}.getType();
+
+ for (ConfigGroupConfigMappingEntity entity : configGroupConfigMappingEntities) {
+ if (entity.getConfigType().equals(Configuration.GLOBAL_CONFIG_TAG)) {
+ configGroupsWithGlobalConfigs.add(entity);
+ }
+ }
+
+ for (ConfigGroupConfigMappingEntity entity : configGroupsWithGlobalConfigs) {
+ String configData = entity.getClusterConfigEntity().getData();
+ Map<String, String> properties = StageUtils.getGson().fromJson(configData, type);
+ Cluster cluster = ambariManagementController.getClusters().getClusterById(entity.getClusterId());
+ HashMap<String, HashMap<String, String>> configs = new HashMap<String, HashMap<String, String>>();
+
+ for (Entry<String, String> property : properties.entrySet()) {
+ Set<String> configTypes = configHelper.findConfigTypesByPropertyName(cluster.getCurrentStackVersion(),
+ property.getKey(), cluster.getClusterName());
+ // i'm not sure, but i hope that every service property is unique
+ String configType = configTypes.iterator().next();
+
+ if (configs.containsKey(configType)) {
+ HashMap<String, String> config = configs.get(configType);
+ config.put(property.getKey(), property.getValue());
+ } else {
+ HashMap<String, String> config = new HashMap<String, String>();
+ config.put(property.getKey(), property.getValue());
+ configs.put(configType, config);
+ }
+ }
+
+ for (Entry<String, HashMap<String, String>> config : configs.entrySet()) {
+
+ String tag;
+ if(cluster.getConfigsByType(config.getKey()) == null) {
+ tag = "version1";
+ } else {
+ tag = "version" + System.currentTimeMillis();
+ }
+
+ ClusterConfigEntity clusterConfigEntity = new ClusterConfigEntity();
+ clusterConfigEntity.setClusterEntity(entity.getClusterConfigEntity().getClusterEntity());
+ clusterConfigEntity.setClusterId(cluster.getClusterId());
+ clusterConfigEntity.setType(config.getKey());
+ clusterConfigEntity.setVersion(cluster.getNextConfigVersion(config.getKey()));
+ clusterConfigEntity.setTag(tag);
+ clusterConfigEntity.setTimestamp(new Date().getTime());
+ clusterConfigEntity.setData(StageUtils.getGson().toJson(config.getValue()));
+ clusterDAO.createConfig(clusterConfigEntity);
+
+
+ ConfigGroupConfigMappingEntity configGroupConfigMappingEntity = new ConfigGroupConfigMappingEntity();
+ configGroupConfigMappingEntity.setTimestamp(System.currentTimeMillis());
+ configGroupConfigMappingEntity.setClusterId(entity.getClusterId());
+ configGroupConfigMappingEntity.setClusterConfigEntity(clusterConfigEntity);
+ configGroupConfigMappingEntity.setConfigGroupEntity(entity.getConfigGroupEntity());
+ configGroupConfigMappingEntity.setConfigGroupId(entity.getConfigGroupId());
+ configGroupConfigMappingEntity.setConfigType(config.getKey());
+ configGroupConfigMappingEntity.setVersionTag(clusterConfigEntity.getTag());
+ confGroupConfMappingDAO.create(configGroupConfigMappingEntity);
+ }
+ }
+
+ for (ConfigGroupConfigMappingEntity entity : configGroupsWithGlobalConfigs) {
+ confGroupConfMappingDAO.remove(entity);
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/6722aba8/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index abd97d6..d3d7f7c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -73,6 +73,7 @@ import org.apache.ambari.server.orm.dao.ResourceTypeDAO;
import org.apache.ambari.server.orm.dao.UserDAO;
import org.apache.ambari.server.orm.dao.ViewDAO;
import org.apache.ambari.server.orm.dao.ViewInstanceDAO;
+import org.apache.ambari.server.orm.dao.ConfigGroupConfigMappingDAO;
import org.apache.ambari.server.orm.entities.ClusterEntity;
import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
import org.apache.ambari.server.orm.entities.KeyValueEntity;
@@ -81,6 +82,8 @@ import org.apache.ambari.server.orm.entities.ResourceEntity;
import org.apache.ambari.server.orm.entities.UserEntity;
import org.apache.ambari.server.orm.entities.ViewEntity;
import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
+import org.apache.ambari.server.orm.entities.ConfigGroupConfigMappingEntity;
+import org.apache.ambari.server.orm.entities.ClusterConfigEntity;
import org.apache.ambari.server.state.Cluster;
import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.Config;
@@ -230,6 +233,8 @@ public class UpgradeCatalog170Test {
Config config = createStrictMock(Config.class);
Config pigConfig = createStrictMock(Config.class);
+ ClusterConfigEntity clusterConfigEntity = createNiceMock(ClusterConfigEntity.class);
+ ConfigGroupConfigMappingDAO configGroupConfigMappingDAO = createNiceMock(ConfigGroupConfigMappingDAO.class);
UserDAO userDAO = createNiceMock(UserDAO.class);
PrincipalDAO principalDAO = createNiceMock(PrincipalDAO.class);
PrincipalTypeDAO principalTypeDAO = createNiceMock(PrincipalTypeDAO.class);
@@ -261,6 +266,14 @@ public class UpgradeCatalog170Test {
UpgradeCatalog170 upgradeCatalog = createMockBuilder(UpgradeCatalog170.class)
.addMockedMethod(m).addMockedMethod(n).createMock();
+ List<ConfigGroupConfigMappingEntity> configGroupConfigMappingEntities =
+ new ArrayList<ConfigGroupConfigMappingEntity>();
+ ConfigGroupConfigMappingEntity configGroupConfigMappingEntity = new ConfigGroupConfigMappingEntity();
+ configGroupConfigMappingEntity.setConfigType(Configuration.GLOBAL_CONFIG_TAG);
+ configGroupConfigMappingEntity.setClusterConfigEntity(clusterConfigEntity);
+ configGroupConfigMappingEntity.setClusterId(1L);
+ configGroupConfigMappingEntities.add(configGroupConfigMappingEntity);
+
Map<String, Cluster> clustersMap = new HashMap<String, Cluster>();
clustersMap.put("c1", cluster);
@@ -275,6 +288,9 @@ public class UpgradeCatalog170Test {
envDicts.add("hadoop-env");
envDicts.add("global");
+ Set<String> configTypes = new HashSet<String>();
+ configTypes.add("hadoop-env");
+
Map<String, String> contentOfHadoopEnv = new HashMap<String, String>();
contentOfHadoopEnv.put("content", "env file contents");
@@ -322,21 +338,27 @@ public class UpgradeCatalog170Test {
expect(hrc.get(isA(SingularAttribute.class))).andReturn(errorLog).once();
expect(q.setMaxResults(1000)).andReturn(q).anyTimes();
expect(q.getResultList()).andReturn(r).anyTimes();
+ expect(clusterConfigEntity.getData()).andReturn("{\"dtnode_heapsize\":\"1028m\"}");
expect(configuration.getDatabaseUrl()).andReturn(Configuration.JDBC_IN_MEMORY_URL).anyTimes();
expect(injector.getInstance(ConfigHelper.class)).andReturn(configHelper).anyTimes();
expect(injector.getInstance(AmbariManagementController.class)).andReturn(amc).anyTimes();
expect(amc.getClusters()).andReturn(clusters).anyTimes();
expect(clusters.getClusters()).andReturn(clustersMap).anyTimes();
+ expect(clusters.getClusterById(1L)).andReturn(clustersMap.values().iterator().next()).anyTimes();
expect(cluster.getDesiredConfigByType("global")).andReturn(config).anyTimes();
+ expect(cluster.getClusterId()).andReturn(1L);
+ expect(cluster.getNextConfigVersion("hadoop-env")).andReturn(3L);
expect(config.getProperties()).andReturn(globalConfigs).anyTimes();
expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.1")).anyTimes();
expect(cluster.getClusterName()).andReturn("c1").anyTimes();
expect(configHelper.findConfigTypesByPropertyName(new StackId("HDP", "2.1"), "prop1", "c1")).andReturn(envDicts).once();
expect(configHelper.findConfigTypesByPropertyName(new StackId("HDP", "2.1"), "smokeuser_keytab", "c1")).andReturn(new HashSet<String>()).once();
expect(configHelper.findConfigTypesByPropertyName(new StackId("HDP", "2.1"), "content", "c1")).andReturn(envDicts).once();
+ expect(configHelper.findConfigTypesByPropertyName(new StackId("HDP", "2.1"), "dtnode_heapsize", "c1")).andReturn(configTypes).once();
expect(configHelper.getPropertyValueFromStackDefenitions(cluster, "hadoop-env", "content")).andReturn("env file contents").once();
+ expect(injector.getInstance(ConfigGroupConfigMappingDAO.class)).andReturn(configGroupConfigMappingDAO).anyTimes();
expect(injector.getInstance(UserDAO.class)).andReturn(userDAO).anyTimes();
expect(injector.getInstance(PrincipalDAO.class)).andReturn(principalDAO).anyTimes();
expect(injector.getInstance(PrincipalTypeDAO.class)).andReturn(principalTypeDAO).anyTimes();
@@ -349,6 +371,7 @@ public class UpgradeCatalog170Test {
expect(injector.getInstance(PrivilegeDAO.class)).andReturn(privilegeDAO).anyTimes();
expect(injector.getInstance(KeyValueDAO.class)).andReturn(keyValueDAO).anyTimes();
+ expect(configGroupConfigMappingDAO.findAll()).andReturn(configGroupConfigMappingEntities).once();
expect(userDAO.findAll()).andReturn(Collections.<UserEntity> emptyList()).times(2);
expect(clusterDAO.findAll()).andReturn(Collections.<ClusterEntity> emptyList()).anyTimes();
expect(viewDAO.findAll()).andReturn(Collections.<ViewEntity> emptyList()).anyTimes();
@@ -381,8 +404,8 @@ public class UpgradeCatalog170Test {
replay(entityManager, trans, upgradeCatalog, cb, cq, hrc, q, userRolesResultSet);
replay(dbAccessor, configuration, injector, cluster, clusters, amc, config, configHelper, pigConfig);
- replay(userDAO, clusterDAO, viewDAO, viewInstanceDAO, permissionDAO);
- replay(resourceTypeDAO, resourceDAO, keyValueDAO, privilegeDAO);
+ replay(userDAO, clusterDAO, viewDAO, viewInstanceDAO, permissionDAO, configGroupConfigMappingDAO);
+ replay(resourceTypeDAO, resourceDAO, keyValueDAO, privilegeDAO, clusterConfigEntity);
replay(jobsView, showJobsKeyValue, user);
Class<?> c = AbstractUpgradeCatalog.class;
[25/26] git commit: AMBARI-7263. Alerts: DDL for alert_current
requires latest_text (ncole)
Posted by jo...@apache.org.
AMBARI-7263. Alerts: DDL for alert_current requires latest_text (ncole)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3035978f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3035978f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3035978f
Branch: refs/heads/branch-alerts-dev
Commit: 3035978fba2921e81e83eedc8fd77090f6442b94
Parents: e293b67
Author: Nate Cole <nc...@hortonworks.com>
Authored: Thu Sep 11 12:03:41 2014 -0400
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Thu Sep 11 14:31:19 2014 -0400
----------------------------------------------------------------------
.../server/orm/entities/AlertCurrentEntity.java | 19 +++++++++++++++++++
.../ambari/server/upgrade/UpgradeCatalog170.java | 1 +
.../main/resources/Ambari-DDL-MySQL-CREATE.sql | 1 +
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 1 +
.../resources/Ambari-DDL-Postgres-CREATE.sql | 1 +
.../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql | 1 +
.../server/upgrade/UpgradeCatalog170Test.java | 2 +-
7 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3035978f/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
index cde61f2..ba21c42 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertCurrentEntity.java
@@ -66,6 +66,9 @@ public class AlertCurrentEntity {
@Column(name = "original_timestamp", nullable = false)
private Long originalTimestamp;
+
+ @Column(name = "latest_text", length = 4000)
+ private String latestText = null;
/**
* Unidirectional one-to-one association to {@link AlertHistoryEntity}
@@ -168,6 +171,22 @@ public class AlertCurrentEntity {
public void setOriginalTimestamp(Long originalTimestamp) {
this.originalTimestamp = originalTimestamp;
}
+
+ /**
+ * Gets the latest text for this alert. History will not get a new record on
+ * update when the state is the same, but the text may be changed. For example,
+ * CPU utilization includes the usage in the text and should be available.
+ */
+ public String getLatestText() {
+ return latestText;
+ }
+
+ /**
+ * Sets the latest text. {@link #getLatestText()}
+ */
+ public void setLatestText(String text) {
+ latestText = text;
+ }
/**
* Gets the associated {@link AlertHistoryEntity} entry for this current alert
http://git-wip-us.apache.org/repos/asf/ambari/blob/3035978f/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index 17750f9..0e8aea5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -737,6 +737,7 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
columns.add(new DBColumnInfo("original_timestamp", Long.class, 0, null,
false));
columns.add(new DBColumnInfo("latest_timestamp", Long.class, 0, null, false));
+ columns.add(new DBColumnInfo("latest_text", String.class, 4000, null, true));
dbAccessor.createTable(ALERT_TABLE_CURRENT, columns, "alert_id");
dbAccessor.addFKConstraint(ALERT_TABLE_CURRENT, "fk_alert_current_def_id",
http://git-wip-us.apache.org/repos/asf/ambari/blob/3035978f/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index 356ef0c..4a6d3ba 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -190,6 +190,7 @@ CREATE TABLE alert_current (
maintenance_state VARCHAR(255),
original_timestamp BIGINT NOT NULL,
latest_timestamp BIGINT NOT NULL,
+ latest_text TEXT,
PRIMARY KEY (alert_id),
FOREIGN KEY (definition_id) REFERENCES alert_definition(definition_id),
FOREIGN KEY (history_id) REFERENCES alert_history(alert_id)
http://git-wip-us.apache.org/repos/asf/ambari/blob/3035978f/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index ecaf220..2e6b5c0 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -181,6 +181,7 @@ CREATE TABLE alert_current (
maintenance_state VARCHAR2(255),
original_timestamp NUMBER(19) NOT NULL,
latest_timestamp NUMBER(19) NOT NULL,
+ latest_text VARCHAR2(4000),
PRIMARY KEY (alert_id),
FOREIGN KEY (definition_id) REFERENCES alert_definition(definition_id),
FOREIGN KEY (history_id) REFERENCES alert_history(alert_id)
http://git-wip-us.apache.org/repos/asf/ambari/blob/3035978f/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index f0ac53a..400373e 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -213,6 +213,7 @@ CREATE TABLE alert_current (
maintenance_state VARCHAR(255),
original_timestamp BIGINT NOT NULL,
latest_timestamp BIGINT NOT NULL,
+ latest_text TEXT,
PRIMARY KEY (alert_id),
FOREIGN KEY (definition_id) REFERENCES alert_definition(definition_id),
FOREIGN KEY (history_id) REFERENCES alert_history(alert_id)
http://git-wip-us.apache.org/repos/asf/ambari/blob/3035978f/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
index 6e82ae1..74e6d1c 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
@@ -277,6 +277,7 @@ CREATE TABLE ambari.alert_current (
maintenance_state VARCHAR(255),
original_timestamp BIGINT NOT NULL,
latest_timestamp BIGINT NOT NULL,
+ latest_text TEXT,
PRIMARY KEY (alert_id),
FOREIGN KEY (definition_id) REFERENCES ambari.alert_definition(definition_id),
FOREIGN KEY (history_id) REFERENCES ambari.alert_history(alert_id)
http://git-wip-us.apache.org/repos/asf/ambari/blob/3035978f/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index d3d7f7c..c7f5f1b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -211,7 +211,7 @@ public class UpgradeCatalog170Test {
assertEquals(12, alertDefinitionColumnCapture.getValue().size());
assertEquals(11, alertHistoryColumnCapture.getValue().size());
- assertEquals(6, alertCurrentColumnCapture.getValue().size());
+ assertEquals(7, alertCurrentColumnCapture.getValue().size());
assertEquals(5, alertGroupColumnCapture.getValue().size());
assertEquals(5, alertTargetCapture.getValue().size());
assertEquals(2, alertGroupTargetCapture.getValue().size());
[02/26] git commit: AMBARI-7240. Change the way oozie uploads
sharelib into hdfs (aonishuk)
Posted by jo...@apache.org.
AMBARI-7240. Change the way oozie uploads sharelib into hdfs (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1ef2af3f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1ef2af3f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1ef2af3f
Branch: refs/heads/branch-alerts-dev
Commit: 1ef2af3f704bddc02c6b5532fecd438f13cab02c
Parents: 2b78d36
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 10 17:51:33 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 10 17:51:33 2014 +0300
----------------------------------------------------------------------
.../HDP/2.0.6/services/HIVE/package/scripts/params.py | 6 +++---
.../HDP/2.0.6/services/OOZIE/package/scripts/oozie.py | 2 +-
.../2.0.6/services/OOZIE/package/scripts/oozie_service.py | 2 +-
.../HDP/2.0.6/services/OOZIE/package/scripts/params.py | 10 ++++++++++
ambari-web/app/data/HDP2/config_mapping.js | 4 ++--
ambari-web/app/data/config_mapping.js | 4 ++--
6 files changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef2af3f/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
index 6f05b6b..b1a4a49 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
@@ -126,10 +126,10 @@ mysql_host = config['clusterHostInfo']['hive_mysql_host']
mysql_adduser_path = format("{tmp_dir}/addMysqlUser.sh")
######## Metastore Schema
-if str(hdp_stack_version).startswith('2.1'):
- init_metastore_schema = True
-else:
+if str(hdp_stack_version).startswith('2.0'):
init_metastore_schema = False
+else:
+ init_metastore_schema = True
########## HCAT
http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef2af3f/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
index f5d4142..d390c69 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py
@@ -139,7 +139,7 @@ def oozie_server_specific(
if params.has_falcon_host:
cmd3 += format(' && cp {falcon_home}/oozie/ext/falcon-oozie-el-extension-*.jar {oozie_libext_dir}')
# this is different for HDP1
- cmd4 = format("cd {oozie_tmp_dir} && /usr/lib/oozie/bin/oozie-setup.sh prepare-war")
+ cmd4 = format("cd {oozie_tmp_dir} && {oozie_setup_sh} prepare-war")
no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
Execute( [cmd1, cmd2, cmd3],
http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef2af3f/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
index aa2b7e2..78661b0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie_service.py
@@ -37,7 +37,7 @@ def oozie_service(action = 'start'): # 'start' or 'stop'
db_connection_check_command = None
cmd1 = format("cd {oozie_tmp_dir} && /usr/lib/oozie/bin/ooziedb.sh create -sqlfile oozie.sql -run")
- cmd2 = format("{kinit_if_needed} hadoop dfs -put /usr/lib/oozie/share {oozie_hdfs_user_dir} ; hadoop dfs -chmod -R 755 {oozie_hdfs_user_dir}/share")
+ cmd2 = format("{kinit_if_needed} {put_shared_lib_to_hdfs_cmd} ; hadoop dfs -chmod -R 755 {oozie_hdfs_user_dir}/share")
if not os.path.isfile(params.jdbc_driver_jar) and params.jdbc_driver_name == "org.postgresql.Driver":
print "ERROR: jdbc file " + params.jdbc_driver_jar + " is unavailable. Please, follow next steps:\n" \
http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef2af3f/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
index 260063f..a484c0e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/OOZIE/package/scripts/params.py
@@ -39,6 +39,7 @@ oozie_hdfs_user_dir = format("/user/{oozie_user}")
oozie_pid_dir = status_params.oozie_pid_dir
pid_file = status_params.pid_file
hadoop_jar_location = "/usr/lib/hadoop/"
+hdp_stack_version = config['hostLevelParams']['stack_version']
# for HDP1 it's "/usr/share/HDP-oozie/ext.zip"
ext_js_path = "/usr/share/HDP-oozie/ext-2.2.zip"
oozie_libext_dir = "/usr/lib/oozie/libext"
@@ -65,7 +66,16 @@ oozie_server_admin_port = config['configurations']['oozie-env']['oozie_admin_por
oozie_env_sh_template = config['configurations']['oozie-env']['content']
oozie_lib_dir = "/var/lib/oozie/"
oozie_webapps_dir = "/var/lib/oozie/oozie-server/webapps/"
+oozie_setup_sh = "/usr/lib/oozie/bin/oozie-setup.sh"
+oozie_shared_lib = "/usr/lib/oozie/share"
+fs_root = config['configurations']['core-site']['fs.defaultFS']
+if str(hdp_stack_version).startswith('2.0') or str(hdp_stack_version).startswith('2.1'):
+ put_shared_lib_to_hdfs_cmd = format("hadoop dfs -put {oozie_shared_lib} {oozie_hdfs_user_dir}")
+# for newer
+else:
+ put_shared_lib_to_hdfs_cmd = format("{oozie_setup_sh} sharelib create -fs {fs_root} -locallib {oozie_shared_lib}")
+
jdbc_driver_name = default("/configurations/oozie-site/oozie.service.JPAService.jdbc.driver", "")
if jdbc_driver_name == "com.mysql.jdbc.Driver":
http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef2af3f/ambari-web/app/data/HDP2/config_mapping.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/config_mapping.js b/ambari-web/app/data/HDP2/config_mapping.js
index f405b94..2e6b4e3 100644
--- a/ambari-web/app/data/HDP2/config_mapping.js
+++ b/ambari-web/app/data/HDP2/config_mapping.js
@@ -37,9 +37,9 @@ var configs = [
},
{
"name": "hadoop.proxyuser.<foreignKey[0]>.groups",
- "templateName": ["proxyuser_group"],
+ "templateName": [],
"foreignKey": ["oozie_user"],
- "value": "<templateName[0]>",
+ "value": "*",
"filename": "core-site.xml",
"isOverridable": true
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/1ef2af3f/ambari-web/app/data/config_mapping.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/config_mapping.js b/ambari-web/app/data/config_mapping.js
index 6b7bdbc..7fcde38 100644
--- a/ambari-web/app/data/config_mapping.js
+++ b/ambari-web/app/data/config_mapping.js
@@ -36,9 +36,9 @@ var configs = [
},
{
"name": "hadoop.proxyuser.<foreignKey[0]>.groups",
- "templateName": ["proxyuser_group"],
+ "templateName": [],
"foreignKey": ["oozie_user"],
- "value": "<templateName[0]>",
+ "value": "*",
"filename": "core-site.xml",
"isOverridable" : true
},
[10/26] git commit: AMBARI-7224. Step 8 of installer is empty for
2.1.GlusterFS stack, then if click back button and next again,
repositories show but no services. (jaimin)
Posted by jo...@apache.org.
AMBARI-7224. Step 8 of installer is empty for 2.1.GlusterFS stack, then if click back button and next again, repositories show but no services. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3c9bb86c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3c9bb86c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3c9bb86c
Branch: refs/heads/branch-alerts-dev
Commit: 3c9bb86cbed926e8024ecf992457cf8008369321
Parents: 6722aba
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Sep 10 11:01:53 2014 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Sep 10 11:01:53 2014 -0700
----------------------------------------------------------------------
.../stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml | 5 +++++
.../stacks/HDP/2.1.GlusterFS/services/YARN/metainfo.xml | 1 +
ambari-web/app/controllers/wizard/step5_controller.js | 2 +-
ambari-web/app/controllers/wizard/step6_controller.js | 2 +-
ambari-web/app/controllers/wizard/step8_controller.js | 2 +-
5 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3c9bb86c/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml
index 5145c02..0a6e730 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/STORM/metainfo.xml
@@ -28,6 +28,7 @@
<component>
<name>NIMBUS</name>
+ <displayName>Nimbus</displayName>
<category>MASTER</category>
<cardinality>1</cardinality>
<dependencies>
@@ -48,6 +49,7 @@
<component>
<name>STORM_REST_API</name>
+ <displayName>Storm REST API Server</displayName>
<category>MASTER</category>
<cardinality>1</cardinality>
<commandScript>
@@ -59,6 +61,7 @@
<component>
<name>SUPERVISOR</name>
+ <displayName>Supervisor</displayName>
<category>SLAVE</category>
<cardinality>1+</cardinality>
<commandScript>
@@ -70,6 +73,7 @@
<component>
<name>STORM_UI_SERVER</name>
+ <displayName>Storm UI Server</displayName>
<category>MASTER</category>
<cardinality>1</cardinality>
<commandScript>
@@ -81,6 +85,7 @@
<component>
<name>DRPC_SERVER</name>
+ <displayName>DRPC Server</displayName>
<category>MASTER</category>
<cardinality>1</cardinality>
<commandScript>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3c9bb86c/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metainfo.xml
index fbe90fa..50c9818 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/metainfo.xml
@@ -27,6 +27,7 @@
<component>
<name>APP_TIMELINE_SERVER</name>
+ <displayName>App Timeline Server</displayName>
<category>MASTER</category>
<cardinality>1</cardinality>
<commandScript>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3c9bb86c/ambari-web/app/controllers/wizard/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step5_controller.js b/ambari-web/app/controllers/wizard/step5_controller.js
index fb8ccf7..e08e709 100644
--- a/ambari-web/app/controllers/wizard/step5_controller.js
+++ b/ambari-web/app/controllers/wizard/step5_controller.js
@@ -623,7 +623,7 @@ App.WizardStep5Controller = Em.Controller.extend(App.BlueprintMixin, {
var componentObj = {};
componentObj.component_name = componentName;
- componentObj.display_name = fullComponent.get('displayName');
+ componentObj.display_name = App.format.role(fullComponent.get('componentName'));
componentObj.serviceId = fullComponent.get('serviceName');
componentObj.isServiceCoHost = App.StackServiceComponent.find().findProperty('componentName', componentName).get('isCoHostedComponent') && !this.get('isReassignWizard');
http://git-wip-us.apache.org/repos/asf/ambari/blob/3c9bb86c/ambari-web/app/controllers/wizard/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js
index 9fe3659..3bd11c5 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -302,7 +302,7 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
if (serviceComponent.get('isShownOnInstallerSlaveClientPage')) {
headers.pushObject(Em.Object.create({
name: serviceComponent.get('componentName'),
- label: serviceComponent.get('displayName'),
+ label: App.format.role(serviceComponent.get('componentName')),
allChecked: false,
isRequired: serviceComponent.get('isRequired'),
noChecked: true,
http://git-wip-us.apache.org/repos/asf/ambari/blob/3c9bb86c/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 04cb728..7b7ae11 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -654,7 +654,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, {
displayName = Em.I18n.t('common.clients')
} else {
// remove service name from component display name
- displayName = component.get('displayName').replace(new RegExp('^' + service.get('serviceName') + '\\s', 'i'), '');
+ displayName = App.format.role(component.get('componentName')).replace(new RegExp('^' + service.get('serviceName') + '\\s', 'i'), '');
}
serviceObj.get('service_components').pushObject(Em.Object.create({
component_name: component.get('isClient') ? Em.I18n.t('common.client').toUpperCase() : component.get('componentName'),
[20/26] git commit: AMBARI-7259. Slider View: Configuration section
on Deploy page should have its own scrollbar (alexantonenko)
Posted by jo...@apache.org.
AMBARI-7259. Slider View: Configuration section on Deploy page should have its own scrollbar (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c405d5fe
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c405d5fe
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c405d5fe
Branch: refs/heads/branch-alerts-dev
Commit: c405d5feee32cab500a9d5c0e7c29666942fe538
Parents: 43a4283
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Sep 11 17:39:12 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Sep 11 17:39:12 2014 +0300
----------------------------------------------------------------------
.../views/slider/src/main/resources/ui/app/styles/application.less | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c405d5fe/contrib/views/slider/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/application.less b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
index b7f385a..891c991 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
@@ -355,6 +355,7 @@ a {
}
pre {
margin-left: 30px;
+ max-height: 124px;
}
}
#step2 {
[22/26] git commit: AMBARI-7262. Slider View: Flex action for running
app not showing user input dialog (regression). (onechiporenko)
Posted by jo...@apache.org.
AMBARI-7262. Slider View: Flex action for running app not showing user input dialog (regression). (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b0fee6d4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b0fee6d4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b0fee6d4
Branch: refs/heads/branch-alerts-dev
Commit: b0fee6d4c6546f650d2e255dd646a52b6dc6d46f
Parents: a2f0bcd
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Thu Sep 11 18:39:56 2014 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Thu Sep 11 18:39:56 2014 +0300
----------------------------------------------------------------------
.../resources/ui/app/assets/data/apps/apps.json | 16 ++-
.../ui/app/controllers/slider_app_controller.js | 127 ++++++++++++++++---
.../ui/app/mappers/slider_apps_mapper.js | 4 +-
.../resources/ui/app/styles/application.less | 15 ++-
.../ui/app/templates/slider_app/flex_popup.hbs | 39 ++++++
.../src/main/resources/ui/app/translations.js | 5 +-
6 files changed, 182 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b0fee6d4/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json b/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json
index d774387..63aa0be 100644
--- a/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json
+++ b/contrib/views/slider/src/main/resources/ui/app/assets/data/apps/apps.json
@@ -83,7 +83,7 @@
"components" : {
"HBASE_MASTER" : {
"componentName" : "HBASE_MASTER",
- "instanceCount" : 1,
+ "instanceCount" : 2,
"activeContainers" : {
"container_1409333994422_0005_01_000002" : {
"released" : "false",
@@ -98,6 +98,20 @@
"exitCode" : "0",
"diagnostics" : "",
"roleId" : "1"
+ },
+ "container_1409333994422_0005_01_000003" : {
+ "released" : "false",
+ "startTime" : "1409348511279",
+ "createTime" : "1409348510529",
+ "environment" : "[AGENT_WORK_ROOT=\"$PWD\", HADOOP_USER_NAME=\"yarn\", AGENT_LOG_ROOT=\"$LOG_DIRS\", PYTHONPATH=\"./infra/agent/slider-agent/\", SLIDER_PASSPHRASE=\"DEV\"]",
+ "host" : "с6402.ambari.apache.org",
+ "name" : "container_1409333994422_0005_01_000002",
+ "command" : "python ./infra/agent/slider-agent/agent/main.py --label container_1409333994422_0005_01_000002___HBASE_MASTER --zk-quorum с6401.ambari.apache.org:2181 --zk-reg-path /registry/org-apache-slider/h4 ; ",
+ "state" : "3",
+ "role" : "HBASE_MASTER",
+ "exitCode" : "0",
+ "diagnostics" : "",
+ "roleId" : "1"
}
},
"completedContainers" : { }
http://git-wip-us.apache.org/repos/asf/ambari/blob/b0fee6d4/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
index f160383..e78a1b3 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
@@ -126,24 +126,82 @@ App.SliderAppController = Ember.ObjectController.extend({
},
/**
+ * Buttons for Flex modal popup
+ * @type {Em.Object[]}
+ */
+ flexModalButtons: [
+ Ember.Object.create({title: Em.I18n.t('common.cancel'), clicked:"closeFlex", dismiss: 'modal'}),
+ Ember.Object.create({title: Em.I18n.t('common.send'), clicked:"submitFlex", type:'success'})
+ ],
+
+ /**
+ * Grouped components by name
+ * @type {{name: string, count: number}[]}
+ */
+ groupedComponents: [],
+
+ /**
+ * Group components by <code>componentName</code> and save them to <code>groupedComponents</code>
+ * @method groupComponents
+ */
+ groupComponents: function() {
+ var groupedComponents = this.get('appType.components').map(function(c) {
+ return {
+ name: c.get('name'),
+ count: 0
+ };
+ });
+
+ this.get('components').forEach(function(component) {
+ var name = component.get('componentName'),
+ group = groupedComponents.findBy('name', name);
+ if (group) {
+ group.count++;
+ }
+ });
+ this.set('groupedComponents', groupedComponents);
+ },
+
+ /**
+ * Does new instance counts are invalid
+ * @type {bool}
+ */
+ groupedComponentsHaveErrors: false,
+
+ /**
+ * Validate new instance counts for components (should be integer and >= 0)
+ * @method validateGroupedComponents
+ * @returns {boolean}
+ */
+ validateGroupedComponents: function() {
+ var hasErrors = false;
+ this.get('groupedComponents').forEach(function(c) {
+ if (!/^\d+$/.test(c.count)) {
+ hasErrors = true;
+ return;
+ }
+ var count = parseInt(c.count + 0);
+ if (count < 0) {
+ hasErrors = true;
+ }
+ });
+ this.set('groupedComponentsHaveErrors', hasErrors);
+ return hasErrors;
+ },
+
+ /**
* Do request to <strong>flex</strong> current slider's app
- * @returns {$.ajax}
* @method flex
*/
flex: function() {
- var model = this.get('model');
- return App.ajax.send({
- name: 'flexApp',
- sender: this,
- data: {
- id: model.get('id'),
- data: {
- id: model.get('id'),
- name: model.get('name'),
- components: this.mapComponentsForFlexRequest()
- }
- }
- });
+ this.groupComponents();
+ Bootstrap.ModalManager.open(
+ 'flex-popup',
+ 'Flex',
+ 'slider_app/flex_popup',
+ this.get('flexModalButtons'),
+ this
+ );
},
/**
@@ -165,9 +223,9 @@ App.SliderAppController = Ember.ObjectController.extend({
*/
mapComponentsForFlexRequest: function() {
var components = {};
- this.get('model.components').forEach(function(component) {
- components[component.get('name')] = {
- instanceCount: component.get('defaultNumInstances')
+ this.get('groupedComponents').forEach(function(component) {
+ components[Em.get(component, 'name')] = {
+ instanceCount: Em.get(component, 'count')
}
});
return components;
@@ -200,6 +258,41 @@ App.SliderAppController = Ember.ObjectController.extend({
actions: {
/**
+ * Submit new instance counts for app components
+ * @method submitFlex
+ * @returns {*}
+ */
+ submitFlex: function() {
+ if (this.validateGroupedComponents()) return;
+ var model = this.get('model'),
+ components = this.mapComponentsForFlexRequest();
+ this.get('groupedComponents').clear();
+ this.set('groupedComponentsHaveErrors', false);
+ Bootstrap.ModalManager.close('flex-popup');
+ return App.ajax.send({
+ name: 'flexApp',
+ sender: this,
+ data: {
+ id: model.get('id'),
+ data: {
+ id: model.get('id'),
+ name: model.get('name'),
+ components: components
+ }
+ }
+ });
+ },
+
+ /**
+ * Close flex-popup
+ * @method closeFlex
+ */
+ closeFlex: function() {
+ this.get('groupedComponents').clear();
+ this.set('groupedComponentsHaveErrors', false);
+ },
+
+ /**
* Handler for "Yes" click in modal popup
* @returns {*}
* @method modalConfirmed
http://git-wip-us.apache.org/repos/asf/ambari/blob/b0fee6d4/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
index 6b83eea..013c65c 100644
--- a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
+++ b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
@@ -75,8 +75,8 @@ App.SliderAppsMapper = App.Mapper.createWithMixins(App.RunPeriodically, {
appId = data.id;
Object.keys(data.components).forEach(function (key) {
- var component = data.components[key];
- activeContainers = Object.keys(component.activeContainers);
+ var component = data.components[key],
+ activeContainers = Object.keys(component.activeContainers);
for (var i = 0; i < component.instanceCount; i++) {
components.pushObject(
Ember.Object.create({
http://git-wip-us.apache.org/repos/asf/ambari/blob/b0fee6d4/contrib/views/slider/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/application.less b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
index c0988f2..f3c4df9 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
@@ -16,6 +16,10 @@
* limitations under the License.
*/
+.table-row() {
+ margin: 10px 0;
+}
+
html {
overflow-y: scroll;
}
@@ -380,6 +384,7 @@ a {
}
}
}
+
.app-page {
.wrap-tabs {
margin-top: 30px;
@@ -539,7 +544,6 @@ a {
}
}
-
.chart-container {
cursor: default;
@@ -620,13 +624,12 @@ a {
}
}
-
.app_configs {
a.accordion-toggle {
display: block;
}
.row {
- margin: 10px 0;
+ .table-row();
textarea {
height: 200px;
padding-left: 5px;
@@ -695,3 +698,9 @@ a {
color: #999;
}
}
+
+.flex-popup {
+ .row {
+ .table-row();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b0fee6d4/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/flex_popup.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/flex_popup.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/flex_popup.hbs
new file mode 100644
index 0000000..70dfce8
--- /dev/null
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/flex_popup.hbs
@@ -0,0 +1,39 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div class="container flex-popup">
+ <form class="form-horizontal" role="form">
+ <div class="form-group">
+ <div class="col-sm-2"><strong>{{t common.components}}</strong></div>
+ <div class="col-sm-4"><strong>{{t wizard.step2.table.instances}}</strong></div>
+ </div>
+ {{#each component in groupedComponents}}
+ <div class="form-group">
+ <div class="col-sm-2">{{component.name}}</div>
+ <div class="col-sm-4">{{input value=component.count}}</div>
+ </div>
+ {{/each}}
+ <div class="form-group">
+ {{#if groupedComponentsHaveErrors}}
+ <div class="col-sm-5 alert alert-danger">
+ {{t sliderApp.flex.invalid_counts}}
+ </div>
+ {{/if}}
+ </div>
+ </form>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b0fee6d4/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 056b21f..51c9352 100644
--- a/contrib/views/slider/src/main/resources/ui/app/translations.js
+++ b/contrib/views/slider/src/main/resources/ui/app/translations.js
@@ -49,7 +49,8 @@ Em.I18n.translations = {
'description': 'Description',
'alerts': 'Alerts',
'key': 'Key',
- 'remove': 'Remove'
+ 'remove': 'Remove',
+ 'send': 'Send'
},
'error.noHDFS': 'Slider applications view requires HDFS service.',
@@ -80,6 +81,8 @@ Em.I18n.translations = {
'slider.apps.create': 'Create App',
'sliderApps.filters.info': '{0} of {1} sliders showing',
+ 'sliderApp.flex.invalid_counts': 'Instance counts should be integer and >= 0',
+
'sliderApp.summary.go_to_nagios': 'Go to Nagios',
'sliderApp.summary.go_to_ganglia': 'Go to Ganglia',
[16/26] git commit: AMBARI-7255 Slider View: Create slider app should
have add/remove/cancel buttons consistent with Ambari. (ababiichuk)
Posted by jo...@apache.org.
AMBARI-7255 Slider View: Create slider app should have add/remove/cancel buttons consistent with Ambari. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/71c98457
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/71c98457
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/71c98457
Branch: refs/heads/branch-alerts-dev
Commit: 71c984577ff80b1ea0adecd50badf4f632114423
Parents: 11c057d
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Sep 11 12:55:33 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Sep 11 12:55:33 2014 +0300
----------------------------------------------------------------------
.../ui/app/components/configSection.js | 12 ++-
.../resources/ui/app/styles/application.less | 7 +-
.../app/templates/components/configSection.hbs | 90 ++++++++++----------
.../src/main/resources/ui/app/translations.js | 4 +-
4 files changed, 63 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/71c98457/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
index c5858bc..43a2427 100644
--- a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
+++ b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
@@ -92,6 +92,15 @@ App.ConfigSectionComponent = Em.Component.extend({
});
},
+ addPropertyModalButtons: [
+ Ember.Object.create({title: Em.I18n.t('common.cancel'), clicked:"discard", dismiss: 'modal'}),
+ Ember.Object.create({title: Em.I18n.t('common.add'), clicked:"submit", type:'success'})
+ ],
+
+ addPropertyModalTitle: Em.I18n.t('configs.add_property'),
+
+ tooltipRemove: Em.I18n.t('common.remove'),
+
actions: {
/**
@@ -99,7 +108,7 @@ App.ConfigSectionComponent = Em.Component.extend({
* @method addProperty
*/
addProperty: function() {
- this.toggleProperty('buttonVisible');
+ return Bootstrap.ModalManager.show('addPropertyModal');
},
/**
@@ -116,6 +125,7 @@ App.ConfigSectionComponent = Em.Component.extend({
* @method submit
*/
submit: function() {
+ Bootstrap.ModalManager.hide('addPropertyModal');
var name = this.get('newConfig.name'),
value = this.get('newConfig.value');
if (this.get('config').mapBy('name').contains(name)) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/71c98457/contrib/views/slider/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/application.less b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
index f5024a1..eb71c9a 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
@@ -19,7 +19,12 @@
html {
overflow-y: scroll;
}
-
+.icon-minus-sign {
+ color: #FF4B4B;
+}
+.tooltip {
+ z-index: 1500;
+}
.popover {
max-width: 800px;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/71c98457/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
index c6c77ec..b0d1db7 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/components/configSection.hbs
@@ -17,60 +17,56 @@
}}
{{#bs-panel heading=sectionLabel collapsible=true dismiss=false open=isGeneral }}
- <form class="form-horizontal" role="form">
- {{#each config in sectionConfigs}}
- <div class="form-group">
-
- <label class="col-sm-4 control-label">{{formatWordBreak config.label devider='.'}}</label>
-
- <div class="col-sm-6">
- {{input value=config.value class="form-control"}}
- </div>
+ <form class="form-horizontal" role="form">
+ {{#each config in sectionConfigs}}
+ <div class="form-group">
+ <label class="col-sm-4 control-label">{{formatWordBreak config.label devider='.'}}</label>
+ <div class="col-sm-6">
+ {{input value=config.value class="form-control"}}
+ </div>
+ {{#if isCustom}}
+ <div class="col-sm-2">
+ {{#bs-button clicked="deleteConfig" clickedParamBinding="config"}}
+ <i {{bs-bind-tooltip content=tooltipRemove}} class="icon-minus-sign"></i>{{/bs-button}}
+ </div>
+ {{/if}}
- {{#if isCustom}}
- <div class="col-sm-2">
- {{#bs-button clicked="deleteConfig" clickedParamBinding="config" type="danger"}}{{t common.delete}}{{/bs-button}}
</div>
- {{/if}}
-
- </div>
- {{/each}}
- </form>
- {{#if isCustom}}
- {{#if buttonVisible}}
- {{#bs-button clicked="addProperty" type="primary"}}{{t configs.add_property}}{{/bs-button}}
- {{else}}
- {{! "Add Property"-form}}
- <form class="form-horizontal" role="form">
+ {{/each}}
+ </form>
+ {{#if isCustom}}
+ {{#bs-button clicked="addProperty" type="link"}}{{t configs.add_property}}...{{/bs-button}}
+ {{/if}}
+{{/bs-panel}}
+{{#bs-modal name="addPropertyModal" footerButtonsBinding="addPropertyModalButtons" titleBinding="addPropertyModalTitle"}}
+{{! "Add Property"-form}}
+ <form class="form-horizontal" role="form">
<div class="form-group">
- <div class="col-sm-4">
- <label class="control-label">{{t common.name}}</label>
- </div>
- <div class="col-sm-6">
- <label class="control-label">{{t common.value}}</label>
- </div>
+ <div class="col-sm-4">
+ <label class="control-label">{{t common.key}}</label>
+ </div>
+ <div class="col-sm-6">
+ {{input value=newConfig.name class="form-control"}}
+ </div>
</div>
<div {{bind-attr class=":form-group newConfig.hasError:has-error"}}>
- <div class="col-sm-4">
- {{input value=newConfig.name class="form-control"}}
- </div>
- <div class="col-sm-6">
- {{input value=newConfig.value class="form-control"}}
- </div>
+ <div class="col-sm-4">
+ <label class="control-label">{{t common.value}}</label>
+ </div>
+ <div class="col-sm-6">
+ {{input value=newConfig.value class="form-control"}}
+ </div>
</div>
<div class="form-group">
{{#if newConfig.hasError}}
- <div class="col-sm-10">
- <div class="alert alert-danger">
- {{newConfig.messsage}}
- </div>
- </div>
+ <div class="col-sm-10">
+ <div class="alert alert-danger">
+ {{newConfig.messsage}}
+ </div>
+ </div>
{{/if}}
</div>
- {{#bs-button clicked="submit" type="primary"}}{{t common.add}}{{/bs-button}}
- {{#bs-button clicked="discard"}}{{t common.cancel}}{{/bs-button}}
- </form>
- {{! "Add Property"-form end}}
- {{/if}}
- {{/if}}
-{{/bs-panel}}
+ </form>
+{{! "Add Property"-form end}}
+{{/bs-modal}}
+{{outlet bs-tooltip-box}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/71c98457/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 efa3979..8957c29 100644
--- a/contrib/views/slider/src/main/resources/ui/app/translations.js
+++ b/contrib/views/slider/src/main/resources/ui/app/translations.js
@@ -47,7 +47,9 @@ Em.I18n.translations = {
'finished': 'Finished',
'diagnostics': 'Diagnostics',
'description': 'Description',
- 'alerts': 'Alerts'
+ 'alerts': 'Alerts',
+ 'key': 'Key',
+ 'remove': 'Remove'
},
'error.noHDFS': 'Slider applications view requires HDFS service.',