You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2016/03/02 03:46:38 UTC
ambari git commit: AMBARI-15258. Make Hive Server Interactive
component as hidden till the point "Turn on Interactive Query" from UI is
turned ON. (jaimin)
Repository: ambari
Updated Branches:
refs/heads/trunk fa38d29a1 -> 9979e429e
AMBARI-15258. Make Hive Server Interactive component as hidden till the point "Turn on Interactive Query" from UI is turned ON. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9979e429
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9979e429
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9979e429
Branch: refs/heads/trunk
Commit: 9979e429e628cb146533977136a0b85319377f1b
Parents: fa38d29
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Tue Mar 1 18:45:41 2016 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Tue Mar 1 18:45:41 2016 -0800
----------------------------------------------------------------------
.../HIVE/configuration/llap-daemon-log4j.xml | 126 +++++++++++++++++++
.../services/HIVE/configuration/llap-env.xml | 72 +++++++++++
.../stacks/HDP/2.4/services/HIVE/metainfo.xml | 9 +-
.../HDP/2.4/services/HIVE/themes/theme.json | 76 +++++++++++
ambari-web/app/controllers.js | 1 +
.../wizard/step7/assign_master_controller.js | 107 ++++++++++++++++
.../app/controllers/wizard/step7_controller.js | 15 ++-
.../app/controllers/wizard/step8_controller.js | 20 +--
ambari-web/app/messages.js | 3 +
.../mixins/wizard/assign_master_components.js | 18 ++-
ambari-web/app/models.js | 1 +
.../app/models/configs/theme/config_action.js | 57 +++++++++
.../app/models/stack_service_component.js | 2 +-
.../common/assign_master_components.hbs | 4 +-
ambari-web/app/utils/configs/theme/theme.js | 45 ++++++-
ambari-web/app/views.js | 1 +
.../common/assign_master_components_view.js | 2 +
.../views/wizard/step7/assign_master_view.js | 44 +++++++
.../test/controllers/wizard/step8_test.js | 3 +-
19 files changed, 585 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-daemon-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-daemon-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-daemon-log4j.xml
new file mode 100644
index 0000000..1c60285
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-daemon-log4j.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<configuration supports_final="false" supports_adding_forbidden="true">
+ <property>
+ <name>content</name>
+ <description>Custom log4j.properties</description>
+ <value>
+# 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.
+status = WARN
+name = LlapDaemonLog4j2
+packages = org.apache.hadoop.hive.ql.log
+
+# list of properties
+property.llap.daemon.log.level = WARN
+property.llap.daemon.root.logger = console
+property.llap.daemon.log.dir = .
+property.llap.daemon.log.file = llapdaemon.log
+property.llap.daemon.historylog.file = llapdaemon_history.log
+property.llap.daemon.log.maxfilesize = 256MB
+property.llap.daemon.log.maxbackupindex = 20
+
+# list of all appenders
+appenders = console, RFA, HISTORYAPPENDER
+
+# console appender
+appender.console.type = Console
+appender.console.name = console
+appender.console.target = SYSTEM_ERR
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yy/MM/dd HH:mm:ss} [%t%x] %p %c{2} : %m%n
+
+# rolling file appender
+appender.RFA.type = RollingFile
+appender.RFA.name = RFA
+appender.RFA.fileName = ${sys:llap.daemon.log.dir}/${sys:llap.daemon.log.file}
+appender.RFA.filePattern = ${sys:llap.daemon.log.dir}/${sys:llap.daemon.log.file}_%i
+appender.RFA.layout.type = PatternLayout
+appender.RFA.layout.pattern = %d{ISO8601} %-5p [%t%x]: %c{2} (%F:%M(%L)) - %m%n
+appender.RFA.policies.type = Policies
+appender.RFA.policies.size.type = SizeBasedTriggeringPolicy
+appender.RFA.policies.size.size = ${sys:llap.daemon.log.maxfilesize}
+appender.RFA.strategy.type = DefaultRolloverStrategy
+appender.RFA.strategy.max = ${sys:llap.daemon.log.maxbackupindex}
+
+# history file appender
+appender.HISTORYAPPENDER.type = RollingFile
+appender.HISTORYAPPENDER.name = HISTORYAPPENDER
+appender.HISTORYAPPENDER.fileName = ${sys:llap.daemon.log.dir}/${sys:llap.daemon.historylog.file}
+appender.HISTORYAPPENDER.filePattern = ${sys:llap.daemon.log.dir}/${sys:llap.daemon.historylog.file}_%i
+appender.HISTORYAPPENDER.layout.type = PatternLayout
+appender.HISTORYAPPENDER.layout.pattern = %m%n
+appender.HISTORYAPPENDER.policies.type = Policies
+appender.HISTORYAPPENDER.policies.size.type = SizeBasedTriggeringPolicy
+appender.HISTORYAPPENDER.policies.size.size = ${sys:llap.daemon.log.maxfilesize}
+appender.HISTORYAPPENDER.strategy.type = DefaultRolloverStrategy
+appender.HISTORYAPPENDER.strategy.max = ${sys:llap.daemon.log.maxbackupindex}
+
+# list of all loggers
+loggers = NIOServerCnxn, ClientCnxnSocketNIO, DataNucleus, Datastore, JPOX, HistoryLogger
+
+logger.NIOServerCnxn.name = org.apache.zookeeper.server.NIOServerCnxn
+logger.NIOServerCnxn.level = WARN
+
+logger.ClientCnxnSocketNIO.name = org.apache.zookeeper.ClientCnxnSocketNIO
+logger.ClientCnxnSocketNIO.level = WARN
+
+logger.DataNucleus.name = DataNucleus
+logger.DataNucleus.level = ERROR
+
+logger.Datastore.name = Datastore
+logger.Datastore.level = ERROR
+
+logger.JPOX.name = JPOX
+logger.JPOX.level = ERROR
+
+logger.HistoryLogger.name = org.apache.hadoop.hive.llap.daemon.HistoryLogger
+logger.HistoryLogger.level = WARN
+logger.HistoryLogger.additivity = false
+logger.HistoryLogger.appenderRefs = HistoryAppender
+logger.HistoryLogger.appenderRef.HistoryAppender.ref = HISTORYAPPENDER
+
+# root logger
+rootLogger.level = ${sys:llap.daemon.log.level}
+rootLogger.appenderRefs = root
+rootLogger.appenderRef.root.ref = ${sys:llap.daemon.root.logger}
+ </value>
+ <value-attributes>
+ <type>content</type>
+ <show-property-name>false</show-property-name>
+ </value-attributes>
+ </property>
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-env.xml
new file mode 100644
index 0000000..24a95cf
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/configuration/llap-env.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+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.
+-->
+<configuration supports_final="false" supports_adding_forbidden="true">
+ <property>
+ <name>enable_hive_interactive</name>
+ <value>false</value>
+ <description>Enable or disable interactive query in this cluster.</description>
+ <display-name>Enable Interactive Query</display-name>
+ <value-attributes>
+ <type>value-list</type>
+ <entries>
+ <entry>
+ <value>true</value>
+ <label>Yes</label>
+ </entry>
+ <entry>
+ <value>false</value>
+ <label>No</label>
+ </entry>
+ </entries>
+ <selection-cardinality>1</selection-cardinality>
+ </value-attributes>
+ </property>
+ <property>
+ <name>llap_queue_name</name>
+ <value>default</value>
+ <description>LLAP Queue Name.</description>
+ <display-name>LLAP Queue Name</display-name>
+ <value-attributes>
+ <type>combo</type>
+ <entries>
+ <entry>
+ <value>default</value>
+ <label>Default</label>
+ </entry>
+ </entries>
+ <selection-cardinality>1</selection-cardinality>
+ </value-attributes>
+ </property>
+ <property>
+ <name>llap_am_queue_name</name>
+ <value>default</value>
+ <description>LLAP AM Queue Name.</description>
+ <display-name>LLAP AM Queue Name</display-name>
+ <value-attributes>
+ <type>combo</type>
+ <entries>
+ <entry>
+ <value>default</value>
+ <label>Default</label>
+ </entry>
+ </entries>
+ <selection-cardinality>1</selection-cardinality>
+ </value-attributes>
+ </property>
+</configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/metainfo.xml
index 93728fd..eb3cff6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/metainfo.xml
@@ -26,7 +26,7 @@
<name>HIVE_SERVER_INTERACTIVE</name>
<displayName>HiveServer2 Interactive</displayName>
<category>MASTER</category>
- <cardinality>0+</cardinality>
+ <cardinality>0-1</cardinality>
<versionAdvertised>true</versionAdvertised>
<clientsToUpdateConfigs></clientsToUpdateConfigs>
<dependencies>
@@ -97,6 +97,13 @@
</configuration-dependencies>
</component>
</components>
+ <themes>
+ <theme>
+ <fileName>theme.json</fileName>
+ <default>true</default>
+ </theme>
+ </themes>
+
<requiredServices>
<service>ZOOKEEPER</service>
<service>HDFS</service>
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/themes/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/themes/theme.json b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/themes/theme.json
new file mode 100644
index 0000000..26b9532
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HIVE/themes/theme.json
@@ -0,0 +1,76 @@
+{
+ "configuration" : {
+ "placement" : {
+ "configs" : [
+ {
+ "config": "llap-env/enable_hive_interactive",
+ "subsection-name": "interactive-query-row1-col1"
+ },
+ {
+ "config": "llap-env/llap_queue_name",
+ "subsection-name": "interactive-query-row1-col1",
+ "depends-on": [
+ {
+ "configs":[
+ "llap-env/enable_hive_interactive"
+ ],
+ "if": "${llap-env/enable_hive_interactive}",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
+ },
+ {
+ "config": "llap-env/llap_am_queue_name",
+ "subsection-name": "interactive-query-row1-col1",
+ "depends-on": [
+ {
+ "configs":[
+ "llap-env/enable_hive_interactive"
+ ],
+ "if": "${llap-env/enable_hive_interactive}",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "widgets" : [
+ {
+ "config": "llap-env/enable_hive_interactive",
+ "widget": {
+ "type": "toggle"
+ }
+ },
+ {
+ "config": "llap-env/llap_queue_name",
+ "widget": {
+ "type": "list"
+ }
+ },
+ {
+ "config": "llap-env/llap_am_queue_name",
+ "widget": {
+ "type": "list"
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 8fa9e6b..c9214f8 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -136,6 +136,7 @@ require('controllers/wizard/step4_controller');
require('controllers/wizard/step5_controller');
require('controllers/wizard/step6_controller');
require('controllers/wizard/step7_controller');
+require('controllers/wizard/step7/assign_master_controller');
require('controllers/wizard/step7/pre_install_checks_controller');
require('controllers/wizard/step8_controller');
require('controllers/wizard/step9_controller');
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7/assign_master_controller.js b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
new file mode 100644
index 0000000..496968b
--- /dev/null
+++ b/ambari-web/app/controllers/wizard/step7/assign_master_controller.js
@@ -0,0 +1,107 @@
+/**
+ * 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.AssignMasterOnStep7Controller = Em.Controller.extend(App.BlueprintMixin, App.AssignMasterComponents, {
+
+ name:"assignMasterOnStep7Controller",
+
+ useServerValidation: false,
+
+ showInstalledMastersFirst: false,
+
+ deferred: null,
+
+ popup: null,
+
+ mastersToCreate: [],
+
+ markSavedComponentsAsInstalled: true,
+
+ execute: function(context) {
+ var dfd = $.Deferred();
+ this.set('content', context.get('content'));
+ var allConfigs = context.get('stepConfigs').mapProperty('configs').filter(function(item) {
+ return item.length;
+ }).reduce(function(p, c) {
+ if (p) {
+ return p.concat(c);
+ }
+ });
+ var storedConfigs = this.get('content.serviceConfigProperties');
+ var configThemeActions = App.configTheme.getConfigThemeActions(allConfigs, storedConfigs || []);
+
+ if (configThemeActions['add'].length) {
+ this.showAssignComponentPopup(dfd, configThemeActions['add']);
+ } else {
+ if (configThemeActions['delete'].length) {
+ this.removeMasterComponent(configThemeActions['delete']);
+ }
+ dfd.resolve();
+ }
+ return dfd.promise();
+ },
+
+ showAssignComponentPopup: function(dfd, componentsToAdd) {
+ var self = this;
+ this.set('deferred', dfd);
+ this.set('mastersToCreate', componentsToAdd);
+
+ var popup = App.ModalPopup.show({
+ classNames: ['full-width-modal', 'add-service-wizard-modal'],
+ header: Em.I18n.t('admin.highAvailability.wizard.step2.header'),
+ bodyClass: App.AssignMasterOnStep7View.extend({
+ controller: self
+ }),
+ primary: Em.I18n.t('form.cancel'),
+ showFooter: false,
+ secondary: null,
+ onClose: function () {
+ this.hide();
+ },
+ didInsertElement: function () {
+ this._super();
+ this.fitHeight();
+ }
+ });
+ this.set('popup', popup);
+ },
+
+ removeMasterComponent: function(componentsToDelete) {
+ var parentController = App.router.get(this.get('content.controllerName'));
+ var masterComponentHosts = this.get('content.masterComponentHosts');
+ componentsToDelete.forEach(function(_componentName) {
+ masterComponentHosts = masterComponentHosts.rejectProperty('component',_componentName);
+ }, this);
+ this.get('content').set('masterComponentHosts', masterComponentHosts);
+ parentController.setDBProperty('masterComponentHosts', masterComponentHosts);
+ },
+
+ /**
+ * Submit button click handler
+ * @method submit
+ */
+ submit: function () {
+ if (this.get('deferred')) {
+ this.get('popup').hide();
+ var controller = App.router.get(this.get('content.controllerName'));
+ controller.saveMasterComponentHosts(this);
+ this.get('deferred').resolve();
+ this.set('deferred', null);
+ }
+ }
+});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index fc6b5ab..91385b3 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -1614,17 +1614,24 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
* @method submit
*/
submit: function () {
+ var self = this;
if (this.get('isSubmitDisabled') || App.router.nextBtnClickInProgress) {
return false;
}
- var preInstallChecksController = App.router.get('preInstallChecksController');
+
+ var assignMasterOnStep7Controller = App.router.get('assignMasterOnStep7Controller');
+ var dfdPromise = assignMasterOnStep7Controller.execute(self);
+
if (this.get('supportsPreInstallChecks')) {
+ var preInstallChecksController = App.router.get('preInstallChecksController');
if (preInstallChecksController.get('preInstallChecksWhereRun')) {
- return this.postSubmit();
+ return dfdPromise.done(self.postSubmit.bind(self));
}
- return preInstallChecksController.notRunChecksWarnPopup(this.postSubmit.bind(this));
+ return dfdPromise.done(function() {
+ preInstallChecksController.notRunChecksWarnPopup(self.postSubmit.bind(self));
+ });
}
- return this.postSubmit();
+ return dfdPromise.done(self.postSubmit.bind(self));
},
postSubmit: function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/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 911d0a8..27374b9 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -437,8 +437,6 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
service.get('serviceComponents').forEach(function (component) {
// show clients for services that have only clients components
if ((component.get('isClient') || component.get('isRequiredOnAllHosts')) && !service.get('isClientOnlyService')) return;
- // skip components that was hide on assign master page
- if (component.get('isMaster') && !component.get('isShownOnInstallerAssignMasterPage')) return;
// no HA component
if (component.get('isHAComponentOnly')) return;
// skip if component is not allowed on single node cluster
@@ -450,11 +448,19 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
// remove service name from component display name
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'),
- display_name: displayName,
- component_value: this.assignComponentHosts(component)
- }));
+
+ var componentName = component.get('componentName');
+ var masterComponents = this.get('content.masterComponentHosts');
+ var isMasterComponentSelected = masterComponents.someProperty('component', componentName);
+ var isMaster = component.get('isMaster');
+
+ if (!isMaster || isMasterComponentSelected) {
+ serviceObj.get('service_components').pushObject(Em.Object.create({
+ component_name: component.get('isClient') ? Em.I18n.t('common.client').toUpperCase() : component.get('componentName'),
+ display_name: displayName,
+ component_value: this.assignComponentHosts(component)
+ }));
+ }
}, this);
if (service.get('customReviewHandler')) {
for (var displayName in service.get('customReviewHandler')) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index d0c8840..a12b729 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -853,6 +853,9 @@ Em.I18n.translations = {
'installer.step7.preInstallChecks.checksPopup.header':'Pre Install Checks',
+ 'installer.step7.assign.master.body':'Assign {0} to {1} you want to run {2} on.',
+
+
'installer.step8.header': 'Review',
'installer.step8.body': 'Please review the configuration before installation',
'installer.step8.kerberors.warning': '<strong>Because Kerberos has been manually installed on the cluster, you will have to create/distribute principals and keytabs when this operation is finished.</strong>',
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/mixins/wizard/assign_master_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js
index 0500014..4fe5d95 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -37,6 +37,12 @@ App.AssignMasterComponents = Em.Mixin.create({
mastersToShow: [],
/**
+ * Array of master component names to show on the service config assign master page
+ * @type {Array}
+ */
+ mastersToCreate: [],
+
+ /**
* Array of master component names to add for install
* @type {Array}
*/
@@ -110,6 +116,8 @@ App.AssignMasterComponents = Em.Mixin.create({
*/
recommendedHostsForComponents: {},
+ markSavedComponentsAsInstalled: false,
+
/**
* Array of <code>servicesMasters</code> objects, that will be shown on the page
* Are filtered using <code>mastersToShow</code>
@@ -446,7 +454,7 @@ App.AssignMasterComponents = Em.Mixin.create({
},
/**
- * Composes selected values of comboboxes into master blueprint + merge it with currenlty installed slave blueprint
+ * Composes selected values of comboboxes into master blueprint + merge it with currently installed slave blueprint
*/
getCurrentBlueprint: function() {
var self = this;
@@ -516,7 +524,7 @@ App.AssignMasterComponents = Em.Mixin.create({
self.get('addableComponents').forEach(function (componentName) {
self.updateComponent(componentName);
}, self);
- if (self.thereIsNoMasters()) {
+ if (self.thereIsNoMasters() && !this.get('mastersToCreate').length) {
App.router.send('next');
}
},
@@ -668,11 +676,11 @@ App.AssignMasterComponents = Em.Mixin.create({
App.StackServiceComponent.find().forEach(function(component) {
if (this.get('isInstallerWizard')) {
- if (component.get('isShownOnInstallerAssignMasterPage')) {
+ if (component.get('isShownOnInstallerAssignMasterPage') || this.get('mastersToCreate').contains(component.get('componentName'))) {
stackMasterComponentsMap[component.get('componentName')] = component;
}
} else {
- if (component.get('isShownOnAddServiceAssignMasterPage') || this.get('mastersToShow').contains(component.get('componentName'))) {
+ if (component.get('isShownOnAddServiceAssignMasterPage') || this.get('mastersToShow').contains(component.get('componentName')) || this.get('mastersToCreate').contains(component.get('componentName'))) {
stackMasterComponentsMap[component.get('componentName')] = component;
}
}
@@ -737,7 +745,7 @@ App.AssignMasterComponents = Em.Mixin.create({
componentObj.serviceId = fullComponent.get('serviceName');
componentObj.isServiceCoHost = App.StackServiceComponent.find().findProperty('componentName', componentName).get('isCoHostedComponent') && !this.get('mastersToMove').contains(componentName);
componentObj.selectedHost = savedComponent ? savedComponent.hostName : hostName;
- componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : false;
+ componentObj.isInstalled = savedComponent ? savedComponent.isInstalled || (this.get('markSavedComponentsAsInstalled') && !this.get('mastersToCreate').contains(fullComponent.get('componentName'))) : false;
return componentObj;
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/models.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models.js b/ambari-web/app/models.js
index 01fe689..1112b0c 100644
--- a/ambari-web/app/models.js
+++ b/ambari-web/app/models.js
@@ -70,6 +70,7 @@ require('models/configs/theme/tab');
require('models/configs/theme/section');
require('models/configs/theme/sub_section');
require('models/configs/theme/sub_section_tab');
+require('models/configs/theme/config_action');
require('models/configs/objects/service_config');
require('models/configs/objects/service_config_category');
require('models/configs/objects/service_config_property');
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/models/configs/theme/config_action.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/theme/config_action.js b/ambari-web/app/models/configs/theme/config_action.js
new file mode 100644
index 0000000..288c674
--- /dev/null
+++ b/ambari-web/app/models/configs/theme/config_action.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.
+ */
+
+/**
+ * THIS IS NOT USED FOR NOW
+ * FOR CONFIG GROUPS WE ARE USING OLD MODELS AND LOGIC
+ */
+
+var App = require('app');
+
+App.ConfigAction = DS.Model.extend({
+
+ hostComponent: DS.attr('string'),
+
+ configs: DS.attr('array', {defaultValue: []}),
+
+ /**
+ * conditional String which can be evaluated to boolean result.
+ * If evaluated result of this staring is true then use the statement provided by `then` attribute.
+ * Otherwise use the attribute provided by `else` attributes
+ */
+ if: DS.attr('string'),
+ then: DS.attr('string'),
+ else: DS.attr('string')
+
+});
+
+App.ConfigAction.FIXTURES = [
+ {
+ id:1,
+ host_component: 'HIVE_SERVER_INTERACTIVE',
+ "configs":[
+ {
+ configName: "enable_hive_interactive",
+ fileName: "llap-env.xml"
+ }
+ ],
+ if:'${llap-env/enable_hive_interactive}',
+ then:'add',
+ else: 'delete'
+ }
+];
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/models/stack_service_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js
index a9b342b..26ff1b8 100644
--- a/ambari-web/app/models/stack_service_component.js
+++ b/ambari-web/app/models/stack_service_component.js
@@ -101,7 +101,7 @@ App.StackServiceComponent = DS.Model.extend({
/** @property {Boolean} isShownOnInstallerAssignMasterPage - component visible on "Assign Masters" step of Install Wizard **/
isShownOnInstallerAssignMasterPage: function() {
var component = this.get('componentName');
- var mastersNotShown = ['MYSQL_SERVER', 'POSTGRESQL_SERVER'];
+ var mastersNotShown = ['MYSQL_SERVER', 'POSTGRESQL_SERVER', 'HIVE_SERVER_INTERACTIVE'];
return this.get('isMaster') && !mastersNotShown.contains(component);
}.property('isMaster','componentName'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/templates/common/assign_master_components.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/assign_master_components.hbs b/ambari-web/app/templates/common/assign_master_components.hbs
index f7cebed..ea77c73 100644
--- a/ambari-web/app/templates/common/assign_master_components.hbs
+++ b/ambari-web/app/templates/common/assign_master_components.hbs
@@ -138,7 +138,9 @@
{{view App.SpinnerView}}
{{/if}}
<div class="btn-area">
+ {{#if view.isBackButtonVisible}}
<a class="btn pull-left installer-back-btn" {{action back}}>← {{t common.back}}</a>
- <a class="btn btn-success pull-right" {{bindAttr disabled="submitDisabled"}} {{action submit target="controller"}}>{{t common.next}} →</a>
+ {{/if}}
+ <a class="btn btn-success pull-right" {{bindAttr disabled="submitDisabled"}} {{action submit target="controller"}}>{{t common.next}} →</a>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/utils/configs/theme/theme.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/theme/theme.js b/ambari-web/app/utils/configs/theme/theme.js
index a7d3b68..f0cf966 100644
--- a/ambari-web/app/utils/configs/theme/theme.js
+++ b/ambari-web/app/utils/configs/theme/theme.js
@@ -61,7 +61,50 @@ App.configTheme = Em.Object.create({
}
}
}
- });
+ }, this);
+ },
+
+ getConfigThemeActions: function(configs, storedConfigs) {
+ //config actions for changed configs should be only effective
+ var configActions = App.ConfigAction.find().filter(function(item){
+ var isAnyConfigAbsent = false;
+ var configChanged = false;
+ item.get("configs").forEach(function(_config){
+ var config = configs.filterProperty('filename',_config.fileName).findProperty('name', _config.configName);
+ if (!config) {
+ isAnyConfigAbsent = true;
+ } else {
+ configChanged = configChanged || config.get('value') != config.get('recommendedValue');
+ var storedConfig = storedConfigs.filterProperty('filename',_config.fileName).findProperty('name', _config.configName);
+ if (storedConfig) {
+ configChanged = configChanged || config.get('value') != storedConfig.value;
+ }
+ }
+ }, this);
+ return !isAnyConfigAbsent && configChanged;
+ }, this);
+
+ var componentsToAdd = [];
+ var componentsToDelete = [];
+ configActions.forEach(function(_action){
+ var isConditionTrue = this.calculateConfigCondition(_action.get('if'), configs);
+ var action = isConditionTrue ? _action.get("then") : _action.get("else");
+ switch(action) {
+ case 'add':
+ componentsToAdd.push(_action.get('hostComponent'));
+ break;
+ case 'delete':
+ componentsToDelete.push(_action.get('hostComponent'));
+ break;
+ }
+ }, this);
+
+ var configThemeActions = {
+ add: componentsToAdd,
+ delete: componentsToDelete
+ };
+
+ return configThemeActions;
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 9d606e9..9761d11 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -328,6 +328,7 @@ require('views/wizard/step4_view');
require('views/wizard/step5_view');
require('views/wizard/step6_view');
require('views/wizard/step7_view');
+require('views/wizard/step7/assign_master_view');
require('views/main/service/reassign/step7_view');
require('views/wizard/step8_view');
require('views/wizard/step9_view');
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/views/common/assign_master_components_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/assign_master_components_view.js b/ambari-web/app/views/common/assign_master_components_view.js
index e37d864..da45ee9 100644
--- a/ambari-web/app/views/common/assign_master_components_view.js
+++ b/ambari-web/app/views/common/assign_master_components_view.js
@@ -41,6 +41,8 @@ App.AssignMasterComponentsView = Em.View.extend({
*/
shouldUseInputs: Em.computed.gt('controller.hosts.length', 25),
+ isBackButtonVisible: true,
+
didInsertElement: function () {
this.get('controller').loadStep();
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/app/views/wizard/step7/assign_master_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step7/assign_master_view.js b/ambari-web/app/views/wizard/step7/assign_master_view.js
new file mode 100644
index 0000000..2bc2ce3
--- /dev/null
+++ b/ambari-web/app/views/wizard/step7/assign_master_view.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.
+ */
+
+
+var App = require('app');
+
+require('views/wizard/step5_view');
+
+App.AssignMasterOnStep7View = App.AssignMasterComponentsView.extend({
+
+ title: Em.I18n.t('installer.step5.header'),
+
+ alertMessage: '',
+
+ isBackButtonVisible: false,
+
+ willInsertElement: function() {
+ this._super();
+ var mastersToCreate = this.get('controller.mastersToCreate');
+ var mastersToCreateDisplayName = mastersToCreate.map(function(item){
+ return App.StackServiceComponent.find().findProperty('componentName', item).get('displayName');
+ });
+ var stringText1 = mastersToCreate.length > 1 ? 'hosts' : 'host';
+ var stringText2 = mastersToCreate.length > 1 ? 'them' : 'it';
+ var alertMessage = Em.I18n.t('installer.step7.assign.master.body').format(mastersToCreateDisplayName.join(), stringText1, stringText2);
+ this.set('alertMessage', alertMessage)
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/9979e429/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index e647eda..5f6e4f7 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -376,7 +376,8 @@ describe('App.WizardStep8Controller', function () {
hosts: Em.A([
Em.Object.create({hostName: 'h1', isInstalled: true}),
Em.Object.create({hostName: 'h2', isInstalled: false})
- ])
+ ]),
+ masterComponentHosts: []
});
installerStep8Controller.set('content', content);
installerStep8Controller.set('services', Em.A([]));