ambari git commit: AMBARI-15238. Deploying AMS datasource and default dashboards sometimes fails during cluster install. (swagle)

2016-02-29 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk a323c387f -> d68235871


AMBARI-15238. Deploying AMS datasource and default dashboards sometimes fails 
during cluster install. (swagle)


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

Branch: refs/heads/trunk
Commit: d68235871267ab6ff836c2a1e9ec7a810fa59e70
Parents: a323c38
Author: Siddharth Wagle 
Authored: Mon Feb 29 18:07:29 2016 -0800
Committer: Siddharth Wagle 
Committed: Mon Feb 29 18:07:29 2016 -0800

--
 .../package/scripts/metrics_grafana_util.py | 40 +---
 1 file changed, 27 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6823587/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
index eb0b691..593591c 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
@@ -30,7 +30,7 @@ import ambari_simplejson as json
 import network
 
 GRAFANA_CONNECT_TRIES = 5
-GRAFANA_CONNECT_TIMEOUT = 15
+GRAFANA_CONNECT_TIMEOUT = 10
 GRAFANA_SEARCH_BULTIN_DASHBOARDS = "/api/search?tag=builtin"
 GRAFANA_DATASOURCE_URL = "/api/datasources"
 GRAFANA_DASHBOARDS_URL = "/api/dashboards/db"
@@ -40,19 +40,31 @@ Server = namedtuple('Server', [ 'protocol', 'host', 'port', 
'user', 'password' ]
 
 def perform_grafana_get_call(url, server):
   grafana_https_enabled = server.protocol.lower() == 'https'
+  response = None
 
-  conn = network.get_http_connection(server.host,
- int(server.port),
- grafana_https_enabled)
+  for i in xrange(0, GRAFANA_CONNECT_TRIES):
+try:
+  conn = network.get_http_connection(server.host,
+ int(server.port),
+ grafana_https_enabled)
 
-  userAndPass = b64encode('{0}:{1}'.format(server.user, server.password))
-  headers = { 'Authorization' : 'Basic %s' %  userAndPass }
+  userAndPass = b64encode('{0}:{1}'.format(server.user, server.password))
+  headers = { 'Authorization' : 'Basic %s' %  userAndPass }
 
-  Logger.info("Connecting (GET) to %s:%s%s" % (server.host, server.port, url))
+  Logger.info("Connecting (GET) to %s:%s%s" % (server.host, server.port, 
url))
 
-  conn.request("GET", url, headers = headers)
-  response = conn.getresponse()
-  Logger.info("Http response: %s %s" % (response.status, response.reason))
+  conn.request("GET", url, headers = headers)
+  response = conn.getresponse()
+  Logger.info("Http response: %s %s" % (response.status, response.reason))
+except (httplib.HTTPException, socket.error) as ex:
+  if i < GRAFANA_CONNECT_TRIES - 1:
+time.sleep(GRAFANA_CONNECT_TIMEOUT)
+Logger.info("Connection to Grafana failed. Next retry in %s seconds."
+% (GRAFANA_CONNECT_TIMEOUT))
+continue
+  else:
+raise Fail("Ambari Metrics Grafana update failed due to: %s" % str(ex))
+  pass
 
   return response
 
@@ -80,7 +92,8 @@ def perform_grafana_put_call(url, id, payload, server):
 % (GRAFANA_CONNECT_TIMEOUT))
 continue
   else:
-raise Fail("Ambari Metrics Grafana update failed")
+raise Fail("Ambari Metrics Grafana update failed due to: %s" % str(ex))
+  pass
 
   return (response, data)
 
@@ -115,7 +128,8 @@ def perform_grafana_post_call(url, payload, server):
 % (GRAFANA_CONNECT_TIMEOUT))
 continue
   else:
-raise Fail("Ambari Metrics Grafana create failed.")
+raise Fail("Ambari Metrics Grafana update failed due to: %s" % str(ex))
+  pass
 
   return (response, data)
 
@@ -153,7 +167,7 @@ def create_ams_datasource():
   response = perform_grafana_get_call(GRAFANA_DATASOURCE_URL, server)
   create_datasource = True
 
-  if response.status == 200:
+  if response and response.status == 200:
 datasources = response.read()
 datasources_json = json.loads(datasources)
 for i in xrange(0, len(datasources_json)):



ambari git commit: AMBARI-15238. Deploying AMS datasource and default dashboards sometimes fails during cluster install. (swagle)

2016-02-29 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 f3051f953 -> e23b6e178


AMBARI-15238. Deploying AMS datasource and default dashboards sometimes fails 
during cluster install. (swagle)


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

Branch: refs/heads/branch-2.2
Commit: e23b6e178b662132018dc99bdee493635527c9e8
Parents: f3051f9
Author: Siddharth Wagle 
Authored: Mon Feb 29 18:06:51 2016 -0800
Committer: Siddharth Wagle 
Committed: Mon Feb 29 18:06:51 2016 -0800

--
 .../package/scripts/metrics_grafana_util.py | 40 +---
 1 file changed, 27 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e23b6e17/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
index eb0b691..593591c 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
@@ -30,7 +30,7 @@ import ambari_simplejson as json
 import network
 
 GRAFANA_CONNECT_TRIES = 5
-GRAFANA_CONNECT_TIMEOUT = 15
+GRAFANA_CONNECT_TIMEOUT = 10
 GRAFANA_SEARCH_BULTIN_DASHBOARDS = "/api/search?tag=builtin"
 GRAFANA_DATASOURCE_URL = "/api/datasources"
 GRAFANA_DASHBOARDS_URL = "/api/dashboards/db"
@@ -40,19 +40,31 @@ Server = namedtuple('Server', [ 'protocol', 'host', 'port', 
'user', 'password' ]
 
 def perform_grafana_get_call(url, server):
   grafana_https_enabled = server.protocol.lower() == 'https'
+  response = None
 
-  conn = network.get_http_connection(server.host,
- int(server.port),
- grafana_https_enabled)
+  for i in xrange(0, GRAFANA_CONNECT_TRIES):
+try:
+  conn = network.get_http_connection(server.host,
+ int(server.port),
+ grafana_https_enabled)
 
-  userAndPass = b64encode('{0}:{1}'.format(server.user, server.password))
-  headers = { 'Authorization' : 'Basic %s' %  userAndPass }
+  userAndPass = b64encode('{0}:{1}'.format(server.user, server.password))
+  headers = { 'Authorization' : 'Basic %s' %  userAndPass }
 
-  Logger.info("Connecting (GET) to %s:%s%s" % (server.host, server.port, url))
+  Logger.info("Connecting (GET) to %s:%s%s" % (server.host, server.port, 
url))
 
-  conn.request("GET", url, headers = headers)
-  response = conn.getresponse()
-  Logger.info("Http response: %s %s" % (response.status, response.reason))
+  conn.request("GET", url, headers = headers)
+  response = conn.getresponse()
+  Logger.info("Http response: %s %s" % (response.status, response.reason))
+except (httplib.HTTPException, socket.error) as ex:
+  if i < GRAFANA_CONNECT_TRIES - 1:
+time.sleep(GRAFANA_CONNECT_TIMEOUT)
+Logger.info("Connection to Grafana failed. Next retry in %s seconds."
+% (GRAFANA_CONNECT_TIMEOUT))
+continue
+  else:
+raise Fail("Ambari Metrics Grafana update failed due to: %s" % str(ex))
+  pass
 
   return response
 
@@ -80,7 +92,8 @@ def perform_grafana_put_call(url, id, payload, server):
 % (GRAFANA_CONNECT_TIMEOUT))
 continue
   else:
-raise Fail("Ambari Metrics Grafana update failed")
+raise Fail("Ambari Metrics Grafana update failed due to: %s" % str(ex))
+  pass
 
   return (response, data)
 
@@ -115,7 +128,8 @@ def perform_grafana_post_call(url, payload, server):
 % (GRAFANA_CONNECT_TIMEOUT))
 continue
   else:
-raise Fail("Ambari Metrics Grafana create failed.")
+raise Fail("Ambari Metrics Grafana update failed due to: %s" % str(ex))
+  pass
 
   return (response, data)
 
@@ -153,7 +167,7 @@ def create_ams_datasource():
   response = perform_grafana_get_call(GRAFANA_DATASOURCE_URL, server)
   create_datasource = True
 
-  if response.status == 200:
+  if response and response.status == 200:
 datasources = response.read()
 datasources_json = json.loads(datasources)
 for i in xrange(0, len(datasources_json)):



ambari git commit: AMBARI-15189: Set dfs.allow.truncate = True on HDFS during HAWQ install or add service (lavjain via jaoki)

2016-02-29 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/trunk ee6929be8 -> a323c387f


AMBARI-15189: Set dfs.allow.truncate = True on HDFS during HAWQ install or add 
service (lavjain via jaoki)


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

Branch: refs/heads/trunk
Commit: a323c387f37b669e9cd7963f1535680abf20f8c2
Parents: ee6929b
Author: Jun Aoki 
Authored: Mon Feb 29 17:42:45 2016 -0800
Committer: Jun Aoki 
Committed: Mon Feb 29 17:42:45 2016 -0800

--
 .../stacks/HDP/2.3/services/stack_advisor.py|  5 +
 .../stacks/2.3/common/test_stack_advisor.py | 20 
 2 files changed, 25 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a323c387/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index 11adca5..ae7c36e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -363,6 +363,11 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
 putHdfsSiteProperty = self.putProperty(configurations, "hdfs-site", 
services)
 putHdfsSitePropertyAttribute = self.putPropertyAttribute(configurations, 
"hdfs-site")
 
+servicesList = [service["StackServices"]["service_name"] for service in 
services["services"]]
+if "HAWQ" in servicesList:
+  # Set dfs.allow.truncate to true
+  putHdfsSiteProperty('dfs.allow.truncate', 'true')
+
 if ('ranger-hdfs-plugin-properties' in services['configurations']) and 
('ranger-hdfs-plugin-enabled' in 
services['configurations']['ranger-hdfs-plugin-properties']['properties']):
   rangerPluginEnabled = ''
   if 'ranger-hdfs-plugin-properties' in configurations and 
'ranger-hdfs-plugin-enabled' in  
configurations['ranger-hdfs-plugin-properties']['properties']:

http://git-wip-us.apache.org/repos/asf/ambari/blob/a323c387/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py 
b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index 690c053..8932bde 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -595,6 +595,26 @@ class TestHDP23StackAdvisor(TestCase):
 self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
 
self.assertEquals(configurations['hdfs-site']['properties']['dfs.namenode.inode.attributes.provider.class'],
 'org.apache.ranger.authorization.hadoop.RangerHdfsAuthorizer', "Test with 
Ranger HDFS plugin is enabled")
 
+# Test 1 for dfs.allow.truncate with no HAWQ and dfs.allow.truncate not set
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+self.assertTrue('dfs.allow.truncate' not in 
configurations['hdfs-site']['properties'])
+
+# Test 2 for dfs.allow.truncate with HAWQ and dfs.allow.truncate not set
+services["services"].append({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'true')
+
+# Test 3 for dfs.allow.truncate with no HAWQ and dfs.allow.truncate set to 
false
+services["services"].remove({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
+configurations['hdfs-site']['properties']['dfs.allow.truncate'] = 'false'
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'false')
+
+# Test 4 for dfs.allow.truncate with HAWQ and dfs.allow.truncate set to 
false
+services["services"].append({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'true')
+
   def test_recommendYARNConfigurations(self):
 configurations = {}
 servicesList = ["YARN"]



ambari git commit: AMBARI-15237. Create Grafana user through Ambari and add user to Grafana. (avijayan, swagle via swagle)

2016-02-29 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 93bdd5eeb -> ee6929be8


AMBARI-15237. Create Grafana user through Ambari and add user to Grafana. 
(avijayan, swagle via swagle)


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

Branch: refs/heads/trunk
Commit: ee6929be8a06a1db7c45b9523f7e195dd34eab4b
Parents: 93bdd5e
Author: Siddharth Wagle 
Authored: Mon Feb 29 17:41:34 2016 -0800
Committer: Siddharth Wagle 
Committed: Mon Feb 29 17:41:34 2016 -0800

--
 .../conf/unix/ams-grafana.ini   |  6 +--
 .../0.1.0/configuration/ams-grafana-env.xml | 28 +
 .../0.1.0/configuration/ams-grafana-ini.xml |  4 +-
 .../package/scripts/metrics_grafana_util.py | 43 +---
 .../0.1.0/package/scripts/params.py |  2 +
 .../AMBARI_METRICS/test_metrics_grafana.py  |  4 +-
 .../python/stacks/2.0.6/configs/default.json|  4 +-
 ambari-web/app/data/HDP2/site_properties.js | 14 +++
 8 files changed, 83 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ee6929be/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini
--
diff --git a/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini 
b/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini
index c0ccf1a..78f30b5 100644
--- a/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini
+++ b/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini
@@ -145,13 +145,13 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
  Anonymous Auth ##
 [auth.anonymous]
 # enable anonymous access
-enabled = true
+;enabled = true
 
 # specify organization name that should be used for unauthenticated users
-org_name = Main Org.
+;org_name = Main Org.
 
 # specify role for unauthenticated users
-org_role = Admin
+;org_role = Admin
 
  Github Auth ##
 [auth.github]

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee6929be/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
index de32ead..f15cd20 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
@@ -38,6 +38,34 @@
 Metrics Grafana data directory.
   
   
+metrics_grafana_username
+admin
+Metrics Grafana Admin Username
+
+  Metrics Grafana Username. This value cannot be modified by Ambari
+  except on initial install. Please make sure the username change in
+  Grafana is reflected in Ambari.
+
+
+  db_user
+  false
+
+  
+  
+metrics_grafana_password
+ 
+PASSWORD
+Metrics Grafana Admin Password
+
+  Metrics Grafana password. This value cannot be modified by Ambari
+  except on initial install. Please make sure the password change in
+  Grafana is reflected back in Ambari.
+
+
+  false
+
+  
+  
 content
 
 # Set environment variables here.

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee6929be/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
index 0a1ff32..3a0e86b 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
@@ -153,10 +153,10 @@ cert_key = {{ams_grafana_cert_key}}
  Security 

 [security]
 # default admin user, created on startup
-;admin_user = admin
+admin_user = {{ams_grafana_admin_user}}
 
 # default admin password, can be changed before first start of grafana,  or in 
profile 

ambari git commit: AMBARI-15189: Set dfs.allow.truncate = True on HDFS during HAWQ install or add service (lavjain via jaoki)

2016-02-29 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 fbbc855d3 -> f3051f953


AMBARI-15189: Set dfs.allow.truncate = True on HDFS during HAWQ install or add 
service (lavjain via jaoki)


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

Branch: refs/heads/branch-2.2
Commit: f3051f953f4cad56c9e8b8c162038f2f75a5a00e
Parents: fbbc855
Author: Jun Aoki 
Authored: Mon Feb 29 17:41:31 2016 -0800
Committer: Jun Aoki 
Committed: Mon Feb 29 17:41:31 2016 -0800

--
 .../stacks/HDP/2.3/services/stack_advisor.py|  5 +
 .../stacks/2.3/common/test_stack_advisor.py | 20 
 2 files changed, 25 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f3051f95/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index 0b4e543..1382697 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -364,6 +364,11 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
 putHdfsSiteProperty = self.putProperty(configurations, "hdfs-site", 
services)
 putHdfsSitePropertyAttribute = self.putPropertyAttribute(configurations, 
"hdfs-site")
 
+servicesList = [service["StackServices"]["service_name"] for service in 
services["services"]]
+if "HAWQ" in servicesList:
+  # Set dfs.allow.truncate to true
+  putHdfsSiteProperty('dfs.allow.truncate', 'true')
+
 if ('ranger-hdfs-plugin-properties' in services['configurations']) and 
('ranger-hdfs-plugin-enabled' in 
services['configurations']['ranger-hdfs-plugin-properties']['properties']):
   rangerPluginEnabled = ''
   if 'ranger-hdfs-plugin-properties' in configurations and 
'ranger-hdfs-plugin-enabled' in  
configurations['ranger-hdfs-plugin-properties']['properties']:

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3051f95/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py 
b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index 1968c4b..316d172 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -583,6 +583,26 @@ class TestHDP23StackAdvisor(TestCase):
 self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, None)
 
self.assertEquals(configurations['hdfs-site']['properties']['dfs.namenode.inode.attributes.provider.class'],
 'org.apache.ranger.authorization.hadoop.RangerHdfsAuthorizer', "Test with 
Ranger HDFS plugin is enabled")
 
+# Test 1 for dfs.allow.truncate with no HAWQ and dfs.allow.truncate not set
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+self.assertTrue('dfs.allow.truncate' not in 
configurations['hdfs-site']['properties'])
+
+# Test 2 for dfs.allow.truncate with HAWQ and dfs.allow.truncate not set
+services["services"].append({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'true')
+
+# Test 3 for dfs.allow.truncate with no HAWQ and dfs.allow.truncate set to 
false
+services["services"].remove({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
+configurations['hdfs-site']['properties']['dfs.allow.truncate'] = 'false'
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'false')
+
+# Test 4 for dfs.allow.truncate with HAWQ and dfs.allow.truncate set to 
false
+services["services"].append({"StackServices" : {"service_name" : "HAWQ"}, 
"components":[]})
+self.stackAdvisor.recommendHDFSConfigurations(configurations, clusterData, 
services, hosts)
+
self.assertEquals(configurations['hdfs-site']['properties']['dfs.allow.truncate'],
 'true')
+
   def test_recommendYARNConfigurations(self):
 configurations = {}
 servicesList = ["YARN"]



ambari git commit: AMBARI-15237. Create Grafana user through Ambari and add user to Grafana. (avijayan, swagle via swagle)

2016-02-29 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 50c61d602 -> fbbc855d3


AMBARI-15237. Create Grafana user through Ambari and add user to Grafana. 
(avijayan, swagle via swagle)


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

Branch: refs/heads/branch-2.2
Commit: fbbc855d3adcdfc0abd92e4cb3d00ee994782491
Parents: 50c61d6
Author: Siddharth Wagle 
Authored: Mon Feb 29 17:27:58 2016 -0800
Committer: Siddharth Wagle 
Committed: Mon Feb 29 17:40:07 2016 -0800

--
 .../conf/unix/ams-grafana.ini   |  6 +--
 .../0.1.0/configuration/ams-grafana-env.xml | 28 +
 .../0.1.0/configuration/ams-grafana-ini.xml |  4 +-
 .../package/scripts/metrics_grafana_util.py | 43 +---
 .../0.1.0/package/scripts/params.py |  2 +
 .../AMBARI_METRICS/test_metrics_grafana.py  |  4 +-
 .../python/stacks/2.0.6/configs/default.json|  4 +-
 ambari-web/app/data/HDP2/site_properties.js | 14 +++
 8 files changed, 83 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fbbc855d/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini
--
diff --git a/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini 
b/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini
index c0ccf1a..78f30b5 100644
--- a/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini
+++ b/ambari-metrics/ambari-metrics-grafana/conf/unix/ams-grafana.ini
@@ -145,13 +145,13 @@ static_root_path = /usr/lib/ambari-metrics-grafana/public
  Anonymous Auth ##
 [auth.anonymous]
 # enable anonymous access
-enabled = true
+;enabled = true
 
 # specify organization name that should be used for unauthenticated users
-org_name = Main Org.
+;org_name = Main Org.
 
 # specify role for unauthenticated users
-org_role = Admin
+;org_role = Admin
 
  Github Auth ##
 [auth.github]

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbbc855d/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
index de32ead..f15cd20 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
@@ -38,6 +38,34 @@
 Metrics Grafana data directory.
   
   
+metrics_grafana_username
+admin
+Metrics Grafana Admin Username
+
+  Metrics Grafana Username. This value cannot be modified by Ambari
+  except on initial install. Please make sure the username change in
+  Grafana is reflected in Ambari.
+
+
+  db_user
+  false
+
+  
+  
+metrics_grafana_password
+ 
+PASSWORD
+Metrics Grafana Admin Password
+
+  Metrics Grafana password. This value cannot be modified by Ambari
+  except on initial install. Please make sure the password change in
+  Grafana is reflected back in Ambari.
+
+
+  false
+
+  
+  
 content
 
 # Set environment variables here.

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbbc855d/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
index 0a1ff32..3a0e86b 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-ini.xml
@@ -153,10 +153,10 @@ cert_key = {{ams_grafana_cert_key}}
  Security 

 [security]
 # default admin user, created on startup
-;admin_user = admin
+admin_user = {{ams_grafana_admin_user}}
 
 # default admin password, can be changed before first start of grafana,  or 

ambari git commit: AMBARI-15236 Combo Search: Implement "core", "ram" filters (Joe Wang via rzang)

2016-02-29 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/trunk e175f770f -> 93bdd5eeb


AMBARI-15236 Combo Search: Implement "core", "ram" filters (Joe Wang via rzang)


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

Branch: refs/heads/trunk
Commit: 93bdd5eebf4fffcd09c4c8d140f2d78a14951507
Parents: e175f77
Author: Richard Zang 
Authored: Mon Feb 29 16:40:29 2016 -0800
Committer: Richard Zang 
Committed: Mon Feb 29 16:40:29 2016 -0800

--
 ambari-web/app/mixins/common/table_server_view_mixin.js | 9 -
 ambari-web/app/views/main/host/combo_search_box.js  | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/93bdd5ee/ambari-web/app/mixins/common/table_server_view_mixin.js
--
diff --git a/ambari-web/app/mixins/common/table_server_view_mixin.js 
b/ambari-web/app/mixins/common/table_server_view_mixin.js
index b126efa..cb26367 100644
--- a/ambari-web/app/mixins/common/table_server_view_mixin.js
+++ b/ambari-web/app/mixins/common/table_server_view_mixin.js
@@ -107,11 +107,18 @@ App.TableServerViewMixin = Em.Mixin.create({
   filterCondition.value.push(filterValue);
 }
   } else {
+var type = 'string';
+if (tag.category === 'cpu') {
+  type = 'number';
+}
+if (tag.category === 'memoryFormatted') {
+  type = 'ambari-bandwidth';
+}
 filterCondition = {
   skipFilter: false,
   iColumn: iColumn,
   value: filterValue,
-  type: 'string'
+  type: type
 };
 self.get('filterConditions').push(filterCondition);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/93bdd5ee/ambari-web/app/views/main/host/combo_search_box.js
--
diff --git a/ambari-web/app/views/main/host/combo_search_box.js 
b/ambari-web/app/views/main/host/combo_search_box.js
index 86f0c2f..dc5b6d1 100644
--- a/ambari-web/app/views/main/host/combo_search_box.js
+++ b/ambari-web/app/views/main/host/combo_search_box.js
@@ -47,6 +47,8 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 {label: 'IP', value: 'ip', category: 'Host'},
 {label: 'Heath Status', value: 'healthClass', category: 'Host'},
 {label: 'Stack Version', value: 'version', category: 'Host'},
+{label: 'Cores', value: 'cpu', category: 'Host'},
+{label: 'RAM', value: 'memoryFormatted', category: 'Host'},
 {label: 'Version State', value: 'versionState', category: 'Host'},
 {label: 'Rack', value: 'rack', category: 'Host'},
 {label: 'Service', value: 'services', category: 'Service'},



ambari git commit: AMBARI-15212 Master component names are missing on service summary page (Joe Wang via rzang)

2016-02-29 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/trunk a5ed43fca -> e175f770f


AMBARI-15212 Master component names are missing on service summary page (Joe 
Wang via rzang)


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

Branch: refs/heads/trunk
Commit: e175f770f99a48ebee07b143a85c2ffbb2a6d99c
Parents: a5ed43f
Author: Richard Zang 
Authored: Mon Feb 29 14:55:07 2016 -0800
Committer: Richard Zang 
Committed: Mon Feb 29 14:55:39 2016 -0800

--
 ambari-web/app/controllers/global/update_controller.js | 1 +
 ambari-web/app/mappers/service_metrics_mapper.js   | 1 +
 2 files changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e175f770/ambari-web/app/controllers/global/update_controller.js
--
diff --git a/ambari-web/app/controllers/global/update_controller.js 
b/ambari-web/app/controllers/global/update_controller.js
index de4523b..2256e21 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -462,6 +462,7 @@ App.UpdateController = Em.Controller.extend({
 'host_components/HostRoles/stale_configs,' +
 'host_components/HostRoles/ha_state,' +
 'host_components/HostRoles/desired_admin_state,' +
+'host_components/HostRoles/display_name,' +
 conditionalFieldsString +
 '_response=true';
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e175f770/ambari-web/app/mappers/service_metrics_mapper.js
--
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index 9d5c155..115c246 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -152,6 +152,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
 passive_state: 'HostRoles.maintenance_state',
 display_name: 'HostRoles.display_name',
 component_name: 'HostRoles.component_name',
+display_name: 'HostRoles.display_name',
 host_id: 'HostRoles.host_name',
 host_name: 'HostRoles.host_name',
 stale_configs: 'HostRoles.stale_configs',



ambari git commit: AMBARI-15235. Display tag for StandBy name node should not be changed to NameNode if there is an active namenode. (jaimin)

2016-02-29 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 397ac16dc -> 50c61d602


AMBARI-15235. Display tag for StandBy name node should not be changed to 
NameNode if there is an active namenode. (jaimin)


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

Branch: refs/heads/branch-2.2
Commit: 50c61d602b81fa4cc3b75adb578cbd16e9ecfc1a
Parents: 397ac16
Author: Jaimin Jetly 
Authored: Mon Feb 29 14:42:58 2016 -0800
Committer: Jaimin Jetly 
Committed: Mon Feb 29 14:47:12 2016 -0800

--
 .../app/mappers/service_metrics_mapper.js   |  17 +++-
 .../test/mappers/service_metrics_mapper_test.js | 101 +++
 2 files changed, 114 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/50c61d60/ambari-web/app/mappers/service_metrics_mapper.js
--
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index 30a96d6..9dbd26d 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -407,20 +407,23 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   var haState2 = Em.get(component.host_components[1], 
'metrics.dfs.FSNamesystem.HAState');
   var active_name_node = [];
   var standby_name_nodes = [];
+  var namenodeName1 = component.host_components[0].HostRoles.host_name;
+  var namenodeName2 = component.host_components[1].HostRoles.host_name;
+
   switch (haState1) {
 case "active":
-  
active_name_node.push(component.host_components[0].HostRoles.host_name);
+  active_name_node.push(namenodeName1);
   break;
 case "standby":
-  
standby_name_nodes.push(component.host_components[0].HostRoles.host_name);
+  standby_name_nodes.push(namenodeName1);
   break;
   }
   switch (haState2) {
 case "active":
-  
active_name_node.push(component.host_components[1].HostRoles.host_name);
+  active_name_node.push(namenodeName2);
   break;
 case "standby":
-  
standby_name_nodes.push(component.host_components[1].HostRoles.host_name);
+  standby_name_nodes.push(namenodeName2);
   break;
   }
   item.active_name_node_id = null;
@@ -432,6 +435,12 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   break;
   }
   switch (standby_name_nodes.length) {
+case 0:
+  if (active_name_node.length === 1) {
+var standbyNameNode =  (active_name_node[0] === namenodeName1) 
? namenodeName2 : namenodeName1;
+item.standby_name_node_id = 'NAMENODE' + '_' + standbyNameNode;
+  }
+  break;
 case 1:
   item.standby_name_node_id = 'NAMENODE' + '_' + 
standby_name_nodes[0];
   break;

http://git-wip-us.apache.org/repos/asf/ambari/blob/50c61d60/ambari-web/test/mappers/service_metrics_mapper_test.js
--
diff --git a/ambari-web/test/mappers/service_metrics_mapper_test.js 
b/ambari-web/test/mappers/service_metrics_mapper_test.js
index d2c9cc0..4e0f216 100644
--- a/ambari-web/test/mappers/service_metrics_mapper_test.js
+++ b/ambari-web/test/mappers/service_metrics_mapper_test.js
@@ -20,6 +20,107 @@ var App = require('app');
 
 describe('App.serviceMetricsMapper', function () {
 
+  describe('#computeAdditionalRelations', function () {
+
+var tests = [
+  {
+message: 'if both namenodes are standby then `display_name_advanced` 
for both should be `Standby NameNode`',
+haStateForNn1: 'standby',
+haStateForNn2: 'standby',
+expectedNameForNn1: 'Standby NameNode',
+expectedNameForNn2: 'Standby NameNode'
+  },
+  {
+message: 'if one namenode is active and another is standby then they 
should be shown as  `Active NameNode` and `Standby NameNode` respectively',
+haStateForNn1: 'active',
+haStateForNn2: 'standby',
+expectedNameForNn1: 'Active NameNode',
+expectedNameForNn2: 'Standby NameNode'
+  },
+  {
+message: 'if one namenode is active and another is unknown then they 
should be shown as  `Active NameNode` and `Standby NameNode` respectively',
+haStateForNn1: 'active',
+haStateForNn2: undefined,
+expectedNameForNn1: 

ambari git commit: AMBARI-15235. Display tag for StandBy name node should not be changed to NameNode if there is an active namenode. (jaimin)

2016-02-29 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 7a36ae748 -> a5ed43fca


AMBARI-15235. Display tag for StandBy name node should not be changed to 
NameNode if there is an active namenode. (jaimin)


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

Branch: refs/heads/trunk
Commit: a5ed43fcab5de7fcb94fa56e7279f32e158760e3
Parents: 7a36ae7
Author: Jaimin Jetly 
Authored: Mon Feb 29 14:42:58 2016 -0800
Committer: Jaimin Jetly 
Committed: Mon Feb 29 14:46:19 2016 -0800

--
 .../app/mappers/service_metrics_mapper.js   |  17 +++-
 .../test/mappers/service_metrics_mapper_test.js | 101 +++
 2 files changed, 114 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a5ed43fc/ambari-web/app/mappers/service_metrics_mapper.js
--
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index a88c3e6..9d5c155 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -408,20 +408,23 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   var haState2 = Em.get(component.host_components[1], 
'metrics.dfs.FSNamesystem.HAState');
   var active_name_node = [];
   var standby_name_nodes = [];
+  var namenodeName1 = component.host_components[0].HostRoles.host_name;
+  var namenodeName2 = component.host_components[1].HostRoles.host_name;
+
   switch (haState1) {
 case "active":
-  
active_name_node.push(component.host_components[0].HostRoles.host_name);
+  active_name_node.push(namenodeName1);
   break;
 case "standby":
-  
standby_name_nodes.push(component.host_components[0].HostRoles.host_name);
+  standby_name_nodes.push(namenodeName1);
   break;
   }
   switch (haState2) {
 case "active":
-  
active_name_node.push(component.host_components[1].HostRoles.host_name);
+  active_name_node.push(namenodeName2);
   break;
 case "standby":
-  
standby_name_nodes.push(component.host_components[1].HostRoles.host_name);
+  standby_name_nodes.push(namenodeName2);
   break;
   }
   item.active_name_node_id = null;
@@ -433,6 +436,12 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   break;
   }
   switch (standby_name_nodes.length) {
+case 0:
+  if (active_name_node.length === 1) {
+var standbyNameNode =  (active_name_node[0] === namenodeName1) 
? namenodeName2 : namenodeName1;
+item.standby_name_node_id = 'NAMENODE' + '_' + standbyNameNode;
+  }
+  break;
 case 1:
   item.standby_name_node_id = 'NAMENODE' + '_' + 
standby_name_nodes[0];
   break;

http://git-wip-us.apache.org/repos/asf/ambari/blob/a5ed43fc/ambari-web/test/mappers/service_metrics_mapper_test.js
--
diff --git a/ambari-web/test/mappers/service_metrics_mapper_test.js 
b/ambari-web/test/mappers/service_metrics_mapper_test.js
index d2c9cc0..4e0f216 100644
--- a/ambari-web/test/mappers/service_metrics_mapper_test.js
+++ b/ambari-web/test/mappers/service_metrics_mapper_test.js
@@ -20,6 +20,107 @@ var App = require('app');
 
 describe('App.serviceMetricsMapper', function () {
 
+  describe('#computeAdditionalRelations', function () {
+
+var tests = [
+  {
+message: 'if both namenodes are standby then `display_name_advanced` 
for both should be `Standby NameNode`',
+haStateForNn1: 'standby',
+haStateForNn2: 'standby',
+expectedNameForNn1: 'Standby NameNode',
+expectedNameForNn2: 'Standby NameNode'
+  },
+  {
+message: 'if one namenode is active and another is standby then they 
should be shown as  `Active NameNode` and `Standby NameNode` respectively',
+haStateForNn1: 'active',
+haStateForNn2: 'standby',
+expectedNameForNn1: 'Active NameNode',
+expectedNameForNn2: 'Standby NameNode'
+  },
+  {
+message: 'if one namenode is active and another is unknown then they 
should be shown as  `Active NameNode` and `Standby NameNode` respectively',
+haStateForNn1: 'active',
+haStateForNn2: undefined,
+expectedNameForNn1: 'Active 

ambari git commit: AMBARI-15193 Auto-start UI edits (Joe Wang via rzang)

2016-02-29 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/trunk 7abe374dd -> 7a36ae748


AMBARI-15193 Auto-start UI edits (Joe Wang via rzang)


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

Branch: refs/heads/trunk
Commit: 7a36ae74861b369aea4a0a2351e8a341e6eedc6f
Parents: 7abe374
Author: Richard Zang 
Authored: Mon Feb 29 14:42:48 2016 -0800
Committer: Richard Zang 
Committed: Mon Feb 29 14:45:22 2016 -0800

--
 .../main/admin/service_auto_start.js| 107 +--
 ambari-web/app/messages.js  |  12 ++-
 ambari-web/app/styles/application.less  |   8 ++
 .../templates/main/admin/service_auto_start.hbs |  20 ++--
 .../service_auto_start_indicator.hbs|  19 
 ambari-web/app/utils/ajax/ajax.js   |   6 +-
 ambari-web/app/views.js |   1 +
 .../service_auto_start/component_auto_start.js  |   8 +-
 .../service_auto_start_indicator.js |  34 ++
 9 files changed, 164 insertions(+), 51 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7a36ae74/ambari-web/app/controllers/main/admin/service_auto_start.js
--
diff --git a/ambari-web/app/controllers/main/admin/service_auto_start.js 
b/ambari-web/app/controllers/main/admin/service_auto_start.js
index 4071292..a4d607a 100644
--- a/ambari-web/app/controllers/main/admin/service_auto_start.js
+++ b/ambari-web/app/controllers/main/admin/service_auto_start.js
@@ -53,39 +53,52 @@ App.MainAdminServiceAutoStartController = 
Em.Controller.extend({
 var tabs = [];
 this.get('componentsConfigs').forEach(function(component) {
   var serviceComponentInfo = component.ServiceComponentInfo;
-  if (serviceComponentInfo.category === "MASTER" || 
serviceComponentInfo.category === "SLAVE") {
-var componentRecovery = Ember.Object.create({
-  display_name: App.format.role(serviceComponentInfo.component_name),
-  component_name: serviceComponentInfo.component_name,
-  //recovery_enabled: serviceComponentInfo.recovery_enabled === 'true',
-  recovery_enabled: false,
-  valueChanged: false,
-  service_name: serviceComponentInfo.service_name
-});
-if (services[serviceComponentInfo.service_name]) {
-  
services[serviceComponentInfo.service_name].get('componentRecovery').push(componentRecovery);
-  services[serviceComponentInfo.service_name].set('enabledComponents', 
services[serviceComponentInfo.service_name].get('enabledComponents') + 
(componentRecovery.get('recovery_enabled') ? 1 : 0));
-  services[serviceComponentInfo.service_name].set('totalComponents', 
services[serviceComponentInfo.service_name].get('totalComponents') + 1);
-} else {
-  services[serviceComponentInfo.service_name] = Ember.Object.create({
-service_name: serviceComponentInfo.service_name,
-display_name: App.format.role(serviceComponentInfo.service_name),
-headingClass: "." + serviceComponentInfo.service_name,
-isActive: false,
-componentRecovery: [componentRecovery],
-enabledComponents: componentRecovery.recovery_enabled ? 1 : 0,
-totalComponents: 1,
-indicator: function() {
-  var percentage = this.get('enabledComponents') / 
this.get('totalComponents');
-  var indicator = "icon-adjust";
-  if (percentage === 1) {
-indicator = "icon-circle";
-  } else if (percentage === 0) {
-indicator = "icon-circle-blank";
-  }
-  return indicator;
-}.property('enabledComponents', 'totalComponents')
+  if (serviceComponentInfo.total_count) {
+if (serviceComponentInfo.category === "MASTER" || 
serviceComponentInfo.category === "SLAVE") {
+  var componentRecovery = Ember.Object.create({
+display_name: App.format.role(serviceComponentInfo.component_name),
+component_name: serviceComponentInfo.component_name,
+recovery_enabled: serviceComponentInfo.recovery_enabled === 'true',
+valueChanged: false,
+service_name: serviceComponentInfo.service_name
   });
+  if (services[serviceComponentInfo.service_name]) {
+
services[serviceComponentInfo.service_name].get('componentRecovery').push(componentRecovery);
+
services[serviceComponentInfo.service_name].set('enabledComponents', 

ambari git commit: AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status Calculation Cache Problem (part4) (jonathanhurley)

2016-02-29 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 0d933837e -> 397ac16dc


AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status 
Calculation Cache Problem (part4) (jonathanhurley)


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

Branch: refs/heads/branch-2.2
Commit: 397ac16dcdd975406d85dbf25cc30f191a3ca461
Parents: 0d93383
Author: Jonathan Hurley 
Authored: Mon Feb 29 17:24:37 2016 -0500
Committer: Jonathan Hurley 
Committed: Mon Feb 29 17:25:35 2016 -0500

--
 .../apache/ambari/server/orm/dao/HostRoleCommandDAO.java  | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/397ac16d/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
index 7a54d27..d462090 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
@@ -634,7 +634,15 @@ public class HostRoleCommandDAO {
   entity = entityManager.merge(entity);
   managedList.add(entity);
 
-  requestsToInvalidate.add(entity.getRequestId());
+  Long requestId = entity.getRequestId();
+  if (requestId == null) {
+StageEntity stageEntity = entity.getStage();
+if (stageEntity != null) {
+  requestId = stageEntity.getRequestId();
+}
+  }
+
+  requestsToInvalidate.add(requestId);
 }
 
 invalidateHostRoleCommandStatusSummaryCache(requestsToInvalidate);



ambari git commit: AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status Calculation Cache Problem (part4) (jonathanhurley)

2016-02-29 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 8d38f1638 -> 7abe374dd


AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status 
Calculation Cache Problem (part4) (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: 7abe374dd5375f908514a0e4c266e661d6b20298
Parents: 8d38f16
Author: Jonathan Hurley 
Authored: Mon Feb 29 17:24:37 2016 -0500
Committer: Jonathan Hurley 
Committed: Mon Feb 29 17:24:44 2016 -0500

--
 .../apache/ambari/server/orm/dao/HostRoleCommandDAO.java  | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7abe374d/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
index c256066..14dac79 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java
@@ -634,7 +634,15 @@ public class HostRoleCommandDAO {
   entity = entityManager.merge(entity);
   managedList.add(entity);
 
-  requestsToInvalidate.add(entity.getRequestId());
+  Long requestId = entity.getRequestId();
+  if (requestId == null) {
+StageEntity stageEntity = entity.getStage();
+if (stageEntity != null) {
+  requestId = stageEntity.getRequestId();
+}
+  }
+
+  requestsToInvalidate.add(requestId);
 }
 
 invalidateHostRoleCommandStatusSummaryCache(requestsToInvalidate);



ambari git commit: AMBARI-15184. Host with uppercased symbols was not registered during deploy via blueprints. (Sandor Magyari via stoader)

2016-02-29 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 5a04ef2c3 -> 0d933837e


AMBARI-15184. Host with uppercased symbols was not registered during deploy via 
blueprints. (Sandor Magyari via stoader)


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

Branch: refs/heads/branch-2.2
Commit: 0d933837eef7b32b1c6920b4a61afd31291d777b
Parents: 5a04ef2
Author: Toader, Sebastian 
Authored: Mon Feb 29 20:17:54 2016 +0100
Committer: Toader, Sebastian 
Committed: Mon Feb 29 22:58:43 2016 +0100

--
 .../ambari/server/topology/ClusterTopologyImpl.java |  3 ++-
 .../apache/ambari/server/topology/HostGroupInfo.java| 11 ++-
 .../internal/BlueprintConfigurationProcessorTest.java   | 12 ++--
 .../internal/ProvisionClusterRequestTest.java   |  4 ++--
 .../ambari/server/topology/HostGroupInfoTest.java   | 11 +++
 5 files changed, 31 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0d933837/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
index af716a0..003539c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
@@ -360,7 +360,8 @@ public class ClusterTopologyImpl implements ClusterTopology 
{
   }
 }
 if (! duplicates.isEmpty()) {
-  throw new InvalidTopologyException("The following hosts are mapped to 
multiple host groups: " + duplicates);
+  throw new InvalidTopologyException("The following hosts are mapped to 
multiple host groups: " + duplicates + "." +
+" Be aware that host names are converted to lowercase, case 
differences do not matter in Ambari deployments.");
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/0d933837/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
index 98ad3a9..4847a11 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
@@ -26,11 +26,16 @@ import java.util.Map;
 import org.apache.ambari.server.api.predicate.InvalidQueryException;
 import org.apache.ambari.server.api.predicate.PredicateCompiler;
 import org.apache.ambari.server.controller.spi.Predicate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Host Group information specific to a cluster instance.
  */
 public class HostGroupInfo {
+
+  private final static Logger LOG = 
LoggerFactory.getLogger(HostGroupInfo.class);
+
   /**
* predicate compiler
*/
@@ -125,7 +130,11 @@ public class HostGroupInfo {
*/
   public void addHost(String hostName) {
 synchronized(hostNames) {
-  hostNames.add(hostName);
+  String lowerHostName = hostName.toLowerCase();
+  if (!hostName.equals(lowerHostName)) {
+LOG.warn("Host name {} contains upper case letters, will be converted 
to lowercase!", hostName );
+  }
+  hostNames.add(lowerHostName);
 }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0d933837/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index e70105b..ef5dc76 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -2541,7 +2541,7 @@ public class BlueprintConfigurationProcessorTest {
   public void 
testDoUpdateForClusterWithNameNodeHAEnabledSpecifyingHostNamesDirectly() throws 
Exception {
 final String expectedNameService = 

ambari git commit: AMBARI-15175: Hide Custom configuration category for files which does not support custom configuration in HAWQ and PXF (bhuvnesh2703 via jaoki)

2016-02-29 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 45a4a0e44 -> 5a04ef2c3


AMBARI-15175: Hide Custom configuration category for files which does not 
support custom configuration in HAWQ and PXF (bhuvnesh2703 via jaoki)


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

Branch: refs/heads/branch-2.2
Commit: 5a04ef2c3633044a96d57ad03ba27eefd5243f53
Parents: 45a4a0e
Author: Jun Aoki 
Authored: Mon Feb 29 13:52:06 2016 -0800
Committer: Jun Aoki 
Committed: Mon Feb 29 13:52:06 2016 -0800

--
 ambari-web/app/models/stack_service.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5a04ef2c/ambari-web/app/models/stack_service.js
--
diff --git a/ambari-web/app/models/stack_service.js 
b/ambari-web/app/models/stack_service.js
index d9edf6e..e71b599 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -399,7 +399,7 @@ App.StackService.configCategories = function () {
 
   // Add custom section for every configType to all the services
   configTypes.forEach(function (type) {
-var configTypesWithNoCustomSection = 
['capacity-scheduler','mapred-queue-acls','flume-conf', 
'pig-properties','topology','users-ldif'];
+var configTypesWithNoCustomSection = 
['capacity-scheduler','mapred-queue-acls','flume-conf', 
'pig-properties','topology','users-ldif', 'pxf-profiles', 
'pxf-public-classpath'];
 if (type.endsWith('-env') || type.endsWith('-log4j') || 
configTypesWithNoCustomSection.contains(type)) {
   return;
 }



ambari git commit: AMBARI-15229 Combo Search: Implement "version" related filters (Joe Wang via rzang)

2016-02-29 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/trunk 6bdc7fc7f -> 3286b00f3


AMBARI-15229 Combo Search: Implement "version" related filters (Joe Wang via 
rzang)


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

Branch: refs/heads/trunk
Commit: 3286b00f3d69be4b9944a8243a69613677e1a90f
Parents: 6bdc7fc
Author: Richard Zang 
Authored: Mon Feb 29 13:48:43 2016 -0800
Committer: Richard Zang 
Committed: Mon Feb 29 13:49:24 2016 -0800

--
 ambari-web/app/controllers/main/host.js | 12 ++
 .../app/views/main/host/combo_search_box.js | 23 +++-
 2 files changed, 30 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3286b00f/ambari-web/app/controllers/main/host.js
--
diff --git a/ambari-web/app/controllers/main/host.js 
b/ambari-web/app/controllers/main/host.js
index b7f6208..bfed1ba 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -143,6 +143,16 @@ App.MainHostController = 
Em.ArrayController.extend(App.TableServerMixin, {
   type: 'MULTIPLE'
 },
 {
+  name: 'version',
+  key: 
'stack_versions/repository_versions/RepositoryVersions/display_name',
+  type: 'EQUAL'
+},
+{
+  name: 'versionState',
+  key: 'stack_versions/HostStackVersions/state',
+  type: 'EQUAL'
+},
+{
   name: 'hostStackVersion',
   key: 'stack_versions',
   type: 'EQUAL'
@@ -570,6 +580,8 @@ App.MainHostController = 
Em.ArrayController.extend(App.TableServerMixin, {
 associations[13] = 'services';
 associations[14] = 'state';
 associations[15] = 'componentState';
+associations[16] = 'version';
+associations[17] = 'versionState';
 return associations;
   }.property()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3286b00f/ambari-web/app/views/main/host/combo_search_box.js
--
diff --git a/ambari-web/app/views/main/host/combo_search_box.js 
b/ambari-web/app/views/main/host/combo_search_box.js
index b52d91f..86f0c2f 100644
--- a/ambari-web/app/views/main/host/combo_search_box.js
+++ b/ambari-web/app/views/main/host/combo_search_box.js
@@ -46,6 +46,8 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 {label: 'Host Name', value: 'hostName', category: 'Host'},
 {label: 'IP', value: 'ip', category: 'Host'},
 {label: 'Heath Status', value: 'healthClass', category: 'Host'},
+{label: 'Stack Version', value: 'version', category: 'Host'},
+{label: 'Version State', value: 'versionState', category: 'Host'},
 {label: 'Rack', value: 'rack', category: 'Host'},
 {label: 'Service', value: 'services', category: 'Service'},
 {label: 'Has Component', value: 'hostComponents', category: 
'Service'},
@@ -66,7 +68,6 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 },
 
 valueMatches: function (facet, searchTerm, callback) {
-  var category_mocks = require('data/host/categories');
   if (controller.isComponentStateFacet(facet)) {
 facet = 'componentState'
   }
@@ -82,16 +83,28 @@ App.MainHostComboSearchBoxView = Em.View.extend({
   callback(App.Host.find().toArray().mapProperty('rack').uniq());
   break;
 case 'version':
-  callback(App.StackVersion.find().toArray().mapProperty('name'));
+  
callback(App.HostStackVersion.find().toArray().filterProperty('isVisible', 
true).mapProperty('displayName').uniq());
+  break;
+case 'versionState':
+  callback(App.HostStackVersion.statusDefinition.map(function 
(status) {
+return {label: App.HostStackVersion.formatStatus(status), 
value: status};
+  }));
   break;
 case 'healthClass':
-  callback(category_mocks.slice(1).mapProperty('healthStatus'), 
{preserveOrder: true});
+  var category_mocks = require('data/host/categories');
+  callback(category_mocks.slice(1).map(function (category) {
+return {label: category.value, value: category.healthStatus}
+  }), {preserveOrder: true});
   break;
 case 'services':
-  
callback(App.Service.find().toArray().mapProperty('serviceName'), 
{preserveOrder: true});
+  callback(App.Service.find().toArray().map(function (service) {
+return {label: 

ambari git commit: AMBARI-15184. Host with uppercased symbols was not registered during deploy via blueprints. (Sandor Magyari via stoader)

2016-02-29 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/trunk ba59c242d -> 6bdc7fc7f


AMBARI-15184. Host with uppercased symbols was not registered during deploy via 
blueprints. (Sandor Magyari via stoader)


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

Branch: refs/heads/trunk
Commit: 6bdc7fc7fe88a151116b92f1b9023780c2f219ad
Parents: ba59c24
Author: Toader, Sebastian 
Authored: Mon Feb 29 20:17:54 2016 +0100
Committer: Toader, Sebastian 
Committed: Mon Feb 29 21:43:33 2016 +0100

--
 .../ambari/server/topology/ClusterTopologyImpl.java |  3 ++-
 .../apache/ambari/server/topology/HostGroupInfo.java| 11 ++-
 .../internal/BlueprintConfigurationProcessorTest.java   | 12 ++--
 .../internal/ProvisionClusterRequestTest.java   |  4 ++--
 .../ambari/server/topology/HostGroupInfoTest.java   | 11 +++
 5 files changed, 31 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6bdc7fc7/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
index af716a0..003539c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/ClusterTopologyImpl.java
@@ -360,7 +360,8 @@ public class ClusterTopologyImpl implements ClusterTopology 
{
   }
 }
 if (! duplicates.isEmpty()) {
-  throw new InvalidTopologyException("The following hosts are mapped to 
multiple host groups: " + duplicates);
+  throw new InvalidTopologyException("The following hosts are mapped to 
multiple host groups: " + duplicates + "." +
+" Be aware that host names are converted to lowercase, case 
differences do not matter in Ambari deployments.");
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bdc7fc7/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
index 98ad3a9..4847a11 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostGroupInfo.java
@@ -26,11 +26,16 @@ import java.util.Map;
 import org.apache.ambari.server.api.predicate.InvalidQueryException;
 import org.apache.ambari.server.api.predicate.PredicateCompiler;
 import org.apache.ambari.server.controller.spi.Predicate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Host Group information specific to a cluster instance.
  */
 public class HostGroupInfo {
+
+  private final static Logger LOG = 
LoggerFactory.getLogger(HostGroupInfo.class);
+
   /**
* predicate compiler
*/
@@ -125,7 +130,11 @@ public class HostGroupInfo {
*/
   public void addHost(String hostName) {
 synchronized(hostNames) {
-  hostNames.add(hostName);
+  String lowerHostName = hostName.toLowerCase();
+  if (!hostName.equals(lowerHostName)) {
+LOG.warn("Host name {} contains upper case letters, will be converted 
to lowercase!", hostName );
+  }
+  hostNames.add(lowerHostName);
 }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bdc7fc7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 15166f7..30351d8 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -2556,7 +2556,7 @@ public class BlueprintConfigurationProcessorTest {
   public void 
testDoUpdateForClusterWithNameNodeHAEnabledSpecifyingHostNamesDirectly() throws 
Exception {
 final String expectedNameService = "mynameservice";
  

ambari git commit: AMBARI-15172: HAWQ temp directories should not be /tmp (adenissov via jaoki)

2016-02-29 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/trunk 15c992c5b -> ba59c242d


AMBARI-15172: HAWQ temp directories should not be /tmp (adenissov via jaoki)


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

Branch: refs/heads/trunk
Commit: ba59c242d65428e1ebcf7758a2dd7de3e90c7f5b
Parents: 15c992c
Author: Jun Aoki 
Authored: Mon Feb 29 12:34:59 2016 -0800
Committer: Jun Aoki 
Committed: Mon Feb 29 12:34:59 2016 -0800

--
 .../common-services/HAWQ/2.0.0/configuration/hawq-site.xml   | 4 ++--
 ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py | 2 +-
 .../src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py  | 2 +-
 .../src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py  | 2 +-
 .../src/test/python/stacks/2.3/configs/hawq_default.json | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ba59c242/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
index f195215..457c1d2 100644
--- 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
@@ -100,7 +100,7 @@
   
 hawq_master_temp_directory
 HAWQ Master Temp Directory
-/tmp
+/tmp/hawq/master
 
   The temporary directory reserved for HAWQ master.
 
@@ -112,7 +112,7 @@
   
 hawq_segment_temp_directory
 HAWQ Segment Temp Directory
-/tmp
+/tmp/hawq/segment
 
   The temporary directory reserved for HAWQ segment.
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba59c242/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
--
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py 
b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
index 355207c..56fc5e4 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqmaster.py
@@ -99,7 +99,7 @@ class TestHawqMaster(RMFTestCase):
 create_parents = True
 )
 
-self.assertResourceCalled('Directory', '/tmp',
+self.assertResourceCalled('Directory', '/tmp/hawq/master',
 group = self.GPADMIN,
 owner = self.GPADMIN,
 create_parents = True

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba59c242/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
--
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py 
b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
index 66800ea..b6c682f 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py
@@ -121,7 +121,7 @@ class TestHawqSegment(RMFTestCase):
 create_parents = True
 )
 
-self.assertResourceCalled('Directory', '/tmp',
+self.assertResourceCalled('Directory', '/tmp/hawq/segment',
 owner = self.GPADMIN,
 group = self.GPADMIN,
 create_parents = True

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba59c242/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
--
diff --git a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py 
b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
index 26a211d..7f4d3af 100644
--- a/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
+++ b/ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py
@@ -98,7 +98,7 @@ class TestHawqStandby(RMFTestCase):
 create_parents = True
 )
 
-self.assertResourceCalled('Directory', '/tmp',
+self.assertResourceCalled('Directory', '/tmp/hawq/master',
 group = self.GPADMIN,
 owner = self.GPADMIN,
 create_parents = True

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba59c242/ambari-server/src/test/python/stacks/2.3/configs/hawq_default.json
--
diff --git 

ambari git commit: AMBARI-15172: HAWQ temp directories should not be /tmp (adenissov via jaoki)

2016-02-29 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 8f05ad824 -> 45a4a0e44


AMBARI-15172: HAWQ temp directories should not be /tmp (adenissov via jaoki)


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

Branch: refs/heads/branch-2.2
Commit: 45a4a0e44eeb29d7a140b26b37e36156fbda0c30
Parents: 8f05ad8
Author: Jun Aoki 
Authored: Mon Feb 29 12:33:29 2016 -0800
Committer: Jun Aoki 
Committed: Mon Feb 29 12:33:29 2016 -0800

--
 .../common-services/HAWQ/2.0.0/configuration/hawq-site.xml   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/45a4a0e4/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
index f195215..457c1d2 100644
--- 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
@@ -100,7 +100,7 @@
   
 hawq_master_temp_directory
 HAWQ Master Temp Directory
-/tmp
+/tmp/hawq/master
 
   The temporary directory reserved for HAWQ master.
 
@@ -112,7 +112,7 @@
   
 hawq_segment_temp_directory
 HAWQ Segment Temp Directory
-/tmp
+/tmp/hawq/segment
 
   The temporary directory reserved for HAWQ segment.
 



ambari git commit: AMBARI-15231. Cluster Stack Version returning wrong state (ncole)

2016-02-29 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/trunk 365c74b53 -> 15c992c5b


AMBARI-15231. Cluster Stack Version returning wrong state (ncole)


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

Branch: refs/heads/trunk
Commit: 15c992c5beb3210c5be23eda73869bab85b50fcb
Parents: 365c74b
Author: Nate Cole 
Authored: Mon Feb 29 14:13:17 2016 -0500
Committer: Nate Cole 
Committed: Mon Feb 29 15:25:23 2016 -0500

--
 .../server/state/cluster/ClusterImpl.java   |  7 +--
 .../resources/Ambari-DDL-Postgres-CREATE.sql|  2 +-
 .../src/main/resources/version_definition.xsd   |  1 -
 .../server/state/cluster/ClusterTest.java   | 51 
 contrib/version-builder/example.sh  |  4 +-
 5 files changed, 48 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/15c992c5/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 9560a65..0592c05 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -1379,13 +1379,14 @@ public class ClusterImpl implements Cluster {
 }
 
 if (totalNotRequired > 0) {
+  if (totalInstalled + totalNotRequired == totalHosts) {
+return RepositoryVersionState.INSTALLED;
+  }
+
   if (totalInstalling + totalInstalled + totalNotRequired == totalHosts) {
 return RepositoryVersionState.INSTALLING;
   }
 
-  if (totalInstalled + totalNotRequired == totalHosts) {
-return RepositoryVersionState.INSTALLED;
-  }
 }
 
 // Also returns when have a mix of CURRENT and INSTALLING|INSTALLED

http://git-wip-us.apache.org/repos/asf/ambari/blob/15c992c5/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
--
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql 
b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index bb47a8a..5d8899e 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -559,7 +559,7 @@ CREATE TABLE repo_version (
   repositories TEXT NOT NULL,
   repo_type VARCHAR(255) DEFAULT 'STANDARD' NOT NULL,
   version_url VARCHAR(1024),
-  version_xml VARCHAR TEXT,
+  version_xml TEXT,
   version_xsd VARCHAR(512),
   parent_id BIGINT,
   PRIMARY KEY(repo_version_id)

http://git-wip-us.apache.org/repos/asf/ambari/blob/15c992c5/ambari-server/src/main/resources/version_definition.xsd
--
diff --git a/ambari-server/src/main/resources/version_definition.xsd 
b/ambari-server/src/main/resources/version_definition.xsd
index de0efd8..3c0399f 100644
--- a/ambari-server/src/main/resources/version_definition.xsd
+++ b/ambari-server/src/main/resources/version_definition.xsd
@@ -54,7 +54,6 @@
   
   
   
-  
 
   
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/15c992c5/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
index a89eb1b..57e21d2 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
@@ -18,6 +18,16 @@
 
 package org.apache.ambari.server.state.cluster;
 
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -119,16 +129,6 @@ import com.google.inject.util.Modules;
 
 import junit.framework.Assert;
 
-import static 

ambari git commit: AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status Calculation Cache Problem (part3) (jonathanhurley)

2016-02-29 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk aaca7c479 -> 365c74b53


AMBARI-15173 - Express Upgrade Stuck At Manual Prompt Due To HRC Status 
Calculation Cache Problem (part3) (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: 365c74b53c653a96fda189846ad5e07ab268e0fc
Parents: aaca7c4
Author: Jonathan Hurley 
Authored: Mon Feb 29 12:56:35 2016 -0500
Committer: Jonathan Hurley 
Committed: Mon Feb 29 15:24:27 2016 -0500

--
 .../actionmanager/ActionDBAccessorImpl.java |   7 +-
 .../orm/AmbariJpaLocalTxnInterceptor.java   |   5 +
 .../ambari/server/orm/TransactionalLocks.java   |  40 +---
 .../server/orm/dao/HostRoleCommandDAO.java  | 102 ---
 .../apache/ambari/annotations/LockAreaTest.java |  78 ++
 .../TransactionalLockInterceptorTest.java   |  80 ++-
 .../annotations/TransactionalLockTest.java  |   5 +-
 .../internal/AlertResourceProviderTest.java |  54 +-
 8 files changed, 280 insertions(+), 91 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/365c74b5/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
index 003e2e6..429f573 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
@@ -735,8 +735,6 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 
   @Override
   public void resubmitTasks(List taskIds) {
-hostRoleCommandCache.invalidateAll(taskIds);
-
 List tasks = hostRoleCommandDAO.findByPKs(taskIds);
 for (HostRoleCommandEntity task : tasks) {
   task.setStatus(HostRoleStatus.PENDING);
@@ -748,6 +746,8 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 if (!tasks.isEmpty()) {
   hostRoleCommandDAO.mergeAll(tasks);
 }
+
+hostRoleCommandCache.invalidateAll(taskIds);
   }
 
   /**
@@ -756,8 +756,7 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
*/
   @Subscribe
   public void invalidateCommandCacheOnHostRemove(HostRemovedEvent event) {
-LOG.info("Invalidating command cache on host delete event." );
-LOG.debug("HostRemovedEvent => " + event);
+LOG.info("Invalidating HRC cache after receiveing {}", event);
 hostRoleCommandCache.invalidateAll();
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/365c74b5/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 b5442c2..d7ba463 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
@@ -276,6 +276,11 @@ public class AmbariJpaLocalTxnInterceptor implements 
MethodInterceptor {
   return;
 }
 
+// no need to lock again
+if (s_transactionalLocks.get().contains(annotation)) {
+  return;
+}
+
 // there is a lock area, so acquire the lock
 LockArea lockArea = annotation.lockArea();
 LockType lockType = annotation.lockType();

http://git-wip-us.apache.org/repos/asf/ambari/blob/365c74b5/ambari-server/src/main/java/org/apache/ambari/server/orm/TransactionalLocks.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/TransactionalLocks.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/TransactionalLocks.java
index 1768dd8..2c35b61 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/TransactionalLocks.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/TransactionalLocks.java
@@ -41,29 +41,26 @@ public class TransactionalLocks {
   /**
* Used to lookup whether {@link LockArea}s are enabled.
*/
-  @Inject
-  private Configuration m_configuration;
+  private final Configuration m_configuration;
 
   /**
* Manages 

ambari git commit: AMBARI-15191. Show swap memory for HAWQ Segment hosts(mithmatt via odiachenko).

2016-02-29 Thread odiachenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 db7ebc0c8 -> c784ea16c


AMBARI-15191. Show swap memory for HAWQ Segment hosts(mithmatt via odiachenko).


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

Branch: refs/heads/branch-2.2
Commit: c784ea16c22ff6adc5073f9c3ae6fc57cf68bbdb
Parents: db7ebc0
Author: Oleksandr Diachenko 
Authored: Mon Feb 29 11:50:59 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Mon Feb 29 11:50:59 2016 -0800

--
 .../common-services/HAWQ/2.0.0/widgets.json | 24 
 1 file changed, 20 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c784ea16/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json
index 48ae989..95a6c3f 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json
@@ -135,28 +135,44 @@
   "is_visible": true,
   "metrics": [
 {
-  "name": "mem_total",
+  "name": "mem_total._sum",
   "metric_path": "metrics/memory/mem_total",
   "service_name": "HAWQ",
   "component_name": "HAWQSEGMENT"
 },
 {
-  "name": "mem_free",
+  "name": "mem_free._sum",
   "metric_path": "metrics/memory/mem_free",
   "service_name": "HAWQ",
   "component_name": "HAWQSEGMENT"
 },
 {
-  "name": "mem_cached",
+  "name": "mem_cached._sum",
   "metric_path": "metrics/memory/mem_cached",
   "service_name": "HAWQ",
   "component_name": "HAWQSEGMENT"
+},
+{
+  "name": "swap_total._sum",
+  "metric_path": "metrics/memory/swap_total",
+  "service_name": "HAWQ",
+  "component_name": "HAWQSEGMENT"
+},
+{
+  "name": "swap_free._sum",
+  "metric_path": "metrics/memory/swap_free",
+  "service_name": "HAWQ",
+  "component_name": "HAWQSEGMENT"
 }
   ],
   "values": [
 {
   "name": "Memory utilization",
-  "value": "${((mem_total - mem_free - mem_cached)/mem_total) * 
100}"
+  "value": "${((mem_total._sum - mem_free._sum - 
mem_cached._sum)/mem_total._sum) * 100}"
+},
+{
+  "name": "Swap utilization",
+  "value": "${((swap_total._sum - swap_free._sum)/swap_total._sum) 
* 100}"
 }
   ],
   "properties": {



ambari git commit: AMBARI-15191. Show swap memory for HAWQ Segment hosts(mithmatt via odiachenko).

2016-02-29 Thread odiachenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 4cd5ad4e6 -> aaca7c479


AMBARI-15191. Show swap memory for HAWQ Segment hosts(mithmatt via odiachenko).


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

Branch: refs/heads/trunk
Commit: aaca7c47909510453ab5b1034190c9a8ab28e338
Parents: 4cd5ad4
Author: Oleksandr Diachenko 
Authored: Mon Feb 29 11:48:29 2016 -0800
Committer: Oleksandr Diachenko 
Committed: Mon Feb 29 11:48:29 2016 -0800

--
 .../common-services/HAWQ/2.0.0/widgets.json | 24 
 1 file changed, 20 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/aaca7c47/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json
index 48ae989..95a6c3f 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/widgets.json
@@ -135,28 +135,44 @@
   "is_visible": true,
   "metrics": [
 {
-  "name": "mem_total",
+  "name": "mem_total._sum",
   "metric_path": "metrics/memory/mem_total",
   "service_name": "HAWQ",
   "component_name": "HAWQSEGMENT"
 },
 {
-  "name": "mem_free",
+  "name": "mem_free._sum",
   "metric_path": "metrics/memory/mem_free",
   "service_name": "HAWQ",
   "component_name": "HAWQSEGMENT"
 },
 {
-  "name": "mem_cached",
+  "name": "mem_cached._sum",
   "metric_path": "metrics/memory/mem_cached",
   "service_name": "HAWQ",
   "component_name": "HAWQSEGMENT"
+},
+{
+  "name": "swap_total._sum",
+  "metric_path": "metrics/memory/swap_total",
+  "service_name": "HAWQ",
+  "component_name": "HAWQSEGMENT"
+},
+{
+  "name": "swap_free._sum",
+  "metric_path": "metrics/memory/swap_free",
+  "service_name": "HAWQ",
+  "component_name": "HAWQSEGMENT"
 }
   ],
   "values": [
 {
   "name": "Memory utilization",
-  "value": "${((mem_total - mem_free - mem_cached)/mem_total) * 
100}"
+  "value": "${((mem_total._sum - mem_free._sum - 
mem_cached._sum)/mem_total._sum) * 100}"
+},
+{
+  "name": "Swap utilization",
+  "value": "${((swap_total._sum - swap_free._sum)/swap_total._sum) 
* 100}"
 }
   ],
   "properties": {



ambari git commit: AMBARI-14951. Tez Ambari View: Add protocol configuration for YARN. (Sreenath Somarajapuram via yusaku)

2016-02-29 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 8eb62315f -> db7ebc0c8


AMBARI-14951. Tez Ambari View: Add protocol configuration for YARN. (Sreenath 
Somarajapuram via yusaku)


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

Branch: refs/heads/branch-2.2
Commit: db7ebc0c820923ab6bbd24d2b15ed22d669f4028
Parents: 8eb6231
Author: Yusaku Sako 
Authored: Mon Feb 29 11:21:28 2016 -0800
Committer: Yusaku Sako 
Committed: Mon Feb 29 11:23:38 2016 -0800

--
 contrib/views/capacity-scheduler/pom.xml|  2 +-
 contrib/views/files/pom.xml |  2 +-
 contrib/views/hive/pom.xml  |  2 +-
 contrib/views/pig/pom.xml   |  2 +-
 contrib/views/pom.xml   |  2 +-
 contrib/views/slider/pom.xml|  2 +-
 contrib/views/tez/pom.xml   |  2 +-
 .../apache/ambari/view/tez/ViewController.java  |  6 +++
 .../ambari/view/tez/ViewControllerImpl.java |  6 +++
 .../resources/ui/scripts/init-ambari-view.js| 40 +++-
 contrib/views/utils/pom.xml |  2 +-
 .../ambari/view/utils/ambari/Services.java  | 15 
 .../ambari/view/utils/ambari/ServicesTest.java  | 16 
 13 files changed, 89 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/db7ebc0c/contrib/views/capacity-scheduler/pom.xml
--
diff --git a/contrib/views/capacity-scheduler/pom.xml 
b/contrib/views/capacity-scheduler/pom.xml
index cacd3d3..5569859 100644
--- a/contrib/views/capacity-scheduler/pom.xml
+++ b/contrib/views/capacity-scheduler/pom.xml
@@ -81,7 +81,7 @@
 
 org.apache.ambari.contrib.views
 ambari-views-utils
-0.0.1.0-SNAPSHOT
+2.0.0.0-SNAPSHOT
 
 
 org.easymock

http://git-wip-us.apache.org/repos/asf/ambari/blob/db7ebc0c/contrib/views/files/pom.xml
--
diff --git a/contrib/views/files/pom.xml b/contrib/views/files/pom.xml
index 0a8a752..ccea5ab 100644
--- a/contrib/views/files/pom.xml
+++ b/contrib/views/files/pom.xml
@@ -94,7 +94,7 @@
 
   org.apache.ambari.contrib.views
   ambari-views-utils
-  0.0.1.0-SNAPSHOT
+  2.0.0.0-SNAPSHOT
 
 
   com.google.code.gson

http://git-wip-us.apache.org/repos/asf/ambari/blob/db7ebc0c/contrib/views/hive/pom.xml
--
diff --git a/contrib/views/hive/pom.xml b/contrib/views/hive/pom.xml
index 9ad4296..1f150ff 100644
--- a/contrib/views/hive/pom.xml
+++ b/contrib/views/hive/pom.xml
@@ -199,7 +199,7 @@
 
   org.apache.ambari.contrib.views
   ambari-views-utils
-  0.0.1.0-SNAPSHOT
+  2.0.0.0-SNAPSHOT
 
 
   commons-validator

http://git-wip-us.apache.org/repos/asf/ambari/blob/db7ebc0c/contrib/views/pig/pom.xml
--
diff --git a/contrib/views/pig/pom.xml b/contrib/views/pig/pom.xml
index fe5fcdf..97160cc 100644
--- a/contrib/views/pig/pom.xml
+++ b/contrib/views/pig/pom.xml
@@ -138,7 +138,7 @@
 
   org.apache.ambari.contrib.views
   ambari-views-utils
-  0.0.1.0-SNAPSHOT
+  2.0.0.0-SNAPSHOT
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/db7ebc0c/contrib/views/pom.xml
--
diff --git a/contrib/views/pom.xml b/contrib/views/pom.xml
index 32ea74f..6509277 100644
--- a/contrib/views/pom.xml
+++ b/contrib/views/pom.xml
@@ -34,13 +34,13 @@
 2.7.1
   
   
+utils
 files
 jobs
 pig
 slider
 capacity-scheduler
 tez
-utils
 storm
   
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/db7ebc0c/contrib/views/slider/pom.xml
--
diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml
index f66d71a..608988f 100644
--- a/contrib/views/slider/pom.xml
+++ b/contrib/views/slider/pom.xml
@@ -129,7 +129,7 @@
 
   org.apache.ambari.contrib.views
   ambari-views-utils
-  0.0.1.0-SNAPSHOT
+  2.0.0.0-SNAPSHOT
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/db7ebc0c/contrib/views/tez/pom.xml
--
diff --git a/contrib/views/tez/pom.xml b/contrib/views/tez/pom.xml
index 450cf9f..8e82c5e 100644
--- 

ambari git commit: AMBARI-14951. Tez Ambari View: Add protocol configuration for YARN. (Sreenath Somarajapuram via yusaku)

2016-02-29 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 042345c1b -> 4cd5ad4e6


AMBARI-14951. Tez Ambari View: Add protocol configuration for YARN. (Sreenath 
Somarajapuram via yusaku)


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

Branch: refs/heads/trunk
Commit: 4cd5ad4e61c2a9a3cfc7e22233b484e8fc88e8b2
Parents: 042345c
Author: Yusaku Sako 
Authored: Mon Feb 29 11:21:28 2016 -0800
Committer: Yusaku Sako 
Committed: Mon Feb 29 11:21:28 2016 -0800

--
 contrib/views/capacity-scheduler/pom.xml|  2 +-
 contrib/views/files/pom.xml |  2 +-
 contrib/views/hive/pom.xml  |  2 +-
 contrib/views/pig/pom.xml   |  2 +-
 contrib/views/pom.xml   |  2 +-
 contrib/views/slider/pom.xml|  2 +-
 contrib/views/tez/pom.xml   |  2 +-
 .../apache/ambari/view/tez/ViewController.java  |  6 +++
 .../ambari/view/tez/ViewControllerImpl.java |  6 +++
 .../resources/ui/scripts/init-ambari-view.js| 40 +++-
 contrib/views/utils/pom.xml |  2 +-
 .../ambari/view/utils/ambari/Services.java  | 15 
 .../ambari/view/utils/ambari/ServicesTest.java  | 16 
 13 files changed, 89 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4cd5ad4e/contrib/views/capacity-scheduler/pom.xml
--
diff --git a/contrib/views/capacity-scheduler/pom.xml 
b/contrib/views/capacity-scheduler/pom.xml
index 24a8ca2..393dccb 100644
--- a/contrib/views/capacity-scheduler/pom.xml
+++ b/contrib/views/capacity-scheduler/pom.xml
@@ -81,7 +81,7 @@
 
 org.apache.ambari.contrib.views
 ambari-views-utils
-0.0.1.0-SNAPSHOT
+2.0.0.0-SNAPSHOT
 
 
 org.easymock

http://git-wip-us.apache.org/repos/asf/ambari/blob/4cd5ad4e/contrib/views/files/pom.xml
--
diff --git a/contrib/views/files/pom.xml b/contrib/views/files/pom.xml
index ccdd281..961889e 100644
--- a/contrib/views/files/pom.xml
+++ b/contrib/views/files/pom.xml
@@ -94,7 +94,7 @@
 
   org.apache.ambari.contrib.views
   ambari-views-utils
-  0.0.1.0-SNAPSHOT
+  2.0.0.0-SNAPSHOT
 
 
   com.google.code.gson

http://git-wip-us.apache.org/repos/asf/ambari/blob/4cd5ad4e/contrib/views/hive/pom.xml
--
diff --git a/contrib/views/hive/pom.xml b/contrib/views/hive/pom.xml
index b82a413..34ec7d1 100644
--- a/contrib/views/hive/pom.xml
+++ b/contrib/views/hive/pom.xml
@@ -199,7 +199,7 @@
 
   org.apache.ambari.contrib.views
   ambari-views-utils
-  0.0.1.0-SNAPSHOT
+  2.0.0.0-SNAPSHOT
 
 
   commons-validator

http://git-wip-us.apache.org/repos/asf/ambari/blob/4cd5ad4e/contrib/views/pig/pom.xml
--
diff --git a/contrib/views/pig/pom.xml b/contrib/views/pig/pom.xml
index a88be2a..5679f1f 100644
--- a/contrib/views/pig/pom.xml
+++ b/contrib/views/pig/pom.xml
@@ -138,7 +138,7 @@
 
   org.apache.ambari.contrib.views
   ambari-views-utils
-  0.0.1.0-SNAPSHOT
+  2.0.0.0-SNAPSHOT
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4cd5ad4e/contrib/views/pom.xml
--
diff --git a/contrib/views/pom.xml b/contrib/views/pom.xml
index 627552a..eb1972c 100644
--- a/contrib/views/pom.xml
+++ b/contrib/views/pom.xml
@@ -34,13 +34,13 @@
 2.7.1
   
   
+utils
 files
 jobs
 pig
 slider
 capacity-scheduler
 tez
-utils
 storm
   
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/4cd5ad4e/contrib/views/slider/pom.xml
--
diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml
index c449413..94115f0 100644
--- a/contrib/views/slider/pom.xml
+++ b/contrib/views/slider/pom.xml
@@ -129,7 +129,7 @@
 
   org.apache.ambari.contrib.views
   ambari-views-utils
-  0.0.1.0-SNAPSHOT
+  2.0.0.0-SNAPSHOT
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4cd5ad4e/contrib/views/tez/pom.xml
--
diff --git a/contrib/views/tez/pom.xml b/contrib/views/tez/pom.xml
index 65400fb..cdda4dc 100644
--- a/contrib/views/tez/pom.xml

ambari git commit: AMBARI-15187. Introduce possibility to retry stack installation in case of network instability (dlysnichenko)

2016-02-29 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 16cda7576 -> 8eb62315f


AMBARI-15187. Introduce possibility to retry stack installation in case of 
network instability (dlysnichenko)


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

Branch: refs/heads/branch-2.2
Commit: 8eb62315f53e07ac922da07b8430e0fc1d0ea975
Parents: 16cda75
Author: Lisnichenko Dmitro 
Authored: Mon Feb 29 20:20:02 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Mon Feb 29 20:20:02 2016 +0200

--
 .../resource_management/TestPackageResource.py  |   6 +
 .../python/resource_management/TestScript.py|  12 +-
 .../core/providers/package/__init__.py  |  69 +--
 .../core/providers/package/apt.py   |  11 +-
 .../core/providers/package/yumrpm.py|   6 +-
 .../core/providers/package/zypper.py|  11 +-
 .../core/resources/packaging.py |  10 +-
 .../libraries/script/script.py  |   8 +-
 ambari-server/conf/unix/ambari.properties   |   5 +
 .../ambari/server/agent/ExecutionCommand.java   |   2 +
 .../ambari/server/agent/HeartbeatMonitor.java   |   2 -
 .../server/configuration/Configuration.java |  16 ++
 .../controller/AmbariActionExecutionHelper.java |   8 +-
 .../AmbariCustomCommandExecutionHelper.java |   4 +
 .../HBASE/0.96.0.2.0/package/scripts/hbase.py   |   4 +-
 .../0.96.0.2.0/package/scripts/params_linux.py  |   3 +
 .../HDFS/2.1.0.2.0/package/scripts/hdfs.py  |   4 +-
 .../2.1.0.2.0/package/scripts/params_linux.py   |   2 +
 .../0.12.0.2.0/package/scripts/params_linux.py  |   2 +
 .../package/scripts/setup_atlas_hive.py |   2 +-
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py|   4 +-
 .../4.0.0.2.0/package/scripts/params_linux.py   |   2 +
 .../custom_actions/scripts/install_packages.py  |  12 +-
 .../0.8/hooks/before-INSTALL/scripts/params.py  |   3 +
 .../scripts/shared_initialization.py|   5 +-
 .../hooks/before-INSTALL/scripts/params.py  |   3 +
 .../scripts/shared_initialization.py|   4 +-
 .../AmbariManagementControllerImplTest.java |   2 +-
 ...ClusterStackVersionResourceProviderTest.java |   3 +
 .../custom_actions/TestInstallPackages.py   | 196 +++
 .../configs/install_packages_config.json|   2 +
 .../stacks/2.0.6/HBASE/test_hbase_master.py |  12 +-
 .../2.0.6/HBASE/test_hbase_regionserver.py  |   2 +-
 .../python/stacks/2.0.6/configs/default.json|   5 +-
 .../2.0.6/configs/hbase-rs-2.2-phoenix.json |   2 +
 .../stacks/2.0.6/configs/hbase_no_phx.json  |   2 +
 .../stacks/2.0.6/configs/hbase_with_phx.json|   2 +
 .../hooks/before-INSTALL/test_before_install.py |   4 +-
 .../src/test/python/stacks/2.3/PXF/test_pxf.py  |  20 +-
 .../python/stacks/2.3/configs/pxf_default.json  |   2 +
 40 files changed, 373 insertions(+), 101 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8eb62315/ambari-agent/src/test/python/resource_management/TestPackageResource.py
--
diff --git 
a/ambari-agent/src/test/python/resource_management/TestPackageResource.py 
b/ambari-agent/src/test/python/resource_management/TestPackageResource.py
index 1d8ef01..1f2250d 100644
--- a/ambari-agent/src/test/python/resource_management/TestPackageResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestPackageResource.py
@@ -93,6 +93,7 @@ class TestPackageResource(TestCase):
   @patch.object(shell, "checked_call")
   @patch.object(System, "os_family", new = 'redhat')
   def test_action_install_rhel(self, shell_mock):
+shell_mock.return_value = (0,'')
 sys.modules['rpm'] = MagicMock()
 sys.modules['rpm'].TransactionSet.return_value = MagicMock()
 sys.modules['rpm'].TransactionSet.return_value.dbMatch.return_value = 
[{'name':'some_packag'}]
@@ -106,6 +107,7 @@ class TestPackageResource(TestCase):
   @patch.object(shell, "checked_call")
   @patch.object(System, "os_family", new = 'redhat')
   def test_action_install_pattern_rhel(self, shell_mock):
+shell_mock.return_value = (0,'')
 sys.modules['rpm'] = MagicMock()
 sys.modules['rpm'].TransactionSet.return_value = MagicMock()
 sys.modules['rpm'].TransactionSet.return_value.dbMatch.return_value = 
[{'name':'some_packag'}]
@@ -118,12 +120,14 @@ class TestPackageResource(TestCase):
   @patch.object(shell, "checked_call")
   @patch.object(System, "os_family", new = 'redhat')
   def test_action_install_pattern_installed_rhel(self, shell_mock):
+shell_mock.return_value = (0,'')
 

ambari git commit: AMBARI-15195: Auto-start services - Ambari should handle AMS auto start

2016-02-29 Thread smnaha
Repository: ambari
Updated Branches:
  refs/heads/trunk 7452f7165 -> 042345c1b


AMBARI-15195: Auto-start services - Ambari should handle AMS auto start


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

Branch: refs/heads/trunk
Commit: 042345c1bc909ba4ec22b0aec55af25452e69860
Parents: 7452f71
Author: Nahappan Somasundaram 
Authored: Fri Feb 26 16:55:41 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Mon Feb 29 10:17:58 2016 -0800

--
 .../resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/042345c1/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
index 2f2f116..c9d10e3 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
@@ -32,6 +32,7 @@
   1
   false
   AMS-HBASE
+  true
   
 
   ZOOKEEPER/ZOOKEEPER_SERVER



ambari git commit: AMBARI-15203. Add pre-upgrade check that warns about components with VERSION_MISMATCH . Add license headers (dlysnichenko)

2016-02-29 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 067cc6223 -> 7ee9fa875


AMBARI-15203. Add pre-upgrade check that warns about components with 
VERSION_MISMATCH . Add license headers (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7ee9fa8759818d80e15783afda1aa2e5c25ee802
Parents: 067cc62
Author: Lisnichenko Dmitro 
Authored: Mon Feb 29 17:06:28 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Mon Feb 29 17:08:17 2016 +0200

--
 .../ambari/server/checks/VersionMismatchCheck.java | 17 +
 .../server/checks/VersionMismatchCheckTest.java| 17 +
 2 files changed, 34 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7ee9fa87/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
index e37dc33..2caa69b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
@@ -1,3 +1,20 @@
+/**
+ * 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.checks;
 
 import com.google.inject.Singleton;

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ee9fa87/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
index 42aef30..fd60d22 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java
@@ -1,3 +1,20 @@
+/**
+ * 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.checks;
 
 import com.google.common.collect.ImmutableMap;



ambari git commit: AMBARI-15225. Write more UI UT (onechiporenko)

2016-02-29 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 5e0ad173d -> 7452f7165


AMBARI-15225. Write more UI UT (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 7452f7165842612d10aff8a9438f535518aa149e
Parents: 5e0ad17
Author: Oleg Nechiporenko 
Authored: Mon Feb 29 17:21:40 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Mon Feb 29 17:42:09 2016 +0200

--
 ambari-web/app/assets/test/tests.js |   5 +
 .../app/controllers/global/update_controller.js |  49 +
 .../app/views/main/service/services/hbase.js|  43 
 .../app/views/main/service/services/hdfs.js |   4 +-
 .../app/views/main/service/services/storm.js|   5 +-
 .../test/aliases/computed/formatUnavailable.js  |  62 +++
 .../global/update_controller_test.js| 103 +++
 .../hawq/addStandby/step3_controller_test.js|  54 +-
 .../nameNode/step3_controller_test.js   |  37 +++
 .../admin/kerberos/step2_controller_test.js |   2 +-
 .../admin/kerberos/step5_controller_test.js |  44 
 .../manage_config_groups_controller_test.js |  34 ++
 .../test/controllers/main/service_test.js   |  12 ---
 ambari-web/test/helpers.js  |   2 -
 ambari-web/test/init_computed_aliases.js|   3 +-
 ambari-web/test/models/form_test.js |   4 +-
 .../views/main/service/services/hbase_test.js   |  68 
 .../views/main/service/services/hdfs_test.js|  34 ++
 .../views/main/service/services/storm_test.js   |  34 ++
 .../views/main/service/services/yarn_test.js|  51 +
 20 files changed, 546 insertions(+), 104 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7452f716/ambari-web/app/assets/test/tests.js
--
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index 1954432..a875656 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -60,6 +60,7 @@ var files = [
   'test/controllers/main/admin/kerberos/step2_controller_test',
   'test/controllers/main/admin/kerberos/step3_controller_test',
   'test/controllers/main/admin/kerberos/step4_controller_test',
+  'test/controllers/main/admin/kerberos/step5_controller_test',
   'test/controllers/main/admin/kerberos/step6_controller_test',
   'test/controllers/main/admin/stack_and_upgrade_controller_test',
   'test/controllers/main/admin/serviceAccounts_controller_test',
@@ -275,7 +276,11 @@ var files = [
   'test/views/main/service/info/component_list_view_test',
   'test/views/main/service/info/metrics/ambari_metrics/regionserver_base_test',
   
'test/views/main/service/info/metrics/flume/flume_agent_metrics_section_test',
+  'test/views/main/service/services/hdfs_test',
+  'test/views/main/service/services/hbase_test',
   'test/views/main/service/services/ranger_test',
+  'test/views/main/service/services/storm_test',
+  'test/views/main/service/services/yarn_test',
   'test/views/main/service/widgets/create/expression_view_test',
   'test/views/main/admin/highAvailability/nameNode/step1_view_test',
   'test/views/main/admin/highAvailability/nameNode/step3_view_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/7452f716/ambari-web/app/controllers/global/update_controller.js
--
diff --git a/ambari-web/app/controllers/global/update_controller.js 
b/ambari-web/app/controllers/global/update_controller.js
index b1fa1cd..de4523b 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -89,7 +89,7 @@ App.UpdateController = Em.Controller.extend({
   },
 
   getUrl: function (testUrl, url) {
-return (App.get('testMode')) ? testUrl : App.apiPrefix + '/clusters/' + 
this.get('clusterName') + url;
+return App.get('testMode') ? testUrl : App.apiPrefix + '/clusters/' + 
this.get('clusterName') + url;
   },
 
   /**
@@ -105,7 +105,7 @@ App.UpdateController = Em.Controller.extend({
 if (queryParams) {
   params = this.computeParameters(queryParams);
 }
-params = (params.length > 0) ? params + "&" : params;
+params = params.length > 0 ? params + "&" : params;
 return prefix + realUrl.replace('', params);
   },
 
@@ -136,12 +136,9 @@ App.UpdateController = Em.Controller.extend({
   break;
 case 'MATCH':
   if (Em.isArray(param.value)) {
-params += 

ambari git commit: AMBARI-15204 Host checks should not be performed if 0 hosts register. (ababiichuk)

2016-02-29 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk ae6dbcea6 -> 5e0ad173d


AMBARI-15204 Host checks should not be performed if 0 hosts register. 
(ababiichuk)


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

Branch: refs/heads/trunk
Commit: 5e0ad173d34e16f3c4cb231e0e8b496e659ae3e9
Parents: ae6dbce
Author: ababiichuk 
Authored: Fri Feb 26 15:32:48 2016 +0200
Committer: ababiichuk 
Committed: Mon Feb 29 17:39:39 2016 +0200

--
 .../app/controllers/wizard/step3_controller.js| 18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5e0ad173/ambari-web/app/controllers/wizard/step3_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js 
b/ambari-web/app/controllers/wizard/step3_controller.js
index 8ae9068..19ddd20 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -230,7 +230,7 @@ App.WizardStep3Controller = 
Em.Controller.extend(App.ReloadPopupMixin, {
   } else {
 this.set('bootHosts', this.get('hosts'));
 if (App.get('testMode')) {
-  this.startHostcheck();
+  this.startHostcheck(this.get('hosts'));
   this.get('bootHosts').setEach('cpu', '2');
   this.get('bootHosts').setEach('memory', '200');
   this.set('isSubmitDisabled', false);
@@ -702,7 +702,7 @@ App.WizardStep3Controller = 
Em.Controller.extend(App.ReloadPopupMixin, {
 }, this);
 
 if (stopPolling) {
-  this.startHostcheck();
+  this.startHostcheck(hosts);
 }
 else {
   if (hosts.someProperty('bootStatus', 'RUNNING') || App.dateTime() - 
this.get('registrationStartedAt') < this.get('registrationTimeoutSecs') * 1000) 
{
@@ -718,7 +718,7 @@ App.WizardStep3Controller = 
Em.Controller.extend(App.ReloadPopupMixin, {
   _host.set('bootStatus', 'FAILED');
   _host.set('bootLog', (_host.get('bootLog') != null ? 
_host.get('bootLog') : '') + Em.I18n.t('installer.step3.hosts.bootLog.failed'));
 });
-this.startHostcheck();
+this.startHostcheck(hosts);
   }
 }
   },
@@ -910,10 +910,14 @@ App.WizardStep3Controller = 
Em.Controller.extend(App.ReloadPopupMixin, {
   },
 
 
-  startHostcheck: function() {
-this.set('isWarningsLoaded', false);
-this.getHostNameResolution();
-this.checkHostJDK();
+  startHostcheck: function(hosts) {
+if (!hosts.everyProperty('bootStatus', 'FAILED')) {
+  this.set('isWarningsLoaded', false);
+  this.getHostNameResolution();
+  this.checkHostJDK();
+} else {
+  this.stopHostCheck();
+}
   },
 
   getHostNameResolution: function () {



ambari git commit: AMBARI-14451:Parameterize distro-specific stack information for HDFS (Juanjo Marron via dili)

2016-02-29 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-13364 7f4975fa5 -> 3e02731ab


AMBARI-14451:Parameterize distro-specific stack information for HDFS (Juanjo 
Marron via dili)


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

Branch: refs/heads/AMBARI-13364
Commit: 3e02731abe04f4614108a6750371c5bf369d73de
Parents: 7f4975f
Author: Di Li 
Authored: Mon Feb 29 10:26:13 2016 -0500
Committer: Di Li 
Committed: Mon Feb 29 10:26:13 2016 -0500

--
 .../HDFS/2.1.0.2.0/configuration/hadoop-env.xml |  3 +--
 .../package/alerts/alert_ha_namenode_health.py  |  6 +++---
 .../package/alerts/alert_metrics_deviation.py   |  6 +++---
 .../HDFS/2.1.0.2.0/package/scripts/datanode.py  |  5 +++--
 .../HDFS/2.1.0.2.0/package/scripts/hdfs_client.py   |  5 +++--
 .../HDFS/2.1.0.2.0/package/scripts/journalnode.py   |  5 +++--
 .../package/scripts/journalnode_upgrade.py  |  2 +-
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py  |  5 +++--
 .../HDFS/2.1.0.2.0/package/scripts/nfsgateway.py|  5 +++--
 .../HDFS/2.1.0.2.0/package/scripts/params.py|  1 +
 .../HDFS/2.1.0.2.0/package/scripts/params_linux.py  | 14 +-
 .../2.1.0.2.0/package/scripts/setup_ranger_hdfs.py  | 12 ++--
 .../HDFS/2.1.0.2.0/package/scripts/snamenode.py |  5 +++--
 .../HDFS/2.1.0.2.0/package/scripts/status_params.py | 12 ++--
 .../HDFS/2.1.0.2.0/package/scripts/utils.py | 16 
 .../stacks/HDP/2.0.6/configuration/cluster-env.xml  | 15 +++
 16 files changed, 71 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3e02731a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hadoop-env.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hadoop-env.xml
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hadoop-env.xml
index 5e43b71..acdde55 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hadoop-env.xml
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/hadoop-env.xml
@@ -229,8 +229,7 @@ export HADOOP_HOME=${HADOOP_HOME:-/usr/lib/hadoop}
 #TODO: if env var set that can cause problems
 export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}
 
-{# this is different for HDP1 #}
-# Path to jsvc required by secure HDP 2.0 datanode
+# Path to jsvc required by secure datanode
 export JSVC_HOME={{jsvc_path}}
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e02731a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
index 7cd5591..419d976 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
@@ -234,7 +234,7 @@ def get_jmx(query, connection_timeout):
 
 def _get_ha_state_from_json(string_json):
   """
-  Searches through the specified JSON string looking for either the HDP 2.0 or 
2.1+ HA state
+  Searches through the specified JSON string looking for HA state
   enumerations.
   :param string_json: the string JSON
   :return:  the value of the HA state (active, standby, etc)
@@ -242,7 +242,7 @@ def _get_ha_state_from_json(string_json):
   json_data = json.loads(string_json)
   jmx_beans = json_data["beans"]
 
-  # look for HDP 2.1+ first
+  # look for NameNodeStatus-State first
   for jmx_bean in jmx_beans:
 if "name" not in jmx_bean:
   continue
@@ -251,7 +251,7 @@ def _get_ha_state_from_json(string_json):
 if jmx_bean_name == "Hadoop:service=NameNode,name=NameNodeStatus" and 
"State" in jmx_bean:
   return jmx_bean["State"]
 
-  # look for HDP 2.0 last
+  # look for FSNamesystem-tag.HAState last
   for jmx_bean in jmx_beans:
 if "name" not in jmx_bean:
   continue

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e02731a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py
--
diff --git 

ambari git commit: AMBARI-15171: Parameterize distro-specific stack information for SLIDER (Juanjo Marron via dili)

2016-02-29 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-13364 f83a07e36 -> ec88341d1


AMBARI-15171: Parameterize distro-specific stack information for SLIDER (Juanjo 
Marron via dili)


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

Branch: refs/heads/AMBARI-13364
Commit: ec88341d12042241afcbef6ef320c7a5790ec9b7
Parents: f83a07e
Author: Di Li 
Authored: Mon Feb 29 10:36:01 2016 -0500
Committer: Di Li 
Committed: Mon Feb 29 10:36:01 2016 -0500

--
 .../SLIDER/0.60.0.2.2/package/scripts/params.py | 2 +-
 .../SLIDER/0.60.0.2.2/package/scripts/params_linux.py   | 9 ++---
 .../SLIDER/0.60.0.2.2/package/scripts/params_windows.py | 4 ++--
 .../SLIDER/0.60.0.2.2/package/scripts/service_check.py  | 4 ++--
 .../SLIDER/0.60.0.2.2/package/scripts/slider.py | 2 +-
 .../SLIDER/0.60.0.2.2/package/scripts/slider_client.py  | 5 +++--
 6 files changed, 15 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
index 7b6a490..bb16dc3 100644
--- 
a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
@@ -41,7 +41,7 @@ stack_name = default("/hostLevelParams/stack_name", None)
 version = default("/commandParams/version", None)
 
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+stack_version_formatted = format_hdp_stack_version(stack_version_unformatted)
 
 #hadoop params
 hadoop_conf_dir = conf_select.get_hadoop_conf_dir()

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
index 09b7876..0b6b3a9 100644
--- 
a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_linux.py
@@ -27,15 +27,18 @@ from resource_management.libraries.functions import 
get_kinit_path
 # server configurations
 config = Script.get_config()
 
-slider_home_dir = '/usr/hdp/current/slider-client'
+stack_dir = config['configurations']['cluster-env']['stack_dir']
+stack_version_ru_support = 
config['configurations']['cluster-env']['stack_version_ru_support']
+
+slider_home_dir = format('{stack_dir}/current/slider-client')
 
 #hadoop params
 slider_bin_dir = "/usr/lib/slider/bin"
-if Script.is_hdp_stack_greater_or_equal("2.2"):
+if Script.is_hdp_stack_greater_or_equal(stack_version_ru_support):
 slider_bin_dir = format('{slider_home_dir}/bin')
 
 slider_conf_dir = format("{slider_home_dir}/conf")
-storm_slider_conf_dir = '/usr/hdp/current/storm-slider-client/conf'
+storm_slider_conf_dir = format('{stack_dir}/current/storm-slider-client/conf')
 
 slider_lib_dir = format('{slider_home_dir}/lib')
 slider_tar_gz = format('{slider_lib_dir}/slider.tar.gz')

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec88341d/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
 
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
index 366a1c9..fdb8160 100644
--- 
a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
+++ 
b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params_windows.py
@@ -24,13 +24,13 @@ import os
 # server configurations
 config = Script.get_config()
 
-hdp_root = None
+stack_root = None
 slider_home = None
 slider_bin_dir = None
 slider_conf_dir = None
 storm_slider_conf_dir = None
 try:
-  hdp_root 

ambari git commit: AMBARI-15137: Parameterize distro-specific stack information for TEZ (Juanjo Marron via dili)

2016-02-29 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-13364 e9741e0e6 -> f83a07e36


AMBARI-15137: Parameterize distro-specific stack information for TEZ (Juanjo 
Marron via dili)


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

Branch: refs/heads/AMBARI-13364
Commit: f83a07e360a9dd6717ce03a7b5d718e1fe8433c4
Parents: e9741e0
Author: Di Li 
Authored: Mon Feb 29 10:34:46 2016 -0500
Committer: Di Li 
Committed: Mon Feb 29 10:34:46 2016 -0500

--
 .../TEZ/0.4.0.2.1/package/scripts/params_linux.py | 18 +++---
 .../0.4.0.2.1/package/scripts/params_windows.py   | 10 +-
 .../TEZ/0.4.0.2.1/package/scripts/pre_upgrade.py  |  4 ++--
 .../0.4.0.2.1/package/scripts/service_check.py|  4 ++--
 .../TEZ/0.4.0.2.1/package/scripts/tez_client.py   |  5 +++--
 .../HDP/2.0.6/configuration/cluster-env.xml   |  5 +
 6 files changed, 28 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f83a07e3/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
index 25f867e..05bf5e0 100644
--- 
a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py
@@ -32,10 +32,13 @@ config = Script.get_config()
 tmp_dir = Script.get_tmp_dir()
 
 stack_name = default("/hostLevelParams/stack_name", None)
+stack_dir = config['configurations']['cluster-env']['stack_dir']
 
 # This is expected to be of the form #.#.#.#
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+stack_version_formatted = format_hdp_stack_version(stack_version_unformatted)
+stack_version_ru_support = 
config['configurations']['cluster-env']['stack_version_ru_support']
+stack_version_tez_symlink_support = 
config['configurations']['cluster-env']['stack_version_tez_symlink_support']
 
 # New Cluster Stack Version that is defined during the RESTART of a Rolling 
Upgrade
 version = default("/commandParams/version", None)
@@ -48,15 +51,16 @@ tez_etc_dir = "/etc/tez"
 config_dir = "/etc/tez/conf"
 tez_examples_jar = "/usr/lib/tez/tez-mapreduce-examples*.jar"
 
-# hadoop parameters for 2.2+
-if Script.is_hdp_stack_greater_or_equal("2.2"):
-  tez_examples_jar = "/usr/hdp/current/tez-client/tez-examples*.jar"
+# hadoop parameters for stack_version_ru_support+
+if Script.is_hdp_stack_greater_or_equal(stack_version_ru_support):
+  tez_examples_jar = "{stack_dir}/current/tez-client/tez-examples*.jar"
 
-# tez only started linking /usr/hdp/x.x.x.x/tez-client/conf in HDP 2.3+
-if Script.is_hdp_stack_greater_or_equal("2.3"):
+# tez only started linking /x.x.x.x/tez-client/conf in 
stack_version_tez_symlink_support+
+if Script.is_hdp_stack_greater_or_equal(stack_version_tez_symlink_support):
   # !!! use realpath for now since the symlink exists but is broken and a
   # broken symlink messes with the DirectoryProvider class
-  config_dir = os.path.realpath("/usr/hdp/current/tez-client/conf")
+  config_path = os.path.join(stack_dir, "current/tez-client/conf")
+  config_dir = os.path.realpath(config_path)
 
 kinit_path_local = 
get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', 
None))
 security_enabled = config['configurations']['cluster-env']['security_enabled']

http://git-wip-us.apache.org/repos/asf/ambari/blob/f83a07e3/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py
 
b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py
index 636d092..31d37f0 100644
--- 
a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py
+++ 
b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_windows.py
@@ -34,20 +34,20 @@ try:
 except KeyError:
   hadoop_classpath_prefix_template = ""
 
-hdp_stack_version = ""
+stack_version_formatted = ""
 
-hdp_root = None
+stack_root = None
 try:
-  hdp_root = 

ambari git commit: AMBARI-15114: Parameterize distro-specific stack information for HBASE (Juanjo Marron via dili)

2016-02-29 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-13364 b3f886e13 -> e9741e0e6


AMBARI-15114: Parameterize distro-specific stack information for HBASE (Juanjo 
Marron via dili)


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

Branch: refs/heads/AMBARI-13364
Commit: e9741e0e6b6c0696fa06eea549d28df4795d2a7e
Parents: b3f886e
Author: Di Li 
Authored: Mon Feb 29 10:32:35 2016 -0500
Committer: Di Li 
Committed: Mon Feb 29 10:32:35 2016 -0500

--
 .../0.96.0.2.0/package/scripts/hbase_client.py  |  5 +--
 .../0.96.0.2.0/package/scripts/hbase_master.py  |  3 +-
 .../package/scripts/hbase_regionserver.py   |  3 +-
 .../0.96.0.2.0/package/scripts/params_linux.py  | 34 +++-
 .../package/scripts/params_windows.py   |  2 +-
 .../package/scripts/phoenix_queryserver.py  |  7 ++--
 .../package/scripts/phoenix_service.py  |  2 +-
 .../0.96.0.2.0/package/scripts/service_check.py |  2 +-
 .../package/scripts/setup_ranger_hbase.py   |  6 ++--
 .../0.96.0.2.0/package/scripts/status_params.py | 10 --
 .../HBASE/0.96.0.2.0/package/scripts/upgrade.py |  6 ++--
 .../HDP/2.0.6/configuration/cluster-env.xml | 10 ++
 12 files changed, 56 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e9741e0e/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
index ac34d40..28d7375 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_client.py
@@ -51,13 +51,14 @@ class HbaseClientWindows(HbaseClient):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HbaseClientDefault(HbaseClient):
   def get_stack_to_component(self):
-return {"HDP": "hbase-client"}
+import params
+return {params.stack_name: "hbase-client"}
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
 import params
 env.set_params(params)
 
-if params.version and 
compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
+if params.version and 
compare_versions(format_hdp_stack_version(params.version), 
params.stack_version_ru_support) >= 0:
   conf_select.select(params.stack_name, "hbase", params.version)
   hdp_select.select("hbase-client", params.version)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e9741e0e/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
index 9515f61..5833773 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_master.py
@@ -71,7 +71,8 @@ class HbaseMasterWindows(HbaseMaster):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HbaseMasterDefault(HbaseMaster):
   def get_stack_to_component(self):
-return {"HDP": "hbase-master"}
+import params
+return {params.stack_name: "hbase-master"}
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
 import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/e9741e0e/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
index c17d219..37dd0a1 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase_regionserver.py
@@ -69,7 +69,8 @@ class HbaseRegionServerWindows(HbaseRegionServer):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HbaseRegionServerDefault(HbaseRegionServer):
   def 

ambari git commit: AMBARI-14472: Parameterize distro-specific stack information for OOZIE (Juanjo Marron via dili)

2016-02-29 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-13364 7a77bfe52 -> b3f886e13


AMBARI-14472: Parameterize distro-specific stack information for OOZIE (Juanjo 
Marron via dili)


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

Branch: refs/heads/AMBARI-13364
Commit: b3f886e13daea3641a8942ef5046f738d9809d8d
Parents: 7a77bfe
Author: Di Li 
Authored: Mon Feb 29 10:30:41 2016 -0500
Committer: Di Li 
Committed: Mon Feb 29 10:30:41 2016 -0500

--
 .../package/alerts/alert_check_oozie_server.py  | 10 -
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py|  6 +--
 .../4.0.0.2.0/package/scripts/oozie_client.py   |  7 ++--
 .../4.0.0.2.0/package/scripts/oozie_server.py   | 19 +
 .../package/scripts/oozie_server_upgrade.py | 32 +++---
 .../4.0.0.2.0/package/scripts/params_linux.py   | 44 +++-
 .../4.0.0.2.0/package/scripts/params_windows.py |  2 +-
 .../4.0.0.2.0/package/scripts/service_check.py  |  3 +-
 .../4.0.0.2.0/package/scripts/status_params.py  |  9 ++--
 .../HDP/2.0.6/configuration/cluster-env.xml | 15 +++
 10 files changed, 88 insertions(+), 59 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b3f886e1/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
index 90851c8..83db163 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
@@ -26,10 +26,15 @@ from resource_management.core.resources import Execute
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions import get_kinit_path
 from resource_management.libraries.functions import get_klist_path
+from resource_management.libraries.script.script import Script
 from ambari_commons.os_check import OSConst, OSCheck
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 from urlparse import urlparse
 
+
+# server configurations
+config = Script.get_config()
+
 RESULT_CODE_OK = 'OK'
 RESULT_CODE_CRITICAL = 'CRITICAL'
 RESULT_CODE_UNKNOWN = 'UNKNOWN'
@@ -45,7 +50,8 @@ KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY = 
'{{kerberos-env/executable_search_paths}}
 OOZIE_URL_KEY = '{{oozie-site/oozie.base.url}}'
 SECURITY_ENABLED = '{{cluster-env/security_enabled}}'
 OOZIE_USER = '{{oozie-env/oozie_user}}'
-OOZIE_CONF_DIR = '/usr/hdp/current/oozie-server/conf'
+stack_dir = config['configurations']['cluster-env']['stack_dir']
+OOZIE_CONF_DIR = format('{stack_dir}/current/oozie-server/conf')
 OOZIE_CONF_DIR_LEGACY = '/etc/oozie/conf'
 OOZIE_HTTPS_PORT = '{{oozie-site/oozie.https.port}}'
 OOZIE_ENV_CONTENT = '{{oozie-env/content}}'
@@ -152,7 +158,7 @@ def get_check_command(oozie_url, host_name, configurations, 
parameters, only_kin
 finally:
   kinit_lock.release()
 
-  # oozie configuration directory uses a symlink when > HDP 2.2
+  # oozie configuration directory uses a symlink when stack_version > 
stack_version_ru_support
   oozie_config_directory = OOZIE_CONF_DIR_LEGACY
   if os.path.exists(OOZIE_CONF_DIR):
 oozie_config_directory = OOZIE_CONF_DIR

http://git-wip-us.apache.org/repos/asf/ambari/blob/b3f886e1/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index 7591bad..1eddc4a 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -147,7 +147,7 @@ def oozie(is_server=False):
   owner=params.oozie_user
 )
 
-  if params.hdp_stack_version != "" and 
compare_versions(params.hdp_stack_version, '2.2') >= 0:
+  if params.stack_version_formatted != "" and 
compare_versions(params.stack_version_formatted, 
params.stack_version_ru_support) >= 0:
 File(format("{params.conf_dir}/adminusers.txt"),
   mode=0644,
   group=params.user_group,
@@ -201,7 +201,7 

ambari git commit: AMBARI-15053: Parameterize distro-specific stack information for YARN/MR (Juanjo Marron via dili)

2016-02-29 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-13364 3e02731ab -> 7a77bfe52


AMBARI-15053: Parameterize distro-specific stack information for YARN/MR 
(Juanjo Marron via dili)


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

Branch: refs/heads/AMBARI-13364
Commit: 7a77bfe52060920678d50aebc6d7f1e24ef01858
Parents: 3e02731
Author: Di Li 
Authored: Mon Feb 29 10:28:27 2016 -0500
Committer: Di Li 
Committed: Mon Feb 29 10:28:27 2016 -0500

--
 .../scripts/application_timeline_server.py  |  5 ++--
 .../2.1.0.2.0/package/scripts/historyserver.py  |  9 
 .../package/scripts/mapreduce2_client.py|  5 ++--
 .../2.1.0.2.0/package/scripts/nodemanager.py|  5 ++--
 .../2.1.0.2.0/package/scripts/params_linux.py   | 24 +++-
 .../package/scripts/resourcemanager.py  |  5 ++--
 .../2.1.0.2.0/package/scripts/service_check.py  |  6 ++---
 .../YARN/2.1.0.2.0/package/scripts/yarn.py  |  6 ++---
 .../2.1.0.2.0/package/scripts/yarn_client.py|  5 ++--
 9 files changed, 39 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7a77bfe5/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
index 7644225..61e4d66 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/application_timeline_server.py
@@ -63,14 +63,15 @@ class 
ApplicationTimelineServerWindows(ApplicationTimelineServer):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class ApplicationTimelineServerDefault(ApplicationTimelineServer):
   def get_stack_to_component(self):
-return {"HDP": "hadoop-yarn-timelineserver"}
+import params
+return {params.stack_name: "hadoop-yarn-timelineserver"}
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
 Logger.info("Executing Stack Upgrade pre-restart")
 import params
 env.set_params(params)
 
-if params.version and 
compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
+if params.version and 
compare_versions(format_hdp_stack_version(params.version), 
params.stack_version_ru_support) >= 0:
   conf_select.select(params.stack_name, "hadoop", params.version)
   hdp_select.select("hadoop-yarn-timelineserver", params.version)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a77bfe5/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
index 5d95c5c..c8b1bcd 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/historyserver.py
@@ -70,14 +70,15 @@ class HistoryserverWindows(HistoryServer):
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)
 class HistoryServerDefault(HistoryServer):
   def get_stack_to_component(self):
-return {"HDP": "hadoop-mapreduce-historyserver"}
+import params
+return {params.stack_name: "hadoop-mapreduce-historyserver"}
 
   def pre_upgrade_restart(self, env, upgrade_type=None):
 Logger.info("Executing Stack Upgrade pre-restart")
 import params
 env.set_params(params)
 
-if params.version and 
compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0:
+if params.version and 
compare_versions(format_hdp_stack_version(params.version), 
params.stack_version_ru_support) >= 0:
   conf_select.select(params.stack_name, "hadoop", params.version)
   hdp_select.select("hadoop-mapreduce-historyserver", params.version)
   # MC Hammer said, "Can't touch this"
@@ -91,7 +92,7 @@ class HistoryServerDefault(HistoryServer):
 env.set_params(params)
 self.configure(env) # FOR SECURITY
 
-if params.hdp_stack_version_major and 
compare_versions(params.hdp_stack_version_major, '2.2.0.0') >= 0:
+if params.stack_version_formatted and 

ambari git commit: AMBARI-15190. Authorization for Auto start services (rlevas)

2016-02-29 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk 7ee9fa875 -> ae6dbcea6


AMBARI-15190. Authorization for Auto start services (rlevas)


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

Branch: refs/heads/trunk
Commit: ae6dbcea63d5fe8b691723e0c86d80480719aefd
Parents: 7ee9fa8
Author: Robert Levas 
Authored: Mon Feb 29 10:27:58 2016 -0500
Committer: Robert Levas 
Committed: Mon Feb 29 10:28:03 2016 -0500

--
 .../internal/ComponentResourceProvider.java |   4 +
 .../internal/ComponentResourceProviderTest.java | 130 +++
 ambari-web/app/views/main/admin.js  |   2 +-
 ambari-web/app/views/main/menu.js   |   4 +-
 4 files changed, 137 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ae6dbcea/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
index 03d74a7..6236ac2 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ComponentResourceProvider.java
@@ -542,6 +542,10 @@ public class ComponentResourceProvider extends 
AbstractControllerResourceProvide
   // Gather the components affected by the change in
   // auto start state
   if (!StringUtils.isEmpty(request.getRecoveryEnabled())) {
+// Verify that the authenticated user has authorization to change 
auto-start states for services
+AuthorizationHelper.verifyAuthorization(ResourceType.CLUSTER, 
getClusterResourceId(clusterName),
+EnumSet.of(RoleAuthorization.SERVICE_START_STOP));
+
 boolean newRecoveryEnabled = 
Boolean.parseBoolean(request.getRecoveryEnabled());
 boolean oldRecoveryEnabled = sc.isRecoveryEnabled();
 if (newRecoveryEnabled != oldRecoveryEnabled) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ae6dbcea/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
index 042c5d4..286b3cf 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
@@ -604,6 +604,136 @@ public class ComponentResourceProviderTest {
 verify(managementController);
   }
 
+  @Test
+  public void testUpdateAutoStartAsAdministrator() throws Exception {
+testUpdateAutoStart(TestAuthenticationFactory.createAdministrator());
+  }
+
+  @Test
+  public void testUpdateAutoStartAsClusterAdministrator() throws Exception {
+
testUpdateAutoStart(TestAuthenticationFactory.createClusterAdministrator());
+  }
+
+  @Test
+  public void testUpdateAutoStartAsServiceAdministrator() throws Exception {
+
testUpdateAutoStart(TestAuthenticationFactory.createServiceAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testUpdateAutoStartAsClusterUser() throws Exception {
+testUpdateAutoStart(TestAuthenticationFactory.createClusterUser());
+  }
+
+  /**
+   * Perform steps to test updating the Auto-Start property 
(ServiceComponentInfo/recovery_enabled)
+   * of a service.
+   *
+   * @param authentication the authentication and authorization details of the 
acting user
+   * @throws Exception
+   */
+  private void testUpdateAutoStart(Authentication authentication) throws 
Exception {
+Resource.Type type = Resource.Type.Component;
+
+MaintenanceStateHelper maintenanceStateHelper = 
createMock(MaintenanceStateHelper.class);
+AmbariManagementController managementController = 
createMock(AmbariManagementController.class);
+Clusters clusters = createMock(Clusters.class);
+Cluster cluster = createMock(Cluster.class);
+AmbariMetaInfo ambariMetaInfo = createMock(AmbariMetaInfo.class);
+Service service = createMock(Service.class);
+ComponentInfo component1Info = 

ambari git commit: AMBARI-14435: Parameterize distro-specific stack information for ZOOKEEPER (Juanjo Marron via dili)

2016-02-29 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/AMBARI-13364 aac5389fe -> 7f4975fa5


AMBARI-14435: Parameterize distro-specific stack information for ZOOKEEPER 
(Juanjo Marron via dili)


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

Branch: refs/heads/AMBARI-13364
Commit: 7f4975fa5078eff6fda34c76b9830c263e03f859
Parents: aac5389
Author: Di Li 
Authored: Mon Feb 29 10:19:21 2016 -0500
Committer: Di Li 
Committed: Mon Feb 29 10:19:21 2016 -0500

--
 .../3.4.5.2.0/package/scripts/params_linux.py| 15 ---
 .../3.4.5.2.0/package/scripts/params_windows.py  |  4 ++--
 .../3.4.5.2.0/package/scripts/service_check.py   |  2 +-
 .../3.4.5.2.0/package/scripts/status_params.py   | 10 +++---
 .../ZOOKEEPER/3.4.5.2.0/package/scripts/zookeeper.py |  4 ++--
 .../3.4.5.2.0/package/scripts/zookeeper_client.py|  5 +++--
 .../3.4.5.2.0/package/scripts/zookeeper_server.py|  5 +++--
 .../3.4.5.2.0/package/scripts/zookeeper_service.py   |  4 ++--
 .../stacks/HDP/2.0.6/configuration/cluster-env.xml   | 10 ++
 9 files changed, 38 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7f4975fa/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
index c6264ff..8834879 100644
--- 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_linux.py
@@ -32,9 +32,11 @@ config = Script.get_config()
 tmp_dir = Script.get_tmp_dir()
 
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
-hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+stack_version_formatted = format_hdp_stack_version(stack_version_unformatted)
+stack_version_ru_support = 
config['configurations']['cluster-env']['stack_version_ru_support']
 
 stack_name = default("/hostLevelParams/stack_name", None)
+stack_dir = config['configurations']['cluster-env']['stack_dir']
 current_version = default("/hostLevelParams/current_version", None)
 component_directory = status_params.component_directory
 
@@ -48,14 +50,13 @@ zk_cli_shell = "/usr/lib/zookeeper/bin/zkCli.sh"
 config_dir = "/etc/zookeeper/conf"
 zk_smoke_out = os.path.join(tmp_dir, "zkSmoke.out")
 
-# hadoop parameters for 2.2+
-if Script.is_hdp_stack_greater_or_equal("2.2"):
-  zk_home = format("/usr/hdp/current/{component_directory}")
-  zk_bin = format("/usr/hdp/current/{component_directory}/bin")
-  zk_cli_shell = format("/usr/hdp/current/{component_directory}/bin/zkCli.sh")
+# hadoop parameters for stack_version_ru_support+
+if Script.is_hdp_stack_greater_or_equal(stack_version_ru_support):
+  zk_home = format("{stack_dir}/current/{component_directory}")
+  zk_bin = format("{stack_dir}/current/{component_directory}/bin")
+  zk_cli_shell = 
format("{stack_dir}/current/{component_directory}/bin/zkCli.sh")
   config_dir = status_params.config_dir
 
-
 zk_user = config['configurations']['zookeeper-env']['zk_user']
 hostname = config['hostname']
 user_group = config['configurations']['cluster-env']['user_group']

http://git-wip-us.apache.org/repos/asf/ambari/blob/7f4975fa/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_windows.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_windows.py
 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_windows.py
index 480fc8b..c36e152 100644
--- 
a/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_windows.py
+++ 
b/ambari-server/src/main/resources/common-services/ZOOKEEPER/3.4.5.2.0/package/scripts/params_windows.py
@@ -26,11 +26,11 @@ import status_params
 config = Script.get_config()
 
 config_dir = None
-hdp_root = None
+stack_root = None
 try:
   # not used zookeeper_home_dir = os.environ["ZOOKEEPER_HOME"]
   config_dir = os.environ["ZOOKEEPER_CONF_DIR"]
-  hdp_root = os.environ["HADOOP_NODE_INSTALL_ROOT"]
+  stack_root = os.environ["HADOOP_NODE_INSTALL_ROOT"]
 except:
   pass
 


ambari git commit: AMBARI-15224. On Trunk, UI has missing names for components which have alert information associated with them (alexantonenko)

2016-02-29 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk cb280b583 -> 067cc6223


AMBARI-15224. On Trunk, UI has missing names for components which have alert 
information associated with them (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 067cc6223b0b7ff44c7c75485d12088821e89cc9
Parents: cb280b5
Author: Alex Antonenko 
Authored: Mon Feb 29 16:45:48 2016 +0200
Committer: Alex Antonenko 
Committed: Mon Feb 29 16:45:48 2016 +0200

--
 ambari-web/app/controllers/global/update_controller.js | 1 +
 ambari-web/app/mappers/service_metrics_mapper.js   | 1 +
 2 files changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/067cc622/ambari-web/app/controllers/global/update_controller.js
--
diff --git a/ambari-web/app/controllers/global/update_controller.js 
b/ambari-web/app/controllers/global/update_controller.js
index 72b3ca2..b1fa1cd 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -458,6 +458,7 @@ App.UpdateController = Em.Controller.extend({
   realUrl = '/components/?' + flumeHandlerParam + atsHandlerParam + 
haComponents +
 'ServiceComponentInfo/category=MASTER=' +
 'ServiceComponentInfo/service_name,' +
+'host_components/HostRoles/display_name,' +
 'host_components/HostRoles/host_name,' +
 'host_components/HostRoles/state,' +
 'host_components/HostRoles/maintenance_state,' +

http://git-wip-us.apache.org/repos/asf/ambari/blob/067cc622/ambari-web/app/mappers/service_metrics_mapper.js
--
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index 80e86c6..a88c3e6 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -150,6 +150,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   config3: {
 work_status: 'HostRoles.state',
 passive_state: 'HostRoles.maintenance_state',
+display_name: 'HostRoles.display_name',
 component_name: 'HostRoles.component_name',
 host_id: 'HostRoles.host_name',
 host_name: 'HostRoles.host_name',



ambari git commit: AMBARI-15221. Gap between top navigation bar and views dropdown (alexantonenko)

2016-02-29 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 771deecd2 -> cb280b583


AMBARI-15221. Gap between top navigation bar and views dropdown (alexantonenko)


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

Branch: refs/heads/trunk
Commit: cb280b5832ed5464fb6dcbc3f5c879948a0493bd
Parents: 771deec
Author: Alex Antonenko 
Authored: Mon Feb 29 15:37:03 2016 +0200
Committer: Alex Antonenko 
Committed: Mon Feb 29 16:21:25 2016 +0200

--
 ambari-web/app/styles/application.less  | 3 +++
 ambari-web/app/templates/main/menu_item.hbs | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/cb280b58/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 75ceacc..d8cb4ca 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -218,6 +218,9 @@ footer {
 color: @top-nav-menu-text-color;
 text-align: center;
 white-space: nowrap;
+&.views-button-container {
+  padding-bottom: 9.23077px;
+}
   }
   .active > a, .active > a:hover, .active > a:focus {
 color: @top-nav-menu-active-text-color;

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb280b58/ambari-web/app/templates/main/menu_item.hbs
--
diff --git a/ambari-web/app/templates/main/menu_item.hbs 
b/ambari-web/app/templates/main/menu_item.hbs
index 4d75298..0f8d6a9 100644
--- a/ambari-web/app/templates/main/menu_item.hbs
+++ b/ambari-web/app/templates/main/menu_item.hbs
@@ -17,7 +17,7 @@
 }}
 
 
-
+
   {{{unbound view.content.label}}}
 
 



ambari git commit: AMBARI-15132: in upgrade.xml to support set/replace/transfer (dili)

2016-02-29 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/trunk c4e5cdf5c -> 771deecd2


AMBARI-15132:  in upgrade.xml to support set/replace/transfer (dili)


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

Branch: refs/heads/trunk
Commit: 771deecd2a2f7d04e354f211ca64f3b2f41e6043
Parents: c4e5cdf
Author: Di Li 
Authored: Mon Feb 29 08:49:38 2016 -0500
Committer: Di Li 
Committed: Mon Feb 29 08:49:38 2016 -0500

--
 .../serveraction/upgrades/ConfigureAction.java  |  143 ++-
 .../upgrade/ConfigUpgradeChangeDefinition.java  |   68 +-
 .../state/stack/upgrade/ConfigureTask.java  |  146 +--
 .../upgrades/ConfigureActionTest.java   | 1004 ++
 .../ambari/server/state/UpgradeHelperTest.java  |  182 +++-
 .../HDP/2.1.1/upgrades/config-upgrade.xml   |  113 +-
 .../stacks/HDP/2.1.1/upgrades/upgrade_test.xml  |2 +
 7 files changed, 1534 insertions(+), 124 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/771deecd/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
index e77cf36..f7de8a9 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/ConfigureAction.java
@@ -44,7 +44,11 @@ import 
org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinitio
 import 
org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.Replace;
 import 
org.apache.ambari.server.state.stack.upgrade.ConfigUpgradeChangeDefinition.Transfer;
 import org.apache.ambari.server.state.stack.upgrade.ConfigureTask;
+import org.apache.ambari.server.state.stack.upgrade.PropertyKeyState;
+import org.apache.ambari.server.state.stack.upgrade.TransferOperation;
 import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.text.MessageFormat;
 import java.util.ArrayList;
@@ -78,6 +82,8 @@ import java.util.concurrent.ConcurrentMap;
  */
 public class ConfigureAction extends AbstractServerAction {
 
+  private static Logger LOG = LoggerFactory.getLogger(ConfigureAction.class);
+
   /**
* Used to lookup the cluster.
*/
@@ -173,6 +179,7 @@ public class ConfigureAction extends AbstractServerAction {
 }
 
 String clusterName = commandParameters.get("clusterName");
+Cluster cluster = m_clusters.getCluster(clusterName);
 
 // such as hdfs-site or hbase-env
 String configType = 
commandParameters.get(ConfigureTask.PARAMETER_CONFIG_TYPE);
@@ -183,6 +190,7 @@ public class ConfigureAction extends AbstractServerAction {
 if (null != keyValuePairJson) {
   keyValuePairs = m_gson.fromJson(
   keyValuePairJson, new 
TypeToken(){}.getType());
+  keyValuePairs = getAllowedSets(cluster, configType, keyValuePairs);
 }
 
 // extract transfers
@@ -191,6 +199,7 @@ public class ConfigureAction extends AbstractServerAction {
 if (null != transferJson) {
   transfers = m_gson.fromJson(
 transferJson, new TypeToken(){}.getType());
+  transfers = getAllowedTransfers(cluster, configType, transfers);
 }
 
 // extract replacements
@@ -199,6 +208,7 @@ public class ConfigureAction extends AbstractServerAction {
 if (null != replaceJson) {
   replacements = m_gson.fromJson(
   replaceJson, new TypeToken(){}.getType());
+  replacements = getAllowedReplacements(cluster, configType, replacements);
 }
 
 // if there is nothing to do, then skip the task
@@ -224,8 +234,6 @@ public class ConfigureAction extends AbstractServerAction {
   return createCommandReport(0, HostRoleStatus.FAILED, "{}", "", message);
 }
 
-Cluster cluster = m_clusters.getCluster(clusterName);
-
 Map desiredConfigs = cluster.getDesiredConfigs();
 DesiredConfig desiredConfig = desiredConfigs.get(configType);
 Config config = cluster.getConfig(configType, desiredConfig.getTag());
@@ -550,4 +558,135 @@ public class ConfigureAction extends AbstractServerAction 
{
 return value;
   }
 
+  private List getAllowedReplacements(Cluster cluster, String 
configType, List replacements){
+List allowedReplacements= new ArrayList<>();
+
+for(Replace replacement: replacements){
+  

ambari git commit: Revert "AMBARI-15160. YARN restart icon appeared after 5 minutes after reconfig (aonishuk)"

2016-02-29 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 227ead0c7 -> 16cda7576


Revert "AMBARI-15160. YARN restart icon appeared after 5 minutes after reconfig 
(aonishuk)"

This reverts commit 5edef8a68c41fedaee171f40afd0fe204890aca5.


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

Branch: refs/heads/branch-2.2
Commit: 16cda7576e6c0ae750a314aae4ec40ecbc370042
Parents: 227ead0
Author: Sumit Mohanty 
Authored: Mon Feb 29 05:50:32 2016 -0800
Committer: Sumit Mohanty 
Committed: Mon Feb 29 05:50:32 2016 -0800

--
 .../ambari/server/state/ConfigHelper.java   | 43 +---
 .../ambari/server/state/ConfigHelperTest.java   |  2 +-
 2 files changed, 3 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/16cda757/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index 30e4157..aa30b48 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -19,8 +19,6 @@ package org.apache.ambari.server.state;
 
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.RemovalListener;
-import com.google.common.cache.RemovalNotification;
 import com.google.common.collect.Maps;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -35,7 +33,6 @@ import 
org.apache.ambari.server.orm.entities.ClusterConfigEntity;
 import org.apache.ambari.server.state.PropertyInfo.PropertyType;
 import org.apache.ambari.server.state.configgroup.ConfigGroup;
 import org.apache.ambari.server.upgrade.UpgradeCatalog170;
-import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -86,30 +83,6 @@ public class ConfigHelper {
   public static final String HTTP_ONLY = "HTTP_ONLY";
   public static final String HTTPS_ONLY = "HTTPS_ONLY";
 
-  /**
-   * Used to debug stale config cache changes.
-   */
-  private class StaleConfigRemovalListener implements RemovalListener {
-
-@Override
-public void onRemoval(RemovalNotification removalNotification) {
-  ServiceComponentHost sch;
-  if(removalNotification.getKey() instanceof ServiceComponentHost)
-  {
-sch = (ServiceComponentHost)removalNotification.getKey();
-  } else {
-return;
-  }
-  String message = String.format(
-  "Removed stale config flag 
for:\n\thost:component=%s:%s\n\treason=%s",
-  sch.getHostName(),
-  sch.getServiceComponentName(),
-  removalNotification.getCause().toString()
-  );
-  LOG.info(message);
-}
-  }
-
   @Inject
   public ConfigHelper(Clusters c, AmbariMetaInfo metaInfo, Configuration 
configuration, ClusterDAO clusterDAO) {
 clusters = c;
@@ -117,8 +90,7 @@ public class ConfigHelper {
 this.clusterDAO = clusterDAO;
 STALE_CONFIGS_CACHE_ENABLED = configuration.isStaleConfigCacheEnabled();
 staleConfigsCache = CacheBuilder.newBuilder().
-expireAfterWrite(STALE_CONFIGS_CACHE_EXPIRATION_TIME, 
TimeUnit.SECONDS).
-removalListener(new StaleConfigRemovalListener()).build();
+expireAfterWrite(STALE_CONFIGS_CACHE_EXPIRATION_TIME, 
TimeUnit.SECONDS).build();
   }
 
   /**
@@ -1005,17 +977,6 @@ public class ConfigHelper {
 Map> desired = getEffectiveDesiredTags(cluster,
 sch.getHostName());
 
-ArrayList configs = new ArrayList<>();
-Iterator>> configIterator = 
desired.entrySet().iterator();
-while (configIterator.hasNext()) {
-  Entry> desiredEntry = configIterator.next();
-  configs.add(desiredEntry.getKey() + ":" + desiredEntry.getValue());
-}
-LOG.info(String.format(
-"Calculating stale configs for \n\tcomponent:%s\n\twith 
configs:%s",
-sch.getHostName() + ":" + sch.getServiceComponentName(),
-StringUtils.join(configs, ';')));
-
 ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(),
 stackId.getStackVersion(), sch.getServiceName());
 ComponentInfo componentInfo = 
serviceInfo.getComponentByName(sch.getServiceComponentName());
@@ -1218,4 +1179,4 @@ public class ConfigHelper {
   }
 
 
-}
\ No 

ambari git commit: AMBARI-15203. Add pre-upgrade check that warns about components with VERSION_MISMATCH (dlysnichenko)

2016-02-29 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk b305aecae -> c4e5cdf5c


AMBARI-15203. Add pre-upgrade check that warns about components with 
VERSION_MISMATCH (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: c4e5cdf5c68563f3b8a5c7e0d1043eddfc236ae0
Parents: b305aec
Author: Lisnichenko Dmitro 
Authored: Mon Feb 29 13:34:40 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Mon Feb 29 13:34:40 2016 +0200

--
 .../ambari/server/checks/CheckDescription.java  |   7 ++
 .../ambari/server/checks/UpgradeCheckGroup.java |   5 +
 .../server/checks/VersionMismatchCheck.java | 105 +++
 .../server/checks/VersionMismatchCheckTest.java |  80 ++
 4 files changed, 197 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c4e5cdf5/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
index ba987aa..b06848a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
@@ -224,6 +224,13 @@ public enum CheckDescription {
   " That is a potential problem when doing stack update.");
   }}),
 
+  VERSION_MISMATCH(PrereqCheckType.HOST,
+  "All components must be reporting the expected version",
+  new HashMap() {{
+put(AbstractCheckDescriptor.DEFAULT,
+"There are components which are not reporting the expected stack 
version: \n%s");
+  }}),
+
   SERVICES_RANGER_PASSWORD_VERIFY(PrereqCheckType.SERVICE,
   "Verify Ambari and Ranger Password Synchronization",
   new HashMap() {{

http://git-wip-us.apache.org/repos/asf/ambari/blob/c4e5cdf5/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckGroup.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckGroup.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckGroup.java
index 0be5be1..0b24426 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckGroup.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckGroup.java
@@ -69,6 +69,11 @@ public enum UpgradeCheckGroup {
*/
   CONFIGURATION_WARNING(8.0f),
 
+  /***
+   * Checks the component version on the hosts.
+   */
+  COMPONENT_VERSION(9.0f),
+
   /**
* All other checks.
*/

http://git-wip-us.apache.org/repos/asf/ambari/blob/c4e5cdf5/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
new file mode 100644
index 000..e37dc33
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
@@ -0,0 +1,105 @@
+package org.apache.ambari.server.checks;
+
+import com.google.inject.Singleton;
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.PrereqCheckRequest;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Service;
+import org.apache.ambari.server.state.ServiceComponent;
+import org.apache.ambari.server.state.ServiceComponentHost;
+import org.apache.ambari.server.state.UpgradeState;
+import org.apache.ambari.server.state.stack.PrereqCheckStatus;
+import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Warns about host components whose upgrade state is VERSION_MISMATCH. Never 
triggers
+ * fail. In failure description, lists actual and expected component versions.
+ */
+@Singleton
+@UpgradeCheck(group = UpgradeCheckGroup.COMPONENT_VERSION, order = 7.0f, 
required = true)
+public class VersionMismatchCheck extends AbstractCheckDescriptor {
+
+  public VersionMismatchCheck() {
+super(CheckDescription.VERSION_MISMATCH);
+  }
+
+  @Override
+  public void