[7/7] ambari git commit: Merge branch 'trunk' into branch-feature-AMBARI-18456

2016-12-02 Thread jonathanhurley
Merge branch 'trunk' into branch-feature-AMBARI-18456


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 3bbe75c3bd7b1a913905137465c19b2c7f7c9ba9
Parents: a58c39c 3096c79
Author: Jonathan Hurley 
Authored: Fri Dec 2 22:40:18 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 22:40:18 2016 -0500

--
 ambari-agent/conf/unix/ambari-agent.ini |   3 +
 .../ambari_agent/CustomServiceOrchestrator.py   | 120 +++
 ambari-agent/src/packages/tarball/all.xml   |  30 +
 .../ambari/server/agent/ExecutionCommand.java   |  28 +
 .../ambari/server/agent/HeartBeatHandler.java   |   2 +-
 .../AmbariManagementControllerImpl.java |   5 +
 .../configuration/logsearch-properties.xml  |   2 +-
 .../HDP/2.6/services/ACCUMULO/metainfo.xml  |   2 +-
 .../stacks/HDP/2.6/services/FALCON/metainfo.xml |   2 +-
 .../stacks/HDP/2.6/services/FLUME/metainfo.xml  |   2 +-
 .../stacks/HDP/2.6/services/HBASE/metainfo.xml  |   2 +-
 .../stacks/HDP/2.6/services/HDFS/metainfo.xml   |   2 +-
 .../stacks/HDP/2.6/services/HIVE/metainfo.xml   |   2 +-
 .../stacks/HDP/2.6/services/KAFKA/metainfo.xml  |   2 +-
 .../stacks/HDP/2.6/services/KNOX/metainfo.xml   |   2 +-
 .../stacks/HDP/2.6/services/MAHOUT/metainfo.xml |   2 +-
 .../stacks/HDP/2.6/services/OOZIE/metainfo.xml  |   1 +
 .../stacks/HDP/2.6/services/PIG/metainfo.xml|   2 +-
 .../stacks/HDP/2.6/services/RANGER/metainfo.xml |   2 +-
 .../HDP/2.6/services/RANGER_KMS/metainfo.xml|   2 +-
 .../stacks/HDP/2.6/services/SLIDER/metainfo.xml |   2 +-
 .../stacks/HDP/2.6/services/SPARK/metainfo.xml  |   2 +-
 .../stacks/HDP/2.6/services/SPARK2/metainfo.xml |   2 +-
 .../stacks/HDP/2.6/services/SQOOP/metainfo.xml  |   2 +-
 .../stacks/HDP/2.6/services/STORM/metainfo.xml  |   2 +-
 .../stacks/HDP/2.6/services/TEZ/metainfo.xml|   2 +-
 .../stacks/HDP/2.6/services/YARN/metainfo.xml   |   4 +-
 .../HDP/2.6/services/ZOOKEEPER/metainfo.xml |   2 +-
 .../HAPPY/configuration/happy-alert-config.xml  |   5 +
 .../HBASE/configuration/hbase-alert-config.xml  |   5 +
 .../HDFS/configuration/hdfs-alert-config.xml|   5 +
 .../configuration/sleepy-alert-config.xml   |   5 +
 .../SNOW/configuration/snow-alert-config.xml|   5 +
 .../YARN/configuration/yarn-alert-config.xml|   5 +
 .../ZOOKEEPER/configuration/zk-alert-config.xml |   5 +
 .../server/agent/TestHeartbeatHandler.java  |  28 +++--
 ambari-web/app/messages.js  |   1 -
 .../configs/objects/service_config_property.js  |   7 --
 .../widgets/slider_config_widget_view.js|   7 +-
 contrib/views/ambari-views-package/pom.xml  |   4 +-
 40 files changed, 269 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3bbe75c3/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--



[6/7] ambari git commit: AMBARI-19073 - Ambari Contrib View Has Inconsistent Version in pom.xml (jonathanhurley)

2016-12-02 Thread jonathanhurley
AMBARI-19073 - Ambari Contrib View Has Inconsistent Version in pom.xml 
(jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 3096c79dfa666341154d70a7b5a0b61eb7696d52
Parents: 2f6942f
Author: Jonathan Hurley 
Authored: Fri Dec 2 21:23:23 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 22:34:13 2016 -0500

--
 contrib/views/ambari-views-package/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3096c79d/contrib/views/ambari-views-package/pom.xml
--
diff --git a/contrib/views/ambari-views-package/pom.xml 
b/contrib/views/ambari-views-package/pom.xml
index cb070e6..16c9985 100644
--- a/contrib/views/ambari-views-package/pom.xml
+++ b/contrib/views/ambari-views-package/pom.xml
@@ -26,7 +26,7 @@
   
 org.apache.ambari.contrib.views
 ambari-contrib-views
-2.5.0.0.0
+2.0.0.0-SNAPSHOT
   
 
   
@@ -120,4 +120,4 @@
 
 
   
-
\ No newline at end of file
+



[5/7] ambari git commit: AMBARI-19070. Incorrect version metadata for HDP 2.6 (smohanty)

2016-12-02 Thread jonathanhurley
AMBARI-19070. Incorrect version metadata for HDP 2.6 (smohanty)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 2f6942f5b6d09e07ed31e28ed70a741db899fbc7
Parents: 6c411ba
Author: Sumit Mohanty 
Authored: Fri Dec 2 18:48:09 2016 -0800
Committer: Sumit Mohanty 
Committed: Fri Dec 2 18:48:51 2016 -0800

--
 .../main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/HDFS/metainfo.xml | 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/HIVE/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/KAFKA/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/KNOX/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/MAHOUT/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml| 1 +
 .../src/main/resources/stacks/HDP/2.6/services/PIG/metainfo.xml  | 2 +-
 .../main/resources/stacks/HDP/2.6/services/RANGER/metainfo.xml   | 2 +-
 .../resources/stacks/HDP/2.6/services/RANGER_KMS/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/SLIDER/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/SPARK/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/SPARK2/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/SQOOP/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/TEZ/metainfo.xml  | 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/YARN/metainfo.xml | 4 ++--
 .../resources/stacks/HDP/2.6/services/ZOOKEEPER/metainfo.xml | 2 +-
 21 files changed, 22 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2f6942f5/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
index ec81f3e..3f619af 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   ACCUMULO
-  1.7.0.2.5
+  1.7.0.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f6942f5/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
index 0b54385..b449388 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   FALCON
-  0.10.0.2.5
+  0.10.0.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f6942f5/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
index 33ceb43..0d7cd1f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   FLUME
-  1.5.2.2.5
+  1.5.2.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f6942f5/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
index 0feaa5e..9bc3ee2 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   HBASE
-  1.1.2.2.5
+ 

[1/7] ambari git commit: AMBARI-19068. Logsearch has a 'required' property while adding Ranger which quickly goes off upon navigating to the tab. (jaimin)

2016-12-02 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-18456 a58c39c9c -> 3bbe75c3b


AMBARI-19068. Logsearch has a 'required' property while adding Ranger which 
quickly goes off upon navigating to the tab. (jaimin)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 5901b95bc3c4d718b7e7723baf403f3d5522647a
Parents: 0c837a6
Author: Jaimin Jetly 
Authored: Fri Dec 2 14:02:25 2016 -0800
Committer: Jaimin Jetly 
Committed: Fri Dec 2 14:04:05 2016 -0800

--
 .../LOGSEARCH/0.5.0/configuration/logsearch-properties.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5901b95b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
index 10ca9ae..b474c5d 100644
--- 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
+++ 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
@@ -238,7 +238,7 @@
   
   
 logsearch.spnego.kerberos.enabled
-
+false
 Http Spnego enabled
 Enable SPNEGO based authentication on the Log Search 
UI
 



[2/7] ambari git commit: AMBARI-19069. Remove 'llap_queue_capacity' references from UI code. (jaimin)

2016-12-02 Thread jonathanhurley
AMBARI-19069. Remove 'llap_queue_capacity' references from UI code. (jaimin)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: e465c0e7a667e8c411a1ff38480bddd49e01427c
Parents: 5901b95
Author: Jaimin Jetly 
Authored: Fri Dec 2 14:39:39 2016 -0800
Committer: Jaimin Jetly 
Committed: Fri Dec 2 14:39:39 2016 -0800

--
 ambari-web/app/messages.js| 1 -
 .../app/models/configs/objects/service_config_property.js | 7 ---
 .../views/common/configs/widgets/slider_config_widget_view.js | 7 ++-
 3 files changed, 2 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e465c0e7/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 90ad70f..090244c 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -3200,7 +3200,6 @@ Em.I18n.translations = {
   'config.infoMessage.wrong.value.for.combobox.widget': '"{0}" is not 
available in the list of valid values',
   'config.warnMessage.outOfBoundaries.greater': 'Values greater than {0} are 
not recommended',
   'config.warnMessage.outOfBoundaries.less': 'Values smaller than {0} are not 
recommended',
-  'config.warnMessage.llap_queue_capacity.max': 'LLAP will consume entire Yarn 
queue',
 
   'errorMessage.config.required': 'This is required',
   'errorMessage.config.number.integer': 'Must contain digits only',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e465c0e7/ambari-web/app/models/configs/objects/service_config_property.js
--
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js 
b/ambari-web/app/models/configs/objects/service_config_property.js
index 5d85ae0..4459946 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -358,13 +358,6 @@ App.ServiceConfigProperty = Em.Object.extend({
 } else if ((typeof this.get('value') != 'object') && ((this.get('value') + 
'').length === 0)) {
   var widgetType = this.get('widgetType');
   this.set('errorMessage', (this.get('isRequired') && 
(!['test-db-connection','label'].contains(widgetType))) ? 
Em.I18n.t('errorMessage.config.required') : '');
-} else if (this.get('name') === 'llap_queue_capacity') {
-  if (!isNaN(parseInt(this.get('value'), 10)) && 
parseInt(this.get('value'), 10) === 100) {
-this.set('warnMessage', 
Em.I18n.t('config.warnMessage.llap_queue_capacity.max'));
-  } else {
-this.set('warnMessage', '');
-this.set('errorMessage', this.validateErrors(this.get('value'), 
this.get('name'), this.get('retypedPassword')));
-  }
 } else {
   this.set('errorMessage', this.validateErrors(this.get('value'), 
this.get('name'), this.get('retypedPassword')));
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e465c0e7/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
--
diff --git 
a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js 
b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
index 71156f4..c7e810b 100644
--- a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
@@ -645,11 +645,8 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
   return false;
 }
   }
-  if (this.get('config.name') === 'llap_queue_capacity') {
-this.get('config').validate();
-  } else {
-this.updateWarningsForCompatibilityWithWidget('');
-  }
+
+  this.updateWarningsForCompatibilityWithWidget('');
   return true;
 }
 return false;



[3/7] ambari git commit: Revert "Revert "AMBARI-18888: Ambari-agent: Create configuration files with JCEKS information""

2016-12-02 Thread jonathanhurley
Revert "Revert "AMBARI-1: Ambari-agent: Create configuration files with 
JCEKS information""

Set the value of credential store enabled on the execution command in 
AmbariManagementController::createHostAction() where the cluster and service 
are available.

This reverts commit 60a6bd4575fb87fc26c4a277cbabf850ef2089e1.


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: db46822fbf50c5e5222bdec094b3a011584f8ee8
Parents: e465c0e
Author: Nahappan Somasundaram 
Authored: Fri Dec 2 08:23:43 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Fri Dec 2 15:39:25 2016 -0800

--
 ambari-agent/conf/unix/ambari-agent.ini |   3 +
 .../ambari_agent/CustomServiceOrchestrator.py   | 120 +++
 ambari-agent/src/packages/tarball/all.xml   |  30 +
 .../ambari/server/agent/ExecutionCommand.java   |  28 +
 .../ambari/server/agent/HeartBeatHandler.java   |   2 +-
 .../AmbariManagementControllerImpl.java |   5 +
 .../server/agent/TestHeartbeatHandler.java  |  28 +++--
 7 files changed, 207 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/db46822f/ambari-agent/conf/unix/ambari-agent.ini
--
diff --git a/ambari-agent/conf/unix/ambari-agent.ini 
b/ambari-agent/conf/unix/ambari-agent.ini
index 61948d4..d6fcf5f 100644
--- a/ambari-agent/conf/unix/ambari-agent.ini
+++ b/ambari-agent/conf/unix/ambari-agent.ini
@@ -46,6 +46,9 @@ keysdir=/var/lib/ambari-agent/keys
 server_crt=ca.crt
 passphrase_env_var_name=AMBARI_PASSPHRASE
 ssl_verify_cert=0
+credential_lib_dir=/var/lib/ambari-agent/cred/lib
+credential_conf_dir=/var/lib/ambari-agent/cred/conf
+credential_shell_cmd=org.apache.hadoop.security.alias.CredentialShell
 
 [services]
 pidLookupPath=/var/run/

http://git-wip-us.apache.org/repos/asf/ambari/blob/db46822f/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 11c8cbe..f9ed4cf 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -29,6 +29,8 @@ from FileCache import FileCache
 from AgentException import AgentException
 from PythonExecutor import PythonExecutor
 from PythonReflectiveExecutor import PythonReflectiveExecutor
+from resource_management.core.utils import PasswordString
+import subprocess
 import Constants
 import hostname
 
@@ -65,6 +67,11 @@ class CustomServiceOrchestrator():
   REFLECTIVELY_RUN_COMMANDS = FREQUENT_COMMANDS # -- commands which run a lot 
and often (this increases their speed)
   DONT_BACKUP_LOGS_FOR_COMMANDS = FREQUENT_COMMANDS
 
+  # Path where hadoop credential JARS will be available
+  DEFAULT_CREDENTIAL_SHELL_LIB_PATH = '/var/lib/ambari-agent/cred/lib'
+  DEFAULT_CREDENTIAL_CONF_DIR = '/var/lib/ambari-agent/cred/conf'
+  DEFAULT_CREDENTIAL_SHELL_CMD = 
'org.apache.hadoop.security.alias.CredentialShell'
+
   def __init__(self, config, controller):
 self.config = config
 self.tmp_dir = config.get('agent', 'prefix')
@@ -78,6 +85,14 @@ class CustomServiceOrchestrator():
 # cache reset will be called on every agent registration
 controller.registration_listeners.append(self.file_cache.reset)
 
+# Construct the hadoop credential lib JARs path
+self.credential_shell_lib_path = os.path.join(config.get('security', 
'credential_lib_dir',
+ 
self.DEFAULT_CREDENTIAL_SHELL_LIB_PATH), '*')
+
+self.credential_conf_dir = config.get('security', 'credential_conf_dir', 
self.DEFAULT_CREDENTIAL_CONF_DIR)
+
+self.credential_shell_cmd = config.get('security', 'credential_shell_cmd', 
self.DEFAULT_CREDENTIAL_SHELL_CMD)
+
 # Clean up old status command files if any
 try:
   os.unlink(self.status_commands_stdout)
@@ -114,6 +129,102 @@ class CustomServiceOrchestrator():
 else:
   return PythonExecutor(self.tmp_dir, self.config)
 
+  def getProviderDirectory(self, service_name):
+"""
+Gets the path to the service conf folder where the JCEKS file will be 
created.
+
+:param service_name: Name of the service, for example, HIVE
+:return: lower case path to the service conf folder
+"""
+
+# The stack definition scripts of the 

[4/7] ambari git commit: AMBARI-19071. Ambari Server Unit Test failure on branch-2.5 and trunk: org.apache.ambari.server.state.ServicePropertiesTest.validatePropertySchemaOfServiceXMLs.(vbrodetskyi)

2016-12-02 Thread jonathanhurley
AMBARI-19071. Ambari Server Unit Test failure on branch-2.5 and trunk: 
org.apache.ambari.server.state.ServicePropertiesTest.validatePropertySchemaOfServiceXMLs.(vbrodetskyi)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 6c411baa2f3d9bae5ba7e781ac3b4cddbf18ae82
Parents: db46822
Author: Vitaly Brodetskyi 
Authored: Sat Dec 3 01:53:32 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Sat Dec 3 01:53:32 2016 +0200

--
 .../1.0/services/HAPPY/configuration/happy-alert-config.xml | 5 +
 .../1.0/services/HBASE/configuration/hbase-alert-config.xml | 5 +
 .../PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml  | 5 +
 .../1.0/services/SLEEPY/configuration/sleepy-alert-config.xml   | 5 +
 .../PERF/1.0/services/SNOW/configuration/snow-alert-config.xml  | 5 +
 .../PERF/1.0/services/YARN/configuration/yarn-alert-config.xml  | 5 +
 .../1.0/services/ZOOKEEPER/configuration/zk-alert-config.xml| 5 +
 7 files changed, 35 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6c411baa/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
index 760e706..392eea7 100644
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
@@ -26,6 +26,7 @@
 This property describes type of alert behaviour.
 There are three types percentage, timeout, flip.
 
+
 
 
 
@@ -37,6 +38,7 @@
 set to "percentage". Here you should set percent of successful
 alert checks.
 
+
 
 
 
@@ -48,6 +50,7 @@
 set to "timeout". Here you should set result which alert will
 return after timeout, false|true|none.
 
+
 
 
 
@@ -58,6 +61,7 @@
 set to "timeout". Here you should set number of seconds for
 alert to sleep.
 
+
 
 
 
@@ -69,6 +73,7 @@
 set to "flip". Here you should set number of minutes at which
 the alert should flip from true|false.
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c411baa/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
index 760e706..392eea7 100644
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
@@ -26,6 +26,7 @@
 This property describes type of alert behaviour.
 There are three types percentage, timeout, flip.
 
+
 
 
 
@@ -37,6 +38,7 @@
 set to "percentage". Here you should set percent of successful
 alert checks.
 
+
 
 
 
@@ -48,6 +50,7 @@
 set to "timeout". Here you should set result which alert will
 return after timeout, false|true|none.
 
+
 
 
 
@@ -58,6 +61,7 @@
 set to "timeout". Here you should set number of seconds for
 alert to sleep.
 
+
 
 
 
@@ -69,6 +73,7 @@
 set to "flip". Here you should set number of minutes at which
 the alert should flip from true|false.
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c411baa/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml
index 760e706..392eea7 100644
--- 

ambari git commit: AMBARI-19073 - Ambari Contrib View Has Inconsistent Version in pom.xml (jonathanhurley)

2016-12-02 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 2f6942f5b -> 3096c79df


AMBARI-19073 - Ambari Contrib View Has Inconsistent Version in pom.xml 
(jonathanhurley)


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

Branch: refs/heads/trunk
Commit: 3096c79dfa666341154d70a7b5a0b61eb7696d52
Parents: 2f6942f
Author: Jonathan Hurley 
Authored: Fri Dec 2 21:23:23 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 22:34:13 2016 -0500

--
 contrib/views/ambari-views-package/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3096c79d/contrib/views/ambari-views-package/pom.xml
--
diff --git a/contrib/views/ambari-views-package/pom.xml 
b/contrib/views/ambari-views-package/pom.xml
index cb070e6..16c9985 100644
--- a/contrib/views/ambari-views-package/pom.xml
+++ b/contrib/views/ambari-views-package/pom.xml
@@ -26,7 +26,7 @@
   
 org.apache.ambari.contrib.views
 ambari-contrib-views
-2.5.0.0.0
+2.0.0.0-SNAPSHOT
   
 
   
@@ -120,4 +120,4 @@
 
 
   
-
\ No newline at end of file
+



ambari git commit: AMBARI-19070. Incorrect version metadata for HDP 2.6 (smohanty)

2016-12-02 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 0462cf954 -> 32af20930


AMBARI-19070. Incorrect version metadata for HDP 2.6 (smohanty)


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

Branch: refs/heads/branch-2.5
Commit: 32af20930eec5ba0a386edcdd0418cb46a39d9bb
Parents: 0462cf9
Author: Sumit Mohanty 
Authored: Fri Dec 2 18:48:09 2016 -0800
Committer: Sumit Mohanty 
Committed: Fri Dec 2 18:48:09 2016 -0800

--
 .../main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/HDFS/metainfo.xml | 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/HIVE/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/KAFKA/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/KNOX/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/MAHOUT/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml| 1 +
 .../src/main/resources/stacks/HDP/2.6/services/PIG/metainfo.xml  | 2 +-
 .../main/resources/stacks/HDP/2.6/services/RANGER/metainfo.xml   | 2 +-
 .../resources/stacks/HDP/2.6/services/RANGER_KMS/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/SLIDER/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/SPARK/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/SPARK2/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/SQOOP/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/TEZ/metainfo.xml  | 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/YARN/metainfo.xml | 4 ++--
 .../resources/stacks/HDP/2.6/services/ZOOKEEPER/metainfo.xml | 2 +-
 21 files changed, 22 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/32af2093/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
index ec81f3e..3f619af 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   ACCUMULO
-  1.7.0.2.5
+  1.7.0.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/32af2093/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
index 0b54385..b449388 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   FALCON
-  0.10.0.2.5
+  0.10.0.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/32af2093/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
index 33ceb43..0d7cd1f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   FLUME
-  1.5.2.2.5
+  1.5.2.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/32af2093/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
index 0feaa5e..9bc3ee2 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
+++ 

ambari git commit: AMBARI-19070. Incorrect version metadata for HDP 2.6 (smohanty)

2016-12-02 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk 6c411baa2 -> 2f6942f5b


AMBARI-19070. Incorrect version metadata for HDP 2.6 (smohanty)


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

Branch: refs/heads/trunk
Commit: 2f6942f5b6d09e07ed31e28ed70a741db899fbc7
Parents: 6c411ba
Author: Sumit Mohanty 
Authored: Fri Dec 2 18:48:09 2016 -0800
Committer: Sumit Mohanty 
Committed: Fri Dec 2 18:48:51 2016 -0800

--
 .../main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/HDFS/metainfo.xml | 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/HIVE/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/KAFKA/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/KNOX/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.6/services/MAHOUT/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml| 1 +
 .../src/main/resources/stacks/HDP/2.6/services/PIG/metainfo.xml  | 2 +-
 .../main/resources/stacks/HDP/2.6/services/RANGER/metainfo.xml   | 2 +-
 .../resources/stacks/HDP/2.6/services/RANGER_KMS/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/SLIDER/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/SPARK/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/SPARK2/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/SQOOP/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.6/services/STORM/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/TEZ/metainfo.xml  | 2 +-
 .../src/main/resources/stacks/HDP/2.6/services/YARN/metainfo.xml | 4 ++--
 .../resources/stacks/HDP/2.6/services/ZOOKEEPER/metainfo.xml | 2 +-
 21 files changed, 22 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2f6942f5/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
index ec81f3e..3f619af 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ACCUMULO/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   ACCUMULO
-  1.7.0.2.5
+  1.7.0.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f6942f5/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
index 0b54385..b449388 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FALCON/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   FALCON
-  0.10.0.2.5
+  0.10.0.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f6942f5/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
index 33ceb43..0d7cd1f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/FLUME/metainfo.xml
@@ -20,7 +20,7 @@
   
 
   FLUME
-  1.5.2.2.5
+  1.5.2.2.6
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2f6942f5/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
index 0feaa5e..9bc3ee2 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/metainfo.xml
@@ 

ambari git commit: AMBARI-19071. Ambari Server Unit Test failure on branch-2.5 and trunk: org.apache.ambari.server.state.ServicePropertiesTest.validatePropertySchemaOfServiceXMLs.(vbrodetskyi)

2016-12-02 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/trunk db46822fb -> 6c411baa2


AMBARI-19071. Ambari Server Unit Test failure on branch-2.5 and trunk: 
org.apache.ambari.server.state.ServicePropertiesTest.validatePropertySchemaOfServiceXMLs.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 6c411baa2f3d9bae5ba7e781ac3b4cddbf18ae82
Parents: db46822
Author: Vitaly Brodetskyi 
Authored: Sat Dec 3 01:53:32 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Sat Dec 3 01:53:32 2016 +0200

--
 .../1.0/services/HAPPY/configuration/happy-alert-config.xml | 5 +
 .../1.0/services/HBASE/configuration/hbase-alert-config.xml | 5 +
 .../PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml  | 5 +
 .../1.0/services/SLEEPY/configuration/sleepy-alert-config.xml   | 5 +
 .../PERF/1.0/services/SNOW/configuration/snow-alert-config.xml  | 5 +
 .../PERF/1.0/services/YARN/configuration/yarn-alert-config.xml  | 5 +
 .../1.0/services/ZOOKEEPER/configuration/zk-alert-config.xml| 5 +
 7 files changed, 35 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6c411baa/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
index 760e706..392eea7 100644
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
@@ -26,6 +26,7 @@
 This property describes type of alert behaviour.
 There are three types percentage, timeout, flip.
 
+
 
 
 
@@ -37,6 +38,7 @@
 set to "percentage". Here you should set percent of successful
 alert checks.
 
+
 
 
 
@@ -48,6 +50,7 @@
 set to "timeout". Here you should set result which alert will
 return after timeout, false|true|none.
 
+
 
 
 
@@ -58,6 +61,7 @@
 set to "timeout". Here you should set number of seconds for
 alert to sleep.
 
+
 
 
 
@@ -69,6 +73,7 @@
 set to "flip". Here you should set number of minutes at which
 the alert should flip from true|false.
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c411baa/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
index 760e706..392eea7 100644
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
@@ -26,6 +26,7 @@
 This property describes type of alert behaviour.
 There are three types percentage, timeout, flip.
 
+
 
 
 
@@ -37,6 +38,7 @@
 set to "percentage". Here you should set percent of successful
 alert checks.
 
+
 
 
 
@@ -48,6 +50,7 @@
 set to "timeout". Here you should set result which alert will
 return after timeout, false|true|none.
 
+
 
 
 
@@ -58,6 +61,7 @@
 set to "timeout". Here you should set number of seconds for
 alert to sleep.
 
+
 
 
 
@@ -69,6 +73,7 @@
 set to "flip". Here you should set number of minutes at which
 the alert should flip from true|false.
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6c411baa/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml
 

ambari git commit: AMBARI-19071. Ambari Server Unit Test failure on branch-2.5 and trunk: org.apache.ambari.server.state.ServicePropertiesTest.validatePropertySchemaOfServiceXMLs.(vbrodetskyi)

2016-12-02 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 e7c2fdd70 -> 0462cf954


AMBARI-19071. Ambari Server Unit Test failure on branch-2.5 and trunk: 
org.apache.ambari.server.state.ServicePropertiesTest.validatePropertySchemaOfServiceXMLs.(vbrodetskyi)


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

Branch: refs/heads/branch-2.5
Commit: 0462cf95434c70a5d8a64fe02d6ff94eac021c5a
Parents: e7c2fdd
Author: Vitaly Brodetskyi 
Authored: Sat Dec 3 01:49:33 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Sat Dec 3 01:49:33 2016 +0200

--
 .../1.0/services/HAPPY/configuration/happy-alert-config.xml | 5 +
 .../1.0/services/HBASE/configuration/hbase-alert-config.xml | 5 +
 .../PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml  | 5 +
 .../1.0/services/SLEEPY/configuration/sleepy-alert-config.xml   | 5 +
 .../PERF/1.0/services/SNOW/configuration/snow-alert-config.xml  | 5 +
 .../PERF/1.0/services/YARN/configuration/yarn-alert-config.xml  | 5 +
 .../1.0/services/ZOOKEEPER/configuration/zk-alert-config.xml| 5 +
 7 files changed, 35 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0462cf95/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
index 760e706..392eea7 100644
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HAPPY/configuration/happy-alert-config.xml
@@ -26,6 +26,7 @@
 This property describes type of alert behaviour.
 There are three types percentage, timeout, flip.
 
+
 
 
 
@@ -37,6 +38,7 @@
 set to "percentage". Here you should set percent of successful
 alert checks.
 
+
 
 
 
@@ -48,6 +50,7 @@
 set to "timeout". Here you should set result which alert will
 return after timeout, false|true|none.
 
+
 
 
 
@@ -58,6 +61,7 @@
 set to "timeout". Here you should set number of seconds for
 alert to sleep.
 
+
 
 
 
@@ -69,6 +73,7 @@
 set to "flip". Here you should set number of minutes at which
 the alert should flip from true|false.
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0462cf95/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
index 760e706..392eea7 100644
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HBASE/configuration/hbase-alert-config.xml
@@ -26,6 +26,7 @@
 This property describes type of alert behaviour.
 There are three types percentage, timeout, flip.
 
+
 
 
 
@@ -37,6 +38,7 @@
 set to "percentage". Here you should set percent of successful
 alert checks.
 
+
 
 
 
@@ -48,6 +50,7 @@
 set to "timeout". Here you should set result which alert will
 return after timeout, false|true|none.
 
+
 
 
 
@@ -58,6 +61,7 @@
 set to "timeout". Here you should set number of seconds for
 alert to sleep.
 
+
 
 
 
@@ -69,6 +73,7 @@
 set to "flip". Here you should set number of minutes at which
 the alert should flip from true|false.
 
+
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0462cf95/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/configuration/hdfs-alert-config.xml
 

ambari git commit: Revert "Revert "AMBARI-18888: Ambari-agent: Create configuration files with JCEKS information""

2016-12-02 Thread smnaha
Repository: ambari
Updated Branches:
  refs/heads/trunk e465c0e7a -> db46822fb


Revert "Revert "AMBARI-1: Ambari-agent: Create configuration files with 
JCEKS information""

Set the value of credential store enabled on the execution command in 
AmbariManagementController::createHostAction() where the cluster and service 
are available.

This reverts commit 60a6bd4575fb87fc26c4a277cbabf850ef2089e1.


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

Branch: refs/heads/trunk
Commit: db46822fbf50c5e5222bdec094b3a011584f8ee8
Parents: e465c0e
Author: Nahappan Somasundaram 
Authored: Fri Dec 2 08:23:43 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Fri Dec 2 15:39:25 2016 -0800

--
 ambari-agent/conf/unix/ambari-agent.ini |   3 +
 .../ambari_agent/CustomServiceOrchestrator.py   | 120 +++
 ambari-agent/src/packages/tarball/all.xml   |  30 +
 .../ambari/server/agent/ExecutionCommand.java   |  28 +
 .../ambari/server/agent/HeartBeatHandler.java   |   2 +-
 .../AmbariManagementControllerImpl.java |   5 +
 .../server/agent/TestHeartbeatHandler.java  |  28 +++--
 7 files changed, 207 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/db46822f/ambari-agent/conf/unix/ambari-agent.ini
--
diff --git a/ambari-agent/conf/unix/ambari-agent.ini 
b/ambari-agent/conf/unix/ambari-agent.ini
index 61948d4..d6fcf5f 100644
--- a/ambari-agent/conf/unix/ambari-agent.ini
+++ b/ambari-agent/conf/unix/ambari-agent.ini
@@ -46,6 +46,9 @@ keysdir=/var/lib/ambari-agent/keys
 server_crt=ca.crt
 passphrase_env_var_name=AMBARI_PASSPHRASE
 ssl_verify_cert=0
+credential_lib_dir=/var/lib/ambari-agent/cred/lib
+credential_conf_dir=/var/lib/ambari-agent/cred/conf
+credential_shell_cmd=org.apache.hadoop.security.alias.CredentialShell
 
 [services]
 pidLookupPath=/var/run/

http://git-wip-us.apache.org/repos/asf/ambari/blob/db46822f/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 11c8cbe..f9ed4cf 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -29,6 +29,8 @@ from FileCache import FileCache
 from AgentException import AgentException
 from PythonExecutor import PythonExecutor
 from PythonReflectiveExecutor import PythonReflectiveExecutor
+from resource_management.core.utils import PasswordString
+import subprocess
 import Constants
 import hostname
 
@@ -65,6 +67,11 @@ class CustomServiceOrchestrator():
   REFLECTIVELY_RUN_COMMANDS = FREQUENT_COMMANDS # -- commands which run a lot 
and often (this increases their speed)
   DONT_BACKUP_LOGS_FOR_COMMANDS = FREQUENT_COMMANDS
 
+  # Path where hadoop credential JARS will be available
+  DEFAULT_CREDENTIAL_SHELL_LIB_PATH = '/var/lib/ambari-agent/cred/lib'
+  DEFAULT_CREDENTIAL_CONF_DIR = '/var/lib/ambari-agent/cred/conf'
+  DEFAULT_CREDENTIAL_SHELL_CMD = 
'org.apache.hadoop.security.alias.CredentialShell'
+
   def __init__(self, config, controller):
 self.config = config
 self.tmp_dir = config.get('agent', 'prefix')
@@ -78,6 +85,14 @@ class CustomServiceOrchestrator():
 # cache reset will be called on every agent registration
 controller.registration_listeners.append(self.file_cache.reset)
 
+# Construct the hadoop credential lib JARs path
+self.credential_shell_lib_path = os.path.join(config.get('security', 
'credential_lib_dir',
+ 
self.DEFAULT_CREDENTIAL_SHELL_LIB_PATH), '*')
+
+self.credential_conf_dir = config.get('security', 'credential_conf_dir', 
self.DEFAULT_CREDENTIAL_CONF_DIR)
+
+self.credential_shell_cmd = config.get('security', 'credential_shell_cmd', 
self.DEFAULT_CREDENTIAL_SHELL_CMD)
+
 # Clean up old status command files if any
 try:
   os.unlink(self.status_commands_stdout)
@@ -114,6 +129,102 @@ class CustomServiceOrchestrator():
 else:
   return PythonExecutor(self.tmp_dir, self.config)
 
+  def getProviderDirectory(self, service_name):
+"""
+Gets the path to the service conf folder where the JCEKS file will be 
created.
+
+:param service_name: Name of the service, for example, HIVE
+:return: lower case path to the service conf 

ambari git commit: AMBARI-19069. Remove 'llap_queue_capacity' references from UI code. (jaimin)

2016-12-02 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 5901b95bc -> e465c0e7a


AMBARI-19069. Remove 'llap_queue_capacity' references from UI code. (jaimin)


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

Branch: refs/heads/trunk
Commit: e465c0e7a667e8c411a1ff38480bddd49e01427c
Parents: 5901b95
Author: Jaimin Jetly 
Authored: Fri Dec 2 14:39:39 2016 -0800
Committer: Jaimin Jetly 
Committed: Fri Dec 2 14:39:39 2016 -0800

--
 ambari-web/app/messages.js| 1 -
 .../app/models/configs/objects/service_config_property.js | 7 ---
 .../views/common/configs/widgets/slider_config_widget_view.js | 7 ++-
 3 files changed, 2 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e465c0e7/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 90ad70f..090244c 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -3200,7 +3200,6 @@ Em.I18n.translations = {
   'config.infoMessage.wrong.value.for.combobox.widget': '"{0}" is not 
available in the list of valid values',
   'config.warnMessage.outOfBoundaries.greater': 'Values greater than {0} are 
not recommended',
   'config.warnMessage.outOfBoundaries.less': 'Values smaller than {0} are not 
recommended',
-  'config.warnMessage.llap_queue_capacity.max': 'LLAP will consume entire Yarn 
queue',
 
   'errorMessage.config.required': 'This is required',
   'errorMessage.config.number.integer': 'Must contain digits only',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e465c0e7/ambari-web/app/models/configs/objects/service_config_property.js
--
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js 
b/ambari-web/app/models/configs/objects/service_config_property.js
index 5d85ae0..4459946 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -358,13 +358,6 @@ App.ServiceConfigProperty = Em.Object.extend({
 } else if ((typeof this.get('value') != 'object') && ((this.get('value') + 
'').length === 0)) {
   var widgetType = this.get('widgetType');
   this.set('errorMessage', (this.get('isRequired') && 
(!['test-db-connection','label'].contains(widgetType))) ? 
Em.I18n.t('errorMessage.config.required') : '');
-} else if (this.get('name') === 'llap_queue_capacity') {
-  if (!isNaN(parseInt(this.get('value'), 10)) && 
parseInt(this.get('value'), 10) === 100) {
-this.set('warnMessage', 
Em.I18n.t('config.warnMessage.llap_queue_capacity.max'));
-  } else {
-this.set('warnMessage', '');
-this.set('errorMessage', this.validateErrors(this.get('value'), 
this.get('name'), this.get('retypedPassword')));
-  }
 } else {
   this.set('errorMessage', this.validateErrors(this.get('value'), 
this.get('name'), this.get('retypedPassword')));
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e465c0e7/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
--
diff --git 
a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js 
b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
index 71156f4..c7e810b 100644
--- a/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/slider_config_widget_view.js
@@ -645,11 +645,8 @@ App.SliderConfigWidgetView = App.ConfigWidgetView.extend({
   return false;
 }
   }
-  if (this.get('config.name') === 'llap_queue_capacity') {
-this.get('config').validate();
-  } else {
-this.updateWarningsForCompatibilityWithWidget('');
-  }
+
+  this.updateWarningsForCompatibilityWithWidget('');
   return true;
 }
 return false;



ambari git commit: AMBARI-19068. Logsearch has a 'required' property while adding Ranger which quickly goes off upon navigating to the tab. (jaimin)

2016-12-02 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 0c837a60c -> 5901b95bc


AMBARI-19068. Logsearch has a 'required' property while adding Ranger which 
quickly goes off upon navigating to the tab. (jaimin)


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

Branch: refs/heads/trunk
Commit: 5901b95bc3c4d718b7e7723baf403f3d5522647a
Parents: 0c837a6
Author: Jaimin Jetly 
Authored: Fri Dec 2 14:02:25 2016 -0800
Committer: Jaimin Jetly 
Committed: Fri Dec 2 14:04:05 2016 -0800

--
 .../LOGSEARCH/0.5.0/configuration/logsearch-properties.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5901b95b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
index 10ca9ae..b474c5d 100644
--- 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
+++ 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
@@ -238,7 +238,7 @@
   
   
 logsearch.spnego.kerberos.enabled
-
+false
 Http Spnego enabled
 Enable SPNEGO based authentication on the Log Search 
UI
 



ambari git commit: AMBARI-19068. Logsearch has a 'required' property while adding Ranger which quickly goes off upon navigating to the tab. (jaimin)

2016-12-02 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 19ca036c6 -> e7c2fdd70


AMBARI-19068. Logsearch has a 'required' property while adding Ranger which 
quickly goes off upon navigating to the tab. (jaimin)


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

Branch: refs/heads/branch-2.5
Commit: e7c2fdd700e2c3f734e4a8ca7d8e88048b8e400e
Parents: 19ca036
Author: Jaimin Jetly 
Authored: Fri Dec 2 14:02:25 2016 -0800
Committer: Jaimin Jetly 
Committed: Fri Dec 2 14:02:52 2016 -0800

--
 .../LOGSEARCH/0.5.0/configuration/logsearch-properties.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e7c2fdd7/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
index 10ca9ae..b474c5d 100644
--- 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
+++ 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
@@ -238,7 +238,7 @@
   
   
 logsearch.spnego.kerberos.enabled
-
+false
 Http Spnego enabled
 Enable SPNEGO based authentication on the Log Search 
UI
 



ambari git commit: AMBARI-19055 - Removing Tasks From host_role_command Causes Upgrades To Show As PENDING (jonathanhurley)

2016-12-02 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 aec30d56a -> 19ca036c6


AMBARI-19055 - Removing Tasks From host_role_command Causes Upgrades To Show As 
PENDING (jonathanhurley)


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

Branch: refs/heads/branch-2.5
Commit: 19ca036c683e6d1741f1b6d73a2f3326f3fc20fd
Parents: aec30d5
Author: Jonathan Hurley 
Authored: Thu Dec 1 15:49:06 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 16:30:09 2016 -0500

--
 .../controller/internal/CalculatedStatus.java   | 52 +++-
 .../internal/RequestResourceProvider.java   | 34 -
 .../internal/StageResourceProvider.java |  2 +-
 .../internal/CalculatedStatusTest.java  | 31 
 .../internal/RequestResourceProviderTest.java   | 12 +++--
 5 files changed, 103 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/19ca036c/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
index 3a86aef..3c415df 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
@@ -53,6 +53,17 @@ public class CalculatedStatus {
*/
   private final double percent;
 
+  /**
+   * A status which represents a COMPLETED state at 0%
+   */
+  public static final CalculatedStatus COMPLETED = new 
CalculatedStatus(HostRoleStatus.COMPLETED,
+  HostRoleStatus.COMPLETED, 100.0);
+
+  /**
+   * A status which represents a PENDING state at 0%
+   */
+  public static final CalculatedStatus PENDING = new 
CalculatedStatus(HostRoleStatus.PENDING,
+  HostRoleStatus.PENDING, 0.0);
 
   // - Constructors --
 
@@ -79,12 +90,6 @@ public class CalculatedStatus {
 this.percent = percent;
   }
 
-  /**
-   * Static factory method to get Status that represents a Completed state
-   */
-  public static CalculatedStatus getCompletedStatus() {
-return new CalculatedStatus(HostRoleStatus.COMPLETED, 
HostRoleStatus.COMPLETED, 100.0);
-  }
 
   // - CalculatedStatus --
 
@@ -291,14 +296,25 @@ public class CalculatedStatus {
   }
 
   /**
-   * Calculates the overall status of an upgrade.
-   * @param stageDto  the map of stage-to-summary value objects
-   * @param stageIds  the stage ids to consider from the value objects
+   * Calculates the overall status of an upgrade. If there are no tasks, then a
+   * status of {@link HostRoleStatus#COMPLETED} is returned.
+   *
+   * @param stageDto
+   *  the map of stage-to-summary value objects
+   * @param stageIds
+   *  the stage ids to consider from the value objects
* @return the calculated status
*/
   public static CalculatedStatus statusFromStageSummary(Map stageDto,
   Set stageIds) {
 
+// if either are empty, then we have no tasks and therefore no status - we
+// should return COMPLETED. This can happen if someone removes all tasks 
but
+// leaves the stages and request
+if (stageDto.isEmpty() || stageIds.isEmpty()) {
+  return COMPLETED;
+}
+
 Collection stageStatuses = new HashSet<>();
 Collection stageDisplayStatuses = new HashSet<>();
 Collection taskStatuses = new ArrayList<>();
@@ -378,19 +394,28 @@ public class CalculatedStatus {
*/
   public static HostRoleStatus 
calculateSummaryStatusOfStage(Map counters,
   int total, boolean skippable) {
+
+// when there are 0 tasks, return COMPLETED
+if (total == 0) {
+  return HostRoleStatus.COMPLETED;
+}
+
 if (counters.get(HostRoleStatus.PENDING) == total) {
   return HostRoleStatus.PENDING;
 }
+
 // By definition, any tasks in a future stage must be held in a PENDING 
status.
 if (counters.get(HostRoleStatus.HOLDING) > 0 || 
counters.get(HostRoleStatus.HOLDING_FAILED) > 0 || 
counters.get(HostRoleStatus.HOLDING_TIMEDOUT) > 0) {
   return counters.get(HostRoleStatus.HOLDING) > 0 ? HostRoleStatus.HOLDING 
:
   counters.get(HostRoleStatus.HOLDING_FAILED) > 0 ? 
HostRoleStatus.HOLDING_FAILED :
   

[08/24] ambari git commit: AMBARI-18956. Ambari attempts to commit transactions marked as rollback-only (magyari_sandor)

2016-12-02 Thread jonathanhurley
AMBARI-18956. Ambari attempts to commit transactions marked as rollback-only 
(magyari_sandor)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 73d372b8db6b4809fac98338aef1c04ae4c95c92
Parents: d24beb1
Author: Sandor Magyari 
Authored: Fri Dec 2 09:43:24 2016 +0100
Committer: Sandor Magyari 
Committed: Fri Dec 2 09:43:24 2016 +0100

--
 .../orm/AmbariJpaLocalTxnInterceptor.java   |   9 +-
 .../orm/AmbariJpaLocalTxnInterceptorTest.java   | 155 +++
 2 files changed, 162 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/73d372b8/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
index d7ba463..e19192a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
@@ -218,12 +218,17 @@ public class AmbariJpaLocalTxnInterceptor implements 
MethodInterceptor {
   /**
* Returns True if rollback DID NOT HAPPEN (i.e. if commit should continue).
*
-   * @param transactional The metadata annotaiton of the method
+   * @param transactional The metadata annotation of the method
* @param e The exception to test for rollback
* @param txn   A JPA Transaction to issue rollbacks on
*/
-  private boolean rollbackIfNecessary(Transactional transactional, Exception e,
+  static boolean rollbackIfNecessary(Transactional transactional, Exception e,
   EntityTransaction txn) {
+if (txn.getRollbackOnly()) {
+  txn.rollback();
+  return false;
+}
+
 boolean commit = true;
 
 //check rollback clauses

http://git-wip-us.apache.org/repos/asf/ambari/blob/73d372b8/ambari-server/src/test/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptorTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptorTest.java
new file mode 100644
index 000..ea7ea53
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptorTest.java
@@ -0,0 +1,155 @@
+/*
+ * 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.server.orm;
+
+import com.google.inject.persist.Transactional;
+import org.easymock.EasyMockSupport;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.persistence.EntityTransaction;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import static 
org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.rollbackIfNecessary;
+import static org.easymock.EasyMock.expect;
+
+public class AmbariJpaLocalTxnInterceptorTest extends EasyMockSupport {
+
+  @Test
+  public void canBeCommittedIfExceptionsToBeRolledBackOnIsEmpty() {
+Transactional transactional = createNiceMock(Transactional.class);
+EntityTransaction transaction = createStrictMock(EntityTransaction.class);
+
+expect(transaction.getRollbackOnly()).andReturn(false);
+expect(transactional.rollbackOn()).andReturn(new Class[0]);
+
+replayAll();
+
+boolean canCommit = rollbackIfNecessary(transactional, new 
RuntimeException(), transaction);
+Assert.assertTrue("Should be allowed to commit, since rollbackOn clause is 
empty", canCommit);
+
+

[17/24] ambari git commit: AMBARI-19018 - Services should be able to specify their own resources subdirs for syncing to agents

2016-12-02 Thread jonathanhurley
AMBARI-19018 - Services should be able to specify their own resources subdirs 
for syncing to agents


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 232a9d87e72dfb87e0d25f6a4cba6738e27beb53
Parents: 60a6bd4
Author: Tim Thorpe 
Authored: Fri Dec 2 08:15:09 2016 -0800
Committer: Tim Thorpe 
Committed: Fri Dec 2 08:15:09 2016 -0800

--
 .../ambari_agent/CustomServiceOrchestrator.py   |   7 +-
 .../src/main/python/ambari_agent/FileCache.py   |  12 ++-
 .../TestCustomServiceOrchestrator.py|  30 +-
 .../test/python/ambari_agent/TestFileCache.py   |  10 +-
 .../ambari/server/agent/ExecutionCommand.java   |   1 +
 .../AmbariManagementControllerImpl.java |   9 ++
 .../ambari/server/state/ComponentInfo.java  |  14 +++
 .../python/ambari_server/serverConfiguration.py |  14 +--
 .../AMBARI_METRICS/0.1.0/metainfo.xml   |   1 +
 .../AmbariManagementControllerTest.java |   9 ++
 .../server/orm/InMemoryDefaultTestModule.java   |   5 +
 ambari-server/src/test/python/TestMpacks.py | 102 +--
 .../src/test/resources/dashboards/README.txt|  18 
 .../stacks/HDP/0.1/services/HDFS/metainfo.xml   |   1 +
 14 files changed, 150 insertions(+), 83 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/232a9d87/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 7d61611..11c8cbe 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -154,12 +154,7 @@ class CustomServiceOrchestrator():
 self.file_cache.get_host_scripts_base_dir(server_url_prefix)  
 hook_dir = self.file_cache.get_hook_base_dir(command, 
server_url_prefix)
 base_dir = self.file_cache.get_service_base_dir(command, 
server_url_prefix)
-from ActionQueue import ActionQueue  # To avoid cyclic dependency
-if self.COMMAND_TYPE in command and command[self.COMMAND_TYPE] == 
ActionQueue.EXECUTION_COMMAND:
-  logger.info("Found it - " + str(command[self.COMMAND_TYPE]) + " 
yeah")
-  # limiting to only EXECUTION_COMMANDs for now
-  # TODO need a design for limiting to specific role/component such as 
METRICS_GRAFANA
-  self.file_cache.get_dashboard_base_dir(server_url_prefix)
+self.file_cache.get_custom_resources_subdir(command, server_url_prefix)
 
 script_path = self.resolve_script_path(base_dir, script)
 script_tuple = (script_path, base_dir)

http://git-wip-us.apache.org/repos/asf/ambari/blob/232a9d87/ambari-agent/src/main/python/ambari_agent/FileCache.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/FileCache.py 
b/ambari-agent/src/main/python/ambari_agent/FileCache.py
index 83ac373..a9ea8f6 100644
--- a/ambari-agent/src/main/python/ambari_agent/FileCache.py
+++ b/ambari-agent/src/main/python/ambari_agent/FileCache.py
@@ -45,7 +45,6 @@ class FileCache():
   STACKS_CACHE_DIRECTORY="stacks"
   COMMON_SERVICES_DIRECTORY="common-services"
   CUSTOM_ACTIONS_CACHE_DIRECTORY="custom_actions"
-  DASHBOARD_DIRECTORY="dashboards"
   HOST_SCRIPTS_CACHE_DIRECTORY="host_scripts"
   HASH_SUM_FILE=".hash"
   ARCHIVE_NAME="archive.zip"
@@ -100,12 +99,17 @@ class FileCache():
   server_url_prefix)
 
 
-  def get_dashboard_base_dir(self, server_url_prefix):
+  def get_custom_resources_subdir(self, command, server_url_prefix):
 """
-Returns a base directory for dashboards
+Returns a custom directory which must be a subdirectory of the resources 
dir
 """
+try:
+  custom_dir = command['commandParams']['custom_folder']
+except KeyError:
+  return None
+
 return self.provide_directory(self.cache_dir,
-  self.DASHBOARD_DIRECTORY,
+  custom_dir,
   server_url_prefix)
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/232a9d87/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 

[16/24] ambari git commit: Revert "AMBARI-18888: Ambari-agent: Create configuration files with JCEKS information"

2016-12-02 Thread jonathanhurley
Revert "AMBARI-1: Ambari-agent: Create configuration files with JCEKS 
information"

This reverts commit 615438b272e6bd8efd37481ef684ae7d68921e64.


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 60a6bd4575fb87fc26c4a277cbabf850ef2089e1
Parents: 32840c1
Author: Jonathan Hurley 
Authored: Fri Dec 2 10:50:50 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 10:50:50 2016 -0500

--
 ambari-agent/conf/unix/ambari-agent.ini |   3 -
 .../ambari_agent/CustomServiceOrchestrator.py   | 120 ---
 ambari-agent/src/packages/tarball/all.xml   |  30 -
 .../ambari/server/agent/ExecutionCommand.java   |  28 -
 .../ambari/server/agent/HeartBeatHandler.java   |  10 +-
 .../server/agent/TestHeartbeatHandler.java  |  28 ++---
 6 files changed, 9 insertions(+), 210 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/60a6bd45/ambari-agent/conf/unix/ambari-agent.ini
--
diff --git a/ambari-agent/conf/unix/ambari-agent.ini 
b/ambari-agent/conf/unix/ambari-agent.ini
index d6fcf5f..61948d4 100644
--- a/ambari-agent/conf/unix/ambari-agent.ini
+++ b/ambari-agent/conf/unix/ambari-agent.ini
@@ -46,9 +46,6 @@ keysdir=/var/lib/ambari-agent/keys
 server_crt=ca.crt
 passphrase_env_var_name=AMBARI_PASSPHRASE
 ssl_verify_cert=0
-credential_lib_dir=/var/lib/ambari-agent/cred/lib
-credential_conf_dir=/var/lib/ambari-agent/cred/conf
-credential_shell_cmd=org.apache.hadoop.security.alias.CredentialShell
 
 [services]
 pidLookupPath=/var/run/

http://git-wip-us.apache.org/repos/asf/ambari/blob/60a6bd45/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 1eab0a5..7d61611 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -29,8 +29,6 @@ from FileCache import FileCache
 from AgentException import AgentException
 from PythonExecutor import PythonExecutor
 from PythonReflectiveExecutor import PythonReflectiveExecutor
-from resource_management.core.utils import PasswordString
-import subprocess
 import Constants
 import hostname
 
@@ -67,11 +65,6 @@ class CustomServiceOrchestrator():
   REFLECTIVELY_RUN_COMMANDS = FREQUENT_COMMANDS # -- commands which run a lot 
and often (this increases their speed)
   DONT_BACKUP_LOGS_FOR_COMMANDS = FREQUENT_COMMANDS
 
-  # Path where hadoop credential JARS will be available
-  DEFAULT_CREDENTIAL_SHELL_LIB_PATH = '/var/lib/ambari-agent/cred/lib'
-  DEFAULT_CREDENTIAL_CONF_DIR = '/var/lib/ambari-agent/cred/conf'
-  DEFAULT_CREDENTIAL_SHELL_CMD = 
'org.apache.hadoop.security.alias.CredentialShell'
-
   def __init__(self, config, controller):
 self.config = config
 self.tmp_dir = config.get('agent', 'prefix')
@@ -85,14 +78,6 @@ class CustomServiceOrchestrator():
 # cache reset will be called on every agent registration
 controller.registration_listeners.append(self.file_cache.reset)
 
-# Construct the hadoop credential lib JARs path
-self.credential_shell_lib_path = os.path.join(config.get('security', 
'credential_lib_dir',
- 
self.DEFAULT_CREDENTIAL_SHELL_LIB_PATH), '*')
-
-self.credential_conf_dir = config.get('security', 'credential_conf_dir', 
self.DEFAULT_CREDENTIAL_CONF_DIR)
-
-self.credential_shell_cmd = config.get('security', 'credential_shell_cmd', 
self.DEFAULT_CREDENTIAL_SHELL_CMD)
-
 # Clean up old status command files if any
 try:
   os.unlink(self.status_commands_stdout)
@@ -129,102 +114,6 @@ class CustomServiceOrchestrator():
 else:
   return PythonExecutor(self.tmp_dir, self.config)
 
-  def getProviderDirectory(self, service_name):
-"""
-Gets the path to the service conf folder where the JCEKS file will be 
created.
-
-:param service_name: Name of the service, for example, HIVE
-:return: lower case path to the service conf folder
-"""
-
-# The stack definition scripts of the service can move the
-# JCEKS file around to where it wants, which is usually
-# /etc//conf
-
-conf_dir = os.path.join(self.credential_conf_dir, service_name.lower())
-if not os.path.exists(conf_dir):
-  os.makedirs(conf_dir, 0644)
-
- 

[09/24] ambari git commit: AMBARI-18975 Remove Zeppelin View from Ambari (r-kamath)

2016-12-02 Thread jonathanhurley
AMBARI-18975 Remove Zeppelin View from Ambari (r-kamath)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: c2dc7538b65ab9f045010b7964ba00551b0ea099
Parents: 73d372b
Author: Renjith Kamath 
Authored: Fri Dec 2 14:39:28 2016 +0530
Committer: Renjith Kamath 
Committed: Fri Dec 2 14:52:51 2016 +0530

--
 .../server/upgrade/UpgradeCatalog250.java   |   6 +
 .../server/upgrade/UpgradeCatalog250Test.java   |  17 +-
 contrib/views/pom.xml   |   1 -
 contrib/views/zeppelin/pom.xml  | 190 ---
 .../view/zeppelin/ZeppelinServiceCheck.java |  55 --
 .../ambari/view/zeppelin/ZeppelinServlet.java   | 113 ---
 .../zeppelin/src/main/resources/WEB-INF/web.xml |  40 
 .../src/main/resources/view.log4j.properties|  27 ---
 .../views/zeppelin/src/main/resources/view.xml  |  48 -
 9 files changed, 17 insertions(+), 480 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2dc7538/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 3b2cdd3..837f340 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -136,6 +136,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 updateAMSConfigs();
 updateKafkaConfigs();
 updateHiveLlapConfigs();
+updateTablesForZeppelinViewRemoval();
   }
 
   protected void updateHostVersionTable() throws SQLException {
@@ -227,6 +228,11 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 }
   }
 
+  protected void updateTablesForZeppelinViewRemoval() throws SQLException {
+dbAccessor.executeQuery("DELETE from viewinstance WHERE 
view_name='ZEPPELIN{1.0.0}'", true);
+dbAccessor.executeQuery("DELETE from viewmain WHERE 
view_name='ZEPPELIN{1.0.0}'", true);
+dbAccessor.executeQuery("DELETE from viewparameter WHERE 
view_name='ZEPPELIN{1.0.0}'", true);
+  }
 
   protected String updateAmsEnvContent(String content) {
 if (content == null) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2dc7538/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
index 978e2dc..0b2b32d 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
@@ -210,16 +210,18 @@ public class UpgradeCatalog250Test {
   @Test
   public void testExecuteDMLUpdates() throws Exception {
 Method updateAmsConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateAMSConfigs");
-Method addNewConfigurationsFromXml = 
AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
 Method updateKafkaConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateKafkaConfigs");
 Method updateHiveLlapConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateHiveLlapConfigs");
+Method addNewConfigurationsFromXml = 
AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
+Method updateTablesForZeppelinViewRemoval = 
UpgradeCatalog250.class.getDeclaredMethod("updateTablesForZeppelinViewRemoval");
 
 UpgradeCatalog250 upgradeCatalog250 = 
createMockBuilder(UpgradeCatalog250.class)
-.addMockedMethod(updateAmsConfigs)
-.addMockedMethod(addNewConfigurationsFromXml)
-.addMockedMethod(updateKafkaConfigs)
-.addMockedMethod(updateHiveLlapConfigs)
-.createMock();
+  .addMockedMethod(updateAmsConfigs)
+  .addMockedMethod(updateKafkaConfigs)
+  .addMockedMethod(updateHiveLlapConfigs)
+  .addMockedMethod(addNewConfigurationsFromXml)
+  .addMockedMethod(updateTablesForZeppelinViewRemoval)
+  .createMock();
 
 upgradeCatalog250.updateAMSConfigs();
 expectLastCall().once();
@@ -233,6 +235,9 @@ public class UpgradeCatalog250Test {
 

[03/24] ambari git commit: AMBARI-19052. Re-arrange "Role Based Access Control" info table (akovalenko)

2016-12-02 Thread jonathanhurley
AMBARI-19052. Re-arrange "Role Based Access Control" info table (akovalenko)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 63c0f2e58fc09b709e890923752c4ccb04181180
Parents: 63938e0
Author: Aleksandr Kovalenko 
Authored: Thu Dec 1 19:22:02 2016 +0200
Committer: Aleksandr Kovalenko 
Committed: Thu Dec 1 20:20:33 2016 +0200

--
 .../admin-web/app/scripts/services/Cluster.js   | 51 
 .../app/scripts/services/RoleDetailsModal.js| 31 +++-
 .../app/views/modals/RoleDetailsModal.html  |  6 +--
 3 files changed, 23 insertions(+), 65 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/63c0f2e5/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
index 02c231a..0f9b582 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
@@ -30,57 +30,6 @@ angular.module('ambariAdminConsole')
   'CLUSTER.USER'
 ],
 
-orderedAuthorizations : [
-  "SERVICE.VIEW_METRICS",
-  "SERVICE.VIEW_STATUS_INFO",
-  "SERVICE.VIEW_CONFIGS",
-  "SERVICE.COMPARE_CONFIGS",
-  "SERVICE.VIEW_ALERTS",
-  "SERVICE.START_STOP",
-  "SERVICE.DECOMMISSION_RECOMMISSION",
-  "SERVICE.RUN_SERVICE_CHECK",
-  "SERVICE.TOGGLE_MAINTENANCE",
-  "SERVICE.RUN_CUSTOM_COMMAND",
-  "SERVICE.MODIFY_CONFIGS",
-  "SERVICE.MANAGE_CONFIG_GROUPS",
-  "SERVICE.MOVE",
-  "SERVICE.ENABLE_HA",
-  "SERVICE.MANAGE_ALERTS",
-  "SERVICE.TOGGLE_ALERTS",
-  "SERVICE.ADD_DELETE_SERVICES",
-  "SERVICE.VIEW_OPERATIONAL_LOGS",
-  "HOST.VIEW_CONFIGS",
-  "HOST.VIEW_METRICS",
-  "HOST.VIEW_STATUS_INFO",
-  "HOST.ADD_DELETE_COMPONENTS",
-  "HOST.ADD_DELETE_HOSTS",
-  "HOST.TOGGLE_MAINTENANCE",
-  "CLUSTER.VIEW_ALERTS",
-  "CLUSTER.VIEW_CONFIGS",
-  "CLUSTER.VIEW_METRICS",
-  "CLUSTER.VIEW_STACK_DETAILS",
-  "CLUSTER.VIEW_STATUS_INFO",
-  "CLUSTER.MANAGE_ALERTS",
-  "CLUSTER.MANAGE_CONFIG_GROUPS",
-  "CLUSTER.MANAGE_CREDENTIALS",
-  "CLUSTER.MODIFY_CONFIGS",
-  "CLUSTER.TOGGLE_ALERTS",
-  "CLUSTER.TOGGLE_KERBEROS",
-  "CLUSTER.UPGRADE_DOWNGRADE_STACK",
-  "CLUSTER.RUN_CUSTOM_COMMAND",
-  "AMBARI.ADD_DELETE_CLUSTERS",
-  "AMBARI.ASSIGN_ROLES",
-  "AMBARI.EDIT_STACK_REPOS",
-  "AMBARI.MANAGE_GROUPS",
-  "AMBARI.MANAGE_SETTINGS",
-  "AMBARI.MANAGE_STACK_VERSIONS",
-  "AMBARI.MANAGE_USERS",
-  "AMBARI.MANAGE_VIEWS",
-  "AMBARI.RENAME_CLUSTER",
-  "AMBARI.RUN_CUSTOM_COMMAND",
-  "SERVICE.SET_SERVICE_USERS_GROUPS"
-],
-
 orderedLevels: ['SERVICE', 'HOST', 'CLUSTER', 'AMBARI'],
 
 ineditableRoles : ['VIEW.USER', 'AMBARI.ADMINISTRATOR'],

http://git-wip-us.apache.org/repos/asf/ambari/blob/63c0f2e5/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
index 5a14b33..06019c2 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
@@ -33,9 +33,9 @@ angular.module('ambariAdminConsole')
 templateUrl: 'views/modals/RoleDetailsModal.html',
 size: 'lg',
 controller: function($scope, $modalInstance) {
+  var authorizationsOrder;
   $scope.title = '';
   $scope.orderedRoles = 
['AMBARI.ADMINISTRATOR'].concat(Cluster.orderedRoles).reverse();
-  $scope.orderedAuthorizations = Cluster.orderedAuthorizations;
   $scope.orderedLevels = Cluster.orderedLevels;
   $scope.authHash = {};
   $scope.getLevelName = function (key) {
@@ -44,25 +44,34 @@ angular.module('ambariAdminConsole')
   angular.forEach(roles, function (r) {
 angular.forEach(r.authorizations, function (auth) {
   var match = auth.authorization_id.match(/(\w+)\./),
-levelKey = match && match[1],
- 

[14/24] ambari git commit: AMBARI-18944 - Improve remoteIp in audit log (Wang Yaoxin via jonathanhurley)

2016-12-02 Thread jonathanhurley
AMBARI-18944 - Improve remoteIp in audit log (Wang Yaoxin via jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: f4ea309196a2c02b88f5e5ce062200d50d888005
Parents: ae3ff2a
Author: Jonathan Hurley 
Authored: Fri Dec 2 10:18:35 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 10:19:41 2016 -0500

--
 .../apache/ambari/server/utils/RequestUtils.java  | 10 ++
 .../ambari/server/utils/RequestUtilsTest.java | 18 ++
 2 files changed, 28 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f4ea3091/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java 
b/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java
index 0ac782f..dbb0f11 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java
@@ -50,6 +50,9 @@ public class RequestUtils {
 if (isRemoteAddressUnknown(ip)) {
   ip = request.getRemoteAddr();
 }
+if (containsMultipleRemoteAddresses(ip)) {
+   ip = ip.substring(0, ip.indexOf(","));
+}
 return ip;
   }
 
@@ -76,6 +79,13 @@ public class RequestUtils {
   }
 
   /**
+   * Checks if ip contains multiple IP addresses
+   */
+  private static boolean containsMultipleRemoteAddresses(String ip) {
+return ip != null && ip.indexOf(",") > 0;
+  }
+
+  /**
* Checks if RequestContextHolder contains a valid HTTP request
* @return
*/

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4ea3091/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
index 595127e..f36858e 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
@@ -30,6 +30,7 @@ import org.junit.Test;
 public class RequestUtilsTest {
 
   public static final String REMOTE_ADDRESS = "12.13.14.15";
+  public static final String REMOTE_ADDRESS_MULTIPLE = 
"12.13.14.15,12.13.14.16";
 
   @Test
   public void testGetRemoteAddress() {
@@ -49,6 +50,23 @@ public class RequestUtilsTest {
   }
 
   @Test
+  public void testGetMultipleRemoteAddress() {
+// GIVEN
+HttpServletRequest mockedRequest = createMock(HttpServletRequest.class);
+expect(mockedRequest.getHeader("X-Forwarded-For")).andReturn(null);
+expect(mockedRequest.getHeader("Proxy-Client-IP")).andReturn("unknown");
+expect(mockedRequest.getHeader("WL-Proxy-Client-IP")).andReturn("");
+expect(mockedRequest.getHeader("HTTP_CLIENT_IP")).andReturn("unknown");
+
expect(mockedRequest.getHeader("HTTP_X_FORWARDED_FOR")).andReturn(REMOTE_ADDRESS_MULTIPLE);
+replay(mockedRequest);
+// WHEN
+String remoteAddress = RequestUtils.getRemoteAddress(mockedRequest);
+// THEN
+assertEquals(REMOTE_ADDRESS, remoteAddress);
+verify(mockedRequest);
+  }
+
+  @Test
   public void testGetRemoteAddressFoundFirstHeader() {
 // GIVEN
 HttpServletRequest mockedRequest = createMock(HttpServletRequest.class);



[01/24] ambari git commit: AMBARI-18929. Yarn service check fails when either resource manager is down in HA enabled cluster (Weiwei Yang via alejandro)

2016-12-02 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-18456 087de8b78 -> a58c39c9c


AMBARI-18929. Yarn service check fails when either resource manager is down in 
HA enabled cluster (Weiwei Yang via alejandro)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 88e0c29e0617f05c0ecb72a75e74b2bb3def6bac
Parents: 6100be6
Author: Alejandro Fernandez 
Authored: Thu Dec 1 09:45:56 2016 -0800
Committer: Alejandro Fernandez 
Committed: Thu Dec 1 09:45:56 2016 -0800

--
 .../2.1.0.2.0/package/scripts/service_check.py  |  66 +++
 .../2.0.6/YARN/test_yarn_service_check.py   | 111 ++-
 2 files changed, 100 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/88e0c29e/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
index c0bd480..b934767 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
@@ -130,34 +130,56 @@ class ServiceCheckDefault(ServiceCheck):
   if "application" in item:
 application_name = item
 
-for rm_webapp_address in params.rm_webapp_addresses_list:
-  info_app_url = params.scheme + "://" + rm_webapp_address + 
"/ws/v1/cluster/apps/" + application_name
+# Find out the active RM from RM list
+# Raise an exception if the active rm cannot be determined
+active_rm_webapp_address = self.get_active_rm_webapp_address()
+Logger.info("Active Resource Manager web app address is : " + 
active_rm_webapp_address);
 
-  get_app_info_cmd = "curl --negotiate -u : -ks --location-trusted 
--connect-timeout " + CURL_CONNECTION_TIMEOUT + " " + info_app_url
+# Verify job state from active resource manager via rest api
+info_app_url = params.scheme + "://" + active_rm_webapp_address + 
"/ws/v1/cluster/apps/" + application_name
+get_app_info_cmd = "curl --negotiate -u : -ks --location-trusted 
--connect-timeout " + CURL_CONNECTION_TIMEOUT + " " + info_app_url
 
-  return_code, stdout, _ = get_user_call_output(get_app_info_cmd,
-user=params.smokeuser,
-
path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
-)
+return_code, stdout, _ = get_user_call_output(get_app_info_cmd,
+  user=params.smokeuser,
+  
path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
+  )
 
-  # Handle HDP<2.2.8.1 where RM doesn't do automatic redirection from 
standby to active
-  if stdout.startswith("This is standby RM. Redirecting to the current 
active RM:"):
-Logger.info(format("Skipped checking of {rm_webapp_address} since 
returned '{stdout}'"))
-continue
+try:
+  json_response = json.loads(stdout)
+except Exception as e:
+  raise Fail(format("Response from YARN API was not a valid JSON. 
Response: {stdout}"))
 
-  try:
-json_response = json.loads(stdout)
-  except Exception as e:
-raise Fail(format("Response from YARN API was not a valid JSON. 
Response: {stdout}"))
-  
-  if json_response is None or 'app' not in json_response or \
-  'state' not in json_response['app'] or 'finalStatus' not in 
json_response['app']:
-raise Fail("Application " + app_url + " returns invalid data.")
-
-  if json_response['app']['state'] != "FINISHED" or 
json_response['app']['finalStatus'] != "SUCCEEDED":
-raise Fail("Application " + app_url + " state/status is not valid. 
Should be FINISHED/SUCCEEDED.")
+if json_response is None or 'app' not in json_response or \
+'state' not in json_response['app'] or 'finalStatus' not in 
json_response['app']:
+  raise Fail("Application " + app_url + " returns invalid data.")
 
+if json_response['app']['state'] != "FINISHED" or 
json_response['app']['finalStatus'] != "SUCCEEDED":
+  raise Fail("Application " + app_url + " state/status is not valid. 
Should 

[07/24] ambari git commit: AMBARI-19051. Stage is sometimes marked as failed on command reschedule. (mpapirkovskyy)

2016-12-02 Thread jonathanhurley
AMBARI-19051. Stage is sometimes marked as failed on command reschedule. 
(mpapirkovskyy)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: d24beb17e238391b196a2bfae1217035678a0a14
Parents: 615438b
Author: Myroslav Papirkovskyi 
Authored: Thu Dec 1 18:48:25 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Fri Dec 2 09:51:16 2016 +0200

--
 .../src/main/python/ambari_agent/ActionQueue.py | 11 +
 .../test/python/ambari_agent/TestActionQueue.py | 48 
 2 files changed, 59 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d24beb17/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py 
b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index 4416b9a..cb4fcb9 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -300,6 +300,7 @@ class ActionQueue(threading.Thread):
 
 logger.info("Command execution metadata - taskId = {taskId}, retry enabled 
= {retryAble}, max retry duration (sec) = {retryDuration}, log_output = 
{log_command_output}".
  format(taskId=taskId, retryAble=retryAble, 
retryDuration=retryDuration, log_command_output=log_command_output))
+command_canceled = False
 while retryDuration >= 0:
   numAttempts += 1
   start = 0
@@ -328,6 +329,7 @@ class ActionQueue(threading.Thread):
   status = self.FAILED_STATUS
   if (commandresult['exitcode'] == -signal.SIGTERM) or 
(commandresult['exitcode'] == -signal.SIGKILL):
 logger.info('Command with taskId = {cid} was 
canceled!'.format(cid=taskId))
+command_canceled = True
 break
 
   if status != self.COMPLETED_STATUS and retryAble and retryDuration > 0:
@@ -344,6 +346,15 @@ class ActionQueue(threading.Thread):
 .format(cid=taskId, status=status, retryAble=retryAble, 
retryDuration=retryDuration, delay=delay))
 break
 
+# do not fail task which was rescheduled from server
+if command_canceled:
+  with self.commandQueue.mutex:
+for com in self.commandQueue.queue:
+  if com['taskId'] == command['taskId']:
+logger.info('Command with taskId = {cid} was rescheduled by 
server. '
+'Fail report on cancelled command won\'t be sent with 
heartbeat.'.format(cid=taskId))
+return
+
 # final result to stdout
 commandresult['stdout'] += '\n\nCommand completed successfully!\n' if 
status == self.COMPLETED_STATUS else '\n\nCommand failed after ' + 
str(numAttempts) + ' tries\n'
 logger.info('Command with taskId = {cid} completed 
successfully!'.format(cid=taskId) if status == self.COMPLETED_STATUS else 
'Command with taskId = {cid} failed after {attempts} tries'.format(cid=taskId, 
attempts=numAttempts))

http://git-wip-us.apache.org/repos/asf/ambari/blob/d24beb17/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py 
b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
index 4a63f7c..65127f2 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
@@ -27,6 +27,7 @@ import os, errno, time, pprint, tempfile, threading
 import sys
 from threading import Thread
 import copy
+import signal
 
 from mock.mock import patch, MagicMock, call
 from ambari_agent.CustomServiceOrchestrator import CustomServiceOrchestrator
@@ -690,6 +691,53 @@ class TestActionQueue(TestCase):
 report = actionQueue.result()
 self.assertEqual(len(report['reports']), 0)
 
+  def test_cancel_with_reschedule_command(self):
+config = AmbariConfig()
+tempdir = tempfile.gettempdir()
+config.set('agent', 'prefix', tempdir)
+config.set('agent', 'cache_dir', "/var/lib/ambari-agent/cache")
+config.set('agent', 'tolerate_download_failures', "true")
+dummy_controller = MagicMock()
+actionQueue = ActionQueue(config, dummy_controller)
+unfreeze_flag = threading.Event()
+python_execution_result_dict = {
+  'stdout': 'out',
+  'stderr': 'stderr',
+  'structuredOut' : '',
+  'status' : '',
+  'exitcode' : -signal.SIGTERM
+}
+
+def side_effect(command, tmpoutfile, 

[24/24] ambari git commit: Merge branch 'trunk' into branch-feature-AMBARI-18456

2016-12-02 Thread jonathanhurley
Merge branch 'trunk' into branch-feature-AMBARI-18456


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: a58c39c9c177da52c32dd6f004cefa9658e9019d
Parents: 087de8b 0c837a6
Author: Jonathan Hurley 
Authored: Fri Dec 2 16:19:40 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 16:19:40 2016 -0500

--
 .../admin-web/app/scripts/services/Cluster.js   |  51 --
 .../app/scripts/services/RoleDetailsModal.js|  31 +-
 .../app/views/modals/RoleDetailsModal.html  |   6 +-
 .../src/main/python/ambari_agent/ActionQueue.py |  11 +
 .../ambari_agent/CustomServiceOrchestrator.py   |   7 +-
 .../src/main/python/ambari_agent/FileCache.py   |  12 +-
 .../test/python/ambari_agent/TestActionQueue.py |  48 ++
 .../TestCustomServiceOrchestrator.py|  30 +-
 .../test/python/ambari_agent/TestFileCache.py   |  10 +-
 .../ambari_commons/ambari_metrics_helper.py |  45 +-
 .../timeline/AbstractTimelineMetricsSink.java   |   6 +-
 .../AbstractTimelineMetricSinkTest.java |  10 +-
 .../conf/unix/ambari-metrics-grafana|   6 +-
 .../timeline/HadoopTimelineMetricsSink.java |   4 +-
 .../timeline/HadoopTimelineMetricsSinkTest.java |   6 +-
 .../src/main/python/core/config_reader.py   |   9 +-
 .../src/test/python/core/TestEmitter.py |   2 +-
 .../ambari/server/agent/ExecutionCommand.java   |   1 +
 .../AmbariManagementControllerImpl.java |   9 +
 .../controller/internal/CalculatedStatus.java   |  52 +-
 .../internal/RequestResourceProvider.java   |  34 +-
 .../internal/StageResourceProvider.java |   2 +-
 .../internal/UpgradeResourceProvider.java   |  24 +-
 .../orm/AmbariJpaLocalTxnInterceptor.java   |   9 +-
 .../ambari/server/state/ComponentInfo.java  |  14 +
 .../stack/upgrade/ConfigurationCondition.java   |  72 +-
 .../server/upgrade/UpgradeCatalog211.java   |  24 +-
 .../server/upgrade/UpgradeCatalog250.java   |   6 +
 .../ambari/server/utils/RequestUtils.java   |  10 +
 .../python/ambari_server/serverConfiguration.py |  14 +-
 .../src/main/python/ambari_server/utils.py  |  23 +-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  11 +-
 .../1.6.1.2.2.0/package/scripts/params.py   |   2 +-
 .../AMBARI_METRICS/0.1.0/metainfo.xml   |   1 +
 .../0.1.0/package/scripts/params.py |   2 +-
 .../0.1.0/package/scripts/service_check.py  |   2 +-
 .../FLUME/1.4.0.2.0/package/scripts/params.py   |   2 +-
 .../0.96.0.2.0/package/scripts/params_linux.py  |   2 +-
 .../package/alerts/alert_metrics_deviation.py   |   2 +-
 .../KAFKA/0.8.1/package/scripts/params.py   |   2 +-
 .../STORM/0.9.1/package/scripts/params_linux.py |   2 +-
 .../2.1.0.2.0/package/scripts/service_check.py  |  66 +-
 .../ZOOKEEPER/3.4.6/metainfo.xml|   2 +-
 .../2.0.6/hooks/before-START/scripts/params.py  |   2 +-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml |  27 +-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml |  27 +-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml |  27 +-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml |  27 +-
 .../services/HDFS/configuration/hadoop-env.xml  | 176 
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml |  27 +-
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml |  27 +-
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml |  27 +-
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml |  27 +-
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml |  27 +-
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |  27 +-
 .../2.1/hooks/before-START/scripts/params.py|   4 +-
 .../src/main/resources/upgrade-pack.xsd |   8 +-
 .../AmbariManagementControllerTest.java |   9 +
 .../internal/CalculatedStatusTest.java  |  31 +
 .../internal/RequestResourceProviderTest.java   |  12 +-
 .../internal/UpgradeResourceProviderTest.java   |   2 +-
 .../orm/AmbariJpaLocalTxnInterceptorTest.java   | 155 
 .../server/orm/InMemoryDefaultTestModule.java   |   5 +
 .../server/upgrade/UpgradeCatalog250Test.java   |  17 +-
 .../ambari/server/utils/RequestUtilsTest.java   |  18 +
 ambari-server/src/test/python/TestMpacks.py | 102 ++-
 .../2.0.6/YARN/test_yarn_service_check.py   | 111 +--
 .../src/test/resources/dashboards/README.txt|  18 +
 .../stacks/HDP/0.1/services/HDFS/metainfo.xml   |   1 +
 .../controllers/main/service/info/summary.js|  37 +-
 .../main/service/reassign/step4_controller.js   |  19 +-
 .../mixins/main/dashboard/widgets/editable.js   |  47 +-
 .../main/dashboard/edit_widget_popup.hbs|   4 +-
 .../edit_widget_popup_single_threshold.hbs  |   2 +-
 

[21/24] ambari git commit: AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal content (alexantonenko)

2016-12-02 Thread jonathanhurley
AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal 
content (alexantonenko)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: def3b0ae85b968c7dd41307f4c671bf07d4fc826
Parents: 9348725
Author: Alex Antonenko 
Authored: Fri Dec 2 15:18:46 2016 +0200
Committer: Alex Antonenko 
Committed: Fri Dec 2 20:13:17 2016 +0200

--
 .../controllers/main/service/info/summary.js| 37 +++-
 .../main/service/info/service_alert_popup.hbs   | 15 +---
 2 files changed, 31 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/def3b0ae/ambari-web/app/controllers/main/service/info/summary.js
--
diff --git a/ambari-web/app/controllers/main/service/info/summary.js 
b/ambari-web/app/controllers/main/service/info/summary.js
index 88a6581..fc423fe 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -386,25 +386,30 @@ App.MainServiceInfoSummaryController = 
Em.Controller.extend(App.WidgetSectionMix
   var property = context.get('componentName') ? 'componentName' : 
'serviceName';
   var serviceDefinitions = 
this.get('controller.content').filterProperty(property, context.get(property));
   // definitions should be sorted in order: critical, warning, ok, 
unknown, other
-  var criticalDefinitions = [], warningDefinitions = [], okDefinitions 
= [], unknownDefinitions = [];
+  var definitionTypes = {
+"isCritical": [],
+"isWarning": [],
+"isOK": [],
+"isUnknown": []
+  };
+
   serviceDefinitions.forEach(function (definition) {
-if (definition.get('isCritical')) {
-  criticalDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isWarning')) {
-  warningDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isOK')) {
-  okDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isUnknown')) {
-  unknownDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-}
+Object.keys(definitionTypes).forEach(function (type) {
+  if (definition.get(type)) {
+definition.set('isCollapsed', true);
+definitionTypes[type].push(definition);
+serviceDefinitions = serviceDefinitions.without(definition);
+  }
+});
   });
-  serviceDefinitions = criticalDefinitions.concat(warningDefinitions, 
okDefinitions, unknownDefinitions, serviceDefinitions);
+  serviceDefinitions = 
definitionTypes.isCritical.concat(definitionTypes.isWarning, 
definitionTypes.isOK, definitionTypes.isUnknown, serviceDefinitions);
+
   return serviceDefinitions;
 }.property('controller.content'),
+onToggleBlock: function (alert) {
+  this.$('#' + alert.context.clientId).toggle('blind', 500);
+  alert.context.set("isCollapsed", !alert.context.get("isCollapsed"));
+},
 gotoAlertDetails: function (event) {
   if (event && event.context) {
 this.get('parentView').hide();
@@ -856,4 +861,4 @@ App.MainServiceInfoSummaryController = 
Em.Controller.extend(App.WidgetSectionMix
 App.router.route('main' + event.context.href);
   }
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/def3b0ae/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
--
diff --git a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs 
b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
index 3c132a3..8b72a50 100644
--- a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
+++ b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
@@ -22,11 +22,16 @@
   
 
   
-
-  {{alert.label}}
-
-
-  {{alert.latestText}}
+
+  
+
+{{alert.label}}
+  
+  
+ 

[10/24] ambari git commit: AMBARI-19061. Ambari-server restart command not working. if any parameters are changed and reset to default. (aonishuk)

2016-12-02 Thread jonathanhurley
AMBARI-19061. Ambari-server restart command not working. if any parameters are 
changed and reset to default.  (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 2de7ee8d01ce850bbbf9844ad8789615b6570168
Parents: c2dc753
Author: Andrew Onishuk 
Authored: Fri Dec 2 11:45:57 2016 +0200
Committer: Andrew Onishuk 
Committed: Fri Dec 2 11:45:57 2016 +0200

--
 .../src/main/python/ambari_server/utils.py  | 23 ++--
 1 file changed, 12 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2de7ee8d/ambari-server/src/main/python/ambari_server/utils.py
--
diff --git a/ambari-server/src/main/python/ambari_server/utils.py 
b/ambari-server/src/main/python/ambari_server/utils.py
index 26e59ae..fc631f5 100644
--- a/ambari-server/src/main/python/ambari_server/utils.py
+++ b/ambari-server/src/main/python/ambari_server/utils.py
@@ -127,17 +127,18 @@ def save_main_pid_ex(pids, pidfile, exclude_list=[], 
skip_daemonize=False):
   """
   pid_saved = False
   try:
-pfile = open(pidfile, "w")
-for item in pids:
-  if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
-pfile.write("%s\n" % item["pid"])
-pid_saved = True
-logger.info("Ambari server started with PID " + str(item["pid"]))
-  if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not 
skip_daemonize:
-try:
-  os.kill(int(item["pid"]), signal.SIGKILL)
-except:
-  pass
+if pids:
+  pfile = open(pidfile, "w")
+  for item in pids:
+if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
+  pfile.write("%s\n" % item["pid"])
+  pid_saved = True
+  logger.info("Ambari server started with PID " + str(item["pid"]))
+if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not 
skip_daemonize:
+  try:
+os.kill(int(item["pid"]), signal.SIGKILL)
+  except:
+pass
   except IOError as e:
 logger.error("Failed to write PID to " + pidfile + " due to " + str(e))
 pass



[15/24] ambari git commit: AMBARI-19055 - Removing Tasks From host_role_command Causes Upgrades To Show As PENDING (jonathanhurley)

2016-12-02 Thread jonathanhurley
AMBARI-19055 - Removing Tasks From host_role_command Causes Upgrades To Show As 
PENDING (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 32840c1ed434ae4cc99e3ab6f7d3f2604fb69d06
Parents: f4ea309
Author: Jonathan Hurley 
Authored: Thu Dec 1 15:49:06 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 10:19:41 2016 -0500

--
 .../controller/internal/CalculatedStatus.java   | 52 +++-
 .../internal/RequestResourceProvider.java   | 34 -
 .../internal/StageResourceProvider.java |  2 +-
 .../internal/CalculatedStatusTest.java  | 31 
 .../internal/RequestResourceProviderTest.java   | 12 +++--
 5 files changed, 103 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/32840c1e/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
index 3a86aef..3c415df 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
@@ -53,6 +53,17 @@ public class CalculatedStatus {
*/
   private final double percent;
 
+  /**
+   * A status which represents a COMPLETED state at 0%
+   */
+  public static final CalculatedStatus COMPLETED = new 
CalculatedStatus(HostRoleStatus.COMPLETED,
+  HostRoleStatus.COMPLETED, 100.0);
+
+  /**
+   * A status which represents a PENDING state at 0%
+   */
+  public static final CalculatedStatus PENDING = new 
CalculatedStatus(HostRoleStatus.PENDING,
+  HostRoleStatus.PENDING, 0.0);
 
   // - Constructors --
 
@@ -79,12 +90,6 @@ public class CalculatedStatus {
 this.percent = percent;
   }
 
-  /**
-   * Static factory method to get Status that represents a Completed state
-   */
-  public static CalculatedStatus getCompletedStatus() {
-return new CalculatedStatus(HostRoleStatus.COMPLETED, 
HostRoleStatus.COMPLETED, 100.0);
-  }
 
   // - CalculatedStatus --
 
@@ -291,14 +296,25 @@ public class CalculatedStatus {
   }
 
   /**
-   * Calculates the overall status of an upgrade.
-   * @param stageDto  the map of stage-to-summary value objects
-   * @param stageIds  the stage ids to consider from the value objects
+   * Calculates the overall status of an upgrade. If there are no tasks, then a
+   * status of {@link HostRoleStatus#COMPLETED} is returned.
+   *
+   * @param stageDto
+   *  the map of stage-to-summary value objects
+   * @param stageIds
+   *  the stage ids to consider from the value objects
* @return the calculated status
*/
   public static CalculatedStatus statusFromStageSummary(Map stageDto,
   Set stageIds) {
 
+// if either are empty, then we have no tasks and therefore no status - we
+// should return COMPLETED. This can happen if someone removes all tasks 
but
+// leaves the stages and request
+if (stageDto.isEmpty() || stageIds.isEmpty()) {
+  return COMPLETED;
+}
+
 Collection stageStatuses = new HashSet<>();
 Collection stageDisplayStatuses = new HashSet<>();
 Collection taskStatuses = new ArrayList<>();
@@ -378,19 +394,28 @@ public class CalculatedStatus {
*/
   public static HostRoleStatus 
calculateSummaryStatusOfStage(Map counters,
   int total, boolean skippable) {
+
+// when there are 0 tasks, return COMPLETED
+if (total == 0) {
+  return HostRoleStatus.COMPLETED;
+}
+
 if (counters.get(HostRoleStatus.PENDING) == total) {
   return HostRoleStatus.PENDING;
 }
+
 // By definition, any tasks in a future stage must be held in a PENDING 
status.
 if (counters.get(HostRoleStatus.HOLDING) > 0 || 
counters.get(HostRoleStatus.HOLDING_FAILED) > 0 || 
counters.get(HostRoleStatus.HOLDING_TIMEDOUT) > 0) {
   return counters.get(HostRoleStatus.HOLDING) > 0 ? HostRoleStatus.HOLDING 
:
   counters.get(HostRoleStatus.HOLDING_FAILED) > 0 ? 
HostRoleStatus.HOLDING_FAILED :
   HostRoleStatus.HOLDING_TIMEDOUT;
 }
+
 // Because tasks are not skippable, 

[04/24] ambari git commit: AMBARI-19032 HDFS Metric alerts turns to UNKNOWN state with error "'NoneType' object has no attribute 'split'" (dsen)

2016-12-02 Thread jonathanhurley
AMBARI-19032 HDFS Metric alerts turns to UNKNOWN state with error "'NoneType' 
object has no attribute 'split'" (dsen)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 406b245ef9ed3a43fdf4d974dc1a7fc467c576a4
Parents: 63c0f2e
Author: Dmytro Sen 
Authored: Thu Dec 1 22:15:26 2016 +0200
Committer: Dmytro Sen 
Committed: Thu Dec 1 22:15:26 2016 +0200

--
 .../ambari_commons/ambari_metrics_helper.py | 45 +++-
 .../timeline/AbstractTimelineMetricsSink.java   |  6 +--
 .../AbstractTimelineMetricSinkTest.java | 10 ++---
 .../timeline/HadoopTimelineMetricsSink.java |  4 +-
 .../timeline/HadoopTimelineMetricsSinkTest.java |  6 +--
 .../src/main/python/core/config_reader.py   |  9 ++--
 .../src/test/python/core/TestEmitter.py |  2 +-
 .../1.6.1.2.2.0/package/scripts/params.py   |  2 +-
 .../0.1.0/package/scripts/params.py |  2 +-
 .../0.1.0/package/scripts/service_check.py  |  2 +-
 .../FLUME/1.4.0.2.0/package/scripts/params.py   |  2 +-
 .../0.96.0.2.0/package/scripts/params_linux.py  |  2 +-
 .../package/alerts/alert_metrics_deviation.py   |  2 +-
 .../KAFKA/0.8.1/package/scripts/params.py   |  2 +-
 .../STORM/0.9.1/package/scripts/params_linux.py |  2 +-
 .../2.0.6/hooks/before-START/scripts/params.py  |  2 +-
 .../2.1/hooks/before-START/scripts/params.py|  4 +-
 17 files changed, 51 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/406b245e/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
--
diff --git 
a/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py 
b/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
index 2eb0b6d..f6f4068 100644
--- a/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
+++ b/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
@@ -22,38 +22,41 @@ import os
 import random
 from resource_management.libraries.functions import conf_select
 
-DEFAULT_COLLECTOR_SUFFIX = '.sink.timeline.collector'
+DEFAULT_COLLECTOR_SUFFIX = '.sink.timeline.collector.hosts'
 DEFAULT_METRICS2_PROPERTIES_FILE_NAME = 'hadoop-metrics2.properties'
 
 def select_metric_collector_for_sink(sink_name):
-# TODO check '*' sink_name
+  # TODO check '*' sink_name
 
-all_collectors_string = 
get_metric_collectors_from_properties_file(sink_name)
+  all_collectors_string = get_metric_collectors_from_properties_file(sink_name)
+  if all_collectors_string:
 all_collectors_list = all_collectors_string.split(',')
 return select_metric_collector_hosts_from_hostnames(all_collectors_list)
+  else:
+return 'localhost'
 
 def select_metric_collector_hosts_from_hostnames(hosts):
-return get_random_host(hosts)
+  return get_random_host(hosts)
 
 def get_random_host(hosts):
-return random.choice(hosts)
+  return random.choice(hosts)
 
 def get_metric_collectors_from_properties_file(sink_name):
-hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
-props = load_properties_from_file(os.path.join(hadoop_conf_dir, 
DEFAULT_METRICS2_PROPERTIES_FILE_NAME))
-return props.get(sink_name + DEFAULT_COLLECTOR_SUFFIX)
+  hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
+  props = load_properties_from_file(os.path.join(hadoop_conf_dir, 
DEFAULT_METRICS2_PROPERTIES_FILE_NAME))
+  return props.get(sink_name + DEFAULT_COLLECTOR_SUFFIX)
 
 def load_properties_from_file(filepath, sep='=', comment_char='#'):
-"""
-Read the file passed as parameter as a properties file.
-"""
-props = {}
-with open(filepath, "rt") as f:
-for line in f:
-l = line.strip()
-if l and not l.startswith(comment_char):
-key_value = l.split(sep)
-key = key_value[0].strip()
-value = sep.join(key_value[1:]).strip('" \t')
-props[key] = value
-return props
+  """
+  Read the file passed as parameter as a properties file.
+  """
+  props = {}
+  with open(filepath, "rt") as f:
+for line in f:
+l = line.strip()
+if l and not l.startswith(comment_char):
+  key_value = l.split(sep)
+  key = key_value[0].strip()
+  value = sep.join(key_value[1:]).strip('" \t')
+  props[key] = value
+  return props

http://git-wip-us.apache.org/repos/asf/ambari/blob/406b245e/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java

[19/24] ambari git commit: AMBARI-19064 Refactor widgets on Dashboard page. (atkach)

2016-12-02 Thread jonathanhurley
http://git-wip-us.apache.org/repos/asf/ambari/blob/9348725b/ambari-web/test/views/main/dashboard/widget_test.js
--
diff --git a/ambari-web/test/views/main/dashboard/widget_test.js 
b/ambari-web/test/views/main/dashboard/widget_test.js
index 0544ff6..63da712 100644
--- a/ambari-web/test/views/main/dashboard/widget_test.js
+++ b/ambari-web/test/views/main/dashboard/widget_test.js
@@ -21,178 +21,84 @@ require('views/main/dashboard/widget');
 
 describe('App.DashboardWidgetView', function () {
 
-  var dashboardWidgetView = App.DashboardWidgetView.create({
+  var dashboardWidgetView;
+
+  dashboardWidgetView = App.DashboardWidgetView.create({
 parentView: Em.Object.create({
   widgetsMapper: Em.K,
-  getUserPref: function () {return {complete: Em.K}},
+  getUserPref: function () {
+return {complete: Em.K}
+  },
   postUserPref: Em.K,
   translateToReal: Em.K,
   visibleWidgets: [],
   hiddenWidgets: []
+}),
+widget: Em.Object.create({
+  id: 5,
+  sourceName: 'HDFS',
+  title: 'Widget'
 })
   });
 
   describe('#viewID', function () {
 it('viewID is computed with id', function () {
-  dashboardWidgetView.set('id', 5);
   expect(dashboardWidgetView.get('viewID')).to.equal('widget-5');
 });
   });
 
   describe('#model', function () {
-it('model_type is null', function () {
-  dashboardWidgetView.set('model_type', null);
+
+beforeEach(function() {
+  sinon.stub(dashboardWidgetView, 
'findModelBySource').returns(Em.Object.create({serviceName: 'HDFS'}));
+});
+
+afterEach(function() {
+  dashboardWidgetView.findModelBySource.restore();
+});
+
+it('sourceName is null', function () {
+  dashboardWidgetView.set('widget.sourceName', null);
   dashboardWidgetView.propertyDidChange('model');
-  expect(dashboardWidgetView.get('model')).to.eql({});
+  expect(dashboardWidgetView.get('model')).to.be.an.object;
 });
-it('model_type is valid', function () {
-  dashboardWidgetView.set('model_type', 's');
+it('sourceName is valid', function () {
+  dashboardWidgetView.set('widget.sourceName', 'HDFS');
   dashboardWidgetView.propertyDidChange('model');
-  dashboardWidgetView.set('parentView.s_model', {'s': {}});
-  expect(dashboardWidgetView.get('model')).to.eql({'s': {}});
+  
expect(dashboardWidgetView.get('model')).to.eql(Em.Object.create({serviceName: 
'HDFS'}));
 });
   });
 
   describe("#didInsertElement()", function () {
-before(function () {
+
+beforeEach(function () {
   sinon.stub(App, 'tooltip', Em.K);
 });
-after(function () {
+afterEach(function () {
   App.tooltip.restore();
 });
+
 it("call App.tooltip", function () {
   dashboardWidgetView.didInsertElement();
   expect(App.tooltip.calledOnce).to.be.true;
 });
   });
 
-  describe("#deleteWidget()", function () {
-beforeEach(function () {
-  sinon.stub(dashboardWidgetView.get('parentView'), 
'widgetsMapper').returns({});
-  sinon.stub(dashboardWidgetView.get('parentView'), 
'getUserPref').returns({
-complete: Em.K
-  });
-});
-
-afterEach(function () {
-  dashboardWidgetView.get('parentView').widgetsMapper.restore();
-  dashboardWidgetView.get('parentView').getUserPref.restore();
-});
-
-it("testMode is off", function () {
-  dashboardWidgetView.set('parentView.persistKey', 'key');
-  dashboardWidgetView.deleteWidget();
-  
expect(dashboardWidgetView.get('parentView').getUserPref.calledWith('key')).to.be.true;
-});
-  });
+  describe("#editWidget()", function () {
 
-  describe("#deleteWidgetComplete()", function () {
 beforeEach(function () {
-  sinon.spy(dashboardWidgetView.get('parentView'), 'postUserPref');
-  sinon.spy(dashboardWidgetView.get('parentView'), 'translateToReal');
-  dashboardWidgetView.set('parentView.currentPrefObject', {
-dashboardVersion: 'new',
-visible: ['1', '2'],
-hidden: [],
-threshold: 'threshold'
-  });
-  dashboardWidgetView.set('parentView.persistKey', 'key');
-  dashboardWidgetView.deleteWidgetComplete();
-});
-afterEach(function () {
-  dashboardWidgetView.get('parentView').postUserPref.restore();
-  dashboardWidgetView.get('parentView').translateToReal.restore();
-});
-it("postUserPref is called with correct data", function () {
-  var arg = 
JSON.parse(JSON.stringify(dashboardWidgetView.get('parentView').postUserPref.args[0][1]));
-  expect(arg).to.be.eql({
-dashboardVersion: 'new',
-visible: ['1', '2'],
-hidden: [[5, null]],
-threshold: 'threshold'
-  });
-});
-it("translateToReal is called with valid data", function () {
-  var arg = 
JSON.parse(JSON.stringify(dashboardWidgetView.get('parentView').translateToReal.args[0][0]));
-  

[06/24] ambari git commit: AMBARI-18888: Ambari-agent: Create configuration files with JCEKS information

2016-12-02 Thread jonathanhurley
AMBARI-1: Ambari-agent: Create configuration files with JCEKS information


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 615438b272e6bd8efd37481ef684ae7d68921e64
Parents: 7577ebb
Author: Nahappan Somasundaram 
Authored: Tue Nov 29 13:36:16 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Thu Dec 1 13:58:54 2016 -0800

--
 ambari-agent/conf/unix/ambari-agent.ini |   3 +
 .../ambari_agent/CustomServiceOrchestrator.py   | 120 +++
 ambari-agent/src/packages/tarball/all.xml   |  30 +
 .../ambari/server/agent/ExecutionCommand.java   |  28 +
 .../ambari/server/agent/HeartBeatHandler.java   |  10 +-
 .../server/agent/TestHeartbeatHandler.java  |  28 +++--
 6 files changed, 210 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/615438b2/ambari-agent/conf/unix/ambari-agent.ini
--
diff --git a/ambari-agent/conf/unix/ambari-agent.ini 
b/ambari-agent/conf/unix/ambari-agent.ini
index 61948d4..d6fcf5f 100644
--- a/ambari-agent/conf/unix/ambari-agent.ini
+++ b/ambari-agent/conf/unix/ambari-agent.ini
@@ -46,6 +46,9 @@ keysdir=/var/lib/ambari-agent/keys
 server_crt=ca.crt
 passphrase_env_var_name=AMBARI_PASSPHRASE
 ssl_verify_cert=0
+credential_lib_dir=/var/lib/ambari-agent/cred/lib
+credential_conf_dir=/var/lib/ambari-agent/cred/conf
+credential_shell_cmd=org.apache.hadoop.security.alias.CredentialShell
 
 [services]
 pidLookupPath=/var/run/

http://git-wip-us.apache.org/repos/asf/ambari/blob/615438b2/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 7d61611..1eab0a5 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -29,6 +29,8 @@ from FileCache import FileCache
 from AgentException import AgentException
 from PythonExecutor import PythonExecutor
 from PythonReflectiveExecutor import PythonReflectiveExecutor
+from resource_management.core.utils import PasswordString
+import subprocess
 import Constants
 import hostname
 
@@ -65,6 +67,11 @@ class CustomServiceOrchestrator():
   REFLECTIVELY_RUN_COMMANDS = FREQUENT_COMMANDS # -- commands which run a lot 
and often (this increases their speed)
   DONT_BACKUP_LOGS_FOR_COMMANDS = FREQUENT_COMMANDS
 
+  # Path where hadoop credential JARS will be available
+  DEFAULT_CREDENTIAL_SHELL_LIB_PATH = '/var/lib/ambari-agent/cred/lib'
+  DEFAULT_CREDENTIAL_CONF_DIR = '/var/lib/ambari-agent/cred/conf'
+  DEFAULT_CREDENTIAL_SHELL_CMD = 
'org.apache.hadoop.security.alias.CredentialShell'
+
   def __init__(self, config, controller):
 self.config = config
 self.tmp_dir = config.get('agent', 'prefix')
@@ -78,6 +85,14 @@ class CustomServiceOrchestrator():
 # cache reset will be called on every agent registration
 controller.registration_listeners.append(self.file_cache.reset)
 
+# Construct the hadoop credential lib JARs path
+self.credential_shell_lib_path = os.path.join(config.get('security', 
'credential_lib_dir',
+ 
self.DEFAULT_CREDENTIAL_SHELL_LIB_PATH), '*')
+
+self.credential_conf_dir = config.get('security', 'credential_conf_dir', 
self.DEFAULT_CREDENTIAL_CONF_DIR)
+
+self.credential_shell_cmd = config.get('security', 'credential_shell_cmd', 
self.DEFAULT_CREDENTIAL_SHELL_CMD)
+
 # Clean up old status command files if any
 try:
   os.unlink(self.status_commands_stdout)
@@ -114,6 +129,102 @@ class CustomServiceOrchestrator():
 else:
   return PythonExecutor(self.tmp_dir, self.config)
 
+  def getProviderDirectory(self, service_name):
+"""
+Gets the path to the service conf folder where the JCEKS file will be 
created.
+
+:param service_name: Name of the service, for example, HIVE
+:return: lower case path to the service conf folder
+"""
+
+# The stack definition scripts of the service can move the
+# JCEKS file around to where it wants, which is usually
+# /etc//conf
+
+conf_dir = os.path.join(self.credential_conf_dir, service_name.lower())
+if not os.path.exists(conf_dir):
+  os.makedirs(conf_dir, 0644)
+
+return conf_dir
+
+  def 

[22/24] ambari git commit: AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via ncole)

2016-12-02 Thread jonathanhurley
AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via 
ncole)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 05fe42351131f77a6ee5d58da355b1c461562046
Parents: def3b0a
Author: Nate Cole 
Authored: Fri Dec 2 13:23:36 2016 -0500
Committer: Nate Cole 
Committed: Fri Dec 2 13:23:36 2016 -0500

--
 .../main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/05fe4235/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
index 525078e..cbb5ba2 100644
--- 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
@@ -35,7 +35,7 @@
   
 
 
-  ubuntu12
+  ubuntu12,ubuntu14,ubuntu16
   
 
   zookeeper-${stack_version}



[02/24] ambari git commit: AMBARI-19006. EU to message users to start YARN queues if work preserving recovery is disabled (alejandro)

2016-12-02 Thread jonathanhurley
AMBARI-19006. EU to message users to start YARN queues if work preserving 
recovery is disabled (alejandro)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 63938e09ca9e79ee541dd51104964322192e293f
Parents: 88e0c29
Author: Alejandro Fernandez 
Authored: Mon Nov 28 18:05:41 2016 -0800
Committer: Alejandro Fernandez 
Committed: Thu Dec 1 09:55:33 2016 -0800

--
 .../stack/upgrade/ConfigurationCondition.java   | 72 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml | 27 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml | 27 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml | 27 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml | 27 +---
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml | 27 +---
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml | 27 +---
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml | 27 +---
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml | 27 +---
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 27 +---
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml | 27 +---
 .../src/main/resources/upgrade-pack.xsd |  8 ++-
 12 files changed, 231 insertions(+), 119 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
index 1bd88e4..d229270 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
@@ -52,7 +52,37 @@ public final class ConfigurationCondition extends Condition {
  * Equals comparison.
  */
 @XmlEnumValue("equals")
-EQUALS;
+EQUALS,
+
+/**
+ * Not equals comparison.
+ */
+@XmlEnumValue("not-equals")
+NOT_EQUALS,
+
+/**
+ * String contains.
+ */
+@XmlEnumValue("contains")
+CONTAINS,
+
+/**
+ * Does not contain.
+ */
+@XmlEnumValue("not-contains")
+NOT_CONTAINS,
+
+/**
+ * Exists with any value.
+ */
+@XmlEnumValue("exists")
+EXISTS,
+
+/**
+ * Does not exist.
+ */
+@XmlEnumValue("not-exists")
+NOT_EXISTS;
   }
 
   /**
@@ -68,12 +98,18 @@ public final class ConfigurationCondition extends Condition 
{
   public String property;
 
   /**
-   * The value to compare against.
+   * The value to compare against; only valid if comparison type is in (=, !=, 
contains, !contains).
*/
   @XmlAttribute(name = "value")
   public String value;
 
   /**
+   * The value to return if comparison type is in (=, !=, contains, !contains) 
and the config is missing.
+   */
+  @XmlAttribute(name = "return_value_if_config_missing")
+  public boolean returnValueIfConfigMissing;
+
+  /**
* The type of comparison to make.
*/
   @XmlAttribute(name = "comparison")
@@ -84,7 +120,7 @@ public final class ConfigurationCondition extends Condition {
*/
   @Override
   public String toString() {
-return Objects.toStringHelper(this).add("type", type).add("property", 
property).add(value,
+return Objects.toStringHelper(this).add("type", type).add("property", 
property).add("value",
 value).add("comparison", comparisonType).omitNullValues().toString();
   }
 
@@ -94,20 +130,40 @@ public final class ConfigurationCondition extends 
Condition {
   @Override
   public boolean isSatisfied(UpgradeContext upgradeContext) {
 Cluster cluster = upgradeContext.getCluster();
+
+boolean propertyExists = false;
 Config config = cluster.getDesiredConfigByType(type);
-if (null == config) {
-  return false;
+Map properties = null;
+if (null != config) {
+  properties = config.getProperties();
+  if (properties.containsKey(property)) {
+propertyExists = true;
+  }
+}
+
+if (comparisonType == ComparisonType.EXISTS) {
+  return propertyExists;
+}
+if (comparisonType == ComparisonType.NOT_EXISTS) {
+  return !propertyExists;
 }
 
-Map properties = config.getProperties();
-if (MapUtils.isEmpty(properties)) {
-  return false;
+// If property doesn't exist, we cannot make any 

[20/24] ambari git commit: AMBARI-19064 Refactor widgets on Dashboard page. (atkach)

2016-12-02 Thread jonathanhurley
AMBARI-19064 Refactor widgets on Dashboard page. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 9348725b1067fab38907c8eebc172978729394ad
Parents: 7eb2eaa
Author: Andrii Tkach 
Authored: Fri Dec 2 19:27:20 2016 +0200
Committer: Andrii Tkach 
Committed: Fri Dec 2 19:27:20 2016 +0200

--
 .../mixins/main/dashboard/widgets/editable.js   |  47 +-
 .../main/dashboard/edit_widget_popup.hbs|   4 +-
 .../edit_widget_popup_single_threshold.hbs  |   2 +-
 .../main/dashboard/plus_button_filter.hbs   |   2 +-
 .../app/templates/main/dashboard/widgets.hbs|   8 +-
 .../main/dashboard/widgets/pie_chart.hbs|   5 +-
 .../app/views/common/not-scrollable-textarea.js |   2 +-
 ambari-web/app/views/main/dashboard/widget.js   | 159 ++--
 ambari-web/app/views/main/dashboard/widgets.js  | 824 +--
 .../main/dashboard/widgets/datanode_live.js |   7 -
 .../main/dashboard/widgets/flume_agent_live.js  |   7 -
 .../main/dashboard/widgets/hawqsegment_live.js  |   7 -
 .../dashboard/widgets/hbase_average_load.js |  11 +-
 .../views/main/dashboard/widgets/hbase_links.js |   4 -
 .../main/dashboard/widgets/hbase_master_heap.js |   4 -
 .../dashboard/widgets/hbase_master_uptime.js|   5 -
 .../widgets/hbase_regions_in_transition.js  |  10 +-
 .../main/dashboard/widgets/hdfs_capacity.js |   4 -
 .../views/main/dashboard/widgets/hdfs_links.js  |   4 -
 .../views/main/dashboard/widgets/metrics_cpu.js |   3 -
 .../main/dashboard/widgets/metrics_load.js  |   3 -
 .../main/dashboard/widgets/metrics_memory.js|   3 -
 .../main/dashboard/widgets/metrics_network.js   |   3 -
 .../main/dashboard/widgets/namenode_cpu.js  |   4 -
 .../main/dashboard/widgets/namenode_heap.js |   4 -
 .../main/dashboard/widgets/namenode_rpc.js  |  10 +-
 .../main/dashboard/widgets/namenode_uptime.js   |   5 -
 .../dashboard/widgets/node_managers_live.js |   7 -
 .../main/dashboard/widgets/pie_chart_widget.js  |  16 +-
 .../views/main/dashboard/widgets/pxf_live.js|   6 -
 .../dashboard/widgets/resource_manager_heap.js  |   4 -
 .../widgets/resource_manager_uptime.js  |   5 -
 .../main/dashboard/widgets/supervisor_live.js   |   7 -
 .../views/main/dashboard/widgets/text_widget.js |   4 +-
 .../widgets/text_widget_single_threshold.js |   6 +-
 .../dashboard/widgets/uptime_text_widget.js |   2 -
 .../views/main/dashboard/widgets/yarn_links.js  |   4 -
 .../views/main/dashboard/widgets/yarn_memory.js |   4 -
 .../test/views/main/dashboard/widget_test.js| 200 ++---
 .../widgets/hbase_average_load_test.js  |   4 +-
 .../widgets/hbase_regions_in_transition_test.js |   6 +-
 .../main/dashboard/widgets/namenode_rpc_test.js |  13 +-
 .../text_widget_single_threshold_test.js|  10 +-
 .../main/dashboard/widgets/text_widget_test.js  |  10 +-
 .../widgets/uptime_text_widget_test.js  |   2 +-
 .../test/views/main/dashboard/widgets_test.js   | 669 ++-
 46 files changed, 813 insertions(+), 1317 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9348725b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
--
diff --git a/ambari-web/app/mixins/main/dashboard/widgets/editable.js 
b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
index f330ec3..3206229 100644
--- a/ambari-web/app/mixins/main/dashboard/widgets/editable.js
+++ b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
@@ -23,24 +23,24 @@ App.EditableWidgetMixin = Em.Mixin.create({
   hintInfo: '',
 
   editWidget: function () {
-var parent = this;
+var self = this;
 var configObj = Ember.Object.create({
-  thresh1: parent.get('thresh1') + '',
-  thresh2: parent.get('thresh2') + '',
-  hintInfo: parent.get('hintInfo'),
+  thresholdMin: self.get('thresholdMin') + '',
+  thresholdMax: self.get('thresholdMax') + '',
+  hintInfo: self.get('hintInfo'),
   isThresh1Error: false,
   isThresh2Error: false,
   errorMessage1: "",
   errorMessage2: "",
   maxValue: 'infinity',
   observeNewThresholdValue: function () {
-var thresh1 = this.get('thresh1');
-var thresh2 = this.get('thresh2');
-if (thresh1.trim() !== "") {
-  if (isNaN(thresh1) || thresh1 < 0) {
+var thresholdMin = this.get('thresholdMin');
+var thresholdMax = this.get('thresholdMax');
+if (thresholdMin.trim() !== "") {
+  if (isNaN(thresholdMin) || thresholdMin < 0) 

[13/24] ambari git commit: AMBARI-18441 - upgrade ambari to 2.1.1 error (Wang Yaoxin via jonathanhurley)

2016-12-02 Thread jonathanhurley
AMBARI-18441 - upgrade ambari to 2.1.1 error (Wang Yaoxin via jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: ae3ff2a09b6b36f8a456987c60fc695dd262b6bb
Parents: 80084a9
Author: Jonathan Hurley 
Authored: Fri Dec 2 10:13:22 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 10:13:45 2016 -0500

--
 .../server/upgrade/UpgradeCatalog211.java   | 24 
 1 file changed, 15 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ae3ff2a0/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
index db13612..eb835ef 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
@@ -212,8 +212,8 @@ public class UpgradeCatalog211 extends 
AbstractUpgradeCatalog {
 statement = dbAccessor.getConnection().createStatement();
 if (statement != null) {
   String selectSQL = MessageFormat.format(
-  "SELECT cluster_id, service_name, component_name, host_id FROM 
{0}",
-  HOST_COMPONENT_STATE_TABLE);
+  "SELECT id, cluster_id, service_name, component_name, host_id 
FROM {0} ORDER BY {1} {2}",
+  HOST_COMPONENT_STATE_TABLE, "id", "DESC");
 
   resultSet = statement.executeQuery(selectSQL);
   while (resultSet.next()) {
@@ -221,13 +221,19 @@ public class UpgradeCatalog211 extends 
AbstractUpgradeCatalog {
 final String serviceName = resultSet.getString("service_name");
 final String componentName = resultSet.getString("component_name");
 final Long hostId = resultSet.getLong("host_id");
-
-String updateSQL = MessageFormat.format(
-"UPDATE {0} SET {1} = {2,number,#} WHERE cluster_id = {3} AND 
service_name = ''{4}'' AND component_name = ''{5}'' and host_id = {6,number,#}",
-HOST_COMPONENT_STATE_TABLE, HOST_COMPONENT_STATE_ID_COLUMN, 
m_hcsId.getAndIncrement(),
-clusterId, serviceName, componentName, hostId);
-
-dbAccessor.executeQuery(updateSQL);
+final Long idKey = resultSet.getLong("id");
+
+if (idKey != 0 && m_hcsId.get() == 1) {
+  m_hcsId.set(idKey);
+  m_hcsId.getAndIncrement();
+} else if(idKey == 0) {
+  String updateSQL = MessageFormat.format(
+  "UPDATE {0} SET {1} = {2,number,#} WHERE cluster_id = {3} 
AND service_name = ''{4}'' AND component_name = ''{5}'' and host_id = 
{6,number,#}",
+  HOST_COMPONENT_STATE_TABLE, HOST_COMPONENT_STATE_ID_COLUMN, 
m_hcsId.getAndIncrement(),
+  clusterId, serviceName, componentName, hostId);
+
+  dbAccessor.executeQuery(updateSQL);
+}
   }
 }
   } finally {



[23/24] ambari git commit: AMBARI-18936. DataNode JVM heap settings should include CMSInitiatingOccupancy (Arpit Agarwal via smohanty)

2016-12-02 Thread jonathanhurley
AMBARI-18936. DataNode JVM heap settings should include CMSInitiatingOccupancy 
(Arpit Agarwal via smohanty)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 0c837a60c6bbe7c6fb7c5586963520957bb4146f
Parents: 05fe423
Author: Sumit Mohanty 
Authored: Fri Dec 2 13:13:35 2016 -0800
Committer: Sumit Mohanty 
Committed: Fri Dec 2 13:13:35 2016 -0800

--
 .../services/HDFS/configuration/hadoop-env.xml  | 176 +++
 1 file changed, 176 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0c837a60/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
new file mode 100644
index 000..24e0193
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
@@ -0,0 +1,176 @@
+
+
+
+
+  
+  
+content
+hadoop-env template
+This is the jinja template for hadoop-env.sh 
file
+
+# Set Hadoop-specific environment variables here.
+
+# The only required environment variable is JAVA_HOME.  All others are
+# optional.  When running a distributed configuration it is best to
+# set JAVA_HOME in this file, so that it is correctly defined on
+# remote nodes.
+
+# The java implementation to use.  Required.
+export JAVA_HOME={{java_home}}
+export HADOOP_HOME_WARN_SUPPRESS=1
+
+# Hadoop home directory
+export HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}
+
+# Hadoop Configuration Directory
+
+{# this is different for HDP1 #}
+# Path to jsvc required by secure HDP 2.0 datanode
+export JSVC_HOME={{jsvc_path}}
+
+
+# The maximum amount of heap to use, in MB. Default is 1000.
+export HADOOP_HEAPSIZE="{{hadoop_heapsize}}"
+
+export HADOOP_NAMENODE_INIT_HEAPSIZE="-Xms{{namenode_heapsize}}"
+
+# Extra Java runtime options.  Empty by default.
+export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true ${HADOOP_OPTS}"
+
+# Command specific options appended to HADOOP_OPTS when specified
+HADOOP_JOBTRACKER_OPTS="-server -XX:ParallelGCThreads=8 
-XX:+UseConcMarkSweepGC 
-XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log 
-XX:NewSize={{jtnode_opt_newsize}} -XX:MaxNewSize={{jtnode_opt_maxnewsize}} 
-Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-Xmx{{jtnode_heapsize}} -Dhadoop.security.logger=INFO,DRFAS 
-Dmapred.audit.logger=INFO,MRAUDIT 
-Dhadoop.mapreduce.jobsummary.logger=INFO,JSA ${HADOOP_JOBTRACKER_OPTS}"
+
+HADOOP_TASKTRACKER_OPTS="-server -Xmx{{ttnode_heapsize}} 
-Dhadoop.security.logger=ERROR,console -Dmapred.audit.logger=ERROR,console 
${HADOOP_TASKTRACKER_OPTS}"
+
+{% if java_version  8 %}
+SHARED_HADOOP_NAMENODE_OPTS="-server -XX:ParallelGCThreads=8 
-XX:+UseConcMarkSweepGC 
-XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log 
-XX:NewSize={{namenode_opt_newsize}} -XX:MaxNewSize={{namenode_opt_maxnewsize}} 
-XX:PermSize={{namenode_opt_permsize}} 
-XX:MaxPermSize={{namenode_opt_maxpermsize}} 
-Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly 
-Xms{{namenode_heapsize}} -Xmx{{namenode_heapsize}} 
-Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT"
+export HADOOP_NAMENODE_OPTS="${SHARED_HADOOP_NAMENODE_OPTS} 
-XX:OnOutOfMemoryError=\"/usr/hdp/current/hadoop-hdfs-namenode/bin/kill-name-node\"
 -Dorg.mortbay.jetty.Request.maxFormContentSize=-1 ${HADOOP_NAMENODE_OPTS}"
+export HADOOP_DATANODE_OPTS="-server -XX:ParallelGCThreads=4 
-XX:+UseConcMarkSweepGC -XX:ErrorFile=/var/log/hadoop/$USER/hs_err_pid%p.log 
-XX:NewSize=200m -XX:MaxNewSize=200m -XX:PermSize=128m -XX:MaxPermSize=256m 
-Xloggc:/var/log/hadoop/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-Xms{{dtnode_heapsize}} -Xmx{{dtnode_heapsize}} 
-Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT 
${HADOOP_DATANODE_OPTS} -XX:CMSInitiatingOccupancyFraction=70 
-XX:+UseCMSInitiatingOccupancyOnly"
+
+export HADOOP_SECONDARYNAMENODE_OPTS="${SHARED_HADOOP_NAMENODE_OPTS} 

[12/24] ambari git commit: AMBARI-18951. Force InnoDB usage for MySQL. Fix for MySQL < 5.6. (mpapirkovskyy)

2016-12-02 Thread jonathanhurley
AMBARI-18951. Force InnoDB usage for MySQL. Fix for MySQL < 5.6. (mpapirkovskyy)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 80084a9d8de9110365c6f1ef68362b502e07cf28
Parents: e242fc0
Author: Myroslav Papirkovskyi 
Authored: Fri Dec 2 16:41:40 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Fri Dec 2 16:52:55 2016 +0200

--
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql   | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/80084a9d/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 b01ed2f..82ce31e 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -26,7 +26,16 @@ delimiter ;
 
 # USE @schema;
 
-SET default_storage_engine=INNODB;
+-- Set default_storage_engine to InnoDB
+-- storage_engine variable should be used for versions prior to MySQL 5.6
+set @version_short = substring_index(@@version, '.', 2);
+set @major = cast(substring_index(@version_short, '.', 1) as SIGNED);
+set @minor = cast(substring_index(@version_short, '.', -1) as SIGNED);
+set @engine_stmt = IF(@major >= 5 AND @minor>=6, 'SET 
default_storage_engine=INNODB', 'SET storage_engine=INNODB');
+prepare statement from @engine_stmt;
+execute statement;
+DEALLOCATE PREPARE statement;
+
 
 CREATE TABLE stack(
   stack_id BIGINT NOT NULL,



[05/24] ambari git commit: AMBARI-19054 : Grafana failed to start at deployment (avijayan)

2016-12-02 Thread jonathanhurley
AMBARI-19054 : Grafana failed to start at deployment (avijayan)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 7577ebb264ae71f81e6572510500f1b87ac46a18
Parents: 406b245
Author: Aravindan Vijayan 
Authored: Thu Dec 1 13:27:16 2016 -0800
Committer: Aravindan Vijayan 
Committed: Thu Dec 1 13:27:16 2016 -0800

--
 .../ambari-metrics-grafana/conf/unix/ambari-metrics-grafana| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7577ebb2/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
--
diff --git 
a/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana 
b/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
index 472942e..8a8ac8f 100644
--- a/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
+++ b/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
@@ -104,7 +104,7 @@ case "$1" in
 
 # Prepare environment
 # mkdir -p "$LOG_DIR" "$DATA_DIR" && chown 
"$GRAFANA_USER":"$GRAFANA_GROUP" "$LOG_DIR" "$DATA_DIR"
-# touch "$PID_FILE" && chown "$GRAFANA_USER":"$GRAFANA_GROUP" "$PID_FILE"
+touch "$PID_FILE" && chown "$GRAFANA_USER":"$GRAFANA_GROUP" "$PID_FILE"
 
 # if [ -n "$MAX_OPEN_FILES" ]; then
 #   ulimit -n $MAX_OPEN_FILES
@@ -116,10 +116,10 @@ case "$1" in
 return=$?
 if [ $return -eq 0 ]
 then
-  sleep 1
+  sleep 5
   # check if pid file has been written two
   if ! [[ -s $PID_FILE ]]; then
-echo "Start FAILED" >> $LOG_FILE
+echo "Start FAILED because daemon did not write pid in pid_file" >> 
$LOG_FILE
 exit 1
   fi
   i=0



[18/24] ambari git commit: AMBARI-19053. RU: wrong version exposed when Downgrade is going (ncole)

2016-12-02 Thread jonathanhurley
AMBARI-19053. RU: wrong version exposed when Downgrade is going (ncole)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 7eb2eaa73315189533e039b45cf90655adf25390
Parents: 232a9d8
Author: Nate Cole 
Authored: Thu Dec 1 16:26:21 2016 -0500
Committer: Nate Cole 
Committed: Fri Dec 2 11:19:20 2016 -0500

--
 .../internal/UpgradeResourceProvider.java   | 24 
 .../internal/UpgradeResourceProviderTest.java   |  4 ++--
 2 files changed, 22 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7eb2eaa7/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index 9034989..5931743 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -758,13 +758,17 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 upgradeContext.setSupportedServices(supportedServices);
 upgradeContext.setScope(scope);
 
+String downgradeFromVersion = null;
+
 if (direction.isDowngrade()) {
   if (requestMap.containsKey(UPGRADE_FROM_VERSION)) {
-upgradeContext.setDowngradeFromVersion((String) 
requestMap.get(UPGRADE_FROM_VERSION));
+downgradeFromVersion = (String) requestMap.get(UPGRADE_FROM_VERSION);
   } else {
 UpgradeEntity lastUpgradeItemForCluster = 
s_upgradeDAO.findLastUpgradeForCluster(cluster.getClusterId());
-
upgradeContext.setDowngradeFromVersion(lastUpgradeItemForCluster.getToVersion());
+downgradeFromVersion = lastUpgradeItemForCluster.getToVersion();
   }
+
+  upgradeContext.setDowngradeFromVersion(downgradeFromVersion);
 }
 
 // optionally skip failures - this can be supplied on either the request or
@@ -922,7 +926,13 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 }
 
 UpgradeEntity entity = new UpgradeEntity();
-
entity.setFromVersion(cluster.getCurrentClusterVersion().getRepositoryVersion().getVersion());
+
+if (null != downgradeFromVersion) {
+  entity.setFromVersion(downgradeFromVersion);
+} else {
+  
entity.setFromVersion(cluster.getCurrentClusterVersion().getRepositoryVersion().getVersion());
+}
+
 entity.setToVersion(version);
 entity.setUpgradeGroups(groupEntities);
 entity.setClusterId(cluster.getClusterId());
@@ -931,7 +941,13 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 entity.setUpgradeType(pack.getType());
 entity.setAutoSkipComponentFailures(skipComponentFailures);
 entity.setAutoSkipServiceCheckFailures(skipServiceCheckFailures);
-entity.setDowngradeAllowed(pack.isDowngradeAllowed());
+
+if (upgradeContext.getDirection().isDowngrade()) {
+  // !!! You can't downgrade a Downgrade, no matter what the upgrade pack 
says.
+  entity.setDowngradeAllowed(false);
+} else {
+  entity.setDowngradeAllowed(pack.isDowngradeAllowed());
+}
 
 req.getRequestStatusResponse();
 return createUpgradeInsideTransaction(cluster, req, entity);

http://git-wip-us.apache.org/repos/asf/ambari/blob/7eb2eaa7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
index 14e3d08..8efcc61 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
@@ -708,7 +708,7 @@ public class UpgradeResourceProviderTest {
 
 UpgradeEntity entity = upgradeDao.findUpgrade(Long.parseLong(id));
 assertNotNull(entity);
-assertEquals("2.1.1", entity.getFromVersion());
+assertEquals("2.1.1.0", entity.getFromVersion());
 assertEquals("2.2.0.0", 

[11/24] ambari git commit: AMBARI-19063. Do not change timeline.metrics.service.webapp.address in move wizard (akovalenko)

2016-12-02 Thread jonathanhurley
AMBARI-19063. Do not change timeline.metrics.service.webapp.address in move 
wizard (akovalenko)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: e242fc091abe15bc59e8572c43d9227c97e7a247
Parents: 2de7ee8
Author: Aleksandr Kovalenko 
Authored: Fri Dec 2 15:43:15 2016 +0200
Committer: Aleksandr Kovalenko 
Committed: Fri Dec 2 15:44:42 2016 +0200

--
 .../main/service/reassign/step4_controller.js| 19 ++-
 .../service/reassign/step4_controller_test.js|  2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e242fc09/ambari-web/app/controllers/main/service/reassign/step4_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step4_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index 26ac68c..64c2a8e 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -71,6 +71,12 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   hostComponents: [],
 
   /**
+   * List of components, that do not need reconfiguration for moving to 
another host
+   * Reconfigure command will be skipped
+   */
+  componentsWithoutReconfiguration: ['METRICS_COLLECTOR'],
+
+  /**
* Map with lists of related services.
* Used to define list of services to stop/start.
*/
@@ -189,14 +195,6 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   }
 },
 {
-  componentName: 'METRICS_COLLECTOR',
-  configs: {
-'ams-site': {
-  'timeline.metrics.service.webapp.address': ':6188'
-}
-  }
-},
-{
   componentName: 'HISTORYSERVER',
   configs: {
 'mapred-site': {
@@ -398,6 +396,10 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   this.removeTasks(['startZooKeeperServers', 'startNameNode']);
 }
 
+if (this.get('componentsWithoutReconfiguration').contains(componentName)) {
+  this.removeTasks(['reconfigure']);
+}
+
 if (!this.get('content.reassignComponentsInMM.length')) {
   this.removeTasks(['stopHostComponentsInMaintenanceMode']);
 }
@@ -542,7 +544,6 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
 'HIVE_SERVER': ['hive-site', 'webhcat-site', 'hive-env', 'core-site'],
 'HIVE_METASTORE': ['hive-site', 'webhcat-site', 'hive-env', 'core-site'],
 'MYSQL_SERVER': ['hive-site'],
-'METRICS_COLLECTOR': ['ams-site'],
 'HISTORYSERVER': ['mapred-site']
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e242fc09/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
--
diff --git 
a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js 
b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
index 5e7b0e3..9a73524 100644
--- a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
@@ -295,7 +295,7 @@ describe('App.ReassignMasterWizardStep4Controller', 
function () {
 
   controller.set('tasks', commandsForDB);
   controller.removeUnneededTasks();
-  
expect(controller.get('tasks').mapProperty('id')).to.eql([1,2,5,6,8,9,10,12]);
+  
expect(controller.get('tasks').mapProperty('id')).to.eql([1,2,5,6,8,10,12]);
 });
 
 it('reassign component is Mysql Server', function () {



ambari git commit: AMBARI-18936. DataNode JVM heap settings should include CMSInitiatingOccupancy (Arpit Agarwal via smohanty)

2016-12-02 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 f39bd6b6c -> aec30d56a


AMBARI-18936. DataNode JVM heap settings should include CMSInitiatingOccupancy 
(Arpit Agarwal via smohanty)


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

Branch: refs/heads/branch-2.5
Commit: aec30d56ab0165acbe36272016dacdf24627e793
Parents: f39bd6b
Author: Sumit Mohanty 
Authored: Fri Dec 2 13:13:35 2016 -0800
Committer: Sumit Mohanty 
Committed: Fri Dec 2 13:14:39 2016 -0800

--
 .../services/HDFS/configuration/hadoop-env.xml  | 176 +++
 1 file changed, 176 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/aec30d56/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
new file mode 100644
index 000..24e0193
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
@@ -0,0 +1,176 @@
+
+
+
+
+  
+  
+content
+hadoop-env template
+This is the jinja template for hadoop-env.sh 
file
+
+# Set Hadoop-specific environment variables here.
+
+# The only required environment variable is JAVA_HOME.  All others are
+# optional.  When running a distributed configuration it is best to
+# set JAVA_HOME in this file, so that it is correctly defined on
+# remote nodes.
+
+# The java implementation to use.  Required.
+export JAVA_HOME={{java_home}}
+export HADOOP_HOME_WARN_SUPPRESS=1
+
+# Hadoop home directory
+export HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}
+
+# Hadoop Configuration Directory
+
+{# this is different for HDP1 #}
+# Path to jsvc required by secure HDP 2.0 datanode
+export JSVC_HOME={{jsvc_path}}
+
+
+# The maximum amount of heap to use, in MB. Default is 1000.
+export HADOOP_HEAPSIZE="{{hadoop_heapsize}}"
+
+export HADOOP_NAMENODE_INIT_HEAPSIZE="-Xms{{namenode_heapsize}}"
+
+# Extra Java runtime options.  Empty by default.
+export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true ${HADOOP_OPTS}"
+
+# Command specific options appended to HADOOP_OPTS when specified
+HADOOP_JOBTRACKER_OPTS="-server -XX:ParallelGCThreads=8 
-XX:+UseConcMarkSweepGC 
-XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log 
-XX:NewSize={{jtnode_opt_newsize}} -XX:MaxNewSize={{jtnode_opt_maxnewsize}} 
-Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-Xmx{{jtnode_heapsize}} -Dhadoop.security.logger=INFO,DRFAS 
-Dmapred.audit.logger=INFO,MRAUDIT 
-Dhadoop.mapreduce.jobsummary.logger=INFO,JSA ${HADOOP_JOBTRACKER_OPTS}"
+
+HADOOP_TASKTRACKER_OPTS="-server -Xmx{{ttnode_heapsize}} 
-Dhadoop.security.logger=ERROR,console -Dmapred.audit.logger=ERROR,console 
${HADOOP_TASKTRACKER_OPTS}"
+
+{% if java_version  8 %}
+SHARED_HADOOP_NAMENODE_OPTS="-server -XX:ParallelGCThreads=8 
-XX:+UseConcMarkSweepGC 
-XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log 
-XX:NewSize={{namenode_opt_newsize}} -XX:MaxNewSize={{namenode_opt_maxnewsize}} 
-XX:PermSize={{namenode_opt_permsize}} 
-XX:MaxPermSize={{namenode_opt_maxpermsize}} 
-Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly 
-Xms{{namenode_heapsize}} -Xmx{{namenode_heapsize}} 
-Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT"
+export HADOOP_NAMENODE_OPTS="${SHARED_HADOOP_NAMENODE_OPTS} 
-XX:OnOutOfMemoryError=\"/usr/hdp/current/hadoop-hdfs-namenode/bin/kill-name-node\"
 -Dorg.mortbay.jetty.Request.maxFormContentSize=-1 ${HADOOP_NAMENODE_OPTS}"
+export HADOOP_DATANODE_OPTS="-server -XX:ParallelGCThreads=4 
-XX:+UseConcMarkSweepGC -XX:ErrorFile=/var/log/hadoop/$USER/hs_err_pid%p.log 
-XX:NewSize=200m -XX:MaxNewSize=200m -XX:PermSize=128m -XX:MaxPermSize=256m 
-Xloggc:/var/log/hadoop/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-Xms{{dtnode_heapsize}} -Xmx{{dtnode_heapsize}} 
-Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT 
${HADOOP_DATANODE_OPTS} -XX:CMSInitiatingOccupancyFraction=70 
-XX:+UseCMSInitiatingOccupancyOnly"
+
+export HADOOP_SECONDARYNAMENODE_OPTS="${SHARED_HADOOP_NAMENODE_OPTS} 

ambari git commit: AMBARI-18936. DataNode JVM heap settings should include CMSInitiatingOccupancy (Arpit Agarwal via smohanty)

2016-12-02 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk 05fe42351 -> 0c837a60c


AMBARI-18936. DataNode JVM heap settings should include CMSInitiatingOccupancy 
(Arpit Agarwal via smohanty)


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

Branch: refs/heads/trunk
Commit: 0c837a60c6bbe7c6fb7c5586963520957bb4146f
Parents: 05fe423
Author: Sumit Mohanty 
Authored: Fri Dec 2 13:13:35 2016 -0800
Committer: Sumit Mohanty 
Committed: Fri Dec 2 13:13:35 2016 -0800

--
 .../services/HDFS/configuration/hadoop-env.xml  | 176 +++
 1 file changed, 176 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0c837a60/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
new file mode 100644
index 000..24e0193
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.4/services/HDFS/configuration/hadoop-env.xml
@@ -0,0 +1,176 @@
+
+
+
+
+  
+  
+content
+hadoop-env template
+This is the jinja template for hadoop-env.sh 
file
+
+# Set Hadoop-specific environment variables here.
+
+# The only required environment variable is JAVA_HOME.  All others are
+# optional.  When running a distributed configuration it is best to
+# set JAVA_HOME in this file, so that it is correctly defined on
+# remote nodes.
+
+# The java implementation to use.  Required.
+export JAVA_HOME={{java_home}}
+export HADOOP_HOME_WARN_SUPPRESS=1
+
+# Hadoop home directory
+export HADOOP_HOME=${HADOOP_HOME:-{{hadoop_home}}}
+
+# Hadoop Configuration Directory
+
+{# this is different for HDP1 #}
+# Path to jsvc required by secure HDP 2.0 datanode
+export JSVC_HOME={{jsvc_path}}
+
+
+# The maximum amount of heap to use, in MB. Default is 1000.
+export HADOOP_HEAPSIZE="{{hadoop_heapsize}}"
+
+export HADOOP_NAMENODE_INIT_HEAPSIZE="-Xms{{namenode_heapsize}}"
+
+# Extra Java runtime options.  Empty by default.
+export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true ${HADOOP_OPTS}"
+
+# Command specific options appended to HADOOP_OPTS when specified
+HADOOP_JOBTRACKER_OPTS="-server -XX:ParallelGCThreads=8 
-XX:+UseConcMarkSweepGC 
-XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log 
-XX:NewSize={{jtnode_opt_newsize}} -XX:MaxNewSize={{jtnode_opt_maxnewsize}} 
-Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-Xmx{{jtnode_heapsize}} -Dhadoop.security.logger=INFO,DRFAS 
-Dmapred.audit.logger=INFO,MRAUDIT 
-Dhadoop.mapreduce.jobsummary.logger=INFO,JSA ${HADOOP_JOBTRACKER_OPTS}"
+
+HADOOP_TASKTRACKER_OPTS="-server -Xmx{{ttnode_heapsize}} 
-Dhadoop.security.logger=ERROR,console -Dmapred.audit.logger=ERROR,console 
${HADOOP_TASKTRACKER_OPTS}"
+
+{% if java_version  8 %}
+SHARED_HADOOP_NAMENODE_OPTS="-server -XX:ParallelGCThreads=8 
-XX:+UseConcMarkSweepGC 
-XX:ErrorFile={{hdfs_log_dir_prefix}}/$USER/hs_err_pid%p.log 
-XX:NewSize={{namenode_opt_newsize}} -XX:MaxNewSize={{namenode_opt_maxnewsize}} 
-XX:PermSize={{namenode_opt_permsize}} 
-XX:MaxPermSize={{namenode_opt_maxpermsize}} 
-Xloggc:{{hdfs_log_dir_prefix}}/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly 
-Xms{{namenode_heapsize}} -Xmx{{namenode_heapsize}} 
-Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT"
+export HADOOP_NAMENODE_OPTS="${SHARED_HADOOP_NAMENODE_OPTS} 
-XX:OnOutOfMemoryError=\"/usr/hdp/current/hadoop-hdfs-namenode/bin/kill-name-node\"
 -Dorg.mortbay.jetty.Request.maxFormContentSize=-1 ${HADOOP_NAMENODE_OPTS}"
+export HADOOP_DATANODE_OPTS="-server -XX:ParallelGCThreads=4 
-XX:+UseConcMarkSweepGC -XX:ErrorFile=/var/log/hadoop/$USER/hs_err_pid%p.log 
-XX:NewSize=200m -XX:MaxNewSize=200m -XX:PermSize=128m -XX:MaxPermSize=256m 
-Xloggc:/var/log/hadoop/$USER/gc.log-`date +'%Y%m%d%H%M'` -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps 
-Xms{{dtnode_heapsize}} -Xmx{{dtnode_heapsize}} 
-Dhadoop.security.logger=INFO,DRFAS -Dhdfs.audit.logger=INFO,DRFAAUDIT 
${HADOOP_DATANODE_OPTS} -XX:CMSInitiatingOccupancyFraction=70 
-XX:+UseCMSInitiatingOccupancyOnly"
+
+export HADOOP_SECONDARYNAMENODE_OPTS="${SHARED_HADOOP_NAMENODE_OPTS} 

ambari git commit: AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal content (alexantonenko)

2016-12-02 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 8f0a0ae41 -> f39bd6b6c


AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal 
content (alexantonenko)


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

Branch: refs/heads/branch-2.5
Commit: f39bd6b6c8ca5790f5370c7f910f60d21b5f2c8d
Parents: 8f0a0ae
Author: Alex Antonenko 
Authored: Fri Dec 2 01:16:00 2016 +0200
Committer: Alex Antonenko 
Committed: Fri Dec 2 23:08:23 2016 +0200

--
 .../controllers/main/service/info/summary.js| 37 +++-
 .../main/service/info/service_alert_popup.hbs   | 15 +---
 2 files changed, 31 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f39bd6b6/ambari-web/app/controllers/main/service/info/summary.js
--
diff --git a/ambari-web/app/controllers/main/service/info/summary.js 
b/ambari-web/app/controllers/main/service/info/summary.js
index 821b796..09f3429 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -386,25 +386,30 @@ App.MainServiceInfoSummaryController = 
Em.Controller.extend(App.WidgetSectionMix
   var property = context.get('componentName') ? 'componentName' : 
'serviceName';
   var serviceDefinitions = 
this.get('controller.content').filterProperty(property, context.get(property));
   // definitions should be sorted in order: critical, warning, ok, 
unknown, other
-  var criticalDefinitions = [], warningDefinitions = [], okDefinitions 
= [], unknownDefinitions = [];
+  var definitionTypes = {
+"isCritical": [],
+"isWarning": [],
+"isOK": [],
+"isUnknown": []
+  };
+
   serviceDefinitions.forEach(function (definition) {
-if (definition.get('isCritical')) {
-  criticalDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isWarning')) {
-  warningDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isOK')) {
-  okDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isUnknown')) {
-  unknownDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-}
+Object.keys(definitionTypes).forEach(function (type) {
+  if (definition.get(type)) {
+definition.set('isCollapsed', true);
+definitionTypes[type].push(definition);
+serviceDefinitions = serviceDefinitions.without(definition);
+  }
+});
   });
-  serviceDefinitions = criticalDefinitions.concat(warningDefinitions, 
okDefinitions, unknownDefinitions, serviceDefinitions);
+  serviceDefinitions = 
definitionTypes.isCritical.concat(definitionTypes.isWarning, 
definitionTypes.isOK, definitionTypes.isUnknown, serviceDefinitions);
+
   return serviceDefinitions;
 }.property('controller.content'),
+onToggleBlock: function (alert) {
+  this.$('#' + alert.context.clientId).toggle('blind', 500);
+  alert.context.set("isCollapsed", !alert.context.get("isCollapsed"));
+},
 gotoAlertDetails: function (event) {
   if (event && event.context) {
 this.get('parentView').hide();
@@ -855,4 +860,4 @@ App.MainServiceInfoSummaryController = 
Em.Controller.extend(App.WidgetSectionMix
 App.router.route('main' + event.context.href);
   }
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/f39bd6b6/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
--
diff --git a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs 
b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
index cbadf06..6ab6b3f 100644
--- a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
+++ b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
@@ -22,11 +22,16 @@
   
 
   
-
-  {{alert.label}}
-
-
-  {{alert.latestText}}
+
+  
+
+ 

[45/50] [abbrv] ambari git commit: AMBARI-19053. RU: wrong version exposed when Downgrade is going (ncole)

2016-12-02 Thread ncole
AMBARI-19053. RU: wrong version exposed when Downgrade is going (ncole)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7eb2eaa73315189533e039b45cf90655adf25390
Parents: 232a9d8
Author: Nate Cole 
Authored: Thu Dec 1 16:26:21 2016 -0500
Committer: Nate Cole 
Committed: Fri Dec 2 11:19:20 2016 -0500

--
 .../internal/UpgradeResourceProvider.java   | 24 
 .../internal/UpgradeResourceProviderTest.java   |  4 ++--
 2 files changed, 22 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7eb2eaa7/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index 9034989..5931743 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -758,13 +758,17 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 upgradeContext.setSupportedServices(supportedServices);
 upgradeContext.setScope(scope);
 
+String downgradeFromVersion = null;
+
 if (direction.isDowngrade()) {
   if (requestMap.containsKey(UPGRADE_FROM_VERSION)) {
-upgradeContext.setDowngradeFromVersion((String) 
requestMap.get(UPGRADE_FROM_VERSION));
+downgradeFromVersion = (String) requestMap.get(UPGRADE_FROM_VERSION);
   } else {
 UpgradeEntity lastUpgradeItemForCluster = 
s_upgradeDAO.findLastUpgradeForCluster(cluster.getClusterId());
-
upgradeContext.setDowngradeFromVersion(lastUpgradeItemForCluster.getToVersion());
+downgradeFromVersion = lastUpgradeItemForCluster.getToVersion();
   }
+
+  upgradeContext.setDowngradeFromVersion(downgradeFromVersion);
 }
 
 // optionally skip failures - this can be supplied on either the request or
@@ -922,7 +926,13 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 }
 
 UpgradeEntity entity = new UpgradeEntity();
-
entity.setFromVersion(cluster.getCurrentClusterVersion().getRepositoryVersion().getVersion());
+
+if (null != downgradeFromVersion) {
+  entity.setFromVersion(downgradeFromVersion);
+} else {
+  
entity.setFromVersion(cluster.getCurrentClusterVersion().getRepositoryVersion().getVersion());
+}
+
 entity.setToVersion(version);
 entity.setUpgradeGroups(groupEntities);
 entity.setClusterId(cluster.getClusterId());
@@ -931,7 +941,13 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 entity.setUpgradeType(pack.getType());
 entity.setAutoSkipComponentFailures(skipComponentFailures);
 entity.setAutoSkipServiceCheckFailures(skipServiceCheckFailures);
-entity.setDowngradeAllowed(pack.isDowngradeAllowed());
+
+if (upgradeContext.getDirection().isDowngrade()) {
+  // !!! You can't downgrade a Downgrade, no matter what the upgrade pack 
says.
+  entity.setDowngradeAllowed(false);
+} else {
+  entity.setDowngradeAllowed(pack.isDowngradeAllowed());
+}
 
 req.getRequestStatusResponse();
 return createUpgradeInsideTransaction(cluster, req, entity);

http://git-wip-us.apache.org/repos/asf/ambari/blob/7eb2eaa7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
index 14e3d08..8efcc61 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
@@ -708,7 +708,7 @@ public class UpgradeResourceProviderTest {
 
 UpgradeEntity entity = upgradeDao.findUpgrade(Long.parseLong(id));
 assertNotNull(entity);
-assertEquals("2.1.1", entity.getFromVersion());
+assertEquals("2.1.1.0", entity.getFromVersion());
 assertEquals("2.2.0.0", 

[17/50] [abbrv] ambari git commit: AMBARI-19033. Log Search: Cannot increase the number of shards per node for solr collections (oleewere)

2016-12-02 Thread ncole
AMBARI-19033. Log Search: Cannot increase the number of shards per node for 
solr collections (oleewere)

Change-Id: I44fa2c96befa2eff3d6f2acfb608eff8ed45f021


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 195b7456c0b4dc15833b502463daba7b29a51bee
Parents: 337c5f2
Author: oleewere 
Authored: Thu Dec 1 11:34:45 2016 +0100
Committer: oleewere 
Committed: Thu Dec 1 11:37:16 2016 +0100

--
 .../ambari/logsearch/dao/SolrCollectionDao.java | 64 ++--
 1 file changed, 59 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/195b7456/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrCollectionDao.java
--
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrCollectionDao.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrCollectionDao.java
index 834ba38..da76924 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrCollectionDao.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrCollectionDao.java
@@ -20,8 +20,12 @@ package org.apache.ambari.logsearch.dao;
 
 import org.apache.ambari.logsearch.conf.SolrPropsConfig;
 import org.apache.commons.lang.StringUtils;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpClientUtil;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.response.CollectionAdminResponse;
 import org.apache.solr.common.SolrException;
@@ -33,6 +37,7 @@ import org.slf4j.LoggerFactory;
 import static 
org.apache.ambari.logsearch.solr.SolrConstants.CommonLogConstants.ROUTER_FIELD;
 
 import javax.inject.Named;
+import javax.ws.rs.core.Response;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -45,6 +50,8 @@ class SolrCollectionDao {
   private static final Logger LOG = 
LoggerFactory.getLogger(SolrCollectionDao.class);
 
   private static final int SETUP_RETRY_SECOND = 30;
+  private static final String MODIFY_COLLECTION_QUERY = 
"/admin/collections?action=MODIFYCOLLECTION=%s&%s=%d";
+  private static final String MAX_SHARDS_PER_NODE = "maxShardsPerNode";
 
   /**
* This will try to get the collections from the Solr. Ping doesn't work if
@@ -189,7 +196,16 @@ class SolrCollectionDao {
   }
 } else {
   LOG.info("Collection " + solrPropsConfig.getCollection() + " is already 
there. Will check whether it has the required shards");
-  Collection existingShards = getShards(solrClient, 
solrPropsConfig);
+  Collection slices = getSlices(solrClient, solrPropsConfig);
+  Collection existingShards = getShards(slices, solrPropsConfig);
+  if (existingShards.size() < shardsList.size()) {
+try {
+  updateMaximumNumberOfShardsPerCore(slices, solrPropsConfig);
+} catch (Throwable t) {
+  returnValue = false;
+  LOG.error(String.format("Exception during updating collection (%s)", 
t));
+}
+  }
   for (String shard : shardsList) {
 if (!existingShards.contains(shard)) {
   try {
@@ -216,10 +232,44 @@ class SolrCollectionDao {
 return returnValue;
   }
 
-  private Collection getShards(CloudSolrClient solrClient, 
SolrPropsConfig solrPropsConfig) {
-Collection list = new HashSet<>();
+  private String getRandomBaseUrl(Collection slices) {
+String coreUrl = null;
+if (slices != null) {
+  for (Slice slice : slices) {
+if (!slice.getReplicas().isEmpty()) {
+  Replica replica = slice.getReplicas().iterator().next();
+  coreUrl = replica.getStr("base_url");
+  if (coreUrl != null) {
+break;
+  }
+}
+  }
+}
+return coreUrl;
+  }
+
+  private void updateMaximumNumberOfShardsPerCore(Collection slices, 
SolrPropsConfig solrPropsConfig) throws IOException {
+String baseUrl = getRandomBaseUrl(slices);
+if (baseUrl != null) {
+  CloseableHttpClient httpClient = HttpClientUtil.createClient(null);
+  HttpGet request = new HttpGet(baseUrl + 
String.format(MODIFY_COLLECTION_QUERY,
+

[41/50] [abbrv] ambari git commit: AMBARI-18944 - Improve remoteIp in audit log (Wang Yaoxin via jonathanhurley)

2016-12-02 Thread ncole
AMBARI-18944 - Improve remoteIp in audit log (Wang Yaoxin via jonathanhurley)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: f4ea309196a2c02b88f5e5ce062200d50d888005
Parents: ae3ff2a
Author: Jonathan Hurley 
Authored: Fri Dec 2 10:18:35 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 10:19:41 2016 -0500

--
 .../apache/ambari/server/utils/RequestUtils.java  | 10 ++
 .../ambari/server/utils/RequestUtilsTest.java | 18 ++
 2 files changed, 28 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f4ea3091/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java 
b/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java
index 0ac782f..dbb0f11 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/utils/RequestUtils.java
@@ -50,6 +50,9 @@ public class RequestUtils {
 if (isRemoteAddressUnknown(ip)) {
   ip = request.getRemoteAddr();
 }
+if (containsMultipleRemoteAddresses(ip)) {
+   ip = ip.substring(0, ip.indexOf(","));
+}
 return ip;
   }
 
@@ -76,6 +79,13 @@ public class RequestUtils {
   }
 
   /**
+   * Checks if ip contains multiple IP addresses
+   */
+  private static boolean containsMultipleRemoteAddresses(String ip) {
+return ip != null && ip.indexOf(",") > 0;
+  }
+
+  /**
* Checks if RequestContextHolder contains a valid HTTP request
* @return
*/

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4ea3091/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
index 595127e..f36858e 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/RequestUtilsTest.java
@@ -30,6 +30,7 @@ import org.junit.Test;
 public class RequestUtilsTest {
 
   public static final String REMOTE_ADDRESS = "12.13.14.15";
+  public static final String REMOTE_ADDRESS_MULTIPLE = 
"12.13.14.15,12.13.14.16";
 
   @Test
   public void testGetRemoteAddress() {
@@ -49,6 +50,23 @@ public class RequestUtilsTest {
   }
 
   @Test
+  public void testGetMultipleRemoteAddress() {
+// GIVEN
+HttpServletRequest mockedRequest = createMock(HttpServletRequest.class);
+expect(mockedRequest.getHeader("X-Forwarded-For")).andReturn(null);
+expect(mockedRequest.getHeader("Proxy-Client-IP")).andReturn("unknown");
+expect(mockedRequest.getHeader("WL-Proxy-Client-IP")).andReturn("");
+expect(mockedRequest.getHeader("HTTP_CLIENT_IP")).andReturn("unknown");
+
expect(mockedRequest.getHeader("HTTP_X_FORWARDED_FOR")).andReturn(REMOTE_ADDRESS_MULTIPLE);
+replay(mockedRequest);
+// WHEN
+String remoteAddress = RequestUtils.getRemoteAddress(mockedRequest);
+// THEN
+assertEquals(REMOTE_ADDRESS, remoteAddress);
+verify(mockedRequest);
+  }
+
+  @Test
   public void testGetRemoteAddressFoundFirstHeader() {
 // GIVEN
 HttpServletRequest mockedRequest = createMock(HttpServletRequest.class);



[36/50] [abbrv] ambari git commit: AMBARI-18975 Remove Zeppelin View from Ambari (r-kamath)

2016-12-02 Thread ncole
AMBARI-18975 Remove Zeppelin View from Ambari (r-kamath)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: c2dc7538b65ab9f045010b7964ba00551b0ea099
Parents: 73d372b
Author: Renjith Kamath 
Authored: Fri Dec 2 14:39:28 2016 +0530
Committer: Renjith Kamath 
Committed: Fri Dec 2 14:52:51 2016 +0530

--
 .../server/upgrade/UpgradeCatalog250.java   |   6 +
 .../server/upgrade/UpgradeCatalog250Test.java   |  17 +-
 contrib/views/pom.xml   |   1 -
 contrib/views/zeppelin/pom.xml  | 190 ---
 .../view/zeppelin/ZeppelinServiceCheck.java |  55 --
 .../ambari/view/zeppelin/ZeppelinServlet.java   | 113 ---
 .../zeppelin/src/main/resources/WEB-INF/web.xml |  40 
 .../src/main/resources/view.log4j.properties|  27 ---
 .../views/zeppelin/src/main/resources/view.xml  |  48 -
 9 files changed, 17 insertions(+), 480 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2dc7538/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 3b2cdd3..837f340 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -136,6 +136,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 updateAMSConfigs();
 updateKafkaConfigs();
 updateHiveLlapConfigs();
+updateTablesForZeppelinViewRemoval();
   }
 
   protected void updateHostVersionTable() throws SQLException {
@@ -227,6 +228,11 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 }
   }
 
+  protected void updateTablesForZeppelinViewRemoval() throws SQLException {
+dbAccessor.executeQuery("DELETE from viewinstance WHERE 
view_name='ZEPPELIN{1.0.0}'", true);
+dbAccessor.executeQuery("DELETE from viewmain WHERE 
view_name='ZEPPELIN{1.0.0}'", true);
+dbAccessor.executeQuery("DELETE from viewparameter WHERE 
view_name='ZEPPELIN{1.0.0}'", true);
+  }
 
   protected String updateAmsEnvContent(String content) {
 if (content == null) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2dc7538/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
index 978e2dc..0b2b32d 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
@@ -210,16 +210,18 @@ public class UpgradeCatalog250Test {
   @Test
   public void testExecuteDMLUpdates() throws Exception {
 Method updateAmsConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateAMSConfigs");
-Method addNewConfigurationsFromXml = 
AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
 Method updateKafkaConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateKafkaConfigs");
 Method updateHiveLlapConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateHiveLlapConfigs");
+Method addNewConfigurationsFromXml = 
AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
+Method updateTablesForZeppelinViewRemoval = 
UpgradeCatalog250.class.getDeclaredMethod("updateTablesForZeppelinViewRemoval");
 
 UpgradeCatalog250 upgradeCatalog250 = 
createMockBuilder(UpgradeCatalog250.class)
-.addMockedMethod(updateAmsConfigs)
-.addMockedMethod(addNewConfigurationsFromXml)
-.addMockedMethod(updateKafkaConfigs)
-.addMockedMethod(updateHiveLlapConfigs)
-.createMock();
+  .addMockedMethod(updateAmsConfigs)
+  .addMockedMethod(updateKafkaConfigs)
+  .addMockedMethod(updateHiveLlapConfigs)
+  .addMockedMethod(addNewConfigurationsFromXml)
+  .addMockedMethod(updateTablesForZeppelinViewRemoval)
+  .createMock();
 
 upgradeCatalog250.updateAMSConfigs();
 expectLastCall().once();
@@ -233,6 +235,9 @@ public class UpgradeCatalog250Test {
 

[24/50] [abbrv] ambari git commit: AMBARI-18736. Perf: Simulate alerts for multiple Ambari Agents running on single Host.(vbrodetskyi)

2016-12-02 Thread ncole
AMBARI-18736. Perf: Simulate alerts for multiple Ambari Agents running on 
single Host.(vbrodetskyi)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: ef63373ef2fa886d819589b8500e4c1c81390a87
Parents: 9a72a60
Author: Vitaly Brodetskyi 
Authored: Thu Dec 1 16:38:58 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Thu Dec 1 16:38:58 2016 +0200

--
 .../simulate_perf_cluster_alert_behaviour.py|  108 ++
 .../stacks/PERF/1.0/services/HAPPY/alerts.json  |   20 +
 .../HAPPY/configuration/happy-alert-config.xml  |   75 +
 .../stacks/PERF/1.0/services/HAPPY/metainfo.xml |5 +
 .../HAPPY/package/alerts/alert_happy_process.py |   59 +
 .../stacks/PERF/1.0/services/HBASE/alerts.json  |  110 +-
 .../HBASE/configuration/hbase-alert-config.xml  |   75 +
 .../stacks/PERF/1.0/services/HBASE/metainfo.xml |1 +
 .../package/alerts/hbase_master_process.py  |   59 +
 .../alerts/hbase_regionserver_process.py|   59 +
 .../stacks/PERF/1.0/services/HDFS/alerts.json   | 1728 +-
 .../HDFS/configuration/hdfs-alert-config.xml|   75 +
 .../stacks/PERF/1.0/services/HDFS/metainfo.xml  |1 +
 .../package/alerts/alert_checkpoint_time.py |   38 +-
 .../alerts/alert_datanode_unmounted_data_dir.py |   47 +-
 .../package/alerts/alert_ha_namenode_health.py  |   75 -
 .../package/alerts/alert_metrics_deviation.py   |   85 -
 .../package/alerts/alert_nfs_gateway_process.py |   59 +
 .../package/alerts/alert_snamenode_process.py   |   59 +
 .../package/alerts/alert_upgrade_finalized.py   |   49 +-
 .../stacks/PERF/1.0/services/SLEEPY/alerts.json |   20 +
 .../configuration/sleepy-alert-config.xml   |   75 +
 .../PERF/1.0/services/SLEEPY/metainfo.xml   |5 +
 .../package/alerts/alert_sleepy_process.py  |   59 +
 .../stacks/PERF/1.0/services/SNOW/alerts.json   |   20 +
 .../SNOW/configuration/snow-alert-config.xml|   75 +
 .../stacks/PERF/1.0/services/SNOW/metainfo.xml  |5 +
 .../SNOW/package/alerts/alert_snow_process.py   |   59 +
 .../stacks/PERF/1.0/services/YARN/alerts.json   |  361 +---
 .../YARN/configuration/yarn-alert-config.xml|   75 +
 .../stacks/PERF/1.0/services/YARN/metainfo.xml  |3 +
 .../package/alerts/alert_history_process.py |   59 +
 .../package/alerts/alert_nodemanager_health.py  |   36 +-
 .../alerts/alert_nodemanagers_summary.py|   68 -
 .../alerts/alert_resourcemanager_process.py |   59 +
 .../package/alerts/alert_timeline_process.py|   59 +
 .../PERF/1.0/services/ZOOKEEPER/alerts.json |   20 +
 .../ZOOKEEPER/configuration/zk-alert-config.xml |   75 +
 .../PERF/1.0/services/ZOOKEEPER/metainfo.xml|4 +
 .../package/alerts/alert_zk_server_process.py   |   59 +
 40 files changed, 1510 insertions(+), 2473 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
new file mode 100644
index 000..736e5e3
--- /dev/null
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
@@ -0,0 +1,108 @@
+#!/usr/bin/env python
+
+"""
+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.
+"""
+__all__ = ["simulate_perf_cluster_alert_behaviour"]
+
+import logging
+import random
+import time
+
+from datetime import datetime
+from resource_management.core.exceptions import Fail
+
+RESULT_CODE_OK = 'OK'
+RESULT_CODE_CRITICAL = 'CRITICAL'
+RESULT_CODE_UNKNOWN = 'UNKNOWN'
+
+OK_MESSAGE = 

[48/50] [abbrv] ambari git commit: AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal content (alexantonenko)

2016-12-02 Thread ncole
AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal 
content (alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: def3b0ae85b968c7dd41307f4c671bf07d4fc826
Parents: 9348725
Author: Alex Antonenko 
Authored: Fri Dec 2 15:18:46 2016 +0200
Committer: Alex Antonenko 
Committed: Fri Dec 2 20:13:17 2016 +0200

--
 .../controllers/main/service/info/summary.js| 37 +++-
 .../main/service/info/service_alert_popup.hbs   | 15 +---
 2 files changed, 31 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/def3b0ae/ambari-web/app/controllers/main/service/info/summary.js
--
diff --git a/ambari-web/app/controllers/main/service/info/summary.js 
b/ambari-web/app/controllers/main/service/info/summary.js
index 88a6581..fc423fe 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -386,25 +386,30 @@ App.MainServiceInfoSummaryController = 
Em.Controller.extend(App.WidgetSectionMix
   var property = context.get('componentName') ? 'componentName' : 
'serviceName';
   var serviceDefinitions = 
this.get('controller.content').filterProperty(property, context.get(property));
   // definitions should be sorted in order: critical, warning, ok, 
unknown, other
-  var criticalDefinitions = [], warningDefinitions = [], okDefinitions 
= [], unknownDefinitions = [];
+  var definitionTypes = {
+"isCritical": [],
+"isWarning": [],
+"isOK": [],
+"isUnknown": []
+  };
+
   serviceDefinitions.forEach(function (definition) {
-if (definition.get('isCritical')) {
-  criticalDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isWarning')) {
-  warningDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isOK')) {
-  okDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isUnknown')) {
-  unknownDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-}
+Object.keys(definitionTypes).forEach(function (type) {
+  if (definition.get(type)) {
+definition.set('isCollapsed', true);
+definitionTypes[type].push(definition);
+serviceDefinitions = serviceDefinitions.without(definition);
+  }
+});
   });
-  serviceDefinitions = criticalDefinitions.concat(warningDefinitions, 
okDefinitions, unknownDefinitions, serviceDefinitions);
+  serviceDefinitions = 
definitionTypes.isCritical.concat(definitionTypes.isWarning, 
definitionTypes.isOK, definitionTypes.isUnknown, serviceDefinitions);
+
   return serviceDefinitions;
 }.property('controller.content'),
+onToggleBlock: function (alert) {
+  this.$('#' + alert.context.clientId).toggle('blind', 500);
+  alert.context.set("isCollapsed", !alert.context.get("isCollapsed"));
+},
 gotoAlertDetails: function (event) {
   if (event && event.context) {
 this.get('parentView').hide();
@@ -856,4 +861,4 @@ App.MainServiceInfoSummaryController = 
Em.Controller.extend(App.WidgetSectionMix
 App.router.route('main' + event.context.href);
   }
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/def3b0ae/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
--
diff --git a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs 
b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
index 3c132a3..8b72a50 100644
--- a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
+++ b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
@@ -22,11 +22,16 @@
   
 
   
-
-  {{alert.label}}
-
-
-  {{alert.latestText}}
+
+  
+
+{{alert.label}}
+  
+  
+

[33/50] [abbrv] ambari git commit: AMBARI-18888: Ambari-agent: Create configuration files with JCEKS information

2016-12-02 Thread ncole
AMBARI-1: Ambari-agent: Create configuration files with JCEKS information


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 615438b272e6bd8efd37481ef684ae7d68921e64
Parents: 7577ebb
Author: Nahappan Somasundaram 
Authored: Tue Nov 29 13:36:16 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Thu Dec 1 13:58:54 2016 -0800

--
 ambari-agent/conf/unix/ambari-agent.ini |   3 +
 .../ambari_agent/CustomServiceOrchestrator.py   | 120 +++
 ambari-agent/src/packages/tarball/all.xml   |  30 +
 .../ambari/server/agent/ExecutionCommand.java   |  28 +
 .../ambari/server/agent/HeartBeatHandler.java   |  10 +-
 .../server/agent/TestHeartbeatHandler.java  |  28 +++--
 6 files changed, 210 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/615438b2/ambari-agent/conf/unix/ambari-agent.ini
--
diff --git a/ambari-agent/conf/unix/ambari-agent.ini 
b/ambari-agent/conf/unix/ambari-agent.ini
index 61948d4..d6fcf5f 100644
--- a/ambari-agent/conf/unix/ambari-agent.ini
+++ b/ambari-agent/conf/unix/ambari-agent.ini
@@ -46,6 +46,9 @@ keysdir=/var/lib/ambari-agent/keys
 server_crt=ca.crt
 passphrase_env_var_name=AMBARI_PASSPHRASE
 ssl_verify_cert=0
+credential_lib_dir=/var/lib/ambari-agent/cred/lib
+credential_conf_dir=/var/lib/ambari-agent/cred/conf
+credential_shell_cmd=org.apache.hadoop.security.alias.CredentialShell
 
 [services]
 pidLookupPath=/var/run/

http://git-wip-us.apache.org/repos/asf/ambari/blob/615438b2/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 7d61611..1eab0a5 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -29,6 +29,8 @@ from FileCache import FileCache
 from AgentException import AgentException
 from PythonExecutor import PythonExecutor
 from PythonReflectiveExecutor import PythonReflectiveExecutor
+from resource_management.core.utils import PasswordString
+import subprocess
 import Constants
 import hostname
 
@@ -65,6 +67,11 @@ class CustomServiceOrchestrator():
   REFLECTIVELY_RUN_COMMANDS = FREQUENT_COMMANDS # -- commands which run a lot 
and often (this increases their speed)
   DONT_BACKUP_LOGS_FOR_COMMANDS = FREQUENT_COMMANDS
 
+  # Path where hadoop credential JARS will be available
+  DEFAULT_CREDENTIAL_SHELL_LIB_PATH = '/var/lib/ambari-agent/cred/lib'
+  DEFAULT_CREDENTIAL_CONF_DIR = '/var/lib/ambari-agent/cred/conf'
+  DEFAULT_CREDENTIAL_SHELL_CMD = 
'org.apache.hadoop.security.alias.CredentialShell'
+
   def __init__(self, config, controller):
 self.config = config
 self.tmp_dir = config.get('agent', 'prefix')
@@ -78,6 +85,14 @@ class CustomServiceOrchestrator():
 # cache reset will be called on every agent registration
 controller.registration_listeners.append(self.file_cache.reset)
 
+# Construct the hadoop credential lib JARs path
+self.credential_shell_lib_path = os.path.join(config.get('security', 
'credential_lib_dir',
+ 
self.DEFAULT_CREDENTIAL_SHELL_LIB_PATH), '*')
+
+self.credential_conf_dir = config.get('security', 'credential_conf_dir', 
self.DEFAULT_CREDENTIAL_CONF_DIR)
+
+self.credential_shell_cmd = config.get('security', 'credential_shell_cmd', 
self.DEFAULT_CREDENTIAL_SHELL_CMD)
+
 # Clean up old status command files if any
 try:
   os.unlink(self.status_commands_stdout)
@@ -114,6 +129,102 @@ class CustomServiceOrchestrator():
 else:
   return PythonExecutor(self.tmp_dir, self.config)
 
+  def getProviderDirectory(self, service_name):
+"""
+Gets the path to the service conf folder where the JCEKS file will be 
created.
+
+:param service_name: Name of the service, for example, HIVE
+:return: lower case path to the service conf folder
+"""
+
+# The stack definition scripts of the service can move the
+# JCEKS file around to where it wants, which is usually
+# /etc//conf
+
+conf_dir = os.path.join(self.credential_conf_dir, service_name.lower())
+if not os.path.exists(conf_dir):
+  os.makedirs(conf_dir, 0644)
+
+return conf_dir
+
+  def 

[13/50] [abbrv] ambari git commit: AMBARI-19037. Clean up logs for the usage of taskId for easy lookup of command progress and status (smohanty)

2016-12-02 Thread ncole
AMBARI-19037. Clean up logs for the usage of taskId for easy lookup of command 
progress and status (smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 32c9f5a83bef6bca90ebecb7721de256c19061c7
Parents: 15f843b
Author: Sumit Mohanty 
Authored: Wed Nov 30 14:45:40 2016 -0800
Committer: Sumit Mohanty 
Committed: Wed Nov 30 14:45:40 2016 -0800

--
 ambari-agent/src/main/python/ambari_agent/ActionQueue.py  | 10 +-
 .../main/python/ambari_agent/CustomServiceOrchestrator.py |  4 ++--
 .../org/apache/ambari/server/agent/HeartBeatHandler.java  |  2 +-
 .../apache/ambari/server/agent/HeartbeatProcessor.java|  2 +-
 .../server/state/services/RetryUpgradeActionService.java  |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/32c9f5a8/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py 
b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index a9f1084..4416b9a 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -128,7 +128,7 @@ class ActionQueue(threading.Thread):
   def cancel(self, commands):
 for command in commands:
 
-  logger.info("Canceling command {tid}".format(tid = 
str(command['target_task_id'])))
+  logger.info("Canceling command with taskId = {tid}".format(tid = 
str(command['target_task_id'])))
   logger.debug(pprint.pformat(command))
 
   task_id = command['target_task_id']
@@ -327,7 +327,7 @@ class ActionQueue(threading.Thread):
 else:
   status = self.FAILED_STATUS
   if (commandresult['exitcode'] == -signal.SIGTERM) or 
(commandresult['exitcode'] == -signal.SIGKILL):
-logger.info('Command {cid} was canceled!'.format(cid=taskId))
+logger.info('Command with taskId = {cid} was 
canceled!'.format(cid=taskId))
 break
 
   if status != self.COMPLETED_STATUS and retryAble and retryDuration > 0:
@@ -336,17 +336,17 @@ class ActionQueue(threading.Thread):
   delay = retryDuration
 retryDuration -= delay  # allow one last attempt
 commandresult['stderr'] += "\n\nCommand failed. Retrying command 
execution ...\n\n"
-logger.info("Retrying command id {cid} after a wait of 
{delay}".format(cid=taskId, delay=delay))
+logger.info("Retrying command with taskId = {cid} after a wait of 
{delay}".format(cid=taskId, delay=delay))
 time.sleep(delay)
 continue
   else:
-logger.info("Quit retrying for command id {cid}. Status: {status}, 
retryAble: {retryAble}, retryDuration (sec): {retryDuration}, last delay (sec): 
{delay}"
+logger.info("Quit retrying for command with taskId = {cid}. Status: 
{status}, retryAble: {retryAble}, retryDuration (sec): {retryDuration}, last 
delay (sec): {delay}"
 .format(cid=taskId, status=status, retryAble=retryAble, 
retryDuration=retryDuration, delay=delay))
 break
 
 # final result to stdout
 commandresult['stdout'] += '\n\nCommand completed successfully!\n' if 
status == self.COMPLETED_STATUS else '\n\nCommand failed after ' + 
str(numAttempts) + ' tries\n'
-logger.info('Command {cid} completed successfully!'.format(cid=taskId) if 
status == self.COMPLETED_STATUS else 'Command {cid} failed after {attempts} 
tries'.format(cid=taskId, attempts=numAttempts))
+logger.info('Command with taskId = {cid} completed 
successfully!'.format(cid=taskId) if status == self.COMPLETED_STATUS else 
'Command with taskId = {cid} failed after {attempts} tries'.format(cid=taskId, 
attempts=numAttempts))
 
 roleResult = self.commandStatuses.generate_report_template(command)
 roleResult.update({

http://git-wip-us.apache.org/repos/asf/ambari/blob/32c9f5a8/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index ebd3506..7d61611 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -97,12 +97,12 @@ class CustomServiceOrchestrator():
   if task_id in self.commands_in_progress.keys():
 

[49/50] [abbrv] ambari git commit: AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via ncole)

2016-12-02 Thread ncole
AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via 
ncole)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 05fe42351131f77a6ee5d58da355b1c461562046
Parents: def3b0a
Author: Nate Cole 
Authored: Fri Dec 2 13:23:36 2016 -0500
Committer: Nate Cole 
Committed: Fri Dec 2 13:23:36 2016 -0500

--
 .../main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/05fe4235/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
index 525078e..cbb5ba2 100644
--- 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
@@ -35,7 +35,7 @@
   
 
 
-  ubuntu12
+  ubuntu12,ubuntu14,ubuntu16
   
 
   zookeeper-${stack_version}



[12/50] [abbrv] ambari git commit: AMBARI-19023. After adding an Atlas server the first restart command fails since stop doesn't have any configs; if no pid dir exists during stop, perform no-op (alej

2016-12-02 Thread ncole
AMBARI-19023. After adding an Atlas server the first restart command fails 
since stop doesn't have any configs; if no pid dir exists during stop, perform 
no-op (alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 15f843bbb0679d93f836c0fa4a3b23370b1ae91c
Parents: 72b940e
Author: Alejandro Fernandez 
Authored: Tue Nov 29 17:10:16 2016 -0800
Committer: Alejandro Fernandez 
Committed: Wed Nov 30 13:48:07 2016 -0800

--
 .../0.1.0.2.3/package/scripts/metadata_server.py  | 18 ++
 .../stacks/2.3/ATLAS/test_metadata_server.py  |  5 -
 2 files changed, 22 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/15f843bb/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
index a469ebb..36d990d 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata_server.py
@@ -16,6 +16,10 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 
 """
+# Python Imports
+import os
+
+# Local Imports
 from metadata import metadata
 from resource_management import Fail
 from resource_management.libraries.functions import conf_select, stack_select
@@ -124,6 +128,20 @@ class MetadataServer(Script):
 env.set_params(params)
 daemon_cmd = format('source {params.conf_dir}/atlas-env.sh; 
{params.metadata_stop_script}')
 
+# If the pid dir doesn't exist, this means either
+# 1. The user just added Atlas service and issued a restart command 
(stop+start). So stop should be a no-op
+# since there's nothing to stop.
+# OR
+# 2. The user changed the value of the pid dir config and incorrectly 
issued a restart command.
+# In which case the stop command cannot do anything since Ambari doesn't 
know which process to kill.
+# The start command will spawn another instance.
+# The user should have issued a stop, changed the config, and then started 
it.
+if not os.path.isdir(params.pid_dir):
+  
Logger.info("***")
+  Logger.info("Will skip the stop command since this is the first time 
stopping/restarting Atlas "
+  "and the pid dir does not exist, %s\n" % params.pid_dir)
+  return
+
 try:
   Execute(daemon_cmd,
   user=params.metadata_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/15f843bb/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py 
b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
index 585dc94..f2fec70 100644
--- a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
+++ b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
@@ -366,7 +366,10 @@ class TestMetadataServer(RMFTestCase):
   user = 'atlas',
 )
 
-  def test_stop_default(self):
+  @patch('os.path.isdir')
+  def test_stop_default(self, is_dir_mock):
+is_dir_mock.return_value = True
+
 self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
"/scripts/metadata_server.py",
classname = "MetadataServer",
command = "stop",



[37/50] [abbrv] ambari git commit: AMBARI-19061. Ambari-server restart command not working. if any parameters are changed and reset to default. (aonishuk)

2016-12-02 Thread ncole
AMBARI-19061. Ambari-server restart command not working. if any parameters are 
changed and reset to default.  (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 2de7ee8d01ce850bbbf9844ad8789615b6570168
Parents: c2dc753
Author: Andrew Onishuk 
Authored: Fri Dec 2 11:45:57 2016 +0200
Committer: Andrew Onishuk 
Committed: Fri Dec 2 11:45:57 2016 +0200

--
 .../src/main/python/ambari_server/utils.py  | 23 ++--
 1 file changed, 12 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2de7ee8d/ambari-server/src/main/python/ambari_server/utils.py
--
diff --git a/ambari-server/src/main/python/ambari_server/utils.py 
b/ambari-server/src/main/python/ambari_server/utils.py
index 26e59ae..fc631f5 100644
--- a/ambari-server/src/main/python/ambari_server/utils.py
+++ b/ambari-server/src/main/python/ambari_server/utils.py
@@ -127,17 +127,18 @@ def save_main_pid_ex(pids, pidfile, exclude_list=[], 
skip_daemonize=False):
   """
   pid_saved = False
   try:
-pfile = open(pidfile, "w")
-for item in pids:
-  if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
-pfile.write("%s\n" % item["pid"])
-pid_saved = True
-logger.info("Ambari server started with PID " + str(item["pid"]))
-  if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not 
skip_daemonize:
-try:
-  os.kill(int(item["pid"]), signal.SIGKILL)
-except:
-  pass
+if pids:
+  pfile = open(pidfile, "w")
+  for item in pids:
+if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
+  pfile.write("%s\n" % item["pid"])
+  pid_saved = True
+  logger.info("Ambari server started with PID " + str(item["pid"]))
+if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not 
skip_daemonize:
+  try:
+os.kill(int(item["pid"]), signal.SIGKILL)
+  except:
+pass
   except IOError as e:
 logger.error("Failed to write PID to " + pidfile + " due to " + str(e))
 pass



[18/50] [abbrv] ambari git commit: AMBARI-19045 Remove unnecessary Log Feeder Date Mapper tests

2016-12-02 Thread ncole
AMBARI-19045 Remove unnecessary Log Feeder Date Mapper tests

Change-Id: Ia8d613c0c53bff04c5ccee0579a337b8cbb3a00a


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: dc5f4e259ce0f83a3a648de54468f6dadacd5291
Parents: 195b745
Author: Miklos Gergely 
Authored: Thu Dec 1 11:43:28 2016 +0100
Committer: Miklos Gergely 
Committed: Thu Dec 1 11:43:28 2016 +0100

--
 .../ambari/logfeeder/mapper/MapperDateTest.java | 56 
 1 file changed, 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/dc5f4e25/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/mapper/MapperDateTest.java
--
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/mapper/MapperDateTest.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/mapper/MapperDateTest.java
index 667c9ff..08680f6 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/mapper/MapperDateTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/mapper/MapperDateTest.java
@@ -141,60 +141,4 @@ public class MapperDateTest {
 assertEquals("Invalid value wasn't returned as it is", invalidValue, 
mappedValue);
 assertTrue("jsonObj is not empty", jsonObj.isEmpty());
   }
-  
-  @Test
-  public void testMapperDate_patternWithoutYear_previousYearLog() throws 
Exception {
-LOG.info("testMapperDate_patternWithoutYear_previousYearLog()");
-String fieldName = "logtime";
-Calendar currentCalendar = Calendar.getInstance();
-Map mapConfigs = new HashMap<>();
-mapConfigs.put("target_date_pattern", "-MM-dd HH:mm:ss.SSS");
-String srcDatePattern ="MMM dd HH:mm:ss";
-mapConfigs.put("src_date_pattern", srcDatePattern);
-MapperDate mapperDate = new MapperDate();
-assertTrue("Could not initialize!", mapperDate.init(null, fieldName, null, 
mapConfigs));
-Map jsonObj = new HashMap<>();
-Calendar nextMonthCalendar = Calendar.getInstance();
-
-nextMonthCalendar.set(Calendar.MONTH, 
currentCalendar.get(Calendar.MONTH)+1 );
-String inputDateStr = new 
SimpleDateFormat("MMM").format(nextMonthCalendar.getTime()) + " 01 12:01:45";
-Object mappedValue = mapperDate.apply(jsonObj, inputDateStr);
-Date mappedDateValue = new SimpleDateFormat("-MM-dd 
HH:mm:ss.SSS").parse(mappedValue.toString());
-String mappedDateValueStr = new 
SimpleDateFormat(srcDatePattern).format(mappedDateValue);
-assertEquals(Date.class, mappedDateValue.getClass());
-
-int expectedLogYear = currentCalendar.get(Calendar.YEAR)-1;
-Calendar mapppedValueCalendar = Calendar.getInstance();
-mapppedValueCalendar.setTime(mappedDateValue);
-assertEquals("Mapped year wasn't matched properly", expectedLogYear, 
mapppedValueCalendar.get(Calendar.YEAR));
-assertEquals("Mapped date wasn't matched properly", inputDateStr, 
mappedDateValueStr);
-assertEquals("Value wasn't put into jsonObj",mappedValue, 
jsonObj.remove(fieldName));
-assertTrue("jsonObj is not empty", jsonObj.isEmpty());
-  }
-  
-  @Test
-  public void testMapperDate_patternWithoutYear_currentYearLog() throws 
Exception {
-LOG.info("testMapperDate_patternWithoutYear_currentYearLog()");
-String fieldName = "logtime";
-Calendar currentCalendar = Calendar.getInstance();
-Map mapConfigs = new HashMap<>();
-mapConfigs.put("target_date_pattern", "-MM-dd HH:mm:ss.SSS");
-String srcDatePattern ="MMM dd HH:mm:ss";
-mapConfigs.put("src_date_pattern", srcDatePattern);
-MapperDate mapperDate = new MapperDate();
-assertTrue("Could not initialize!", mapperDate.init(null, fieldName, null, 
mapConfigs));
-Map jsonObj = new HashMap<>();
-String inputDateStr = new 
SimpleDateFormat("MMM").format(currentCalendar.getTime()) + " 01 12:01:45";
-Object mappedValue = mapperDate.apply(jsonObj, inputDateStr);
-Date mappedDateValue = new SimpleDateFormat("-MM-dd 
HH:mm:ss.SSS").parse(mappedValue.toString());
-String mappedDateValueStr = new 
SimpleDateFormat(srcDatePattern).format(mappedDateValue);
-assertEquals(Date.class, mappedDateValue.getClass());
-int expectedLogYear = currentCalendar.get(Calendar.YEAR);
-Calendar mapppedValueCalendar = Calendar.getInstance();
-

[08/50] [abbrv] ambari git commit: AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via ncole)

2016-12-02 Thread ncole
AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via 
ncole)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 3a14b4afc9572b9aeb0310cdc0cd80700f27ee8d
Parents: fff9980
Author: Nate Cole 
Authored: Wed Nov 30 12:49:48 2016 -0500
Committer: Nate Cole 
Committed: Wed Nov 30 12:53:00 2016 -0500

--
 .../stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml | 13 +
 1 file changed, 13 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3a14b4af/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
index de8ebd9..9b9477e 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
@@ -21,6 +21,19 @@
 
   ZOOKEEPER
   3.4.6.2.5
+  
+
+  ubuntu14,ubuntu16
+  
+
+  zookeeper-${stack_version}
+
+
+  zookeeper-${stack_version}-server
+
+  
+
+  
 
   
 



[30/50] [abbrv] ambari git commit: AMBARI-19052. Re-arrange "Role Based Access Control" info table (akovalenko)

2016-12-02 Thread ncole
AMBARI-19052. Re-arrange "Role Based Access Control" info table (akovalenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 63c0f2e58fc09b709e890923752c4ccb04181180
Parents: 63938e0
Author: Aleksandr Kovalenko 
Authored: Thu Dec 1 19:22:02 2016 +0200
Committer: Aleksandr Kovalenko 
Committed: Thu Dec 1 20:20:33 2016 +0200

--
 .../admin-web/app/scripts/services/Cluster.js   | 51 
 .../app/scripts/services/RoleDetailsModal.js| 31 +++-
 .../app/views/modals/RoleDetailsModal.html  |  6 +--
 3 files changed, 23 insertions(+), 65 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/63c0f2e5/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
index 02c231a..0f9b582 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
@@ -30,57 +30,6 @@ angular.module('ambariAdminConsole')
   'CLUSTER.USER'
 ],
 
-orderedAuthorizations : [
-  "SERVICE.VIEW_METRICS",
-  "SERVICE.VIEW_STATUS_INFO",
-  "SERVICE.VIEW_CONFIGS",
-  "SERVICE.COMPARE_CONFIGS",
-  "SERVICE.VIEW_ALERTS",
-  "SERVICE.START_STOP",
-  "SERVICE.DECOMMISSION_RECOMMISSION",
-  "SERVICE.RUN_SERVICE_CHECK",
-  "SERVICE.TOGGLE_MAINTENANCE",
-  "SERVICE.RUN_CUSTOM_COMMAND",
-  "SERVICE.MODIFY_CONFIGS",
-  "SERVICE.MANAGE_CONFIG_GROUPS",
-  "SERVICE.MOVE",
-  "SERVICE.ENABLE_HA",
-  "SERVICE.MANAGE_ALERTS",
-  "SERVICE.TOGGLE_ALERTS",
-  "SERVICE.ADD_DELETE_SERVICES",
-  "SERVICE.VIEW_OPERATIONAL_LOGS",
-  "HOST.VIEW_CONFIGS",
-  "HOST.VIEW_METRICS",
-  "HOST.VIEW_STATUS_INFO",
-  "HOST.ADD_DELETE_COMPONENTS",
-  "HOST.ADD_DELETE_HOSTS",
-  "HOST.TOGGLE_MAINTENANCE",
-  "CLUSTER.VIEW_ALERTS",
-  "CLUSTER.VIEW_CONFIGS",
-  "CLUSTER.VIEW_METRICS",
-  "CLUSTER.VIEW_STACK_DETAILS",
-  "CLUSTER.VIEW_STATUS_INFO",
-  "CLUSTER.MANAGE_ALERTS",
-  "CLUSTER.MANAGE_CONFIG_GROUPS",
-  "CLUSTER.MANAGE_CREDENTIALS",
-  "CLUSTER.MODIFY_CONFIGS",
-  "CLUSTER.TOGGLE_ALERTS",
-  "CLUSTER.TOGGLE_KERBEROS",
-  "CLUSTER.UPGRADE_DOWNGRADE_STACK",
-  "CLUSTER.RUN_CUSTOM_COMMAND",
-  "AMBARI.ADD_DELETE_CLUSTERS",
-  "AMBARI.ASSIGN_ROLES",
-  "AMBARI.EDIT_STACK_REPOS",
-  "AMBARI.MANAGE_GROUPS",
-  "AMBARI.MANAGE_SETTINGS",
-  "AMBARI.MANAGE_STACK_VERSIONS",
-  "AMBARI.MANAGE_USERS",
-  "AMBARI.MANAGE_VIEWS",
-  "AMBARI.RENAME_CLUSTER",
-  "AMBARI.RUN_CUSTOM_COMMAND",
-  "SERVICE.SET_SERVICE_USERS_GROUPS"
-],
-
 orderedLevels: ['SERVICE', 'HOST', 'CLUSTER', 'AMBARI'],
 
 ineditableRoles : ['VIEW.USER', 'AMBARI.ADMINISTRATOR'],

http://git-wip-us.apache.org/repos/asf/ambari/blob/63c0f2e5/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
index 5a14b33..06019c2 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/RoleDetailsModal.js
@@ -33,9 +33,9 @@ angular.module('ambariAdminConsole')
 templateUrl: 'views/modals/RoleDetailsModal.html',
 size: 'lg',
 controller: function($scope, $modalInstance) {
+  var authorizationsOrder;
   $scope.title = '';
   $scope.orderedRoles = 
['AMBARI.ADMINISTRATOR'].concat(Cluster.orderedRoles).reverse();
-  $scope.orderedAuthorizations = Cluster.orderedAuthorizations;
   $scope.orderedLevels = Cluster.orderedLevels;
   $scope.authHash = {};
   $scope.getLevelName = function (key) {
@@ -44,25 +44,34 @@ angular.module('ambariAdminConsole')
   angular.forEach(roles, function (r) {
 angular.forEach(r.authorizations, function (auth) {
   var match = auth.authorization_id.match(/(\w+)\./),
-levelKey = match && match[1],
-

[03/50] [abbrv] ambari git commit: AMBARI-19026. Add Host Wizard: validation failed on Assign Slaves step (alexantonenko)

2016-12-02 Thread ncole
AMBARI-19026. Add Host Wizard: validation failed on Assign Slaves step 
(alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 28d783486cb5f4f659126c77792fe44f39f43584
Parents: 89780fa
Author: Alex Antonenko 
Authored: Wed Nov 30 15:56:48 2016 +0200
Committer: Alex Antonenko 
Committed: Wed Nov 30 15:56:57 2016 +0200

--
 .../app/controllers/wizard/step6_controller.js  | 58 +++-
 .../test/controllers/wizard/step6_test.js   |  6 +-
 2 files changed, 36 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/28d78348/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 dfd0687..745ecc7 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -351,29 +351,36 @@ App.WizardStep6Controller = 
Em.Controller.extend(App.HostComponentValidationMixi
   },
 
   /**
-   * Get active host names
-   * @return {string[]}
-   * @method getHostNames
-   */
-  getHostNames: function () {
-var hostInfo = this.get('content.hosts');
-var hostNames = [];
-//flag identify whether get all hosts or only uninstalled(newly added) 
hosts
-var getUninstalledHosts = this.get('content.controllerName') !== 
'addServiceController';
-
-for (var index in hostInfo) {
-  if (hostInfo.hasOwnProperty(index)) {
-if (hostInfo[index].bootStatus === 'REGISTERED') {
-  if (!getUninstalledHosts || !hostInfo[index].isInstalled) {
-hostNames.push(hostInfo[index].name);
-  }
-}
-  }
-}
-return hostNames;
+   * Returns list of new hosts
+   *
+   * @param {object[]} [allHosts=null]
+   * @return {object[]}
+   */
+  getNewHosts: function(allHosts) {
+var hosts = allHosts || this.getAllHosts();
+return hosts.filterProperty('isInstalled', false);
   },
 
   /**
+   * Returns list of registered hosts
+   *
+   * @return {object[{hostName, isInstalled}]}
+   */
+  getAllHosts: function() {
+var self = this;
+var hosts = self.get('content.hosts');
+return Em.keys(this.get('content.hosts')).reduce(function(res, hostName) {
+  var host = hosts[hostName];
+  if (Em.get(host, 'bootStatus') !== 'REGISTERED') {
+return res;
+  }
+  return res.concat({
+hostName: hostName,
+isInstalled: Em.getWithDefault(host, 'isInstalled', false)
+  });
+}, []);
+  },
+  /**
* Load all data needed for this module. Then it automatically renders in 
template
* @method render
*/
@@ -382,9 +389,10 @@ App.WizardStep6Controller = 
Em.Controller.extend(App.HostComponentValidationMixi
   masterHosts = [],
   headers = this.get('headers'),
   masterHostNames = 
this.get('content.masterComponentHosts').mapProperty('hostName').uniq(),
-  masterHostNamesMap = masterHostNames.toWickMap();
+  masterHostNamesMap = masterHostNames.toWickMap(),
+  hosts = this.get('isAddHostWizard') ? this.getNewHosts() : 
this.getAllHosts();
 
-this.getHostNames().forEach(function (_hostName) {
+hosts.mapProperty('hostName').forEach(function (_hostName) {
   var hasMaster = masterHostNamesMap[_hostName];
 
   var obj = {
@@ -403,7 +411,7 @@ App.WizardStep6Controller = 
Em.Controller.extend(App.HostComponentValidationMixi
   };
 
   if (hasMaster) {
-masterHosts.pushObject(obj)
+masterHosts.pushObject(obj);
   } else {
 hostsObj.pushObject(obj);
   }
@@ -640,7 +648,7 @@ App.WizardStep6Controller = 
Em.Controller.extend(App.HostComponentValidationMixi
 var selectedServices = 
App.StackService.find().filterProperty('isSelected').mapProperty('serviceName');
 var installedServices = 
App.StackService.find().filterProperty('isInstalled').mapProperty('serviceName');
 var services = installedServices.concat(selectedServices).uniq();
-var hostNames = this.get('hosts').mapProperty('hostName');
+var hostNames = this.getAllHosts().mapProperty('hostName');
 
 var bluePrintsForValidation = this.getValidationBlueprint();
 this.set('content.recommendationsHostGroups', bluePrintsForValidation);
@@ -660,7 +668,7 @@ App.WizardStep6Controller = 
Em.Controller.extend(App.HostComponentValidationMixi
 var slaveBlueprint = this.getCurrentBlueprint();
 var masterBlueprint = null;
 var 

[14/50] [abbrv] ambari git commit: AMBARI-18755. Deployment failing at creating principal [addendum] (rlevas)

2016-12-02 Thread ncole
AMBARI-18755. Deployment failing at creating principal [addendum] (rlevas)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1e65ba6943a10d04c38f780f476eca3806e2d9f3
Parents: 32c9f5a
Author: Robert Levas 
Authored: Wed Nov 30 19:16:53 2016 -0500
Committer: Robert Levas 
Committed: Wed Nov 30 19:16:53 2016 -0500

--
 ambari-server/docs/configuration/index.md   | 33 +++-
 .../server/configuration/Configuration.java |  7 +
 .../kerberos/MITKerberosOperationHandler.java   | 22 +
 .../ambari/server/utils/ShellCommandUtil.java   | 11 ++-
 .../MITKerberosOperationHandlerTest.java| 23 ++
 .../server/utils/TestShellCommandUtil.java  | 13 +---
 6 files changed, 89 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1e65ba69/ambari-server/docs/configuration/index.md
--
diff --git a/ambari-server/docs/configuration/index.md 
b/ambari-server/docs/configuration/index.md
index 77d3a4d..6ff263c 100644
--- a/ambari-server/docs/configuration/index.md
+++ b/ambari-server/docs/configuration/index.md
@@ -49,15 +49,17 @@ The following are the properties which can be used to 
configure Ambari.
 | agent.stack.retry.tries | The number of times an Ambari Agent should retry 
package installation when it fails due to a repository error.  This 
property is related to `agent.stack.retry.on_repo_unavailability`. |`5` | 
 | agent.task.timeout | The time, in seconds, before agent commands are killed. 
This does not include package installation commands. |`900` | 
 | agent.threadpool.size.max | The size of the Jetty connection pool used for 
handling incoming Ambari Agent requests. |`25` | 
+| alerts.ambari.snmp.dispatcher.udp.port | The UDP port to use when binding 
the Ambari SNMP dispatcher on Ambari Server startup. If no port is specified, 
then a random port will be used. | | 
 | alerts.cache.enabled | Determines whether current alerts should be cached. 
Enabling this can increase performance on large cluster, but can also result in 
lost alert data if the cache is not flushed frequently. |`false` | 
 | alerts.cache.flush.interval | The time, in minutes, after which cached alert 
information is flushed to the database This property is related to 
`alerts.cache.enabled`. |`10` | 
 | alerts.cache.size | The size of the alert cache. This property is 
related to `alerts.cache.enabled`. |`5` | 
 | alerts.execution.scheduler.maxThreads | The number of threads used to handle 
alerts received from the Ambari Agents. The value should be increased as the 
size of the cluster increases. |`2` | 
 | alerts.snmp.dispatcher.udp.port | The UDP port to use when binding the SNMP 
dispatcher on Ambari Server startup. If no port is specified, then a random 
port will be used. | | 
-| alerts.ambari.snmp.dispatcher.udp.port | The UDP port to use when binding 
the SNMP dispatcher on Ambari Server startup. If no port is specified, then a 
random port will be used. | |
-| alerts.template.file | The full path to the XML file that describes the 
different alert templates. | |
+| alerts.template.file | The full path to the XML file that describes the 
different alert templates. | | 
 | ambari.display.url | The URL to use when creating messages which should 
include the Ambari Server URL.The following are examples of valid 
values:`http://ambari.apache.org:8080` | | 
 | ambari.ldap.isConfigured | An internal property used for unit testing and 
development purposes. |`false` | 
+| ambari.post.user.creation.hook | The location of the post user creation hook 
on the ambari server hosting machine. 
|`/var/lib/ambari-server/resources/scripts/post-user-creation-hook.sh` | 
+| ambari.post.user.creation.hook.enabled | Indicates whether the post user 
creation is enabled or not. By default is false. |`false` | 
 | ambari.python.wrap | The name of the shell script used to wrap all 
invocations of Python by Ambari.  |`ambari-python-wrap` | 
 | anonymous.audit.name | The name of the user given to requests which are 
executed without any credentials. |`_anonymous` | 
 | api.authenticated.user | The username of the default user assumed to be 
executing API calls. When set, authentication is not required in order to login 
to Ambari or use the REST APIs.   | | 
@@ -105,6 +107,7 @@ The following are the properties which can be used to 
configure Ambari.
 | authentication.ldap.usernameAttribute | The attribute used for determining 
the user name, such as `uid`. 

[07/50] [abbrv] ambari git commit: AMBARI-18987 A general preupgrade check on if services cannot be upgrade are installed (dili)

2016-12-02 Thread ncole
AMBARI-18987 A general preupgrade check on if services cannot be upgrade are 
installed (dili)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: fff9980992ffcb40e643a4235a7cc36899f1fa5a
Parents: 1087859
Author: Di Li 
Authored: Wed Nov 30 12:49:03 2016 -0500
Committer: Di Li 
Committed: Wed Nov 30 12:49:03 2016 -0500

--
 .../server/checks/ServicePresenceCheck.java | 55 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml |  5 +-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml |  5 +-
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml |  5 +-
 .../stacks/HDP/2.3/upgrades/upgrade-2.6.xml |  5 +-
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml |  5 +-
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml |  5 +-
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml |  5 +-
 .../stacks/HDP/2.4/upgrades/upgrade-2.6.xml |  5 +-
 9 files changed, 57 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fff99809/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicePresenceCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicePresenceCheck.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicePresenceCheck.java
index 0f4eeb1..4642b88 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicePresenceCheck.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicePresenceCheck.java
@@ -19,7 +19,6 @@ package org.apache.ambari.server.checks;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -47,7 +46,7 @@ public class ServicePresenceCheck extends 
AbstractCheckDescriptor{
 
   private static final Logger LOG = 
LoggerFactory.getLogger(ServicePresenceCheck.class);
 
-  static final String KEY_SERVICE_REMOVED = "servcie_removed";
+  static final String KEY_SERVICE_REMOVED = "service_removed";
   /*
* List of services that do not support upgrade
* services must be removed before the stack upgrade
@@ -77,28 +76,26 @@ public class ServicePresenceCheck extends 
AbstractCheckDescriptor{
 Map removedServices = getRemovedServices(request);
 List failReasons = new ArrayList<>();
 
-if(null != noUpgradeSupportServices && 
!noUpgradeSupportServices.isEmpty()){
-  String reason = getFailReason(prerequisiteCheck, request);
-  for(String service: noUpgradeSupportServices){
-if (installedServices.contains(service.toUpperCase())){
-  prerequisiteCheck.getFailedOn().add(service);
-  String msg = String.format(reason, service, service);
-  failReasons.add(msg);
-}
+String reason = getFailReason(prerequisiteCheck, request);
+for(String service: noUpgradeSupportServices){
+  if (installedServices.contains(service.toUpperCase())){
+prerequisiteCheck.getFailedOn().add(service);
+String msg = String.format(reason, service, service);
+failReasons.add(msg);
   }
 }
-if(null != removedServices){
-  String reason = getFailReason(KEY_SERVICE_REMOVED, prerequisiteCheck, 
request);
-  for (Map.Entry entry : removedServices.entrySet()) {
-String removedService = entry.getKey();
-if(installedServices.contains(removedService.toUpperCase())){
-  prerequisiteCheck.getFailedOn().add(removedService);
-  String newService = entry.getValue();
-  String msg = String.format(reason, removedService, newService);
-  failReasons.add(msg);
-}
+
+reason = getFailReason(KEY_SERVICE_REMOVED, prerequisiteCheck, request);
+for (Map.Entry entry : removedServices.entrySet()) {
+  String removedService = entry.getKey();
+  if(installedServices.contains(removedService.toUpperCase())){
+prerequisiteCheck.getFailedOn().add(removedService);
+String newService = entry.getValue();
+String msg = String.format(reason, removedService, newService);
+failReasons.add(msg);
   }
 }
+
 if(!failReasons.isEmpty()){
   prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
   prerequisiteCheck.setFailReason(StringUtils.join(failReasons, '\n'));
@@ -126,52 +123,50 @@ public class ServicePresenceCheck extends 
AbstractCheckDescriptor{
* @return service names
* */
   private List 

[27/50] [abbrv] ambari git commit: AMBARI-18780. Fix livy configuration upgrade from HDP 2.5 to HDP 2.6 (Jeff Zhang via smohanty)

2016-12-02 Thread ncole
AMBARI-18780. Fix livy configuration upgrade from HDP 2.5 to HDP 2.6 (Jeff 
Zhang via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6100be63867209de5dd5eaae6087aad850e25466
Parents: bb8be5b
Author: Sumit Mohanty 
Authored: Thu Dec 1 07:46:20 2016 -0800
Committer: Sumit Mohanty 
Committed: Thu Dec 1 07:46:45 2016 -0800

--
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml  | 12 
 .../stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml  |  4 
 .../resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml   |  3 +++
 3 files changed, 19 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6100be63/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
index 87ede63..9ddb667 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
@@ -44,5 +44,17 @@
 
   
 
+
+
+  
+
+  
+livy-conf
+
+
+  
+
+  
+
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6100be63/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
index fc4c8c5..c13ad99 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
@@ -59,6 +59,10 @@
   prepare
 
   
+
+  
+
+  
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6100be63/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
index eb4309a..1f7c1a8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
@@ -761,6 +761,9 @@
 
   
   
+
+  
+
 
   
 



[29/50] [abbrv] ambari git commit: AMBARI-19006. EU to message users to start YARN queues if work preserving recovery is disabled (alejandro)

2016-12-02 Thread ncole
AMBARI-19006. EU to message users to start YARN queues if work preserving 
recovery is disabled (alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 63938e09ca9e79ee541dd51104964322192e293f
Parents: 88e0c29
Author: Alejandro Fernandez 
Authored: Mon Nov 28 18:05:41 2016 -0800
Committer: Alejandro Fernandez 
Committed: Thu Dec 1 09:55:33 2016 -0800

--
 .../stack/upgrade/ConfigurationCondition.java   | 72 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml | 27 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml | 27 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml | 27 +---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml | 27 +---
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml | 27 +---
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml | 27 +---
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml | 27 +---
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.5.xml | 27 +---
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 27 +---
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml | 27 +---
 .../src/main/resources/upgrade-pack.xsd |  8 ++-
 12 files changed, 231 insertions(+), 119 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/63938e09/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
index 1bd88e4..d229270 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ConfigurationCondition.java
@@ -52,7 +52,37 @@ public final class ConfigurationCondition extends Condition {
  * Equals comparison.
  */
 @XmlEnumValue("equals")
-EQUALS;
+EQUALS,
+
+/**
+ * Not equals comparison.
+ */
+@XmlEnumValue("not-equals")
+NOT_EQUALS,
+
+/**
+ * String contains.
+ */
+@XmlEnumValue("contains")
+CONTAINS,
+
+/**
+ * Does not contain.
+ */
+@XmlEnumValue("not-contains")
+NOT_CONTAINS,
+
+/**
+ * Exists with any value.
+ */
+@XmlEnumValue("exists")
+EXISTS,
+
+/**
+ * Does not exist.
+ */
+@XmlEnumValue("not-exists")
+NOT_EXISTS;
   }
 
   /**
@@ -68,12 +98,18 @@ public final class ConfigurationCondition extends Condition 
{
   public String property;
 
   /**
-   * The value to compare against.
+   * The value to compare against; only valid if comparison type is in (=, !=, 
contains, !contains).
*/
   @XmlAttribute(name = "value")
   public String value;
 
   /**
+   * The value to return if comparison type is in (=, !=, contains, !contains) 
and the config is missing.
+   */
+  @XmlAttribute(name = "return_value_if_config_missing")
+  public boolean returnValueIfConfigMissing;
+
+  /**
* The type of comparison to make.
*/
   @XmlAttribute(name = "comparison")
@@ -84,7 +120,7 @@ public final class ConfigurationCondition extends Condition {
*/
   @Override
   public String toString() {
-return Objects.toStringHelper(this).add("type", type).add("property", 
property).add(value,
+return Objects.toStringHelper(this).add("type", type).add("property", 
property).add("value",
 value).add("comparison", comparisonType).omitNullValues().toString();
   }
 
@@ -94,20 +130,40 @@ public final class ConfigurationCondition extends 
Condition {
   @Override
   public boolean isSatisfied(UpgradeContext upgradeContext) {
 Cluster cluster = upgradeContext.getCluster();
+
+boolean propertyExists = false;
 Config config = cluster.getDesiredConfigByType(type);
-if (null == config) {
-  return false;
+Map properties = null;
+if (null != config) {
+  properties = config.getProperties();
+  if (properties.containsKey(property)) {
+propertyExists = true;
+  }
+}
+
+if (comparisonType == ComparisonType.EXISTS) {
+  return propertyExists;
+}
+if (comparisonType == ComparisonType.NOT_EXISTS) {
+  return !propertyExists;
 }
 
-Map properties = config.getProperties();
-if (MapUtils.isEmpty(properties)) {
-  return false;
+// If property doesn't exist, we cannot make any 

[15/50] [abbrv] ambari git commit: AMBARI-19040. Fix NPE in UpgradeCatalog250Test.testExecuteDMLUpdates (rlevas)

2016-12-02 Thread ncole
AMBARI-19040. Fix NPE in UpgradeCatalog250Test.testExecuteDMLUpdates (rlevas)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7f04e79ab33dc173eb174fd9fcc60bbb54d2c947
Parents: 1e65ba6
Author: Robert Levas 
Authored: Wed Nov 30 20:38:34 2016 -0500
Committer: Robert Levas 
Committed: Wed Nov 30 20:38:34 2016 -0500

--
 .../org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7f04e79a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
index 14fc20b..978e2dc 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
@@ -212,11 +212,13 @@ public class UpgradeCatalog250Test {
 Method updateAmsConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateAMSConfigs");
 Method addNewConfigurationsFromXml = 
AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
 Method updateKafkaConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateKafkaConfigs");
+Method updateHiveLlapConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateHiveLlapConfigs");
 
 UpgradeCatalog250 upgradeCatalog250 = 
createMockBuilder(UpgradeCatalog250.class)
 .addMockedMethod(updateAmsConfigs)
 .addMockedMethod(addNewConfigurationsFromXml)
 .addMockedMethod(updateKafkaConfigs)
+.addMockedMethod(updateHiveLlapConfigs)
 .createMock();
 
 upgradeCatalog250.updateAMSConfigs();
@@ -228,6 +230,9 @@ public class UpgradeCatalog250Test {
 upgradeCatalog250.updateKafkaConfigs();
 expectLastCall().once();
 
+upgradeCatalog250.updateHiveLlapConfigs();
+expectLastCall().once();
+
 replay(upgradeCatalog250);
 
 upgradeCatalog250.executeDMLUpdates();



[10/50] [abbrv] ambari git commit: Revert "AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via ncole)"

2016-12-02 Thread ncole
Revert "AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le 
via ncole)"

This reverts commit 3a14b4afc9572b9aeb0310cdc0cd80700f27ee8d.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4bfbf281ce17eacc2243962191dfb41c38c962b3
Parents: 0afdf65
Author: Nate Cole 
Authored: Wed Nov 30 14:52:23 2016 -0500
Committer: Nate Cole 
Committed: Wed Nov 30 14:52:48 2016 -0500

--
 .../stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml | 13 -
 1 file changed, 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4bfbf281/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
index 9b9477e..de8ebd9 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ZOOKEEPER/metainfo.xml
@@ -21,19 +21,6 @@
 
   ZOOKEEPER
   3.4.6.2.5
-  
-
-  ubuntu14,ubuntu16
-  
-
-  zookeeper-${stack_version}
-
-
-  zookeeper-${stack_version}-server
-
-  
-
-  
 
   
 



[34/50] [abbrv] ambari git commit: AMBARI-19051. Stage is sometimes marked as failed on command reschedule. (mpapirkovskyy)

2016-12-02 Thread ncole
AMBARI-19051. Stage is sometimes marked as failed on command reschedule. 
(mpapirkovskyy)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: d24beb17e238391b196a2bfae1217035678a0a14
Parents: 615438b
Author: Myroslav Papirkovskyi 
Authored: Thu Dec 1 18:48:25 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Fri Dec 2 09:51:16 2016 +0200

--
 .../src/main/python/ambari_agent/ActionQueue.py | 11 +
 .../test/python/ambari_agent/TestActionQueue.py | 48 
 2 files changed, 59 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d24beb17/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py 
b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index 4416b9a..cb4fcb9 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -300,6 +300,7 @@ class ActionQueue(threading.Thread):
 
 logger.info("Command execution metadata - taskId = {taskId}, retry enabled 
= {retryAble}, max retry duration (sec) = {retryDuration}, log_output = 
{log_command_output}".
  format(taskId=taskId, retryAble=retryAble, 
retryDuration=retryDuration, log_command_output=log_command_output))
+command_canceled = False
 while retryDuration >= 0:
   numAttempts += 1
   start = 0
@@ -328,6 +329,7 @@ class ActionQueue(threading.Thread):
   status = self.FAILED_STATUS
   if (commandresult['exitcode'] == -signal.SIGTERM) or 
(commandresult['exitcode'] == -signal.SIGKILL):
 logger.info('Command with taskId = {cid} was 
canceled!'.format(cid=taskId))
+command_canceled = True
 break
 
   if status != self.COMPLETED_STATUS and retryAble and retryDuration > 0:
@@ -344,6 +346,15 @@ class ActionQueue(threading.Thread):
 .format(cid=taskId, status=status, retryAble=retryAble, 
retryDuration=retryDuration, delay=delay))
 break
 
+# do not fail task which was rescheduled from server
+if command_canceled:
+  with self.commandQueue.mutex:
+for com in self.commandQueue.queue:
+  if com['taskId'] == command['taskId']:
+logger.info('Command with taskId = {cid} was rescheduled by 
server. '
+'Fail report on cancelled command won\'t be sent with 
heartbeat.'.format(cid=taskId))
+return
+
 # final result to stdout
 commandresult['stdout'] += '\n\nCommand completed successfully!\n' if 
status == self.COMPLETED_STATUS else '\n\nCommand failed after ' + 
str(numAttempts) + ' tries\n'
 logger.info('Command with taskId = {cid} completed 
successfully!'.format(cid=taskId) if status == self.COMPLETED_STATUS else 
'Command with taskId = {cid} failed after {attempts} tries'.format(cid=taskId, 
attempts=numAttempts))

http://git-wip-us.apache.org/repos/asf/ambari/blob/d24beb17/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py 
b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
index 4a63f7c..65127f2 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
@@ -27,6 +27,7 @@ import os, errno, time, pprint, tempfile, threading
 import sys
 from threading import Thread
 import copy
+import signal
 
 from mock.mock import patch, MagicMock, call
 from ambari_agent.CustomServiceOrchestrator import CustomServiceOrchestrator
@@ -690,6 +691,53 @@ class TestActionQueue(TestCase):
 report = actionQueue.result()
 self.assertEqual(len(report['reports']), 0)
 
+  def test_cancel_with_reschedule_command(self):
+config = AmbariConfig()
+tempdir = tempfile.gettempdir()
+config.set('agent', 'prefix', tempdir)
+config.set('agent', 'cache_dir', "/var/lib/ambari-agent/cache")
+config.set('agent', 'tolerate_download_failures', "true")
+dummy_controller = MagicMock()
+actionQueue = ActionQueue(config, dummy_controller)
+unfreeze_flag = threading.Event()
+python_execution_result_dict = {
+  'stdout': 'out',
+  'stderr': 'stderr',
+  'structuredOut' : '',
+  'status' : '',
+  'exitcode' : -signal.SIGTERM
+}
+
+def side_effect(command, tmpoutfile, 

[23/50] [abbrv] ambari git commit: AMBARI-18736. Perf: Simulate alerts for multiple Ambari Agents running on single Host.(vbrodetskyi)

2016-12-02 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/alerts.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/alerts.json 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/alerts.json
index 8ccfa47..34cea4c 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/alerts.json
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/alerts.json
@@ -1,469 +1,21 @@
 {
   "HDFS":{
-"service": [
-  {
-"name": "datanode_process_percent",
-"label": "Percent DataNodes Available",
-"description": "This alert is triggered if the number of down 
DataNodes in the cluster is greater than the configured critical threshold. It 
aggregates the results of DataNode process checks.",
-"interval": 1,
-"scope": "SERVICE",
-"enabled": true,
-"source": {
-  "type": "AGGREGATE",
-  "alert_name": "datanode_process",
-  "reporting": {
-"ok": {
-  "text": "affected: [{1}], total: [{0}]"
-},
-"warning": {
-  "text": "affected: [{1}], total: [{0}]",
-  "value": 10
-},
-"critical": {
-  "text": "affected: [{1}], total: [{0}]",
-  "value": 30
-},
-"units" : "%",
-"type": "PERCENT"
-  }
-}
-  },
-  {
-"name": "datanode_storage_percent",
-"label": "Percent DataNodes With Available Space",
-"description": "This service-level alert is triggered if the storage 
on a certain percentage of DataNodes exceeds either the warning or critical 
threshold values.",
-"interval": 1,
-"scope": "SERVICE",
-"enabled": true,
-"source": {
-  "type": "AGGREGATE",
-  "alert_name": "datanode_storage",
-  "reporting": {
-"ok": {
-  "text": "affected: [{1}], total: [{0}]"
-},
-"warning": {
-  "text": "affected: [{1}], total: [{0}]",
-  "value": 10
-},
-"critical": {
-  "text": "affected: [{1}], total: [{0}]",
-  "value": 30
-},
-"units" : "%",
-"type": "PERCENT"
-  }
-}
-  },
-  {
-"name": "journalnode_process_percent",
-"label": "Percent JournalNodes Available",
-"description": "This alert is triggered if the number of down 
JournalNodes in the cluster is greater than the configured critical threshold. 
It aggregates the results of JournalNode process checks.",
-"interval": 1,
-"scope": "SERVICE",
-"enabled": true,
-"source": {
-  "type": "AGGREGATE",
-  "alert_name": "journalnode_process",
-  "reporting": {
-"ok": {
-  "text": "affected: [{1}], total: [{0}]"
-},
-"warning": {
-  "text": "affected: [{1}], total: [{0}]",
-  "value": 33
-},
-"critical": {
-  "text": "affected: [{1}], total: [{0}]",
-  "value": 50
-},
-"units" : "%",
-"type": "PERCENT"
-  }
-}
-  }
-],
 "NAMENODE": [
-  {
-"name": "namenode_webui",
-"label": "NameNode Web UI",
-"description": "This host-level alert is triggered if the NameNode Web 
UI is unreachable.",
-"interval": 1,
-"scope": "ANY",
-"enabled": true,
-"source": {
-  "type": "WEB",
-  "uri": {
-"http": "{{hdfs-site/dfs.namenode.http-address}}",
-"https": "{{hdfs-site/dfs.namenode.https-address}}",
-"https_property": "{{hdfs-site/dfs.http.policy}}",
-"https_property_value": "HTTPS_ONLY",
-"kerberos_keytab": 
"{{hdfs-site/dfs.web.authentication.kerberos.keytab}}",
-"kerberos_principal": 
"{{hdfs-site/dfs.web.authentication.kerberos.principal}}",
-"connection_timeout": 5.0,
-"high_availability": {
-  "nameservice": "{{hdfs-site/dfs.internal.nameservices}}",
-  "alias_key" : 
"{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice",
-  "http_pattern" : 
"{{hdfs-site/dfs.namenode.http-address.{{ha-nameservice}}.{{alias",
-  "https_pattern" : 
"{{hdfs-site/dfs.namenode.https-address.{{ha-nameservice}}.{{alias"
-}
-  },
-  "reporting": {
-"ok": {
-  "text": "HTTP {0} response in {2:.3f}s"
-},
-"warning":{
-  "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
-},
-"critical": {
-  "text": "Connection 

[19/50] [abbrv] ambari git commit: AMBARI-19034 Upgrade History Displays Wrong Upgrade Type (atkach)

2016-12-02 Thread ncole
AMBARI-19034 Upgrade History Displays Wrong Upgrade Type (atkach)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4b387915117412b7153a7c36b3f26412538b756d
Parents: dc5f4e2
Author: Andrii Tkach 
Authored: Thu Dec 1 12:11:52 2016 +0200
Committer: Andrii Tkach 
Committed: Thu Dec 1 12:48:41 2016 +0200

--
 .../admin/stack_upgrade_history_controller.js   |   2 +-
 .../app/mappers/stack_upgrade_history_mapper.js |   2 +-
 ambari-web/app/messages.js  |   1 +
 .../stack_version/stack_upgrade_history.js  |   2 +-
 ambari-web/app/styles/stack_versions.less   |  16 +--
 .../upgrade_history_details_view.js |   2 +-
 .../admin/stack_upgrade/upgrade_history_view.js | 120 ++-
 7 files changed, 75 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4b387915/ambari-web/app/controllers/main/admin/stack_upgrade_history_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/stack_upgrade_history_controller.js 
b/ambari-web/app/controllers/main/admin/stack_upgrade_history_controller.js
index 3a78e30..4c9abfe 100644
--- a/ambari-web/app/controllers/main/admin/stack_upgrade_history_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_upgrade_history_controller.js
@@ -213,5 +213,5 @@ App.MainAdminStackUpgradeHistoryController = 
Em.ArrayController.extend({
 } else {
   return ''
 }
-  }.property('upgradeData.Upgrade.request_status'),
+  }.property('upgradeData.Upgrade.request_status')
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b387915/ambari-web/app/mappers/stack_upgrade_history_mapper.js
--
diff --git a/ambari-web/app/mappers/stack_upgrade_history_mapper.js 
b/ambari-web/app/mappers/stack_upgrade_history_mapper.js
index 63088a7..823ae80 100644
--- a/ambari-web/app/mappers/stack_upgrade_history_mapper.js
+++ b/ambari-web/app/mappers/stack_upgrade_history_mapper.js
@@ -50,5 +50,5 @@ App.stackUpgradeHistoryMapper = App.QuickDataMapper.create({
 App.store.loadMany(this.get('model'), result);
 App.store.commit();
 App.set('isStackUpgradeHistoryLoaded',true);
-  },
+  }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b387915/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index a16d0ea..90ad70f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -346,6 +346,7 @@ Em.I18n.translations = {
   'common.end.time': 'End Time',
   'common.rolling': 'Rolling',
   'common.express': 'Express',
+  'common.hostOrdered': 'Host Ordered',
   'common.rolling.downgrade': 'Rolling Downgrade',
   'common.express.downgrade': 'Express Downgrade',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b387915/ambari-web/app/models/stack_version/stack_upgrade_history.js
--
diff --git a/ambari-web/app/models/stack_version/stack_upgrade_history.js 
b/ambari-web/app/models/stack_version/stack_upgrade_history.js
index d4a89dc..9e0439c 100644
--- a/ambari-web/app/models/stack_version/stack_upgrade_history.js
+++ b/ambari-web/app/models/stack_version/stack_upgrade_history.js
@@ -31,7 +31,7 @@ App.StackUpgradeHistory = DS.Model.extend({
   skipServiceCheckFailures: DS.attr('boolean'),
   endTime: DS.attr('number'),
   startTime: DS.attr('number'),
-  createTime: DS.attr('number'),
+  createTime: DS.attr('number')
 });
 
 App.StackUpgradeHistory.FIXTURES = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/4b387915/ambari-web/app/styles/stack_versions.less
--
diff --git a/ambari-web/app/styles/stack_versions.less 
b/ambari-web/app/styles/stack_versions.less
index f67e03e..6698dfa 100644
--- a/ambari-web/app/styles/stack_versions.less
+++ b/ambari-web/app/styles/stack_versions.less
@@ -444,8 +444,14 @@
   .method-options {
 margin: 10px;
 
+.method-option {
+  margin-bottom: 5px;
+}
 .img-thumbnail {
-
+  background-color: #e4e4e4;
+  .method-name,.method-icon,.method-description {
+color: #333;
+  }
   cursor: pointer;
   border: none;
   width: 99%;
@@ -464,18 +470,12 @@
   }
 }
 
-.ROLLING, .NON_ROLLING {
-  background-color: #e4e4e4;
-  .method-name,.method-icon,.method-description 

[26/50] [abbrv] ambari git commit: AMBARI-18713. use exclude list of mount device types on docker containers (dgrinenko via dlysnichenko)

2016-12-02 Thread ncole
AMBARI-18713. use exclude list of mount device types on docker containers 
(dgrinenko via dlysnichenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: bb8be5ba6a950b64382fb1a44f04c1dbf24db382
Parents: 9b21f30
Author: Lisnichenko Dmitro 
Authored: Thu Dec 1 17:36:15 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Thu Dec 1 17:36:15 2016 +0200

--
 .../src/main/resources/scripts/stack_advisor.py |  11 +-
 .../HDP/2.0.6/configuration/cluster-env.xml |  10 +
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |  47 +-
 .../stacks/HDP/2.1/services/stack_advisor.py|  20 +-
 .../stacks/HDP/2.2/services/stack_advisor.py|   7 +
 .../src/main/resources/stacks/stack_advisor.py  | 209 -
 .../stacks/2.0.6/common/test_stack_advisor.py   |  16 +-
 .../stacks/2.1/common/test_stack_advisor.py |   2 +
 .../stacks/2.2/common/test_stack_advisor.py |  17 +-
 .../test/python/stacks/test_stack_adviser.py| 239 ++
 ambari-web/app/mixins.js|   1 -
 .../app/utils/configs/config_initializer.js |  28 +-
 .../mount_points_based_initializer_mixin.js | 340 --
 ambari-web/test/utils/ajax/ajax_test.js |   9 +-
 .../utils/configs/config_initializer_test.js| 457 ---
 15 files changed, 562 insertions(+), 851 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bb8be5ba/ambari-server/src/main/resources/scripts/stack_advisor.py
--
diff --git a/ambari-server/src/main/resources/scripts/stack_advisor.py 
b/ambari-server/src/main/resources/scripts/stack_advisor.py
index 5926c39..abfab87 100755
--- a/ambari-server/src/main/resources/scripts/stack_advisor.py
+++ b/ambari-server/src/main/resources/scripts/stack_advisor.py
@@ -70,13 +70,11 @@ def main(argv=None):
   if len(args) < 3:
 sys.stderr.write(USAGE)
 sys.exit(2)
-pass
 
   action = args[0]
   if action not in ALL_ACTIONS:
 sys.stderr.write(USAGE)
 sys.exit(2)
-pass
 
   hostsFile = args[1]
   servicesFile = args[2]
@@ -89,6 +87,7 @@ def main(argv=None):
   stackName = services["Versions"]["stack_name"]
   stackVersion = services["Versions"]["stack_version"]
   parentVersions = []
+
   if "stack_hierarchy" in services["Versions"]:
 parentVersions = services["Versions"]["stack_hierarchy"]["stack_versions"]
 
@@ -96,8 +95,9 @@ def main(argv=None):
 
   # Perform action
   actionDir = os.path.realpath(os.path.dirname(args[1]))
-  result = {}
-  result_file = "non_valid_result_file.json"
+
+  # filter
+  hosts = stackAdvisor.filterHostMounts(hosts, services)
 
   if action == RECOMMEND_COMPONENT_LAYOUT_ACTION:
 result = stackAdvisor.recommendComponentLayout(services, hosts)
@@ -111,12 +111,11 @@ def main(argv=None):
   elif action == RECOMMEND_CONFIGURATION_DEPENDENCIES:
 result = stackAdvisor.recommendConfigurationDependencies(services, hosts)
 result_file = os.path.join(actionDir, "configurations.json")
-  else: # action == VALIDATE_CONFIGURATIONS
+  else:  # action == VALIDATE_CONFIGURATIONS
 result = stackAdvisor.validateConfigurations(services, hosts)
 result_file = os.path.join(actionDir, "configurations-validation.json")
 
   dumpJson(result, result_file)
-  pass
 
 
 def instantiateStackAdvisor(stackName, stackVersion, parentVersions):

http://git-wip-us.apache.org/repos/asf/ambari/blob/bb8be5ba/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index cc6c8a3..93680bf 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -280,4 +280,14 @@ gpgcheck=0
 YARN Memory widget should be hidden by default on the 
dashboard.
 
   
+   
+agent_mounts_ignore_list
+
+Comma separated list of the mounts which would be ignored by 
Ambari during property values suggestion by Stack Advisor
+
+
+  true
+  true
+
+  
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/bb8be5ba/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
--
diff --git 

[43/50] [abbrv] ambari git commit: Revert "AMBARI-18888: Ambari-agent: Create configuration files with JCEKS information"

2016-12-02 Thread ncole
Revert "AMBARI-1: Ambari-agent: Create configuration files with JCEKS 
information"

This reverts commit 615438b272e6bd8efd37481ef684ae7d68921e64.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 60a6bd4575fb87fc26c4a277cbabf850ef2089e1
Parents: 32840c1
Author: Jonathan Hurley 
Authored: Fri Dec 2 10:50:50 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 10:50:50 2016 -0500

--
 ambari-agent/conf/unix/ambari-agent.ini |   3 -
 .../ambari_agent/CustomServiceOrchestrator.py   | 120 ---
 ambari-agent/src/packages/tarball/all.xml   |  30 -
 .../ambari/server/agent/ExecutionCommand.java   |  28 -
 .../ambari/server/agent/HeartBeatHandler.java   |  10 +-
 .../server/agent/TestHeartbeatHandler.java  |  28 ++---
 6 files changed, 9 insertions(+), 210 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/60a6bd45/ambari-agent/conf/unix/ambari-agent.ini
--
diff --git a/ambari-agent/conf/unix/ambari-agent.ini 
b/ambari-agent/conf/unix/ambari-agent.ini
index d6fcf5f..61948d4 100644
--- a/ambari-agent/conf/unix/ambari-agent.ini
+++ b/ambari-agent/conf/unix/ambari-agent.ini
@@ -46,9 +46,6 @@ keysdir=/var/lib/ambari-agent/keys
 server_crt=ca.crt
 passphrase_env_var_name=AMBARI_PASSPHRASE
 ssl_verify_cert=0
-credential_lib_dir=/var/lib/ambari-agent/cred/lib
-credential_conf_dir=/var/lib/ambari-agent/cred/conf
-credential_shell_cmd=org.apache.hadoop.security.alias.CredentialShell
 
 [services]
 pidLookupPath=/var/run/

http://git-wip-us.apache.org/repos/asf/ambari/blob/60a6bd45/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 1eab0a5..7d61611 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -29,8 +29,6 @@ from FileCache import FileCache
 from AgentException import AgentException
 from PythonExecutor import PythonExecutor
 from PythonReflectiveExecutor import PythonReflectiveExecutor
-from resource_management.core.utils import PasswordString
-import subprocess
 import Constants
 import hostname
 
@@ -67,11 +65,6 @@ class CustomServiceOrchestrator():
   REFLECTIVELY_RUN_COMMANDS = FREQUENT_COMMANDS # -- commands which run a lot 
and often (this increases their speed)
   DONT_BACKUP_LOGS_FOR_COMMANDS = FREQUENT_COMMANDS
 
-  # Path where hadoop credential JARS will be available
-  DEFAULT_CREDENTIAL_SHELL_LIB_PATH = '/var/lib/ambari-agent/cred/lib'
-  DEFAULT_CREDENTIAL_CONF_DIR = '/var/lib/ambari-agent/cred/conf'
-  DEFAULT_CREDENTIAL_SHELL_CMD = 
'org.apache.hadoop.security.alias.CredentialShell'
-
   def __init__(self, config, controller):
 self.config = config
 self.tmp_dir = config.get('agent', 'prefix')
@@ -85,14 +78,6 @@ class CustomServiceOrchestrator():
 # cache reset will be called on every agent registration
 controller.registration_listeners.append(self.file_cache.reset)
 
-# Construct the hadoop credential lib JARs path
-self.credential_shell_lib_path = os.path.join(config.get('security', 
'credential_lib_dir',
- 
self.DEFAULT_CREDENTIAL_SHELL_LIB_PATH), '*')
-
-self.credential_conf_dir = config.get('security', 'credential_conf_dir', 
self.DEFAULT_CREDENTIAL_CONF_DIR)
-
-self.credential_shell_cmd = config.get('security', 'credential_shell_cmd', 
self.DEFAULT_CREDENTIAL_SHELL_CMD)
-
 # Clean up old status command files if any
 try:
   os.unlink(self.status_commands_stdout)
@@ -129,102 +114,6 @@ class CustomServiceOrchestrator():
 else:
   return PythonExecutor(self.tmp_dir, self.config)
 
-  def getProviderDirectory(self, service_name):
-"""
-Gets the path to the service conf folder where the JCEKS file will be 
created.
-
-:param service_name: Name of the service, for example, HIVE
-:return: lower case path to the service conf folder
-"""
-
-# The stack definition scripts of the service can move the
-# JCEKS file around to where it wants, which is usually
-# /etc//conf
-
-conf_dir = os.path.join(self.credential_conf_dir, service_name.lower())
-if not os.path.exists(conf_dir):
-  os.makedirs(conf_dir, 0644)
-
-

[31/50] [abbrv] ambari git commit: AMBARI-19032 HDFS Metric alerts turns to UNKNOWN state with error "'NoneType' object has no attribute 'split'" (dsen)

2016-12-02 Thread ncole
AMBARI-19032 HDFS Metric alerts turns to UNKNOWN state with error "'NoneType' 
object has no attribute 'split'" (dsen)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 406b245ef9ed3a43fdf4d974dc1a7fc467c576a4
Parents: 63c0f2e
Author: Dmytro Sen 
Authored: Thu Dec 1 22:15:26 2016 +0200
Committer: Dmytro Sen 
Committed: Thu Dec 1 22:15:26 2016 +0200

--
 .../ambari_commons/ambari_metrics_helper.py | 45 +++-
 .../timeline/AbstractTimelineMetricsSink.java   |  6 +--
 .../AbstractTimelineMetricSinkTest.java | 10 ++---
 .../timeline/HadoopTimelineMetricsSink.java |  4 +-
 .../timeline/HadoopTimelineMetricsSinkTest.java |  6 +--
 .../src/main/python/core/config_reader.py   |  9 ++--
 .../src/test/python/core/TestEmitter.py |  2 +-
 .../1.6.1.2.2.0/package/scripts/params.py   |  2 +-
 .../0.1.0/package/scripts/params.py |  2 +-
 .../0.1.0/package/scripts/service_check.py  |  2 +-
 .../FLUME/1.4.0.2.0/package/scripts/params.py   |  2 +-
 .../0.96.0.2.0/package/scripts/params_linux.py  |  2 +-
 .../package/alerts/alert_metrics_deviation.py   |  2 +-
 .../KAFKA/0.8.1/package/scripts/params.py   |  2 +-
 .../STORM/0.9.1/package/scripts/params_linux.py |  2 +-
 .../2.0.6/hooks/before-START/scripts/params.py  |  2 +-
 .../2.1/hooks/before-START/scripts/params.py|  4 +-
 17 files changed, 51 insertions(+), 53 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/406b245e/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
--
diff --git 
a/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py 
b/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
index 2eb0b6d..f6f4068 100644
--- a/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
+++ b/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
@@ -22,38 +22,41 @@ import os
 import random
 from resource_management.libraries.functions import conf_select
 
-DEFAULT_COLLECTOR_SUFFIX = '.sink.timeline.collector'
+DEFAULT_COLLECTOR_SUFFIX = '.sink.timeline.collector.hosts'
 DEFAULT_METRICS2_PROPERTIES_FILE_NAME = 'hadoop-metrics2.properties'
 
 def select_metric_collector_for_sink(sink_name):
-# TODO check '*' sink_name
+  # TODO check '*' sink_name
 
-all_collectors_string = 
get_metric_collectors_from_properties_file(sink_name)
+  all_collectors_string = get_metric_collectors_from_properties_file(sink_name)
+  if all_collectors_string:
 all_collectors_list = all_collectors_string.split(',')
 return select_metric_collector_hosts_from_hostnames(all_collectors_list)
+  else:
+return 'localhost'
 
 def select_metric_collector_hosts_from_hostnames(hosts):
-return get_random_host(hosts)
+  return get_random_host(hosts)
 
 def get_random_host(hosts):
-return random.choice(hosts)
+  return random.choice(hosts)
 
 def get_metric_collectors_from_properties_file(sink_name):
-hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
-props = load_properties_from_file(os.path.join(hadoop_conf_dir, 
DEFAULT_METRICS2_PROPERTIES_FILE_NAME))
-return props.get(sink_name + DEFAULT_COLLECTOR_SUFFIX)
+  hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
+  props = load_properties_from_file(os.path.join(hadoop_conf_dir, 
DEFAULT_METRICS2_PROPERTIES_FILE_NAME))
+  return props.get(sink_name + DEFAULT_COLLECTOR_SUFFIX)
 
 def load_properties_from_file(filepath, sep='=', comment_char='#'):
-"""
-Read the file passed as parameter as a properties file.
-"""
-props = {}
-with open(filepath, "rt") as f:
-for line in f:
-l = line.strip()
-if l and not l.startswith(comment_char):
-key_value = l.split(sep)
-key = key_value[0].strip()
-value = sep.join(key_value[1:]).strip('" \t')
-props[key] = value
-return props
+  """
+  Read the file passed as parameter as a properties file.
+  """
+  props = {}
+  with open(filepath, "rt") as f:
+for line in f:
+l = line.strip()
+if l and not l.startswith(comment_char):
+  key_value = l.split(sep)
+  key = key_value[0].strip()
+  value = sep.join(key_value[1:]).strip('" \t')
+  props[key] = value
+  return props

http://git-wip-us.apache.org/repos/asf/ambari/blob/406b245e/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java

[38/50] [abbrv] ambari git commit: AMBARI-19063. Do not change timeline.metrics.service.webapp.address in move wizard (akovalenko)

2016-12-02 Thread ncole
AMBARI-19063. Do not change timeline.metrics.service.webapp.address in move 
wizard (akovalenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e242fc091abe15bc59e8572c43d9227c97e7a247
Parents: 2de7ee8
Author: Aleksandr Kovalenko 
Authored: Fri Dec 2 15:43:15 2016 +0200
Committer: Aleksandr Kovalenko 
Committed: Fri Dec 2 15:44:42 2016 +0200

--
 .../main/service/reassign/step4_controller.js| 19 ++-
 .../service/reassign/step4_controller_test.js|  2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e242fc09/ambari-web/app/controllers/main/service/reassign/step4_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step4_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index 26ac68c..64c2a8e 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -71,6 +71,12 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   hostComponents: [],
 
   /**
+   * List of components, that do not need reconfiguration for moving to 
another host
+   * Reconfigure command will be skipped
+   */
+  componentsWithoutReconfiguration: ['METRICS_COLLECTOR'],
+
+  /**
* Map with lists of related services.
* Used to define list of services to stop/start.
*/
@@ -189,14 +195,6 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   }
 },
 {
-  componentName: 'METRICS_COLLECTOR',
-  configs: {
-'ams-site': {
-  'timeline.metrics.service.webapp.address': ':6188'
-}
-  }
-},
-{
   componentName: 'HISTORYSERVER',
   configs: {
 'mapred-site': {
@@ -398,6 +396,10 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   this.removeTasks(['startZooKeeperServers', 'startNameNode']);
 }
 
+if (this.get('componentsWithoutReconfiguration').contains(componentName)) {
+  this.removeTasks(['reconfigure']);
+}
+
 if (!this.get('content.reassignComponentsInMM.length')) {
   this.removeTasks(['stopHostComponentsInMaintenanceMode']);
 }
@@ -542,7 +544,6 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
 'HIVE_SERVER': ['hive-site', 'webhcat-site', 'hive-env', 'core-site'],
 'HIVE_METASTORE': ['hive-site', 'webhcat-site', 'hive-env', 'core-site'],
 'MYSQL_SERVER': ['hive-site'],
-'METRICS_COLLECTOR': ['ams-site'],
 'HISTORYSERVER': ['mapred-site']
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e242fc09/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
--
diff --git 
a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js 
b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
index 5e7b0e3..9a73524 100644
--- a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
@@ -295,7 +295,7 @@ describe('App.ReassignMasterWizardStep4Controller', 
function () {
 
   controller.set('tasks', commandsForDB);
   controller.removeUnneededTasks();
-  
expect(controller.get('tasks').mapProperty('id')).to.eql([1,2,5,6,8,9,10,12]);
+  
expect(controller.get('tasks').mapProperty('id')).to.eql([1,2,5,6,8,10,12]);
 });
 
 it('reassign component is Mysql Server', function () {



[35/50] [abbrv] ambari git commit: AMBARI-18956. Ambari attempts to commit transactions marked as rollback-only (magyari_sandor)

2016-12-02 Thread ncole
AMBARI-18956. Ambari attempts to commit transactions marked as rollback-only 
(magyari_sandor)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 73d372b8db6b4809fac98338aef1c04ae4c95c92
Parents: d24beb1
Author: Sandor Magyari 
Authored: Fri Dec 2 09:43:24 2016 +0100
Committer: Sandor Magyari 
Committed: Fri Dec 2 09:43:24 2016 +0100

--
 .../orm/AmbariJpaLocalTxnInterceptor.java   |   9 +-
 .../orm/AmbariJpaLocalTxnInterceptorTest.java   | 155 +++
 2 files changed, 162 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/73d372b8/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
index d7ba463..e19192a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptor.java
@@ -218,12 +218,17 @@ public class AmbariJpaLocalTxnInterceptor implements 
MethodInterceptor {
   /**
* Returns True if rollback DID NOT HAPPEN (i.e. if commit should continue).
*
-   * @param transactional The metadata annotaiton of the method
+   * @param transactional The metadata annotation of the method
* @param e The exception to test for rollback
* @param txn   A JPA Transaction to issue rollbacks on
*/
-  private boolean rollbackIfNecessary(Transactional transactional, Exception e,
+  static boolean rollbackIfNecessary(Transactional transactional, Exception e,
   EntityTransaction txn) {
+if (txn.getRollbackOnly()) {
+  txn.rollback();
+  return false;
+}
+
 boolean commit = true;
 
 //check rollback clauses

http://git-wip-us.apache.org/repos/asf/ambari/blob/73d372b8/ambari-server/src/test/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptorTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptorTest.java
new file mode 100644
index 000..ea7ea53
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/AmbariJpaLocalTxnInterceptorTest.java
@@ -0,0 +1,155 @@
+/*
+ * 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.server.orm;
+
+import com.google.inject.persist.Transactional;
+import org.easymock.EasyMockSupport;
+import org.junit.Assert;
+import org.junit.Test;
+
+import javax.persistence.EntityTransaction;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import static 
org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.rollbackIfNecessary;
+import static org.easymock.EasyMock.expect;
+
+public class AmbariJpaLocalTxnInterceptorTest extends EasyMockSupport {
+
+  @Test
+  public void canBeCommittedIfExceptionsToBeRolledBackOnIsEmpty() {
+Transactional transactional = createNiceMock(Transactional.class);
+EntityTransaction transaction = createStrictMock(EntityTransaction.class);
+
+expect(transaction.getRollbackOnly()).andReturn(false);
+expect(transactional.rollbackOn()).andReturn(new Class[0]);
+
+replayAll();
+
+boolean canCommit = rollbackIfNecessary(transactional, new 
RuntimeException(), transaction);
+Assert.assertTrue("Should be allowed to commit, since rollbackOn clause is 
empty", canCommit);
+
+

[47/50] [abbrv] ambari git commit: AMBARI-19064 Refactor widgets on Dashboard page. (atkach)

2016-12-02 Thread ncole
AMBARI-19064 Refactor widgets on Dashboard page. (atkach)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9348725b1067fab38907c8eebc172978729394ad
Parents: 7eb2eaa
Author: Andrii Tkach 
Authored: Fri Dec 2 19:27:20 2016 +0200
Committer: Andrii Tkach 
Committed: Fri Dec 2 19:27:20 2016 +0200

--
 .../mixins/main/dashboard/widgets/editable.js   |  47 +-
 .../main/dashboard/edit_widget_popup.hbs|   4 +-
 .../edit_widget_popup_single_threshold.hbs  |   2 +-
 .../main/dashboard/plus_button_filter.hbs   |   2 +-
 .../app/templates/main/dashboard/widgets.hbs|   8 +-
 .../main/dashboard/widgets/pie_chart.hbs|   5 +-
 .../app/views/common/not-scrollable-textarea.js |   2 +-
 ambari-web/app/views/main/dashboard/widget.js   | 159 ++--
 ambari-web/app/views/main/dashboard/widgets.js  | 824 +--
 .../main/dashboard/widgets/datanode_live.js |   7 -
 .../main/dashboard/widgets/flume_agent_live.js  |   7 -
 .../main/dashboard/widgets/hawqsegment_live.js  |   7 -
 .../dashboard/widgets/hbase_average_load.js |  11 +-
 .../views/main/dashboard/widgets/hbase_links.js |   4 -
 .../main/dashboard/widgets/hbase_master_heap.js |   4 -
 .../dashboard/widgets/hbase_master_uptime.js|   5 -
 .../widgets/hbase_regions_in_transition.js  |  10 +-
 .../main/dashboard/widgets/hdfs_capacity.js |   4 -
 .../views/main/dashboard/widgets/hdfs_links.js  |   4 -
 .../views/main/dashboard/widgets/metrics_cpu.js |   3 -
 .../main/dashboard/widgets/metrics_load.js  |   3 -
 .../main/dashboard/widgets/metrics_memory.js|   3 -
 .../main/dashboard/widgets/metrics_network.js   |   3 -
 .../main/dashboard/widgets/namenode_cpu.js  |   4 -
 .../main/dashboard/widgets/namenode_heap.js |   4 -
 .../main/dashboard/widgets/namenode_rpc.js  |  10 +-
 .../main/dashboard/widgets/namenode_uptime.js   |   5 -
 .../dashboard/widgets/node_managers_live.js |   7 -
 .../main/dashboard/widgets/pie_chart_widget.js  |  16 +-
 .../views/main/dashboard/widgets/pxf_live.js|   6 -
 .../dashboard/widgets/resource_manager_heap.js  |   4 -
 .../widgets/resource_manager_uptime.js  |   5 -
 .../main/dashboard/widgets/supervisor_live.js   |   7 -
 .../views/main/dashboard/widgets/text_widget.js |   4 +-
 .../widgets/text_widget_single_threshold.js |   6 +-
 .../dashboard/widgets/uptime_text_widget.js |   2 -
 .../views/main/dashboard/widgets/yarn_links.js  |   4 -
 .../views/main/dashboard/widgets/yarn_memory.js |   4 -
 .../test/views/main/dashboard/widget_test.js| 200 ++---
 .../widgets/hbase_average_load_test.js  |   4 +-
 .../widgets/hbase_regions_in_transition_test.js |   6 +-
 .../main/dashboard/widgets/namenode_rpc_test.js |  13 +-
 .../text_widget_single_threshold_test.js|  10 +-
 .../main/dashboard/widgets/text_widget_test.js  |  10 +-
 .../widgets/uptime_text_widget_test.js  |   2 +-
 .../test/views/main/dashboard/widgets_test.js   | 669 ++-
 46 files changed, 813 insertions(+), 1317 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9348725b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
--
diff --git a/ambari-web/app/mixins/main/dashboard/widgets/editable.js 
b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
index f330ec3..3206229 100644
--- a/ambari-web/app/mixins/main/dashboard/widgets/editable.js
+++ b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
@@ -23,24 +23,24 @@ App.EditableWidgetMixin = Em.Mixin.create({
   hintInfo: '',
 
   editWidget: function () {
-var parent = this;
+var self = this;
 var configObj = Ember.Object.create({
-  thresh1: parent.get('thresh1') + '',
-  thresh2: parent.get('thresh2') + '',
-  hintInfo: parent.get('hintInfo'),
+  thresholdMin: self.get('thresholdMin') + '',
+  thresholdMax: self.get('thresholdMax') + '',
+  hintInfo: self.get('hintInfo'),
   isThresh1Error: false,
   isThresh2Error: false,
   errorMessage1: "",
   errorMessage2: "",
   maxValue: 'infinity',
   observeNewThresholdValue: function () {
-var thresh1 = this.get('thresh1');
-var thresh2 = this.get('thresh2');
-if (thresh1.trim() !== "") {
-  if (isNaN(thresh1) || thresh1 < 0) {
+var thresholdMin = this.get('thresholdMin');
+var thresholdMax = this.get('thresholdMax');
+if (thresholdMin.trim() !== "") {
+  if (isNaN(thresholdMin) || thresholdMin < 0) {
 

[02/50] [abbrv] ambari git commit: AMBARI-19030 Service Auto Start operations are permitted during Upgrade (atkach)

2016-12-02 Thread ncole
AMBARI-19030 Service Auto Start operations are permitted during Upgrade (atkach)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 89780fabad715e971accb66c3c634cfe0030a91f
Parents: d369809
Author: Andrii Tkach 
Authored: Wed Nov 30 14:33:08 2016 +0200
Committer: Andrii Tkach 
Committed: Wed Nov 30 14:33:08 2016 +0200

--
 .../templates/main/admin/service_auto_start.hbs | 24 +++-
 ambari-web/app/views/main/admin.js  |  3 ++-
 .../app/views/main/admin/service_auto_start.js  |  5 
 .../service_auto_start/component_auto_start.js  |  1 +
 4 files changed, 21 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/89780fab/ambari-web/app/templates/main/admin/service_auto_start.hbs
--
diff --git a/ambari-web/app/templates/main/admin/service_auto_start.hbs 
b/ambari-web/app/templates/main/admin/service_auto_start.hbs
index 7334995..c5a92cf 100644
--- a/ambari-web/app/templates/main/admin/service_auto_start.hbs
+++ b/ambari-web/app/templates/main/admin/service_auto_start.hbs
@@ -80,17 +80,19 @@
 
   {{/each}}
 
-
-  
-
-
-  
-{{t common.enableAll}}
-   |
-  {{t common.disableAll}}
-
-  
-
+{{#isAuthorized "SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS"}}
+  
+
+  
+  
+
+{{t common.enableAll}}
+ |
+{{t common.disableAll}}
+  
+
+  
+{{/isAuthorized}}
   
 
   {{/each}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/89780fab/ambari-web/app/views/main/admin.js
--
diff --git a/ambari-web/app/views/main/admin.js 
b/ambari-web/app/views/main/admin.js
index 704527b..0fa84e8 100644
--- a/ambari-web/app/views/main/admin.js
+++ b/ambari-web/app/views/main/admin.js
@@ -51,7 +51,8 @@ App.MainAdminView = Em.View.extend({
 items.push({
   name: 'serviceAutoStart',
   url: 'adminServiceAutoStart',
-  label: Em.I18n.t('admin.serviceAutoStart.title')
+  label: Em.I18n.t('admin.serviceAutoStart.title'),
+  disabled: App.get('upgradeInProgress') || App.get('upgradeHolding')
 });
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/89780fab/ambari-web/app/views/main/admin/service_auto_start.js
--
diff --git a/ambari-web/app/views/main/admin/service_auto_start.js 
b/ambari-web/app/views/main/admin/service_auto_start.js
index 7b4e46c..1af9845 100644
--- a/ambari-web/app/views/main/admin/service_auto_start.js
+++ b/ambari-web/app/views/main/admin/service_auto_start.js
@@ -27,8 +27,12 @@ App.MainAdminServiceAutoStartView = Em.View.extend({
*/
   isLoaded: false,
 
+  isDisabled: false,
+
   didInsertElement: function () {
 var self = this;
+
+this.set('isDisabled', !App.isAuthorized('SERVICE.START_STOP, 
CLUSTER.MODIFY_CONFIGS'));
 this.get('controller').load().then(function() {
   self.set('isLoaded', true);
   self.initSwitcher();
@@ -55,6 +59,7 @@ App.MainAdminServiceAutoStartView = Em.View.extend({
 offText: Em.I18n.t('common.disabled'),
 offColor: 'default',
 onColor: 'success',
+disabled: this.get('isDisabled'),
 handleWidth: Math.max(Em.I18n.t('common.enabled').length, 
Em.I18n.t('common.disabled').length) * 8,
 onSwitchChange: function (event, state) {
   self.set('controller.servicesAutoStart', state);

http://git-wip-us.apache.org/repos/asf/ambari/blob/89780fab/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js
--
diff --git 
a/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js 
b/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js
index 8588b04..a1e09f2 100644
--- a/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js
+++ 

[42/50] [abbrv] ambari git commit: AMBARI-19055 - Removing Tasks From host_role_command Causes Upgrades To Show As PENDING (jonathanhurley)

2016-12-02 Thread ncole
AMBARI-19055 - Removing Tasks From host_role_command Causes Upgrades To Show As 
PENDING (jonathanhurley)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 32840c1ed434ae4cc99e3ab6f7d3f2604fb69d06
Parents: f4ea309
Author: Jonathan Hurley 
Authored: Thu Dec 1 15:49:06 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 10:19:41 2016 -0500

--
 .../controller/internal/CalculatedStatus.java   | 52 +++-
 .../internal/RequestResourceProvider.java   | 34 -
 .../internal/StageResourceProvider.java |  2 +-
 .../internal/CalculatedStatusTest.java  | 31 
 .../internal/RequestResourceProviderTest.java   | 12 +++--
 5 files changed, 103 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/32840c1e/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
index 3a86aef..3c415df 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
@@ -53,6 +53,17 @@ public class CalculatedStatus {
*/
   private final double percent;
 
+  /**
+   * A status which represents a COMPLETED state at 0%
+   */
+  public static final CalculatedStatus COMPLETED = new 
CalculatedStatus(HostRoleStatus.COMPLETED,
+  HostRoleStatus.COMPLETED, 100.0);
+
+  /**
+   * A status which represents a PENDING state at 0%
+   */
+  public static final CalculatedStatus PENDING = new 
CalculatedStatus(HostRoleStatus.PENDING,
+  HostRoleStatus.PENDING, 0.0);
 
   // - Constructors --
 
@@ -79,12 +90,6 @@ public class CalculatedStatus {
 this.percent = percent;
   }
 
-  /**
-   * Static factory method to get Status that represents a Completed state
-   */
-  public static CalculatedStatus getCompletedStatus() {
-return new CalculatedStatus(HostRoleStatus.COMPLETED, 
HostRoleStatus.COMPLETED, 100.0);
-  }
 
   // - CalculatedStatus --
 
@@ -291,14 +296,25 @@ public class CalculatedStatus {
   }
 
   /**
-   * Calculates the overall status of an upgrade.
-   * @param stageDto  the map of stage-to-summary value objects
-   * @param stageIds  the stage ids to consider from the value objects
+   * Calculates the overall status of an upgrade. If there are no tasks, then a
+   * status of {@link HostRoleStatus#COMPLETED} is returned.
+   *
+   * @param stageDto
+   *  the map of stage-to-summary value objects
+   * @param stageIds
+   *  the stage ids to consider from the value objects
* @return the calculated status
*/
   public static CalculatedStatus statusFromStageSummary(Map stageDto,
   Set stageIds) {
 
+// if either are empty, then we have no tasks and therefore no status - we
+// should return COMPLETED. This can happen if someone removes all tasks 
but
+// leaves the stages and request
+if (stageDto.isEmpty() || stageIds.isEmpty()) {
+  return COMPLETED;
+}
+
 Collection stageStatuses = new HashSet<>();
 Collection stageDisplayStatuses = new HashSet<>();
 Collection taskStatuses = new ArrayList<>();
@@ -378,19 +394,28 @@ public class CalculatedStatus {
*/
   public static HostRoleStatus 
calculateSummaryStatusOfStage(Map counters,
   int total, boolean skippable) {
+
+// when there are 0 tasks, return COMPLETED
+if (total == 0) {
+  return HostRoleStatus.COMPLETED;
+}
+
 if (counters.get(HostRoleStatus.PENDING) == total) {
   return HostRoleStatus.PENDING;
 }
+
 // By definition, any tasks in a future stage must be held in a PENDING 
status.
 if (counters.get(HostRoleStatus.HOLDING) > 0 || 
counters.get(HostRoleStatus.HOLDING_FAILED) > 0 || 
counters.get(HostRoleStatus.HOLDING_TIMEDOUT) > 0) {
   return counters.get(HostRoleStatus.HOLDING) > 0 ? HostRoleStatus.HOLDING 
:
   counters.get(HostRoleStatus.HOLDING_FAILED) > 0 ? 
HostRoleStatus.HOLDING_FAILED :
   HostRoleStatus.HOLDING_TIMEDOUT;
 }
+
 // Because tasks are not skippable, 

[32/50] [abbrv] ambari git commit: AMBARI-19054 : Grafana failed to start at deployment (avijayan)

2016-12-02 Thread ncole
AMBARI-19054 : Grafana failed to start at deployment (avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7577ebb264ae71f81e6572510500f1b87ac46a18
Parents: 406b245
Author: Aravindan Vijayan 
Authored: Thu Dec 1 13:27:16 2016 -0800
Committer: Aravindan Vijayan 
Committed: Thu Dec 1 13:27:16 2016 -0800

--
 .../ambari-metrics-grafana/conf/unix/ambari-metrics-grafana| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7577ebb2/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
--
diff --git 
a/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana 
b/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
index 472942e..8a8ac8f 100644
--- a/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
+++ b/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
@@ -104,7 +104,7 @@ case "$1" in
 
 # Prepare environment
 # mkdir -p "$LOG_DIR" "$DATA_DIR" && chown 
"$GRAFANA_USER":"$GRAFANA_GROUP" "$LOG_DIR" "$DATA_DIR"
-# touch "$PID_FILE" && chown "$GRAFANA_USER":"$GRAFANA_GROUP" "$PID_FILE"
+touch "$PID_FILE" && chown "$GRAFANA_USER":"$GRAFANA_GROUP" "$PID_FILE"
 
 # if [ -n "$MAX_OPEN_FILES" ]; then
 #   ulimit -n $MAX_OPEN_FILES
@@ -116,10 +116,10 @@ case "$1" in
 return=$?
 if [ $return -eq 0 ]
 then
-  sleep 1
+  sleep 5
   # check if pid file has been written two
   if ! [[ -s $PID_FILE ]]; then
-echo "Start FAILED" >> $LOG_FILE
+echo "Start FAILED because daemon did not write pid in pid_file" >> 
$LOG_FILE
 exit 1
   fi
   i=0



[46/50] [abbrv] ambari git commit: AMBARI-19064 Refactor widgets on Dashboard page. (atkach)

2016-12-02 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/9348725b/ambari-web/test/views/main/dashboard/widget_test.js
--
diff --git a/ambari-web/test/views/main/dashboard/widget_test.js 
b/ambari-web/test/views/main/dashboard/widget_test.js
index 0544ff6..63da712 100644
--- a/ambari-web/test/views/main/dashboard/widget_test.js
+++ b/ambari-web/test/views/main/dashboard/widget_test.js
@@ -21,178 +21,84 @@ require('views/main/dashboard/widget');
 
 describe('App.DashboardWidgetView', function () {
 
-  var dashboardWidgetView = App.DashboardWidgetView.create({
+  var dashboardWidgetView;
+
+  dashboardWidgetView = App.DashboardWidgetView.create({
 parentView: Em.Object.create({
   widgetsMapper: Em.K,
-  getUserPref: function () {return {complete: Em.K}},
+  getUserPref: function () {
+return {complete: Em.K}
+  },
   postUserPref: Em.K,
   translateToReal: Em.K,
   visibleWidgets: [],
   hiddenWidgets: []
+}),
+widget: Em.Object.create({
+  id: 5,
+  sourceName: 'HDFS',
+  title: 'Widget'
 })
   });
 
   describe('#viewID', function () {
 it('viewID is computed with id', function () {
-  dashboardWidgetView.set('id', 5);
   expect(dashboardWidgetView.get('viewID')).to.equal('widget-5');
 });
   });
 
   describe('#model', function () {
-it('model_type is null', function () {
-  dashboardWidgetView.set('model_type', null);
+
+beforeEach(function() {
+  sinon.stub(dashboardWidgetView, 
'findModelBySource').returns(Em.Object.create({serviceName: 'HDFS'}));
+});
+
+afterEach(function() {
+  dashboardWidgetView.findModelBySource.restore();
+});
+
+it('sourceName is null', function () {
+  dashboardWidgetView.set('widget.sourceName', null);
   dashboardWidgetView.propertyDidChange('model');
-  expect(dashboardWidgetView.get('model')).to.eql({});
+  expect(dashboardWidgetView.get('model')).to.be.an.object;
 });
-it('model_type is valid', function () {
-  dashboardWidgetView.set('model_type', 's');
+it('sourceName is valid', function () {
+  dashboardWidgetView.set('widget.sourceName', 'HDFS');
   dashboardWidgetView.propertyDidChange('model');
-  dashboardWidgetView.set('parentView.s_model', {'s': {}});
-  expect(dashboardWidgetView.get('model')).to.eql({'s': {}});
+  
expect(dashboardWidgetView.get('model')).to.eql(Em.Object.create({serviceName: 
'HDFS'}));
 });
   });
 
   describe("#didInsertElement()", function () {
-before(function () {
+
+beforeEach(function () {
   sinon.stub(App, 'tooltip', Em.K);
 });
-after(function () {
+afterEach(function () {
   App.tooltip.restore();
 });
+
 it("call App.tooltip", function () {
   dashboardWidgetView.didInsertElement();
   expect(App.tooltip.calledOnce).to.be.true;
 });
   });
 
-  describe("#deleteWidget()", function () {
-beforeEach(function () {
-  sinon.stub(dashboardWidgetView.get('parentView'), 
'widgetsMapper').returns({});
-  sinon.stub(dashboardWidgetView.get('parentView'), 
'getUserPref').returns({
-complete: Em.K
-  });
-});
-
-afterEach(function () {
-  dashboardWidgetView.get('parentView').widgetsMapper.restore();
-  dashboardWidgetView.get('parentView').getUserPref.restore();
-});
-
-it("testMode is off", function () {
-  dashboardWidgetView.set('parentView.persistKey', 'key');
-  dashboardWidgetView.deleteWidget();
-  
expect(dashboardWidgetView.get('parentView').getUserPref.calledWith('key')).to.be.true;
-});
-  });
+  describe("#editWidget()", function () {
 
-  describe("#deleteWidgetComplete()", function () {
 beforeEach(function () {
-  sinon.spy(dashboardWidgetView.get('parentView'), 'postUserPref');
-  sinon.spy(dashboardWidgetView.get('parentView'), 'translateToReal');
-  dashboardWidgetView.set('parentView.currentPrefObject', {
-dashboardVersion: 'new',
-visible: ['1', '2'],
-hidden: [],
-threshold: 'threshold'
-  });
-  dashboardWidgetView.set('parentView.persistKey', 'key');
-  dashboardWidgetView.deleteWidgetComplete();
-});
-afterEach(function () {
-  dashboardWidgetView.get('parentView').postUserPref.restore();
-  dashboardWidgetView.get('parentView').translateToReal.restore();
-});
-it("postUserPref is called with correct data", function () {
-  var arg = 
JSON.parse(JSON.stringify(dashboardWidgetView.get('parentView').postUserPref.args[0][1]));
-  expect(arg).to.be.eql({
-dashboardVersion: 'new',
-visible: ['1', '2'],
-hidden: [[5, null]],
-threshold: 'threshold'
-  });
-});
-it("translateToReal is called with valid data", function () {
-  var arg = 
JSON.parse(JSON.stringify(dashboardWidgetView.get('parentView').translateToReal.args[0][0]));
-  

[01/50] [abbrv] ambari git commit: AMBARI-19027. Manage JournalNode tweaks (onechiporenko)

2016-12-02 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade f70591b13 -> 06327e65e


AMBARI-19027. Manage JournalNode tweaks (onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: d369809c96377fc06d33e1ef7bb1f53819e3f275
Parents: d8ba7f1
Author: Oleg Nechiporenko 
Authored: Wed Nov 30 13:19:43 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Wed Nov 30 13:58:05 2016 +0200

--
 ambari-web/app/messages.js  | 12 +---
 .../main/admin/highAvailability/journalNode/step2.hbs   |  2 ++
 2 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d369809c/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index aa43687..a16d0ea 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1292,7 +1292,7 @@ Em.I18n.translations = {
   'admin.kerberos.disable.notice.completed': 'Services have been successfully 
tested without kerberos environment.',
   'admin.kerberos.wizard.step1.notice.inProgress': 'Please wait while cluster 
is being unkerberized',
 
-  'admin.manageJournalNode.label': 'Manage JournalNode',
+  'admin.manageJournalNode.label': 'Manage JournalNodes',
   'admin.manageJournalNode.wizard.header': 'Manage JournalNodes Wizard',
   'admin.manageJournalNode.wizard.step1.header': 'Assign JournalNodes',
   'admin.manageJournalNode.wizard.step2.header': 'Review',
@@ -1300,14 +1300,12 @@ Em.I18n.translations = {
   'admin.manageJournalNode.wizard.step4.header': 'Add/Remove JournalNodes',
   'admin.manageJournalNode.wizard.step5.header': 'Format JournalNodes',
   'admin.manageJournalNode.wizard.step6.header': 'Start Active NameNode',
-  'admin.manageJournalNode.wizard.step7.header': 'BootStrap StandBy NameNode',
+  'admin.manageJournalNode.wizard.step7.header': 'BootStrap Standby NameNode',
   'admin.manageJournalNode.wizard.step8.header': 'Start All Services',
 
   'admin.manageJournalNode.wizard.step1.body': 'Add, or Remove JournalNodes',
-  'admin.manageJournalNode.wizard.step3.confirm.config.body':'' +
-  'Review Configuration Changes.' +
-  'The following lists the configuration changes that will be made by the 
Wizard to manage JournalNode. This information is for  review only .' +
-  '',
+  'admin.manageJournalNode.wizard.step3.confirm.config.body': 
'Configuration Change Review.' +
+  'As part of this process, configuration changes are required. Please review 
the changes below, and note that they are for review only.  Future steps 
in this wizard will update this configuration, and restart all services 
automatically.',
 
   'admin.manageJournalNode.wizard.step4.task0.title' : 'Stop Standby NameNode',
   'admin.manageJournalNode.wizard.step4.task1.title': 'Stop Services',
@@ -1331,7 +1329,7 @@ Em.I18n.translations = {
   'admin.manageJournalNode.wizard.progressPage.notice.inProgress': 'Please 
wait while JournalNodes are being deployed',
   'admin.manageJournalNode.wizard.step6.notice.inProgress': 'Please wait for 
related services to be started',
   'admin.manageJournalNode.wizard.step4.notice.inProgress': 'Please wait while 
JournalNodes are being deployed',
-  'admin.manageJournalNode.wizard.step8.notice.completed':'JournalNodes has 
been processed successfully.',
+  'admin.manageJournalNode.wizard.step8.notice.completed':'Completed update to 
JournalNodes.',
 
   'admin.manageJournalNode.wizard.step3.body':
   '' +

http://git-wip-us.apache.org/repos/asf/ambari/blob/d369809c/ambari-web/app/templates/main/admin/highAvailability/journalNode/step2.hbs
--
diff --git 
a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step2.hbs 
b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step2.hbs
index 547d364..0cd177d 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/journalNode/step2.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/journalNode/step2.hbs
@@ -69,7 +69,9 @@
 
   
 {{#if controller.isLoaded}}
+  
 {{{t admin.manageJournalNode.wizard.step3.confirm.config.body}}}
+  
 {{view App.ServiceConfigView 
isNotEditableBinding="controller.isNotEditable"}}
 {{else}}
 {{view App.SpinnerView}}



[21/50] [abbrv] ambari git commit: AMBARI-19047. Select Versions page: 'Remove' tooltip does not disappear (onechiporenko)

2016-12-02 Thread ncole
AMBARI-19047. Select Versions page: 'Remove' tooltip does not disappear 
(onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9a72a6009c922f26ee47f2841a5ce89089a24883
Parents: 7c07dd3
Author: Oleg Nechiporenko 
Authored: Wed Nov 30 13:19:43 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Thu Dec 1 14:51:46 2016 +0200

--
 ambari-web/app/templates/wizard/step1.hbs | 2 +-
 ambari-web/app/views/wizard/step1_view.js | 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9a72a600/ambari-web/app/templates/wizard/step1.hbs
--
diff --git a/ambari-web/app/templates/wizard/step1.hbs 
b/ambari-web/app/templates/wizard/step1.hbs
index 312898c..5297d12 100644
--- a/ambari-web/app/templates/wizard/step1.hbs
+++ b/ambari-web/app/templates/wizard/step1.hbs
@@ -165,7 +165,7 @@
   
 
 
-  
+  
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9a72a600/ambari-web/app/views/wizard/step1_view.js
--
diff --git a/ambari-web/app/views/wizard/step1_view.js 
b/ambari-web/app/views/wizard/step1_view.js
index b7a57ca..d5cbbb5 100644
--- a/ambari-web/app/views/wizard/step1_view.js
+++ b/ambari-web/app/views/wizard/step1_view.js
@@ -51,6 +51,8 @@ App.WizardStep1View = Em.View.extend({
 $("[rel=skip-validation-tooltip]").tooltip('destroy');
 $("[rel=use-redhat-tooltip]").tooltip('destroy');
 $('.add-os-button,.redhat-label').tooltip('destroy');
+$('.icon-undo').tooltip('destroy');
+$('.action .icon').tooltip('destroy');
   },
 
   /**
@@ -68,6 +70,11 @@ App.WizardStep1View = Em.View.extend({
 });
   },
 
+  removeOS() {
+$('.action .icon').tooltip('destroy');
+return this.get('controller').removeOS(...arguments);
+  },
+
   /**
* Disable submit button flag
*



[40/50] [abbrv] ambari git commit: AMBARI-18441 - upgrade ambari to 2.1.1 error (Wang Yaoxin via jonathanhurley)

2016-12-02 Thread ncole
AMBARI-18441 - upgrade ambari to 2.1.1 error (Wang Yaoxin via jonathanhurley)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: ae3ff2a09b6b36f8a456987c60fc695dd262b6bb
Parents: 80084a9
Author: Jonathan Hurley 
Authored: Fri Dec 2 10:13:22 2016 -0500
Committer: Jonathan Hurley 
Committed: Fri Dec 2 10:13:45 2016 -0500

--
 .../server/upgrade/UpgradeCatalog211.java   | 24 
 1 file changed, 15 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ae3ff2a0/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
index db13612..eb835ef 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog211.java
@@ -212,8 +212,8 @@ public class UpgradeCatalog211 extends 
AbstractUpgradeCatalog {
 statement = dbAccessor.getConnection().createStatement();
 if (statement != null) {
   String selectSQL = MessageFormat.format(
-  "SELECT cluster_id, service_name, component_name, host_id FROM 
{0}",
-  HOST_COMPONENT_STATE_TABLE);
+  "SELECT id, cluster_id, service_name, component_name, host_id 
FROM {0} ORDER BY {1} {2}",
+  HOST_COMPONENT_STATE_TABLE, "id", "DESC");
 
   resultSet = statement.executeQuery(selectSQL);
   while (resultSet.next()) {
@@ -221,13 +221,19 @@ public class UpgradeCatalog211 extends 
AbstractUpgradeCatalog {
 final String serviceName = resultSet.getString("service_name");
 final String componentName = resultSet.getString("component_name");
 final Long hostId = resultSet.getLong("host_id");
-
-String updateSQL = MessageFormat.format(
-"UPDATE {0} SET {1} = {2,number,#} WHERE cluster_id = {3} AND 
service_name = ''{4}'' AND component_name = ''{5}'' and host_id = {6,number,#}",
-HOST_COMPONENT_STATE_TABLE, HOST_COMPONENT_STATE_ID_COLUMN, 
m_hcsId.getAndIncrement(),
-clusterId, serviceName, componentName, hostId);
-
-dbAccessor.executeQuery(updateSQL);
+final Long idKey = resultSet.getLong("id");
+
+if (idKey != 0 && m_hcsId.get() == 1) {
+  m_hcsId.set(idKey);
+  m_hcsId.getAndIncrement();
+} else if(idKey == 0) {
+  String updateSQL = MessageFormat.format(
+  "UPDATE {0} SET {1} = {2,number,#} WHERE cluster_id = {3} 
AND service_name = ''{4}'' AND component_name = ''{5}'' and host_id = 
{6,number,#}",
+  HOST_COMPONENT_STATE_TABLE, HOST_COMPONENT_STATE_ID_COLUMN, 
m_hcsId.getAndIncrement(),
+  clusterId, serviceName, componentName, hostId);
+
+  dbAccessor.executeQuery(updateSQL);
+}
   }
 }
   } finally {



[11/50] [abbrv] ambari git commit: AMBARI-18994. In HA cluster copy the hdfs-site.xml and hbase-site.xml to Ranger conf directory (Mugdha Varadkar via smohanty)

2016-12-02 Thread ncole
AMBARI-18994. In HA cluster copy the hdfs-site.xml and hbase-site.xml to Ranger 
conf directory (Mugdha Varadkar via smohanty)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 72b940e725658599f055a1c1eaadaa2a9c65075b
Parents: 4bfbf28
Author: Sumit Mohanty 
Authored: Wed Nov 30 12:51:46 2016 -0800
Committer: Sumit Mohanty 
Committed: Wed Nov 30 12:52:22 2016 -0800

--
 .../RANGER/0.4.0/package/scripts/params.py  | 14 +
 .../0.4.0/package/scripts/setup_ranger_xml.py   | 21 
 .../common-services/RANGER/0.6.0/metainfo.xml   |  2 ++
 3 files changed, 37 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/72b940e7/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
index 6debaf1..e27b363 100644
--- 
a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
@@ -385,3 +385,17 @@ if audit_solr_enabled and is_solrCloud_enabled:
   # Check external solrCloud
   if is_external_solrCloud_enabled and is_external_solrCloud_kerberos:
 ranger_is_solr_kerberised = "true"
+
+hbase_master_hosts = default("/clusterHostInfo/hbase_master_hosts", [])
+is_hbase_ha_enabled = True if len(hbase_master_hosts) > 1 else False
+is_namenode_ha_enabled = True if len(namenode_hosts) > 1 else False
+ranger_hbase_plugin_enabled = False
+ranger_hdfs_plugin_enabled = False
+
+
+if is_hbase_ha_enabled:
+  if not 
is_empty(config['configurations']['ranger-hbase-plugin-properties']['ranger-hbase-plugin-enabled']):
+ranger_hbase_plugin_enabled = 
config['configurations']['ranger-hbase-plugin-properties']['ranger-hbase-plugin-enabled'].lower()
 == 'yes'
+if is_namenode_ha_enabled:
+  if not 
is_empty(config['configurations']['ranger-hdfs-plugin-properties']['ranger-hdfs-plugin-enabled']):
+ranger_hdfs_plugin_enabled = 
config['configurations']['ranger-hdfs-plugin-properties']['ranger-hdfs-plugin-enabled'].lower()
 == 'yes'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/72b940e7/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
 
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
index 316d207..8036f28 100644
--- 
a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
+++ 
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
@@ -216,6 +216,27 @@ def setup_ranger_admin(upgrade_type=None):
 
   create_core_site_xml(ranger_conf)
 
+  if params.stack_supports_ranger_kerberos and params.security_enabled:
+if params.is_hbase_ha_enabled and params.ranger_hbase_plugin_enabled:
+  XmlConfig("hbase-site.xml",
+conf_dir=ranger_conf,
+configurations=params.config['configurations']['hbase-site'],
+
configuration_attributes=params.config['configuration_attributes']['hbase-site'],
+owner=params.unix_user,
+group=params.unix_group,
+mode=0644
+  )
+
+if params.is_namenode_ha_enabled and params.ranger_hdfs_plugin_enabled:
+  XmlConfig("hdfs-site.xml",
+conf_dir=ranger_conf,
+configurations=params.config['configurations']['hdfs-site'],
+
configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
+owner=params.unix_user,
+group=params.unix_group,
+mode=0644
+  )
+
 def setup_ranger_db(stack_version=None):
   import params
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/72b940e7/ambari-server/src/main/resources/common-services/RANGER/0.6.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/RANGER/0.6.0/metainfo.xml 
b/ambari-server/src/main/resources/common-services/RANGER/0.6.0/metainfo.xml
index f330bc9..12fde7e 100644
--- 

[25/50] [abbrv] ambari git commit: AMBARI-19048 Delete service action should show the config recommendation popup. (ababiichuk)

2016-12-02 Thread ncole
AMBARI-19048 Delete service action should show the config recommendation popup. 
(ababiichuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9b21f30b5f081d7b313f9070ae125afc84db7647
Parents: ef63373
Author: ababiichuk 
Authored: Thu Dec 1 16:00:31 2016 +0200
Committer: ababiichuk 
Committed: Thu Dec 1 17:07:49 2016 +0200

--
 .../controllers/main/service/info/configs.js|  2 +-
 ambari-web/app/controllers/main/service/item.js | 49 ++--
 .../app/controllers/wizard/step7_controller.js  |  2 +-
 .../app/mixins/main/service/groups_mapping.js   |  2 +-
 .../info/delete_service_warning_popup.hbs   | 28 +++
 .../test/controllers/main/service/item_test.js  | 13 +++---
 6 files changed, 74 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b21f30b/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 130b1b5..94caf4a 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -21,7 +21,7 @@ var batchUtils = require('utils/batch_scheduled_requests');
 
 App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfigs, App.ConfigsLoader,
   App.ServerValidatorMixin, App.EnhancedConfigsMixin, App.ThemesMappingMixin, 
App.ConfigsSaverMixin,
-  App.ConfigsComparator, App.ComponentActionsByConfigs, App.TrackRequestMixin, 
{
+  App.ConfigsComparator, App.ComponentActionsByConfigs, {
 
   name: 'mainServiceInfoConfigsController',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b21f30b/ambari-web/app/controllers/main/service/item.js
--
diff --git a/ambari-web/app/controllers/main/service/item.js 
b/ambari-web/app/controllers/main/service/item.js
index 18a121f..19b021b 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -21,7 +21,7 @@ var batchUtils = require('utils/batch_scheduled_requests');
 var blueprintUtils = require('utils/blueprint');
 var stringUtils = require('utils/string_utils');
 
-App.MainServiceItemController = 
Em.Controller.extend(App.SupportClientConfigsDownload, App.InstallComponent, 
App.ConfigsSaverMixin, App.EnhancedConfigsMixin, {
+App.MainServiceItemController = 
Em.Controller.extend(App.SupportClientConfigsDownload, App.InstallComponent, 
App.ConfigsSaverMixin, App.EnhancedConfigsMixin, App.GroupsMappingMixin, {
   name: 'mainServiceItemController',
 
   /**
@@ -86,6 +86,8 @@ App.MainServiceItemController = 
Em.Controller.extend(App.SupportClientConfigsDow
 
   deleteServiceProgressPopup: null,
 
+  isRecommendationInProgress: false,
+
   isClientsOnlyService: function() {
 return 
App.get('services.clientOnly').contains(this.get('content.serviceName'));
   }.property('content.serviceName'),
@@ -1317,17 +1319,38 @@ App.MainServiceItemController = 
Em.Controller.extend(App.SupportClientConfigsDow
   showLastWarning: function (serviceName, interDependentServices, 
dependentServicesToDeleteFmt) {
 var self = this,
   displayName = App.format.role(serviceName, true),
-  popupHeader = Em.I18n.t('services.service.delete.popup.header');
-
-return App.showConfirmationPopup(
-  function() {self.confirmDeleteService(serviceName, 
interDependentServices, dependentServicesToDeleteFmt)},
-  Em.I18n.t('services.service.delete.popup.warning').format(displayName) +
-  (interDependentServices.length ? 
Em.I18n.t('services.service.delete.popup.warning.dependent').format(dependentServicesToDeleteFmt)
 : ''),
-  null,
-  popupHeader,
-  Em.I18n.t('common.delete'),
-  true
-);
+  popupHeader = Em.I18n.t('services.service.delete.popup.header'),
+  popupPrimary = Em.I18n.t('common.delete'),
+  warningMessage = 
Em.I18n.t('services.service.delete.popup.warning').format(displayName) +
+(interDependentServices.length ? 
Em.I18n.t('services.service.delete.popup.warning.dependent').format(dependentServicesToDeleteFmt)
 : '');
+this.clearRecommendationsInfo();
+this.setProperties({
+  isRecommendationInProgress: true,
+  selectedConfigGroup: Em.Object.create({
+isDefault: true
+  })
+});
+this.loadConfigRecommendations(null, function () {
+  var serviceNames = 

[16/50] [abbrv] ambari git commit: AMBARI-19042: Ambari-server: OOZIE stack definition changes required to support credential store

2016-12-02 Thread ncole
AMBARI-19042: Ambari-server: OOZIE stack definition changes required to support 
credential store


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 337c5f29fd31fa8b7f8391d81125dc1e5eef160c
Parents: 7f04e79
Author: Nahappan Somasundaram 
Authored: Wed Nov 30 17:50:21 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Wed Nov 30 22:07:14 2016 -0800

--
 .../main/resources/stacks/HDP/2.5/services/OOZIE/metainfo.xml| 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/337c5f29/ambari-server/src/main/resources/stacks/HDP/2.5/services/OOZIE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/OOZIE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/OOZIE/metainfo.xml
index 027e8b4..df1092a 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/OOZIE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/OOZIE/metainfo.xml
@@ -20,6 +20,10 @@
   
 
   OOZIE
+  
+true
+false
+  
   common-services/OOZIE/4.2.0.2.5
   
 



[39/50] [abbrv] ambari git commit: AMBARI-18951. Force InnoDB usage for MySQL. Fix for MySQL < 5.6. (mpapirkovskyy)

2016-12-02 Thread ncole
AMBARI-18951. Force InnoDB usage for MySQL. Fix for MySQL < 5.6. (mpapirkovskyy)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 80084a9d8de9110365c6f1ef68362b502e07cf28
Parents: e242fc0
Author: Myroslav Papirkovskyi 
Authored: Fri Dec 2 16:41:40 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Fri Dec 2 16:52:55 2016 +0200

--
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql   | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/80084a9d/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 b01ed2f..82ce31e 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -26,7 +26,16 @@ delimiter ;
 
 # USE @schema;
 
-SET default_storage_engine=INNODB;
+-- Set default_storage_engine to InnoDB
+-- storage_engine variable should be used for versions prior to MySQL 5.6
+set @version_short = substring_index(@@version, '.', 2);
+set @major = cast(substring_index(@version_short, '.', 1) as SIGNED);
+set @minor = cast(substring_index(@version_short, '.', -1) as SIGNED);
+set @engine_stmt = IF(@major >= 5 AND @minor>=6, 'SET 
default_storage_engine=INNODB', 'SET storage_engine=INNODB');
+prepare statement from @engine_stmt;
+execute statement;
+DEALLOCATE PREPARE statement;
+
 
 CREATE TABLE stack(
   stack_id BIGINT NOT NULL,



[22/50] [abbrv] ambari git commit: AMBARI-18736. Perf: Simulate alerts for multiple Ambari Agents running on single Host.(vbrodetskyi)

2016-12-02 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
deleted file mode 100644
index 0946c85..000
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-
-"""
-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.
-"""
-
-import logging
-
-RESULT_STATE_OK = 'OK'
-RESULT_STATE_CRITICAL = 'CRITICAL'
-RESULT_STATE_WARNING = 'WARNING'
-RESULT_STATE_UNKNOWN = 'UNKNOWN'
-RESULT_STATE_SKIPPED = 'SKIPPED'
-
-OK_MESSAGE = 'Ok'
-
-HDFS_SITE_KEY = '{{hdfs-site}}'
-NAMESERVICE_KEY = '{{hdfs-site/dfs.internal.nameservices}}'
-NN_HTTP_ADDRESS_KEY = '{{hdfs-site/dfs.namenode.http-address}}'
-NN_HTTPS_ADDRESS_KEY = '{{hdfs-site/dfs.namenode.https-address}}'
-DFS_POLICY_KEY = '{{hdfs-site/dfs.http.policy}}'
-
-KERBEROS_KEYTAB = '{{hdfs-site/dfs.web.authentication.kerberos.keytab}}'
-KERBEROS_PRINCIPAL = '{{hdfs-site/dfs.web.authentication.kerberos.principal}}'
-SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}'
-SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
-EXECUTABLE_SEARCH_PATHS = '{{kerberos-env/executable_search_paths}}'
-
-METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY = 
'{{ams-site/timeline.metrics.service.webapp.address}}'
-METRICS_COLLECTOR_VIP_HOST_KEY = '{{cluster-env/metrics_collector_vip_host}}'
-METRICS_COLLECTOR_VIP_PORT_KEY = '{{cluster-env/metrics_collector_vip_port}}'
-
-logger = logging.getLogger()
-
-
-def get_tokens():
-  """
-  Returns a tuple of tokens in the format {{site/property}} that will be used
-  to build the dictionary passed into execute
-  """
-  return (HDFS_SITE_KEY, NAMESERVICE_KEY, NN_HTTP_ADDRESS_KEY, DFS_POLICY_KEY,
-  EXECUTABLE_SEARCH_PATHS, NN_HTTPS_ADDRESS_KEY, SMOKEUSER_KEY,
-  KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, SECURITY_ENABLED_KEY,
-  METRICS_COLLECTOR_VIP_HOST_KEY, METRICS_COLLECTOR_VIP_PORT_KEY,
-  METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY)
-
-def execute(configurations={}, parameters={}, host_name=None):
-  """
-  Returns a tuple containing the result code and a pre-formatted result label
-
-  Keyword arguments:
-  configurations : a mapping of configuration key to value
-  parameters : a mapping of script parameter key to value
-  host_name : the name of this host where the alert is running
-
-  :type configurations dict
-  :type parameters dict
-  :type host_name str
-  """
-
-  #parse configuration
-  if configurations is None:
-return (RESULT_STATE_UNKNOWN, ['There were no configurations supplied to 
the script.'])
-
-  # hdfs-site is required
-  if not HDFS_SITE_KEY in configurations:
-return (RESULT_STATE_UNKNOWN, ['{0} is a required parameter for the 
script'.format(HDFS_SITE_KEY)])
-
-  result_code = RESULT_STATE_OK
-  label = OK_MESSAGE
-  return (result_code, [label])
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
new file mode 100644
index 000..73bc168
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+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

[09/50] [abbrv] ambari git commit: AMBARI-18600: Workflow Designer View: When logs are empty, you see the spinner, instead of a message (sangeetar)

2016-12-02 Thread ncole
AMBARI-18600: Workflow Designer View: When logs are empty, you see the spinner, 
instead of a message (sangeetar)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0afdf6512b914b01417d0fecd2fba334e8dc0195
Parents: 3a14b4a
Author: Sangeeta Ravindran 
Authored: Wed Nov 30 11:16:31 2016 -0800
Committer: Sangeeta Ravindran 
Committed: Wed Nov 30 11:16:31 2016 -0800

--
 .../wfmanager/src/main/resources/ui/app/components/job-details.js | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0afdf651/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js
--
diff --git 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js
index e403dc4..0e5fd36 100644
--- 
a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js
+++ 
b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js
@@ -349,6 +349,7 @@ export default Ember.Component.extend({
   url = url + '=action='+ params.logActionList;
 }
 Ember.$.get(url,function(response){
+  response = response.trim().length > 0 ? response : "No messages 
present";
   this.set('model.jobLog', response);
 }.bind(this)).fail(function(error){
   this.set('error', error);
@@ -356,6 +357,7 @@ export default Ember.Component.extend({
   },
   getErrorLog : function (){
 
Ember.$.get(Ember.ENV.API_URL+'/v2/job/'+this.get('id')+'?show=errorlog',function(response){
+  response = response.trim().length > 0 ? response : "No messages 
present";
   this.set('model.errorLog', response);
 }.bind(this)).fail(function(error){
   this.set('error', error);
@@ -363,6 +365,7 @@ export default Ember.Component.extend({
   },
   getAuditLog : function (){
 
Ember.$.get(Ember.ENV.API_URL+'/v2/job/'+this.get('id')+'?show=auditlog',function(response){
+  response = response.trim().length > 0 ? response : "No messages 
present";
   this.set('model.auditLog', response);
 }.bind(this)).fail(function(error){
   this.set('error', error);



[05/50] [abbrv] ambari git commit: AMBARI-18949 Extend current quick link JSON with properties

2016-12-02 Thread ncole
AMBARI-18949 Extend current quick link JSON with properties

Change-Id: I209e594e74964b2bab71a454c2b77f785bb02a82


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9559a1626ac5e6dd3f6ddf65b1fd450171bc4f26
Parents: e3b9a9f
Author: Balazs Bence Sari 
Authored: Wed Nov 30 16:24:04 2016 +0100
Committer: Miklos Gergely 
Committed: Wed Nov 30 16:24:04 2016 +0100

--
 .../ambari/server/state/quicklinks/Link.java| 21 +++
 .../QuickLinksConfigurationModuleTest.java  | 36 +++
 .../child_quicklinks_with_properties.json   | 64 +++
 .../parent_quicklinks_with_properties.json  | 65 
 4 files changed, 186 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9559a162/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
index 091926f..f7c14f3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Link.java
@@ -18,6 +18,11 @@
 
 package org.apache.ambari.server.state.quicklinks;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Nullable;
+
 import org.codehaus.jackson.annotate.JsonIgnoreProperties;
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.annotate.JsonSerialize;
@@ -46,6 +51,9 @@ public class Link{
   @JsonProperty("protocol")
   private Protocol protocol;
 
+  @JsonProperty("properties")
+  private List properties;
+
   public String getName() {
 return name;
   }
@@ -102,6 +110,14 @@ public class Link{
 this.protocol = protocol;
   }
 
+  @Nullable
+  public List getProperties() {
+return properties;
+  }
+
+  public void setProperties(List properties) {
+this.properties = properties;
+  }
 
   public boolean isRemoved(){
 //treat a link as removed if the section only contains a name
@@ -132,5 +148,10 @@ public class Link{
 } else {
   port.mergetWithParent(parentLink.getPort());
 }
+
+if (null == properties && null != parentLink.properties) {
+  properties = parentLink.properties;
+}
   }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/9559a162/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
index 38176aa..f44f741 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.ambari.server.stack;
 
+import com.google.common.collect.Lists;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.state.quicklinks.Check;
 import org.apache.ambari.server.state.quicklinks.Link;
@@ -28,7 +29,10 @@ import 
org.apache.ambari.server.state.quicklinks.QuickLinksConfiguration;
 import org.junit.Test;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import static org.junit.Assert.*;
 
@@ -111,6 +115,38 @@ public class QuickLinksConfigurationModuleTest {
 }
   }
 
+  @Test
+  public void testResolveOverrideProperties() throws Exception{
+QuickLinks[] results = 
resolveQuickLinks("parent_quicklinks_with_properties.json",
+"child_quicklinks_with_properties.json");
+QuickLinks parentQuickLinks = results[0];
+QuickLinks childQuickLinks = results[1];
+
+//resolved quicklinks configuration
+QuickLinksConfiguration childQuickLinksConfig = 
childQuickLinks.getQuickLinksConfiguration();
+assertNotNull(childQuickLinksConfig);
+
+//links
+List links = childQuickLinksConfig.getLinks();
+assertNotNull(links);
+assertEquals(3, links.size());
+Map linksByName = new HashMap<>();
+for (Link link: links) {
+  linksByName.put(link.getName(), link);
+}
+assertEquals("Links are not 

[04/50] [abbrv] ambari git commit: AMBARI-19000. Ambari-server fails to restart with --debug if it is already running (aonishuk)

2016-12-02 Thread ncole
AMBARI-19000. Ambari-server fails to restart with --debug if it is already 
running (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e3b9a9f804537796fa46273b378935a14b75bb33
Parents: 28d7834
Author: Andrew Onishuk 
Authored: Wed Nov 30 17:07:22 2016 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 30 17:07:22 2016 +0200

--
 ambari-server/src/main/python/ambari-server.py  | 12 +++-
 .../src/main/python/ambari_server/serverUtils.py| 11 +++
 2 files changed, 22 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9a9f8/ambari-server/src/main/python/ambari-server.py
--
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 41b2234..21bd0bb 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -35,7 +35,7 @@ from ambari_commons.os_utils import remove_file
 from ambari_server.BackupRestore import main as BackupRestore_main
 from ambari_server.dbConfiguration import DATABASE_NAMES, LINUX_DBMS_KEYS_LIST
 from ambari_server.serverConfiguration import configDefaults, 
get_ambari_properties, PID_NAME
-from ambari_server.serverUtils import is_server_runing, refresh_stack_hash
+from ambari_server.serverUtils import is_server_runing, refresh_stack_hash, 
wait_for_server_to_stop
 from ambari_server.serverSetup import reset, setup, setup_jce_policy
 from ambari_server.serverUpgrade import upgrade, upgrade_stack, set_current
 from ambari_server.setupHttps import setup_https, setup_truststore
@@ -63,6 +63,8 @@ logger = logging.getLogger()
 
 formatstr = "%(levelname)s %(asctime)s %(filename)s:%(lineno)d - %(message)s"
 
+SERVER_STOP_TIMEOUT = 30
+
 class UserActionPossibleArgs(object):
   def __init__(self, i_fn, i_possible_args_numbers, *args, **kwargs):
 self.fn = i_fn
@@ -166,6 +168,14 @@ def stop(args):
 except OSError, e:
   print_info_msg("Unable to stop Ambari Server - " + str(e))
   return
+
+print "Waiting for server stop..."
+logger.info("Waiting for server stop...")
+
+if not wait_for_server_to_stop(SERVER_STOP_TIMEOUT):
+  print "Ambari-server failed to stop"
+  logger.info("Ambari-server failed to stop")
+
 pid_file_path = os.path.join(configDefaults.PID_DIR, PID_NAME)
 os.remove(pid_file_path)
 print "Ambari Server stopped"

http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9a9f8/ambari-server/src/main/python/ambari_server/serverUtils.py
--
diff --git a/ambari-server/src/main/python/ambari_server/serverUtils.py 
b/ambari-server/src/main/python/ambari_server/serverUtils.py
index 3af233c..4621646 100644
--- a/ambari-server/src/main/python/ambari_server/serverUtils.py
+++ b/ambari-server/src/main/python/ambari_server/serverUtils.py
@@ -19,6 +19,7 @@ limitations under the License.
 '''
 
 import os
+import time
 from ambari_commons.exceptions import FatalException, NonFatalException
 from ambari_commons.logging_utils import get_verbose
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
@@ -62,6 +63,16 @@ def is_server_runing():
 return False, None
 
 
+def wait_for_server_to_stop(wait_timeout):
+  start_time = time.time()
+  is_timeout = lambda: time.time() - start_time > wait_timeout
+
+  while is_server_runing()[0] and not is_timeout():
+time.sleep(0.1)
+
+  return not is_timeout()
+
+
 @OsFamilyFuncImpl(OSConst.WINSRV_FAMILY)
 def is_server_runing():
   from ambari_commons.os_windows import SERVICE_STATUS_STARTING, 
SERVICE_STATUS_RUNNING, SERVICE_STATUS_STOPPING, \



[20/50] [abbrv] ambari git commit: AMBARI-19043 : CAPACITY-SCHEDULER & PIG View not loading for Ambari-2.5.0 (Akhil PB via nitirajrathore)

2016-12-02 Thread ncole
AMBARI-19043 : CAPACITY-SCHEDULER & PIG View not loading for Ambari-2.5.0 
(Akhil PB via nitirajrathore)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7c07dd3595068b4e9a58db0fd2d6a8415898261c
Parents: 4b38791
Author: Nitiraj Rathore 
Authored: Thu Dec 1 17:46:00 2016 +0530
Committer: Nitiraj Rathore 
Committed: Thu Dec 1 17:46:00 2016 +0530

--
 .../src/main/resources/ui/app/app.js  | 14 +-
 .../pig/src/main/resources/ui/pig-web/app/app.js  | 14 +-
 2 files changed, 26 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7c07dd35/contrib/views/capacity-scheduler/src/main/resources/ui/app/app.js
--
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/app.js 
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/app.js
index fa1e05a..5854a09 100644
--- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/app.js
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/app.js
@@ -53,4 +53,16 @@ Ember.Application.initializer({
   }
 });
 
-module.exports = Em.Application.create();
+module.exports = Em.Application.create({
+  Resolver: Ember.DefaultResolver.extend({
+resolveTemplate: function(parsedName) {
+  var resolvedTemplate = this._super(parsedName);
+  var templateName = 'templates/' + 
parsedName.fullNameWithoutType.replace(/\./g, '/');
+  if (resolvedTemplate) {
+return resolvedTemplate;
+  } else {
+return Ember.TEMPLATES[templateName];
+  }
+}
+  })
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c07dd35/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js
--
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js 
b/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js
index 866b8a7..c683f72 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/app.js
@@ -35,5 +35,17 @@ module.exports = Em.Application.create({
 }
 var namespaceUrl = 'api/v1/views' + view + version + '/instances' + 
instance;
 return namespaceUrl;
-  }
+  },
+
+  Resolver: Ember.DefaultResolver.extend({
+resolveTemplate: function(parsedName) {
+  var resolvedTemplate = this._super(parsedName);
+  var templateName = 'templates/' + 
parsedName.fullNameWithoutType.replace(/\./g, '/');
+  if (resolvedTemplate) {
+return resolvedTemplate;
+  } else {
+return Ember.TEMPLATES[templateName];
+  }
+}
+  })
 });



[44/50] [abbrv] ambari git commit: AMBARI-19018 - Services should be able to specify their own resources subdirs for syncing to agents

2016-12-02 Thread ncole
AMBARI-19018 - Services should be able to specify their own resources subdirs 
for syncing to agents


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 232a9d87e72dfb87e0d25f6a4cba6738e27beb53
Parents: 60a6bd4
Author: Tim Thorpe 
Authored: Fri Dec 2 08:15:09 2016 -0800
Committer: Tim Thorpe 
Committed: Fri Dec 2 08:15:09 2016 -0800

--
 .../ambari_agent/CustomServiceOrchestrator.py   |   7 +-
 .../src/main/python/ambari_agent/FileCache.py   |  12 ++-
 .../TestCustomServiceOrchestrator.py|  30 +-
 .../test/python/ambari_agent/TestFileCache.py   |  10 +-
 .../ambari/server/agent/ExecutionCommand.java   |   1 +
 .../AmbariManagementControllerImpl.java |   9 ++
 .../ambari/server/state/ComponentInfo.java  |  14 +++
 .../python/ambari_server/serverConfiguration.py |  14 +--
 .../AMBARI_METRICS/0.1.0/metainfo.xml   |   1 +
 .../AmbariManagementControllerTest.java |   9 ++
 .../server/orm/InMemoryDefaultTestModule.java   |   5 +
 ambari-server/src/test/python/TestMpacks.py | 102 +--
 .../src/test/resources/dashboards/README.txt|  18 
 .../stacks/HDP/0.1/services/HDFS/metainfo.xml   |   1 +
 14 files changed, 150 insertions(+), 83 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/232a9d87/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 7d61611..11c8cbe 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -154,12 +154,7 @@ class CustomServiceOrchestrator():
 self.file_cache.get_host_scripts_base_dir(server_url_prefix)  
 hook_dir = self.file_cache.get_hook_base_dir(command, 
server_url_prefix)
 base_dir = self.file_cache.get_service_base_dir(command, 
server_url_prefix)
-from ActionQueue import ActionQueue  # To avoid cyclic dependency
-if self.COMMAND_TYPE in command and command[self.COMMAND_TYPE] == 
ActionQueue.EXECUTION_COMMAND:
-  logger.info("Found it - " + str(command[self.COMMAND_TYPE]) + " 
yeah")
-  # limiting to only EXECUTION_COMMANDs for now
-  # TODO need a design for limiting to specific role/component such as 
METRICS_GRAFANA
-  self.file_cache.get_dashboard_base_dir(server_url_prefix)
+self.file_cache.get_custom_resources_subdir(command, server_url_prefix)
 
 script_path = self.resolve_script_path(base_dir, script)
 script_tuple = (script_path, base_dir)

http://git-wip-us.apache.org/repos/asf/ambari/blob/232a9d87/ambari-agent/src/main/python/ambari_agent/FileCache.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/FileCache.py 
b/ambari-agent/src/main/python/ambari_agent/FileCache.py
index 83ac373..a9ea8f6 100644
--- a/ambari-agent/src/main/python/ambari_agent/FileCache.py
+++ b/ambari-agent/src/main/python/ambari_agent/FileCache.py
@@ -45,7 +45,6 @@ class FileCache():
   STACKS_CACHE_DIRECTORY="stacks"
   COMMON_SERVICES_DIRECTORY="common-services"
   CUSTOM_ACTIONS_CACHE_DIRECTORY="custom_actions"
-  DASHBOARD_DIRECTORY="dashboards"
   HOST_SCRIPTS_CACHE_DIRECTORY="host_scripts"
   HASH_SUM_FILE=".hash"
   ARCHIVE_NAME="archive.zip"
@@ -100,12 +99,17 @@ class FileCache():
   server_url_prefix)
 
 
-  def get_dashboard_base_dir(self, server_url_prefix):
+  def get_custom_resources_subdir(self, command, server_url_prefix):
 """
-Returns a base directory for dashboards
+Returns a custom directory which must be a subdirectory of the resources 
dir
 """
+try:
+  custom_dir = command['commandParams']['custom_folder']
+except KeyError:
+  return None
+
 return self.provide_directory(self.cache_dir,
-  self.DASHBOARD_DIRECTORY,
+  custom_dir,
   server_url_prefix)
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/232a9d87/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 

[50/50] [abbrv] ambari git commit: Merge branch 'trunk' into branch-dev-patch-upgrade

2016-12-02 Thread ncole
Merge branch 'trunk' into branch-dev-patch-upgrade


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 06327e65e9703830e003f3a6effdfe382e5c8de7
Parents: f70591b 05fe423
Author: Nate Cole 
Authored: Fri Dec 2 15:25:46 2016 -0500
Committer: Nate Cole 
Committed: Fri Dec 2 15:25:46 2016 -0500

--
 .../admin-web/app/scripts/services/Cluster.js   |   51 -
 .../app/scripts/services/RoleDetailsModal.js|   31 +-
 .../app/views/modals/RoleDetailsModal.html  |6 +-
 .../src/main/python/ambari_agent/ActionQueue.py |   21 +-
 .../ambari_agent/CustomServiceOrchestrator.py   |   11 +-
 .../src/main/python/ambari_agent/FileCache.py   |   12 +-
 .../test/python/ambari_agent/TestActionQueue.py |   48 +
 .../TestCustomServiceOrchestrator.py|   30 +-
 .../test/python/ambari_agent/TestFileCache.py   |   10 +-
 .../ambari_commons/ambari_metrics_helper.py |   45 +-
 .../simulate_perf_cluster_alert_behaviour.py|  108 ++
 .../libraries/script/script.py  |   15 +-
 .../ambari/logfeeder/mapper/MapperDateTest.java |   56 -
 .../logsearch/common/ExternalServerClient.java  |   12 +-
 .../ambari/logsearch/dao/SolrCollectionDao.java |   64 +-
 .../timeline/AbstractTimelineMetricsSink.java   |6 +-
 .../AbstractTimelineMetricSinkTest.java |   10 +-
 .../conf/unix/ambari-metrics-grafana|6 +-
 .../timeline/HadoopTimelineMetricsSink.java |4 +-
 .../timeline/HadoopTimelineMetricsSinkTest.java |6 +-
 .../src/main/python/core/config_reader.py   |9 +-
 .../src/test/python/core/TestEmitter.py |2 +-
 ambari-server/conf/unix/ambari.properties   |4 +-
 ambari-server/conf/windows/ambari.properties|2 +
 ambari-server/docs/configuration/index.md   |   33 +-
 .../ambari/server/agent/ExecutionCommand.java   |1 +
 .../ambari/server/agent/HeartBeatHandler.java   |2 +-
 .../ambari/server/agent/HeartbeatProcessor.java |2 +-
 .../server/checks/ServicePresenceCheck.java |   55 +-
 .../server/configuration/Configuration.java |   53 +
 .../AmbariManagementControllerImpl.java |9 +
 .../controller/internal/CalculatedStatus.java   |   52 +-
 .../internal/RequestResourceProvider.java   |   34 +-
 .../internal/StageResourceProvider.java |2 +-
 .../internal/UpgradeResourceProvider.java   |   24 +-
 .../orm/AmbariJpaLocalTxnInterceptor.java   |9 +-
 .../security/AbstractSecurityHeaderFilter.java  |   14 +
 .../AmbariServerSecurityHeaderFilter.java   |1 +
 .../AmbariViewsSecurityHeaderFilter.java|1 +
 .../kerberos/MITKerberosOperationHandler.java   |   22 +-
 .../ambari/server/state/ComponentInfo.java  |   14 +
 .../ambari/server/state/quicklinks/Link.java|   21 +
 .../services/RetryUpgradeActionService.java |2 +-
 .../stack/upgrade/ConfigurationCondition.java   |   72 +-
 .../server/upgrade/UpgradeCatalog211.java   |   24 +-
 .../server/upgrade/UpgradeCatalog250.java   |   58 +
 .../ambari/server/utils/RequestUtils.java   |   10 +
 .../ambari/server/utils/ShellCommandUtil.java   |   11 +-
 ambari-server/src/main/python/ambari-server.py  |   12 +-
 .../python/ambari_server/serverConfiguration.py |   14 +-
 .../main/python/ambari_server/serverUtils.py|   11 +
 .../src/main/python/ambari_server/utils.py  |   81 +-
 .../src/main/python/ambari_server_main.py   |   70 +-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   11 +-
 .../1.6.1.2.2.0/package/scripts/params.py   |2 +-
 .../AMBARI_METRICS/0.1.0/metainfo.xml   |1 +
 .../0.1.0/package/scripts/params.py |2 +-
 .../0.1.0/package/scripts/service_check.py  |2 +-
 .../package/scripts/metadata_server.py  |   18 +
 .../FLUME/1.4.0.2.0/package/scripts/params.py   |2 +-
 .../0.96.0.2.0/package/scripts/params_linux.py  |2 +-
 .../package/alerts/alert_metrics_deviation.py   |2 +-
 .../KAFKA/0.8.1/package/scripts/params.py   |2 +-
 .../RANGER/0.4.0/package/scripts/params.py  |   14 +
 .../0.4.0/package/scripts/setup_ranger_xml.py   |   21 +
 .../common-services/RANGER/0.6.0/metainfo.xml   |2 +
 .../STORM/0.9.1/package/scripts/params_linux.py |2 +-
 .../2.1.0.2.0/package/scripts/service_check.py  |   66 +-
 .../ZOOKEEPER/3.4.6/metainfo.xml|2 +-
 .../custom_actions/scripts/install_packages.py  |2 +-
 .../src/main/resources/scripts/stack_advisor.py |   11 +-
 .../HDP/2.0.6/configuration/cluster-env.xml |   10 +
 .../2.0.6/hooks/before-START/scripts/params.py  |2 +-
 

[06/50] [abbrv] ambari git commit: AMBARI-18962:Make check_package_condition in script.py overridable by services in stacks (dili)

2016-12-02 Thread ncole
AMBARI-18962:Make check_package_condition in script.py overridable by services 
in stacks (dili)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 10878592c2e2f5ac0412be8085c634d471f7358f
Parents: 9559a16
Author: Di Li 
Authored: Wed Nov 30 11:13:19 2016 -0500
Committer: Di Li 
Committed: Wed Nov 30 11:13:19 2016 -0500

--
 .../resource_management/libraries/script/script.py   | 15 +--
 .../custom_actions/scripts/install_packages.py   |  2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/10878592/ambari-common/src/main/python/resource_management/libraries/script/script.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/script/script.py 
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index f8df842..584775e 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -580,7 +580,7 @@ class Script(object):
   if isinstance(package_list_str, basestring) and len(package_list_str) > 
0:
 package_list = json.loads(package_list_str)
 for package in package_list:
-  if Script.check_package_condition(package):
+  if self.check_package_condition(package):
 name = self.format_package_name(package['name'])
 # HACK: On Windows, only install ambari-metrics packages using 
Choco Package Installer
 # TODO: Update this once choco packages for hadoop are created. 
This is because, service metainfo.xml support
@@ -604,22 +604,25 @@ class Script(object):
   str(config['hostLevelParams']['stack_version']))
   reload_windows_env()
   
-  @staticmethod
-  def check_package_condition(package):
-from resource_management.libraries.functions import package_conditions
+  def check_package_condition(self, package):
 condition = package['condition']
-name = package['name']
 
 if not condition:
   return True
 
+return self.should_install_package(package)
+
+  def should_install_package(self, package):
+from resource_management.libraries.functions import package_conditions
+condition = package['condition']
 try:
   chooser_method = getattr(package_conditions, condition)
 except AttributeError:
+  name = package['name']
   raise Fail("Condition with name '{0}', when installing package {1}. 
Please check package_conditions.py.".format(condition, name))
 
 return chooser_method()
-  
+
   @staticmethod
   def matches_any_regexp(string, regexp_list):
 for regex in regexp_list:

http://git-wip-us.apache.org/repos/asf/ambari/blob/10878592/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
--
diff --git 
a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py 
b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
index 0e31310..112abe3 100644
--- 
a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
+++ 
b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
@@ -460,7 +460,7 @@ class InstallPackages(Script):
 """
 filtered_package_list = []
 for package in package_list:
-  if Script.check_package_condition(package):
+  if self.check_package_condition(package):
 filtered_package_list.append(package)
 return filtered_package_list
 



[28/50] [abbrv] ambari git commit: AMBARI-18929. Yarn service check fails when either resource manager is down in HA enabled cluster (Weiwei Yang via alejandro)

2016-12-02 Thread ncole
AMBARI-18929. Yarn service check fails when either resource manager is down in 
HA enabled cluster (Weiwei Yang via alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 88e0c29e0617f05c0ecb72a75e74b2bb3def6bac
Parents: 6100be6
Author: Alejandro Fernandez 
Authored: Thu Dec 1 09:45:56 2016 -0800
Committer: Alejandro Fernandez 
Committed: Thu Dec 1 09:45:56 2016 -0800

--
 .../2.1.0.2.0/package/scripts/service_check.py  |  66 +++
 .../2.0.6/YARN/test_yarn_service_check.py   | 111 ++-
 2 files changed, 100 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/88e0c29e/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
index c0bd480..b934767 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
@@ -130,34 +130,56 @@ class ServiceCheckDefault(ServiceCheck):
   if "application" in item:
 application_name = item
 
-for rm_webapp_address in params.rm_webapp_addresses_list:
-  info_app_url = params.scheme + "://" + rm_webapp_address + 
"/ws/v1/cluster/apps/" + application_name
+# Find out the active RM from RM list
+# Raise an exception if the active rm cannot be determined
+active_rm_webapp_address = self.get_active_rm_webapp_address()
+Logger.info("Active Resource Manager web app address is : " + 
active_rm_webapp_address);
 
-  get_app_info_cmd = "curl --negotiate -u : -ks --location-trusted 
--connect-timeout " + CURL_CONNECTION_TIMEOUT + " " + info_app_url
+# Verify job state from active resource manager via rest api
+info_app_url = params.scheme + "://" + active_rm_webapp_address + 
"/ws/v1/cluster/apps/" + application_name
+get_app_info_cmd = "curl --negotiate -u : -ks --location-trusted 
--connect-timeout " + CURL_CONNECTION_TIMEOUT + " " + info_app_url
 
-  return_code, stdout, _ = get_user_call_output(get_app_info_cmd,
-user=params.smokeuser,
-
path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
-)
+return_code, stdout, _ = get_user_call_output(get_app_info_cmd,
+  user=params.smokeuser,
+  
path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
+  )
 
-  # Handle HDP<2.2.8.1 where RM doesn't do automatic redirection from 
standby to active
-  if stdout.startswith("This is standby RM. Redirecting to the current 
active RM:"):
-Logger.info(format("Skipped checking of {rm_webapp_address} since 
returned '{stdout}'"))
-continue
+try:
+  json_response = json.loads(stdout)
+except Exception as e:
+  raise Fail(format("Response from YARN API was not a valid JSON. 
Response: {stdout}"))
 
-  try:
-json_response = json.loads(stdout)
-  except Exception as e:
-raise Fail(format("Response from YARN API was not a valid JSON. 
Response: {stdout}"))
-  
-  if json_response is None or 'app' not in json_response or \
-  'state' not in json_response['app'] or 'finalStatus' not in 
json_response['app']:
-raise Fail("Application " + app_url + " returns invalid data.")
-
-  if json_response['app']['state'] != "FINISHED" or 
json_response['app']['finalStatus'] != "SUCCEEDED":
-raise Fail("Application " + app_url + " state/status is not valid. 
Should be FINISHED/SUCCEEDED.")
+if json_response is None or 'app' not in json_response or \
+'state' not in json_response['app'] or 'finalStatus' not in 
json_response['app']:
+  raise Fail("Application " + app_url + " returns invalid data.")
 
+if json_response['app']['state'] != "FINISHED" or 
json_response['app']['finalStatus'] != "SUCCEEDED":
+  raise Fail("Application " + app_url + " state/status is not valid. 
Should be FINISHED/SUCCEEDED.")
 
+  def get_active_rm_webapp_address(self):
+import params
+

ambari git commit: AMBARI-19060. Update the HiveServer config values if Security Authorization chosen is None.

2016-12-02 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-18901 1b90011eb -> 548d4570a


AMBARI-19060. Update the HiveServer config values if Security Authorization 
chosen is None.


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 548d4570a5e5661e3ee4a9a8f9db526a271ec522
Parents: 1b90011
Author: Swapan Shridhar 
Authored: Thu Dec 1 16:46:31 2016 -0800
Committer: Swapan Shridhar 
Committed: Thu Dec 1 16:46:31 2016 -0800

--
 .../stacks/HDP/2.2/services/stack_advisor.py | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/548d4570/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 4854514..8187da8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -300,6 +300,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 putWebhcatSiteProperty = self.putProperty(configurations, "webhcat-site", 
services)
 putHiveSitePropertyAttribute = self.putPropertyAttribute(configurations, 
"hive-site")
 putHiveEnvPropertyAttributes = self.putPropertyAttribute(configurations, 
"hive-env")
+putHiveServerPropertyAttributes = 
self.putPropertyAttribute(configurations, "hiveserver2-site")
 servicesList = [service["StackServices"]["service_name"] for service in 
services["services"]]
 
 #  Storage
@@ -520,7 +521,8 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
   putHiveServerProperty("hive.security.authorization.enabled", "true")
   putHiveServerProperty("hive.security.authorization.manager", 
"org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory")
   putHiveServerProperty("hive.security.authenticator.manager", 
"org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator")
-  putHiveServerProperty("hive.conf.restricted.list", 
"hive.security.authenticator.manager,hive.security.authorization.manager,hive.users.in.admin.role")
+  putHiveServerProperty("hive.conf.restricted.list", 
"hive.security.authenticator.manager,hive.security.authorization.manager,hive.security.metastore.authorization.manager,"
+ 
"hive.security.metastore.authenticator.manager,hive.users.in.admin.role,hive.server2.xsrf.filter.enabled,hive.security.authorization.enabled")
   putHiveSiteProperty("hive.security.authorization.manager", 
"org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdConfOnlyAuthorizerFactory")
   if sqlstdauth_class not in auth_manager_values:
 auth_manager_values.append(sqlstdauth_class)
@@ -536,7 +538,16 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
   putHiveServerProperty("hive.security.authorization.enabled", "true")
   putHiveServerProperty("hive.security.authorization.manager", 
"com.xasecure.authorization.hive.authorizer.XaSecureHiveAuthorizerFactory")
   putHiveServerProperty("hive.security.authenticator.manager", 
"org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator")
-  putHiveServerProperty("hive.conf.restricted.list", 
"hive.security.authorization.enabled,hive.security.authorization.manager,hive.security.authenticator.manager")
+  putHiveServerProperty("hive.conf.restricted.list", 
"hive.security.authenticator.manager,hive.security.authorization.manager,hive.security.metastore.authorization.manager,"
+ 
"hive.security.metastore.authenticator.manager,hive.users.in.admin.role,hive.server2.xsrf.filter.enabled,hive.security.authorization.enabled")
+
+# hive_security_authorization == 'None'
+if 
str(configurations["hive-env"]["properties"]["hive_security_authorization"]).lower()
 == "None":
+  putHiveSiteProperty("hive.server2.enable.doAs", "true")
+  putHiveServerProperty("hive.security.authorization.enabled", "false")
+  putHiveServerPropertyAttributes("hive.security.authorization.manager", 
'delete', 'true')
+  putHiveServerPropertyAttributes("hive.security.authenticator.manager", 
'delete', 'true')
+  putHiveServerPropertyAttributes("hive.conf.restricted.list", 'delete', 
'true')
 
 

ambari git commit: AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via ncole)

2016-12-02 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/trunk def3b0ae8 -> 05fe42351


AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via 
ncole)


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

Branch: refs/heads/trunk
Commit: 05fe42351131f77a6ee5d58da355b1c461562046
Parents: def3b0a
Author: Nate Cole 
Authored: Fri Dec 2 13:23:36 2016 -0500
Committer: Nate Cole 
Committed: Fri Dec 2 13:23:36 2016 -0500

--
 .../main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/05fe4235/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
index 525078e..cbb5ba2 100644
--- 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
@@ -35,7 +35,7 @@
   
 
 
-  ubuntu12
+  ubuntu12,ubuntu14,ubuntu16
   
 
   zookeeper-${stack_version}



ambari git commit: AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via ncole)

2016-12-02 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 72a348c37 -> 8f0a0ae41


AMBARI-19020. Ubuntu14/16 Add Support for Zookeeper on HDP 2.5 (Duc Le via 
ncole)


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

Branch: refs/heads/branch-2.5
Commit: 8f0a0ae41270c231b1b62df7e20071b5372b8036
Parents: 72a348c
Author: Nate Cole 
Authored: Fri Dec 2 13:23:36 2016 -0500
Committer: Nate Cole 
Committed: Fri Dec 2 13:25:12 2016 -0500

--
 .../main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f0a0ae4/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
index 525078e..cbb5ba2 100644
--- 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.6/metainfo.xml
@@ -35,7 +35,7 @@
   
 
 
-  ubuntu12
+  ubuntu12,ubuntu14,ubuntu16
   
 
   zookeeper-${stack_version}



ambari git commit: AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal content (alexantonenko)

2016-12-02 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 9348725b1 -> def3b0ae8


AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal 
content (alexantonenko)


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

Branch: refs/heads/trunk
Commit: def3b0ae85b968c7dd41307f4c671bf07d4fc826
Parents: 9348725
Author: Alex Antonenko 
Authored: Fri Dec 2 15:18:46 2016 +0200
Committer: Alex Antonenko 
Committed: Fri Dec 2 20:13:17 2016 +0200

--
 .../controllers/main/service/info/summary.js| 37 +++-
 .../main/service/info/service_alert_popup.hbs   | 15 +---
 2 files changed, 31 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/def3b0ae/ambari-web/app/controllers/main/service/info/summary.js
--
diff --git a/ambari-web/app/controllers/main/service/info/summary.js 
b/ambari-web/app/controllers/main/service/info/summary.js
index 88a6581..fc423fe 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -386,25 +386,30 @@ App.MainServiceInfoSummaryController = 
Em.Controller.extend(App.WidgetSectionMix
   var property = context.get('componentName') ? 'componentName' : 
'serviceName';
   var serviceDefinitions = 
this.get('controller.content').filterProperty(property, context.get(property));
   // definitions should be sorted in order: critical, warning, ok, 
unknown, other
-  var criticalDefinitions = [], warningDefinitions = [], okDefinitions 
= [], unknownDefinitions = [];
+  var definitionTypes = {
+"isCritical": [],
+"isWarning": [],
+"isOK": [],
+"isUnknown": []
+  };
+
   serviceDefinitions.forEach(function (definition) {
-if (definition.get('isCritical')) {
-  criticalDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isWarning')) {
-  warningDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isOK')) {
-  okDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-} else if (definition.get('isUnknown')) {
-  unknownDefinitions.push(definition);
-  serviceDefinitions = serviceDefinitions.without(definition);
-}
+Object.keys(definitionTypes).forEach(function (type) {
+  if (definition.get(type)) {
+definition.set('isCollapsed', true);
+definitionTypes[type].push(definition);
+serviceDefinitions = serviceDefinitions.without(definition);
+  }
+});
   });
-  serviceDefinitions = criticalDefinitions.concat(warningDefinitions, 
okDefinitions, unknownDefinitions, serviceDefinitions);
+  serviceDefinitions = 
definitionTypes.isCritical.concat(definitionTypes.isWarning, 
definitionTypes.isOK, definitionTypes.isUnknown, serviceDefinitions);
+
   return serviceDefinitions;
 }.property('controller.content'),
+onToggleBlock: function (alert) {
+  this.$('#' + alert.context.clientId).toggle('blind', 500);
+  alert.context.set("isCollapsed", !alert.context.get("isCollapsed"));
+},
 gotoAlertDetails: function (event) {
   if (event && event.context) {
 this.get('parentView').hide();
@@ -856,4 +861,4 @@ App.MainServiceInfoSummaryController = 
Em.Controller.extend(App.WidgetSectionMix
 App.router.route('main' + event.context.href);
   }
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/def3b0ae/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
--
diff --git a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs 
b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
index 3c132a3..8b72a50 100644
--- a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
+++ b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
@@ -22,11 +22,16 @@
   
 
   
-
-  {{alert.label}}
-
-
-  {{alert.latestText}}
+
+  
+
+   

[1/2] ambari git commit: AMBARI-19064 Refactor widgets on Dashboard page. (atkach)

2016-12-02 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk 7eb2eaa73 -> 9348725b1


http://git-wip-us.apache.org/repos/asf/ambari/blob/9348725b/ambari-web/test/views/main/dashboard/widget_test.js
--
diff --git a/ambari-web/test/views/main/dashboard/widget_test.js 
b/ambari-web/test/views/main/dashboard/widget_test.js
index 0544ff6..63da712 100644
--- a/ambari-web/test/views/main/dashboard/widget_test.js
+++ b/ambari-web/test/views/main/dashboard/widget_test.js
@@ -21,178 +21,84 @@ require('views/main/dashboard/widget');
 
 describe('App.DashboardWidgetView', function () {
 
-  var dashboardWidgetView = App.DashboardWidgetView.create({
+  var dashboardWidgetView;
+
+  dashboardWidgetView = App.DashboardWidgetView.create({
 parentView: Em.Object.create({
   widgetsMapper: Em.K,
-  getUserPref: function () {return {complete: Em.K}},
+  getUserPref: function () {
+return {complete: Em.K}
+  },
   postUserPref: Em.K,
   translateToReal: Em.K,
   visibleWidgets: [],
   hiddenWidgets: []
+}),
+widget: Em.Object.create({
+  id: 5,
+  sourceName: 'HDFS',
+  title: 'Widget'
 })
   });
 
   describe('#viewID', function () {
 it('viewID is computed with id', function () {
-  dashboardWidgetView.set('id', 5);
   expect(dashboardWidgetView.get('viewID')).to.equal('widget-5');
 });
   });
 
   describe('#model', function () {
-it('model_type is null', function () {
-  dashboardWidgetView.set('model_type', null);
+
+beforeEach(function() {
+  sinon.stub(dashboardWidgetView, 
'findModelBySource').returns(Em.Object.create({serviceName: 'HDFS'}));
+});
+
+afterEach(function() {
+  dashboardWidgetView.findModelBySource.restore();
+});
+
+it('sourceName is null', function () {
+  dashboardWidgetView.set('widget.sourceName', null);
   dashboardWidgetView.propertyDidChange('model');
-  expect(dashboardWidgetView.get('model')).to.eql({});
+  expect(dashboardWidgetView.get('model')).to.be.an.object;
 });
-it('model_type is valid', function () {
-  dashboardWidgetView.set('model_type', 's');
+it('sourceName is valid', function () {
+  dashboardWidgetView.set('widget.sourceName', 'HDFS');
   dashboardWidgetView.propertyDidChange('model');
-  dashboardWidgetView.set('parentView.s_model', {'s': {}});
-  expect(dashboardWidgetView.get('model')).to.eql({'s': {}});
+  
expect(dashboardWidgetView.get('model')).to.eql(Em.Object.create({serviceName: 
'HDFS'}));
 });
   });
 
   describe("#didInsertElement()", function () {
-before(function () {
+
+beforeEach(function () {
   sinon.stub(App, 'tooltip', Em.K);
 });
-after(function () {
+afterEach(function () {
   App.tooltip.restore();
 });
+
 it("call App.tooltip", function () {
   dashboardWidgetView.didInsertElement();
   expect(App.tooltip.calledOnce).to.be.true;
 });
   });
 
-  describe("#deleteWidget()", function () {
-beforeEach(function () {
-  sinon.stub(dashboardWidgetView.get('parentView'), 
'widgetsMapper').returns({});
-  sinon.stub(dashboardWidgetView.get('parentView'), 
'getUserPref').returns({
-complete: Em.K
-  });
-});
-
-afterEach(function () {
-  dashboardWidgetView.get('parentView').widgetsMapper.restore();
-  dashboardWidgetView.get('parentView').getUserPref.restore();
-});
-
-it("testMode is off", function () {
-  dashboardWidgetView.set('parentView.persistKey', 'key');
-  dashboardWidgetView.deleteWidget();
-  
expect(dashboardWidgetView.get('parentView').getUserPref.calledWith('key')).to.be.true;
-});
-  });
+  describe("#editWidget()", function () {
 
-  describe("#deleteWidgetComplete()", function () {
 beforeEach(function () {
-  sinon.spy(dashboardWidgetView.get('parentView'), 'postUserPref');
-  sinon.spy(dashboardWidgetView.get('parentView'), 'translateToReal');
-  dashboardWidgetView.set('parentView.currentPrefObject', {
-dashboardVersion: 'new',
-visible: ['1', '2'],
-hidden: [],
-threshold: 'threshold'
-  });
-  dashboardWidgetView.set('parentView.persistKey', 'key');
-  dashboardWidgetView.deleteWidgetComplete();
-});
-afterEach(function () {
-  dashboardWidgetView.get('parentView').postUserPref.restore();
-  dashboardWidgetView.get('parentView').translateToReal.restore();
-});
-it("postUserPref is called with correct data", function () {
-  var arg = 
JSON.parse(JSON.stringify(dashboardWidgetView.get('parentView').postUserPref.args[0][1]));
-  expect(arg).to.be.eql({
-dashboardVersion: 'new',
-visible: ['1', '2'],
-hidden: [[5, null]],
-threshold: 'threshold'
-  });
-});
-it("translateToReal is called with valid data", function () {
-  var arg = 

[2/2] ambari git commit: AMBARI-19064 Refactor widgets on Dashboard page. (atkach)

2016-12-02 Thread atkach
AMBARI-19064 Refactor widgets on Dashboard page. (atkach)


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

Branch: refs/heads/trunk
Commit: 9348725b1067fab38907c8eebc172978729394ad
Parents: 7eb2eaa
Author: Andrii Tkach 
Authored: Fri Dec 2 19:27:20 2016 +0200
Committer: Andrii Tkach 
Committed: Fri Dec 2 19:27:20 2016 +0200

--
 .../mixins/main/dashboard/widgets/editable.js   |  47 +-
 .../main/dashboard/edit_widget_popup.hbs|   4 +-
 .../edit_widget_popup_single_threshold.hbs  |   2 +-
 .../main/dashboard/plus_button_filter.hbs   |   2 +-
 .../app/templates/main/dashboard/widgets.hbs|   8 +-
 .../main/dashboard/widgets/pie_chart.hbs|   5 +-
 .../app/views/common/not-scrollable-textarea.js |   2 +-
 ambari-web/app/views/main/dashboard/widget.js   | 159 ++--
 ambari-web/app/views/main/dashboard/widgets.js  | 824 +--
 .../main/dashboard/widgets/datanode_live.js |   7 -
 .../main/dashboard/widgets/flume_agent_live.js  |   7 -
 .../main/dashboard/widgets/hawqsegment_live.js  |   7 -
 .../dashboard/widgets/hbase_average_load.js |  11 +-
 .../views/main/dashboard/widgets/hbase_links.js |   4 -
 .../main/dashboard/widgets/hbase_master_heap.js |   4 -
 .../dashboard/widgets/hbase_master_uptime.js|   5 -
 .../widgets/hbase_regions_in_transition.js  |  10 +-
 .../main/dashboard/widgets/hdfs_capacity.js |   4 -
 .../views/main/dashboard/widgets/hdfs_links.js  |   4 -
 .../views/main/dashboard/widgets/metrics_cpu.js |   3 -
 .../main/dashboard/widgets/metrics_load.js  |   3 -
 .../main/dashboard/widgets/metrics_memory.js|   3 -
 .../main/dashboard/widgets/metrics_network.js   |   3 -
 .../main/dashboard/widgets/namenode_cpu.js  |   4 -
 .../main/dashboard/widgets/namenode_heap.js |   4 -
 .../main/dashboard/widgets/namenode_rpc.js  |  10 +-
 .../main/dashboard/widgets/namenode_uptime.js   |   5 -
 .../dashboard/widgets/node_managers_live.js |   7 -
 .../main/dashboard/widgets/pie_chart_widget.js  |  16 +-
 .../views/main/dashboard/widgets/pxf_live.js|   6 -
 .../dashboard/widgets/resource_manager_heap.js  |   4 -
 .../widgets/resource_manager_uptime.js  |   5 -
 .../main/dashboard/widgets/supervisor_live.js   |   7 -
 .../views/main/dashboard/widgets/text_widget.js |   4 +-
 .../widgets/text_widget_single_threshold.js |   6 +-
 .../dashboard/widgets/uptime_text_widget.js |   2 -
 .../views/main/dashboard/widgets/yarn_links.js  |   4 -
 .../views/main/dashboard/widgets/yarn_memory.js |   4 -
 .../test/views/main/dashboard/widget_test.js| 200 ++---
 .../widgets/hbase_average_load_test.js  |   4 +-
 .../widgets/hbase_regions_in_transition_test.js |   6 +-
 .../main/dashboard/widgets/namenode_rpc_test.js |  13 +-
 .../text_widget_single_threshold_test.js|  10 +-
 .../main/dashboard/widgets/text_widget_test.js  |  10 +-
 .../widgets/uptime_text_widget_test.js  |   2 +-
 .../test/views/main/dashboard/widgets_test.js   | 669 ++-
 46 files changed, 813 insertions(+), 1317 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9348725b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
--
diff --git a/ambari-web/app/mixins/main/dashboard/widgets/editable.js 
b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
index f330ec3..3206229 100644
--- a/ambari-web/app/mixins/main/dashboard/widgets/editable.js
+++ b/ambari-web/app/mixins/main/dashboard/widgets/editable.js
@@ -23,24 +23,24 @@ App.EditableWidgetMixin = Em.Mixin.create({
   hintInfo: '',
 
   editWidget: function () {
-var parent = this;
+var self = this;
 var configObj = Ember.Object.create({
-  thresh1: parent.get('thresh1') + '',
-  thresh2: parent.get('thresh2') + '',
-  hintInfo: parent.get('hintInfo'),
+  thresholdMin: self.get('thresholdMin') + '',
+  thresholdMax: self.get('thresholdMax') + '',
+  hintInfo: self.get('hintInfo'),
   isThresh1Error: false,
   isThresh2Error: false,
   errorMessage1: "",
   errorMessage2: "",
   maxValue: 'infinity',
   observeNewThresholdValue: function () {
-var thresh1 = this.get('thresh1');
-var thresh2 = this.get('thresh2');
-if (thresh1.trim() !== "") {
-  if (isNaN(thresh1) || thresh1 < 0) {
+var thresholdMin = this.get('thresholdMin');
+var thresholdMax = this.get('thresholdMax');
+if (thresholdMin.trim() !== "") {
+  if (isNaN(thresholdMin) || thresholdMin < 0) {
 

  1   2   >