ambari git commit: AMBARI-13678 Make it configurable as to how frequently ActionScheduler scans DB for tasks (dsen)

2015-11-03 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 59cf4b76c -> 09aad6be9


AMBARI-13678 Make it configurable as to how frequently ActionScheduler scans DB 
for tasks (dsen)


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

Branch: refs/heads/branch-2.1
Commit: 09aad6be9e2731b1c7cdd8878e5a3569b32aaa94
Parents: 59cf4b7
Author: Dmytro Sen 
Authored: Tue Nov 3 11:43:59 2015 +0200
Committer: Dmytro Sen 
Committed: Tue Nov 3 11:45:45 2015 +0200

--
 .../server/configuration/Configuration.java | 55 +++-
 .../server/controller/ControllerModule.java |  3 +-
 .../server/configuration/ConfigurationTest.java | 18 +++
 .../scheduler/ExecutionSchedulerTest.java   |  6 +--
 4 files changed, 64 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/09aad6be/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 26e20e8..dd8e832 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -270,15 +270,17 @@ public class Configuration {
   public static final String REPO_SUFFIX_KEY_UBUNTU = 
"repo.validation.suffixes.ubuntu";
   public static final String REPO_SUFFIX_KEY_DEFAULT = 
"repo.validation.suffixes.default";
 
-  public static final String EXECUTION_SCHEDULER_CLUSTERED = 
"server.execution.scheduler.isClustered";
-  public static final String EXECUTION_SCHEDULER_THREADS = 
"server.execution.scheduler.maxThreads";
-  public static final String EXECUTION_SCHEDULER_CONNECTIONS = 
"server.execution.scheduler.maxDbConnections";
-  public static final String EXECUTION_SCHEDULER_MISFIRE_TOLERATION = 
"server.execution.scheduler.misfire.toleration.minutes";
-  public static final String EXECUTION_SCHEDULER_START_DELAY = 
"server.execution.scheduler.start.delay.seconds";
+  public static final String EXECUTION_SCHEDULER_CLUSTERED_KEY = 
"server.execution.scheduler.isClustered";
+  public static final String EXECUTION_SCHEDULER_THREADS_KEY = 
"server.execution.scheduler.maxThreads";
+  public static final String EXECUTION_SCHEDULER_CONNECTIONS_KEY = 
"server.execution.scheduler.maxDbConnections";
+  public static final String EXECUTION_SCHEDULER_MISFIRE_TOLERATION_KEY = 
"server.execution.scheduler.misfire.toleration.minutes";
+  public static final String EXECUTION_SCHEDULER_START_DELAY_KEY = 
"server.execution.scheduler.start.delay.seconds";
+  public static final String EXECUTION_SCHEDULER_WAIT_KEY = 
"server.execution.scheduler.wait";
   public static final String DEFAULT_SCHEDULER_THREAD_COUNT = "5";
   public static final String DEFAULT_SCHEDULER_MAX_CONNECTIONS = "5";
   public static final String DEFAULT_EXECUTION_SCHEDULER_MISFIRE_TOLERATION = 
"480";
   public static final String DEFAULT_SCHEDULER_START_DELAY_SECONDS = "120";
+  public static final String DEFAULT_EXECUTION_SCHEDULER_WAIT_SECONDS = "1";
   public static final String SERVER_TMP_DIR_KEY = "server.tmp.dir";
   public static final String SERVER_TMP_DIR_DEFAULT = 
"/var/lib/ambari-server/tmp";
   public static final String EXTERNAL_SCRIPT_TIMEOUT_KEY = 
"server.script.timeout";
@@ -1250,8 +1252,8 @@ public class Configuration {
*/
   public boolean isAgentApiGzipped() {
 return "true".equalsIgnoreCase(properties.getProperty(
-AGENT_API_GZIP_COMPRESSION_ENABLED_KEY,
-API_GZIP_COMPRESSION_ENABLED_DEFAULT));
+  AGENT_API_GZIP_COMPRESSION_ENABLED_KEY,
+  API_GZIP_COMPRESSION_ENABLED_DEFAULT));
   }
 
   /**
@@ -1747,17 +1749,17 @@ public class Configuration {
 
 
   public String isExecutionSchedulerClusterd() {
-return properties.getProperty(EXECUTION_SCHEDULER_CLUSTERED, "false");
+return properties.getProperty(EXECUTION_SCHEDULER_CLUSTERED_KEY, "false");
   }
 
   public String getExecutionSchedulerThreads() {
-return properties.getProperty(EXECUTION_SCHEDULER_THREADS,
+return properties.getProperty(EXECUTION_SCHEDULER_THREADS_KEY,
   DEFAULT_SCHEDULER_THREAD_COUNT);
   }
 
   public Integer getRequestReadTimeout() {
 return Integer.parseInt(properties.getProperty(REQUEST_READ_TIMEOUT,
-   
REQUEST_READ_TIMEOUT_DEFAULT));
+  

ambari git commit: AMBARI-13678 Make it configurable as to how frequently ActionScheduler scans DB for tasks (dsen)

2015-11-03 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 9b87326e8 -> e86d1cd7c


AMBARI-13678 Make it configurable as to how frequently ActionScheduler scans DB 
for tasks (dsen)


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

Branch: refs/heads/trunk
Commit: e86d1cd7c3fa6a03f289cd83ed945b5b9acfc668
Parents: 9b87326
Author: Dmytro Sen 
Authored: Tue Nov 3 11:43:59 2015 +0200
Committer: Dmytro Sen 
Committed: Tue Nov 3 11:43:59 2015 +0200

--
 .../server/configuration/Configuration.java | 55 +++-
 .../server/controller/ControllerModule.java |  3 +-
 .../server/configuration/ConfigurationTest.java | 18 +++
 .../scheduler/ExecutionSchedulerTest.java   |  6 +--
 4 files changed, 64 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e86d1cd7/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 227f2a9..3a282ed 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -270,15 +270,17 @@ public class Configuration {
   public static final String REPO_SUFFIX_KEY_UBUNTU = 
"repo.validation.suffixes.ubuntu";
   public static final String REPO_SUFFIX_KEY_DEFAULT = 
"repo.validation.suffixes.default";
 
-  public static final String EXECUTION_SCHEDULER_CLUSTERED = 
"server.execution.scheduler.isClustered";
-  public static final String EXECUTION_SCHEDULER_THREADS = 
"server.execution.scheduler.maxThreads";
-  public static final String EXECUTION_SCHEDULER_CONNECTIONS = 
"server.execution.scheduler.maxDbConnections";
-  public static final String EXECUTION_SCHEDULER_MISFIRE_TOLERATION = 
"server.execution.scheduler.misfire.toleration.minutes";
-  public static final String EXECUTION_SCHEDULER_START_DELAY = 
"server.execution.scheduler.start.delay.seconds";
+  public static final String EXECUTION_SCHEDULER_CLUSTERED_KEY = 
"server.execution.scheduler.isClustered";
+  public static final String EXECUTION_SCHEDULER_THREADS_KEY = 
"server.execution.scheduler.maxThreads";
+  public static final String EXECUTION_SCHEDULER_CONNECTIONS_KEY = 
"server.execution.scheduler.maxDbConnections";
+  public static final String EXECUTION_SCHEDULER_MISFIRE_TOLERATION_KEY = 
"server.execution.scheduler.misfire.toleration.minutes";
+  public static final String EXECUTION_SCHEDULER_START_DELAY_KEY = 
"server.execution.scheduler.start.delay.seconds";
+  public static final String EXECUTION_SCHEDULER_WAIT_KEY = 
"server.execution.scheduler.wait";
   public static final String DEFAULT_SCHEDULER_THREAD_COUNT = "5";
   public static final String DEFAULT_SCHEDULER_MAX_CONNECTIONS = "5";
   public static final String DEFAULT_EXECUTION_SCHEDULER_MISFIRE_TOLERATION = 
"480";
   public static final String DEFAULT_SCHEDULER_START_DELAY_SECONDS = "120";
+  public static final String DEFAULT_EXECUTION_SCHEDULER_WAIT_SECONDS = "1";
   public static final String SERVER_TMP_DIR_KEY = "server.tmp.dir";
   public static final String SERVER_TMP_DIR_DEFAULT = 
"/var/lib/ambari-server/tmp";
   public static final String EXTERNAL_SCRIPT_TIMEOUT_KEY = 
"server.script.timeout";
@@ -1251,8 +1253,8 @@ public class Configuration {
*/
   public boolean isAgentApiGzipped() {
 return "true".equalsIgnoreCase(properties.getProperty(
-AGENT_API_GZIP_COMPRESSION_ENABLED_KEY,
-API_GZIP_COMPRESSION_ENABLED_DEFAULT));
+  AGENT_API_GZIP_COMPRESSION_ENABLED_KEY,
+  API_GZIP_COMPRESSION_ENABLED_DEFAULT));
   }
 
   /**
@@ -1748,17 +1750,17 @@ public class Configuration {
 
 
   public String isExecutionSchedulerClusterd() {
-return properties.getProperty(EXECUTION_SCHEDULER_CLUSTERED, "false");
+return properties.getProperty(EXECUTION_SCHEDULER_CLUSTERED_KEY, "false");
   }
 
   public String getExecutionSchedulerThreads() {
-return properties.getProperty(EXECUTION_SCHEDULER_THREADS,
+return properties.getProperty(EXECUTION_SCHEDULER_THREADS_KEY,
   DEFAULT_SCHEDULER_THREAD_COUNT);
   }
 
   public Integer getRequestReadTimeout() {
 return Integer.parseInt(properties.getProperty(REQUEST_READ_TIMEOUT,
-   
REQUEST_READ_TIMEOUT_DEFAULT));
+  

[2/2] ambari git commit: AMBARI-13696. HDFS has issues after enabling wire encryption and reconfiguring DATANODEs (dlysnichenko)

2015-11-03 Thread dmitriusan
AMBARI-13696. HDFS has issues after enabling wire encryption and reconfiguring 
DATANODEs (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: ca7b8298366b5cb549d6a9de838274ab2cb139f7
Parents: b5406c5
Author: Lisnichenko Dmitro 
Authored: Tue Nov 3 17:05:15 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Tue Nov 3 17:06:20 2015 +0200

--
 .../libraries/providers/hdfs_resource.py  | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ca7b8298/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
 
b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
index 3436b97..a7aa2f8 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
@@ -128,8 +128,14 @@ class WebHDFSUtil:
   
security_enabled, run_user)
 http_nn_address = 
namenode_ha_utils.get_property_for_active_namenode(hdfs_site, 
'dfs.namenode.http-address',
  
security_enabled, run_user)
-self.is_https_enabled = hdfs_site['dfs.https.enable'] if not 
is_empty(hdfs_site['dfs.https.enable']) else False
-
+
+# check for dfs.http.policy and after that for deprecated(for newer 
stacks) dfs.https.enable
+self.is_https_enabled = False
+if not is_empty(hdfs_site['dfs.http.policy']):
+  self.is_https_enabled = hdfs_site['dfs.http.policy'].lower() == 
"https_only"
+elif not is_empty(hdfs_site['dfs.https.enable']):
+  self.is_https_enabled = hdfs_site['dfs.https.enable']
+
 address = https_nn_address if self.is_https_enabled else http_nn_address
 protocol = "https" if self.is_https_enabled else "http"
 



[1/2] ambari git commit: AMBARI-13696. HDFS has issues after enabling wire encryption and reconfiguring DATANODEs (dlysnichenko)

2015-11-03 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 4813cd34c -> e2593c3d4
  refs/heads/trunk b5406c597 -> ca7b82983


AMBARI-13696. HDFS has issues after enabling wire encryption and reconfiguring 
DATANODEs (dlysnichenko)


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

Branch: refs/heads/branch-2.1
Commit: e2593c3d407ead9a821334e1c36091a6a199d1e1
Parents: 4813cd3
Author: Lisnichenko Dmitro 
Authored: Tue Nov 3 17:05:15 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Tue Nov 3 17:05:15 2015 +0200

--
 .../libraries/providers/hdfs_resource.py  | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e2593c3d/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
 
b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
index b12e4a1..a016ad6 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/providers/hdfs_resource.py
@@ -127,8 +127,14 @@ class WebHDFSUtil:
   
security_enabled, run_user)
 http_nn_address = 
namenode_ha_utils.get_property_for_active_namenode(hdfs_site, 
'dfs.namenode.http-address',
  
security_enabled, run_user)
-self.is_https_enabled = hdfs_site['dfs.https.enable'] if not 
is_empty(hdfs_site['dfs.https.enable']) else False
-
+
+# check for dfs.http.policy and after that for deprecated(for newer 
stacks) dfs.https.enable
+self.is_https_enabled = False
+if not is_empty(hdfs_site['dfs.http.policy']):
+  self.is_https_enabled = hdfs_site['dfs.http.policy'].lower() == 
"https_only"
+elif not is_empty(hdfs_site['dfs.https.enable']):
+  self.is_https_enabled = hdfs_site['dfs.https.enable']
+
 address = https_nn_address if self.is_https_enabled else http_nn_address
 protocol = "https" if self.is_https_enabled else "http"
 



ambari git commit: AMBARI-13694 Code to read keysdir cannot handle space in the front (dsen)

2015-11-03 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 e2593c3d4 -> a67b1e12d


AMBARI-13694 Code to read keysdir cannot handle space in the front (dsen)


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

Branch: refs/heads/branch-2.1
Commit: a67b1e12d077ba0e3b6d9b190d6c24a9b5e2a271
Parents: e2593c3
Author: Dmytro Sen 
Authored: Tue Nov 3 17:09:11 2015 +0200
Committer: Dmytro Sen 
Committed: Tue Nov 3 17:09:27 2015 +0200

--
 ambari-agent/conf/unix/ambari-agent |  3 ++
 .../main/python/ambari_agent/AmbariConfig.py|  4 +-
 .../python/ambari_agent/TestAmbariConfig.py | 47 
 3 files changed, 51 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a67b1e12/ambari-agent/conf/unix/ambari-agent
--
diff --git a/ambari-agent/conf/unix/ambari-agent 
b/ambari-agent/conf/unix/ambari-agent
index a08ead2..5a78e5f 100755
--- a/ambari-agent/conf/unix/ambari-agent
+++ b/ambari-agent/conf/unix/ambari-agent
@@ -59,6 +59,9 @@ if [ "$EUID" -ne 0 ] ; then
 fi
 
 keysdir=$(awk -F "=" '/keysdir/ {print $2}' 
/etc/ambari-agent/conf/ambari-agent.ini)
+# trim spaces
+keysdir=${keysdir// }
+keysdir=${keysdir%% }
 
 change_files_permissions() {
 if [ ! -z "$keysdir" ]; then

http://git-wip-us.apache.org/repos/asf/ambari/blob/a67b1e12/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py 
b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
index f8f220b..8b4a749 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
@@ -140,8 +140,6 @@ pidPathVars = [
 ]
 
 
-
-
 class AmbariConfig:
   TWO_WAY_SSL_PROPERTY = "security.server.two_way_ssl"
   AMBARI_PROPERTIES_CATEGORY = 'agentConfig'
@@ -159,7 +157,7 @@ class AmbariConfig:
 
   def get(self, section, value, default=None):
 try:
-  return self.config.get(section, value)
+  return str(self.config.get(section, value)).strip()
 except ConfigParser.Error, err:
   if default != None:
 return default

http://git-wip-us.apache.org/repos/asf/ambari/blob/a67b1e12/ambari-agent/src/test/python/ambari_agent/TestAmbariConfig.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestAmbariConfig.py 
b/ambari-agent/src/test/python/ambari_agent/TestAmbariConfig.py
new file mode 100644
index 000..78f29fe
--- /dev/null
+++ b/ambari-agent/src/test/python/ambari_agent/TestAmbariConfig.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+from unittest import TestCase
+from ambari_agent.AmbariConfig import AmbariConfig
+import sys
+
+import logging
+
+class TestAmbariConfig(TestCase):
+  def setUp(self):
+# save original open() method for later use
+self.original_open = open
+
+  def tearDown(self):
+sys.stdout = sys.__stdout__
+
+  logger = logging.getLogger()
+
+  def test_ambari_config_get(self):
+config = AmbariConfig()
+#default
+self.assertEqual(config.get("security", "keysdir"), "/tmp/ambari-agent")
+#non-default
+config.set("security", "keysdir", "/tmp/non-default-path")
+self.assertEqual(config.get("security", "keysdir"), 
"/tmp/non-default-path")
+#whitespace handling
+config.set("security", "keysdir", " /tmp/non-stripped")
+self.assertEqual(config.get("security", "keysdir"), "/tmp/non-stripped")
+



[2/2] ambari git commit: AMBARI-13697. local variable 'out' referenced before assignment (aonishuk)

2015-11-03 Thread aonishuk
AMBARI-13697. local variable 'out' referenced before assignment (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: a1a1942a18e3877dee2ba40de361aa93e2935aef
Parents: a67b1e1
Author: Andrew Onishuk 
Authored: Tue Nov 3 17:13:20 2015 +0200
Committer: Andrew Onishuk 
Committed: Tue Nov 3 17:13:20 2015 +0200

--
 .../main/python/resource_management/core/providers/service.py| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a1a1942a/ambari-common/src/main/python/resource_management/core/providers/service.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/core/providers/service.py 
b/ambari-common/src/main/python/resource_management/core/providers/service.py
index 50167f1..66f8076 100644
--- 
a/ambari-common/src/main/python/resource_management/core/providers/service.py
+++ 
b/ambari-common/src/main/python/resource_management/core/providers/service.py
@@ -67,7 +67,7 @@ class ServiceProvider(Provider):
   else:
 ret,out = shell.call(custom_cmd)
 else:
-  ret = self._init_cmd(command)
+  ret,out = self._init_cmd(command)
 
 if expect is not None and expect != ret:
   raise Fail("%r command %s for service %s failed with return code: %d. 
%s" % (
@@ -84,7 +84,7 @@ class ServiceProvider(Provider):
 ret,out = shell.call(["/sbin/" + command, self.resource.service_name])
 else:
   ret,out = shell.call(["/etc/init.d/%s" % self.resource.service_name, 
command])
-return ret
+return ret,out
 
   @property
   def _upstart(self):



[1/2] ambari git commit: AMBARI-13697. local variable 'out' referenced before assignment (aonishuk)

2015-11-03 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 a67b1e12d -> a1a1942a1
  refs/heads/trunk ca7b82983 -> d501a38a1


AMBARI-13697. local variable 'out' referenced before assignment (aonishuk)


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

Branch: refs/heads/trunk
Commit: d501a38a144a037f282e53861deb942ea649d88e
Parents: ca7b829
Author: Andrew Onishuk 
Authored: Tue Nov 3 17:13:15 2015 +0200
Committer: Andrew Onishuk 
Committed: Tue Nov 3 17:13:15 2015 +0200

--
 .../main/python/resource_management/core/providers/service.py| 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d501a38a/ambari-common/src/main/python/resource_management/core/providers/service.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/core/providers/service.py 
b/ambari-common/src/main/python/resource_management/core/providers/service.py
index 50167f1..66f8076 100644
--- 
a/ambari-common/src/main/python/resource_management/core/providers/service.py
+++ 
b/ambari-common/src/main/python/resource_management/core/providers/service.py
@@ -67,7 +67,7 @@ class ServiceProvider(Provider):
   else:
 ret,out = shell.call(custom_cmd)
 else:
-  ret = self._init_cmd(command)
+  ret,out = self._init_cmd(command)
 
 if expect is not None and expect != ret:
   raise Fail("%r command %s for service %s failed with return code: %d. 
%s" % (
@@ -84,7 +84,7 @@ class ServiceProvider(Provider):
 ret,out = shell.call(["/sbin/" + command, self.resource.service_name])
 else:
   ret,out = shell.call(["/etc/init.d/%s" % self.resource.service_name, 
command])
-return ret
+return ret,out
 
   @property
   def _upstart(self):



ambari git commit: AMBARI-13690. Service configs page keeps spinning (onechiporenko)

2015-11-03 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 09aad6be9 -> 16fccc48a


AMBARI-13690. Service configs page keeps spinning (onechiporenko)


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

Branch: refs/heads/branch-2.1
Commit: 16fccc48ad7b8799fac3ead0db776755dd7e728a
Parents: 09aad6b
Author: Oleg Nechiporenko 
Authored: Tue Nov 3 11:59:08 2015 +0200
Committer: Oleg Nechiporenko 
Committed: Tue Nov 3 12:06:43 2015 +0200

--
 ambari-web/app/controllers/main/service/info/configs.js | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/16fccc48/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 69d7833..f550af4 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -316,6 +316,9 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.ConfigsLoader, A
 self.loadCurrentVersions();
   });
 }
+else {
+  this.loadCurrentVersions();
+}
 this.loadServiceConfigVersions();
   },
 



[1/2] ambari git commit: AMBARI-13692. Refactor HostProgressPopup (onechiporenko)

2015-11-03 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 6321a0da5 -> 76dd478e5


http://git-wip-us.apache.org/repos/asf/ambari/blob/76dd478e/ambari-web/test/utils/host_progress_popup_test.js
--
diff --git a/ambari-web/test/utils/host_progress_popup_test.js 
b/ambari-web/test/utils/host_progress_popup_test.js
index 5a7ab02..1b7efb3 100644
--- a/ambari-web/test/utils/host_progress_popup_test.js
+++ b/ambari-web/test/utils/host_progress_popup_test.js
@@ -476,4 +476,116 @@ describe('App.HostPopup', function () {
 });
   });
 
+  describe('#_getHostsMap', function () {
+
+Em.A([
+  {
+inputData: [
+  {name: 's1', hostsMap: {h1: {}, h2: {}}},
+  {name: 's2'}
+],
+isBackgroundOperations: true,
+currentServiceId: null,
+serviceName: 's1',
+m: '`currentServiceId` is null, `serviceName` exists, 
`isBackgroundOperations` true, `hostsMap` exists',
+e: {h1: {}, h2: {}}
+  },
+  {
+inputData: [
+  {name: 's1', hosts: [
+{name: 'h1'},
+{name: 'h2'}
+  ]},
+  {name: 's2'}
+],
+isBackgroundOperations: true,
+currentServiceId: null,
+serviceName: 's1',
+m: '`currentServiceId` is null, `serviceName` exists, 
`isBackgroundOperations` true, `hosts` exists',
+e: {h1: {name: 'h1'}, h2: {name: 'h2'}}
+  },
+  {
+inputData: [
+  {id: 1, hostsMap: {h1: {}, h2: {}}},
+  {id: 2}
+],
+isBackgroundOperations: true,
+currentServiceId: 1,
+serviceName: 's1',
+m: '`currentServiceId` is 1, `serviceName` exists, 
`isBackgroundOperations` true, `hostsMap` exists',
+e: {h1: {}, h2: {}}
+  },
+  {
+inputData: [
+  {id: 1, hosts: [
+{name: 'h1'},
+{name: 'h2'}
+  ]},
+  {id: 2}
+],
+isBackgroundOperations: true,
+currentServiceId: 1,
+serviceName: 's1',
+m: '`currentServiceId` is 1, `serviceName` exists, 
`isBackgroundOperations` true, `hosts` exists',
+e: {h1: {name: 'h1'}, h2: {name: 'h2'}}
+  },
+
+  {
+inputData: [
+  {name: 's1', hostsMap: {h1: {}, h2: {}}},
+  {name: 's2'}
+],
+isBackgroundOperations: false,
+currentServiceId: null,
+serviceName: 's1',
+m: '`currentServiceId` is null, `serviceName` exists, 
`isBackgroundOperations` false, `hostsMap` exists',
+e: {h1: {}, h2: {}}
+  },
+  {
+inputData: [
+  {name: 's1', hosts: [
+{name: 'h1'},
+{name: 'h2'}
+  ]},
+  {name: 's2'}
+],
+isBackgroundOperations: false,
+currentServiceId: null,
+serviceName: 's1',
+m: '`currentServiceId` is null, `serviceName` exists, 
`isBackgroundOperations` false, `hosts` exists',
+e: {h1: {name: 'h1'}, h2: {name: 'h2'}}
+  },
+  {
+inputData: [
+  {name: 's1', hostsMap: {h1: {}, h2: {}}}
+],
+isBackgroundOperations: false,
+currentServiceId: 1,
+serviceName: 's1',
+m: '`currentServiceId` is 1, `serviceName` exists, 
`isBackgroundOperations` false, `hostsMap` exists',
+e: {h1: {}, h2: {}}
+  },
+  {
+inputData: [
+  {name: 's1', hostsMap: {h1: {}, h2: {}}}
+],
+isBackgroundOperations: false,
+currentServiceId: 1,
+serviceName: 's1',
+m: '`currentServiceId` is 1, `serviceName` exists, 
`isBackgroundOperations` false, `hosts` exists',
+e: {h1: {}, h2: {}}
+  }
+]).forEach(function (test) {
+
+  it(test.m, function () {
+App.HostPopup.setProperties(test);
+expect(App.HostPopup._getHostsMap()).to.eql(test.e);
+  });
+
+});
+
+  });
+
+
+
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/76dd478e/ambari-web/test/views/common/host_progress_popup_body_view_test.js
--
diff --git a/ambari-web/test/views/common/host_progress_popup_body_view_test.js 
b/ambari-web/test/views/common/host_progress_popup_body_view_test.js
new file mode 100644
index 000..8642d9b
--- /dev/null
+++ b/ambari-web/test/views/common/host_progress_popup_body_view_test.js
@@ -0,0 +1,58 @@
+/**
+ * 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 

[2/2] ambari git commit: AMBARI-13692. Refactor HostProgressPopup (onechiporenko)

2015-11-03 Thread onechiporenko
AMBARI-13692. Refactor HostProgressPopup (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 76dd478e5d701ae2c64989d5e07a9caada3ddfb6
Parents: 6321a0d
Author: Oleg Nechiporenko 
Authored: Tue Nov 3 14:50:27 2015 +0200
Committer: Oleg Nechiporenko 
Committed: Tue Nov 3 14:50:27 2015 +0200

--
 ambari-web/app/assets/test/tests.js |1 +
 ambari-web/app/utils/host_progress_popup.js | 1246 +++---
 ambari-web/app/views.js |1 +
 .../common/host_progress_popup_body_view.js |  749 +++
 .../test/utils/host_progress_popup_test.js  |  112 ++
 .../host_progress_popup_body_view_test.js   |   58 +
 6 files changed, 1388 insertions(+), 779 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/76dd478e/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 cb292a5..6617c97 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -266,6 +266,7 @@ var files = [
   'test/views/main/admin/highAvailability/nameNode/step6_view_test',
   'test/views/main/admin/highAvailability/nameNode/step8_view_test',
   'test/views/main/admin/highAvailability/nameNode/wizard_view_test',
+  'test/views/common/host_progress_popup_body_view_test',
   'test/views/common/configs/config_history_flow_test',
   'test/views/common/configs/overriddenProperty_view_test',
   'test/views/common/configs/service_config_view_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/76dd478e/ambari-web/app/utils/host_progress_popup.js
--
diff --git a/ambari-web/app/utils/host_progress_popup.js 
b/ambari-web/app/utils/host_progress_popup.js
index e834bbe..831baeb 100644
--- a/ambari-web/app/utils/host_progress_popup.js
+++ b/ambari-web/app/utils/host_progress_popup.js
@@ -19,37 +19,112 @@
 var App = require('app');
 var batchUtils = require('utils/batch_scheduled_requests');
 var date = require('utils/date/date');
+var dataUtils = require('utils/data_manipulation');
+
+/**
+ * Host information shown in the operations popup
+ * @typedef {Em.Object} wrappedHost
+ * @property {string} name
+ * @property {string} publicName
+ * @property {string} displayName
+ * @property {number} progress
+ * @property {boolean} isInProgress
+ * @property {string} serviceName
+ * @property {string} status
+ * @property {number} isVisible
+ * @property {string} icon
+ * @property {string} barColor
+ * @property {string} barWidth
+ */
+
+/**
+ * Task information shown in the operations popup
+ * @typedef {Em.Object} wrappedTask
+ * @property {string} id
+ * @property {string} hostName
+ * @property {string} command
+ * @property {string} commandDetail
+ * @property {string} status
+ * @property {string} role
+ * @property {string} stderr
+ * @property {string} stdout
+ * @property {number} request_id
+ * @property {boolean} isVisible
+ * @property {string} startTime
+ * @property {string} duration
+ * @property {string} icon
+ */
+
+/**
+ * Service information shown in the operations popup
+ * @typedef {Em.Object} wrappedService
+ * @property {string} id
+ * @property {string} displayName
+ * @property {string} progress
+ * @property {string} status
+ * @property {boolean} isRunning
+ * @property {string} name
+ * @property {boolean} isVisible
+ * @property {string} startTime
+ * @property {string} duration
+ * @property {string} icon
+ * @property {string} barColor
+ * @property {boolean} isInProgress
+ * @property {string} barWidth
+ * @property {number} sourceRequestScheduleId
+ * @property {string} contextCommand
+ */
 
 /**
  * App.HostPopup is for the popup that shows up upon clicking 
already-performed or currently-in-progress operations
+ * Allows to abort executing operations
+ *
+ * @type {Em.Object}
+ * @class {HostPopup}
  */
 App.HostPopup = Em.Object.create({
 
   name: 'hostPopup',
 
+  /**
+   * @type {object[]}
+   */
   servicesInfo: [],
+
+  /**
+   * @type {?wrappedHost[]}
+   */
   hosts: null,
+
+  /**
+   * @type {?object[]}
+   */
   inputData: null,
 
   /**
* @type {string}
*/
-  serviceName: "",
+  serviceName: '',
 
   /**
-   * @type {Number}
+   * @type {?Number}
*/
   currentServiceId: null,
+
+  /**
+   * @type {?Number}
+   */
   previousServiceId: null,
 
   /**
* @type {string}
*/
-  popupHeaderName: "",
+  popupHeaderName: '',
 
   operationInfo: 

ambari git commit: AMBARI-13691 Allow use passwords references in custom actions - UI changes. (atkach)

2015-11-03 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk dc0ac133d -> df693b7e1


AMBARI-13691 Allow use passwords references in custom actions - UI changes. 
(atkach)


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

Branch: refs/heads/trunk
Commit: df693b7e1af62fe28413e569b687cae16bd67e2d
Parents: dc0ac13
Author: Andrii Tkach 
Authored: Tue Nov 3 12:40:39 2015 +0200
Committer: Andrii Tkach 
Committed: Tue Nov 3 12:40:39 2015 +0200

--
 ambari-web/app/utils/ajax/ajax.js   | 23 
 .../widgets/test_db_connection_widget_view.js   |  3 ++-
 2 files changed, 25 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/df693b7e/ambari-web/app/utils/ajax/ajax.js
--
diff --git a/ambari-web/app/utils/ajax/ajax.js 
b/ambari-web/app/utils/ajax/ajax.js
index a72bbf7..4a3992e 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2363,6 +2363,29 @@ var urls = {
   }
 }
   },
+
+  'cluster.custom_action.create': {
+'real': '/clusters/{clusterName}/requests',
+'mock': '',
+'format': function (data) {
+  var requestInfo = {
+context: 'Check host',
+action: 'check_host',
+parameters: {}
+  };
+  $.extend(true, requestInfo, data.requestInfo);
+  return {
+type: 'POST',
+data: JSON.stringify({
+  'RequestInfo': requestInfo,
+  'Requests/resource_filters': [{
+hosts: data.filteredHosts.join(',')
+  }]
+})
+  }
+}
+  },
+
   'custom_action.request': {
 'real': '/requests/{requestId}/tasks/{taskId}',
 'mock': '/data/requests/1.json',

http://git-wip-us.apache.org/repos/asf/ambari/blob/df693b7e/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
--
diff --git 
a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js 
b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
index d22cb1f..199aac6 100644
--- 
a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
+++ 
b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
@@ -195,6 +195,7 @@ App.TestDbConnectionWidgetView = 
App.ConfigWidgetView.extend({
**/
   createCustomAction: function () {
 var connectionProperties = 
this.getProperties('db_connection_url','user_name', 'user_passwd');
+var isServiceInstalled = 
App.Service.find(this.get('config.serviceName')).get('isLoaded');
 for (var key in connectionProperties) {
   if (connectionProperties.hasOwnProperty(key)) {
 connectionProperties[key] = connectionProperties[key].value;
@@ -203,7 +204,7 @@ App.TestDbConnectionWidgetView = 
App.ConfigWidgetView.extend({
 var params = $.extend(true, {}, {db_name: 
this.get('db_type').toLowerCase()}, connectionProperties, 
this.get('ambariProperties'));
 var filteredHosts =  Array.isArray(this.get('masterHostName.value')) ? 
this.get('masterHostName.value') : [this.get('masterHostName.value')];
 App.ajax.send({
-  name: 'custom_action.create',
+  name: (isServiceInstalled) ? 'cluster.custom_action.create' : 
'custom_action.create',
   sender: this,
   data: {
 requestInfo: {



ambari git commit: AMBARI-13690. Service configs page keeps spinning (onechiporenko)

2015-11-03 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk e86d1cd7c -> a2062703c


AMBARI-13690. Service configs page keeps spinning (onechiporenko)


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

Branch: refs/heads/trunk
Commit: a2062703c4e86f28fb939168a5d2ac45b376240b
Parents: e86d1cd
Author: Oleg Nechiporenko 
Authored: Tue Nov 3 11:59:08 2015 +0200
Committer: Oleg Nechiporenko 
Committed: Tue Nov 3 11:59:08 2015 +0200

--
 ambari-web/app/controllers/main/service/info/configs.js | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a2062703/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 8c4b72c..f3bdc1a 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -314,6 +314,9 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.ConfigsLoader, A
 self.loadCurrentVersions();
   });
 }
+else {
+  this.loadCurrentVersions();
+}
 this.loadServiceConfigVersions();
   },
 



ambari git commit: AMBARI-13582. Allow use passwords references in custom actions.(vbrodetskyi)

2015-11-03 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 aefb1bc9e -> 64ac71514


AMBARI-13582. Allow use passwords references in custom actions.(vbrodetskyi)


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

Branch: refs/heads/branch-2.1
Commit: 64ac71514a70eb75c8b094cf330073749e030141
Parents: aefb1bc
Author: Vitaly Brodetskyi 
Authored: Tue Nov 3 13:19:19 2015 +0200
Committer: Vitaly Brodetskyi 
Committed: Tue Nov 3 13:19:19 2015 +0200

--
 .../controller/AmbariActionExecutionHelper.java |  4 +
 .../AmbariManagementControllerImpl.java | 21 +++---
 .../ambari/server/controller/AmbariServer.java  |  3 +-
 .../controller/ConfigurationResponse.java   | 13 +---
 .../internal/BlueprintResourceProvider.java | 45 +--
 .../apache/ambari/server/state/StackInfo.java   | 24 ++
 .../server/state/cluster/ClusterImpl.java   | 34 ++---
 .../server/topology/BlueprintValidatorImpl.java | 27 +++
 .../ambari/server/utils/SecretReference.java| 78 +++-
 .../AmbariManagementControllerTest.java | 24 --
 .../internal/BlueprintResourceProviderTest.java | 47 ++--
 .../server/topology/BlueprintImplTest.java  | 63 +++-
 .../services/YARN/configuration/yarn-site.xml   |  6 ++
 13 files changed, 298 insertions(+), 91 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/64ac7151/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
index d834731..215aca8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
@@ -46,6 +46,7 @@ import org.apache.ambari.server.state.ServiceComponentHost;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.StackId;
 import 
org.apache.ambari.server.state.svccomphost.ServiceComponentHostOpInProgressEvent;
+import org.apache.ambari.server.utils.SecretReference;
 import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
@@ -406,6 +407,9 @@ public class AmbariActionExecutionHelper {
   }
 
   roleParams.putAll(actionContext.getParameters());
+
+  SecretReference.replaceReferencesWithPasswords(roleParams, cluster);
+
   if (componentInfo != null) {
 roleParams.put(COMPONENT_CATEGORY, componentInfo.getCategory());
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/64ac7151/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 9b53a6a..1d922e2 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -729,9 +729,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   String passwordPropertyValue = 
requestProperties.get(passwordProperty);
   if (!SecretReference.isSecret(passwordPropertyValue))
 continue;
-  SecretReference ref = new SecretReference(passwordPropertyValue, 
passwordProperty, cluster);
-  if (!ref.getClusterName().equals(request.getClusterName()))
-throw new AmbariException("Can not reference to different cluster 
in SECRET");
+  SecretReference ref = new SecretReference(passwordPropertyValue, 
cluster);
   String refValue = ref.getValue();
   requestProperties.put(passwordProperty, refValue);
 }
@@ -1401,7 +1399,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 if (propertiesTypes.containsKey(PropertyType.PASSWORD) &&
 
propertiesTypes.get(PropertyType.PASSWORD).contains(propertyName)) {
   if (SecretReference.isSecret(propertyValue)) {
-SecretReference ref = 

ambari git commit: AMBARI-13582. Allow use passwords references in custom actions.(vbrodetskyi)

2015-11-03 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/trunk df693b7e1 -> 6321a0da5


AMBARI-13582. Allow use passwords references in custom actions.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 6321a0da5274f550e398f929f4a0ea75caa95152
Parents: df693b7
Author: Vitaly Brodetskyi 
Authored: Tue Nov 3 13:21:18 2015 +0200
Committer: Vitaly Brodetskyi 
Committed: Tue Nov 3 13:21:18 2015 +0200

--
 .../controller/AmbariActionExecutionHelper.java |  4 +
 .../AmbariManagementControllerImpl.java | 21 +++---
 .../ambari/server/controller/AmbariServer.java  |  3 +-
 .../controller/ConfigurationResponse.java   | 13 +---
 .../internal/BlueprintResourceProvider.java | 45 +--
 .../apache/ambari/server/state/StackInfo.java   | 24 ++
 .../server/state/cluster/ClusterImpl.java   | 34 ++---
 .../server/topology/BlueprintValidatorImpl.java | 27 +++
 .../ambari/server/utils/SecretReference.java| 78 +++-
 .../AmbariManagementControllerTest.java | 24 --
 .../internal/BlueprintResourceProviderTest.java | 47 ++--
 .../server/topology/BlueprintImplTest.java  | 63 +++-
 .../services/YARN/configuration/yarn-site.xml   |  6 ++
 13 files changed, 298 insertions(+), 91 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6321a0da/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
index d834731..215aca8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java
@@ -46,6 +46,7 @@ import org.apache.ambari.server.state.ServiceComponentHost;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.StackId;
 import 
org.apache.ambari.server.state.svccomphost.ServiceComponentHostOpInProgressEvent;
+import org.apache.ambari.server.utils.SecretReference;
 import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
@@ -406,6 +407,9 @@ public class AmbariActionExecutionHelper {
   }
 
   roleParams.putAll(actionContext.getParameters());
+
+  SecretReference.replaceReferencesWithPasswords(roleParams, cluster);
+
   if (componentInfo != null) {
 roleParams.put(COMPONENT_CATEGORY, componentInfo.getCategory());
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/6321a0da/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 5f432ef..6a1e85c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -728,9 +728,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   String passwordPropertyValue = 
requestProperties.get(passwordProperty);
   if (!SecretReference.isSecret(passwordPropertyValue))
 continue;
-  SecretReference ref = new SecretReference(passwordPropertyValue, 
passwordProperty, cluster);
-  if (!ref.getClusterName().equals(request.getClusterName()))
-throw new AmbariException("Can not reference to different cluster 
in SECRET");
+  SecretReference ref = new SecretReference(passwordPropertyValue, 
cluster);
   String refValue = ref.getValue();
   requestProperties.put(passwordProperty, refValue);
 }
@@ -1400,7 +1398,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 if (propertiesTypes.containsKey(PropertyType.PASSWORD) &&
 
propertiesTypes.get(PropertyType.PASSWORD).contains(propertyName)) {
   if (SecretReference.isSecret(propertyValue)) {
-SecretReference ref = new 

ambari git commit: AMBARI-13691 Allow use passwords references in custom actions - UI changes. (atkach)

2015-11-03 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 e596d775a -> aefb1bc9e


AMBARI-13691 Allow use passwords references in custom actions - UI changes. 
(atkach)


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

Branch: refs/heads/branch-2.1
Commit: aefb1bc9e083af3d96099d1743004532aa79c001
Parents: e596d77
Author: Andrii Tkach 
Authored: Tue Nov 3 13:10:37 2015 +0200
Committer: Andrii Tkach 
Committed: Tue Nov 3 13:10:37 2015 +0200

--
 ambari-web/app/utils/ajax/ajax.js   | 23 
 .../widgets/test_db_connection_widget_view.js   |  3 ++-
 2 files changed, 25 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/aefb1bc9/ambari-web/app/utils/ajax/ajax.js
--
diff --git a/ambari-web/app/utils/ajax/ajax.js 
b/ambari-web/app/utils/ajax/ajax.js
index 3e0298b..ea45fda 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2363,6 +2363,29 @@ var urls = {
   }
 }
   },
+
+  'cluster.custom_action.create': {
+'real': '/clusters/{clusterName}/requests',
+'mock': '',
+'format': function (data) {
+  var requestInfo = {
+context: 'Check host',
+action: 'check_host',
+parameters: {}
+  };
+  $.extend(true, requestInfo, data.requestInfo);
+  return {
+type: 'POST',
+data: JSON.stringify({
+  'RequestInfo': requestInfo,
+  'Requests/resource_filters': [{
+hosts: data.filteredHosts.join(',')
+  }]
+})
+  }
+}
+  },
+
   'custom_action.request': {
 'real': '/requests/{requestId}/tasks/{taskId}',
 'mock': '/data/requests/1.json',

http://git-wip-us.apache.org/repos/asf/ambari/blob/aefb1bc9/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
--
diff --git 
a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js 
b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
index d22cb1f..199aac6 100644
--- 
a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
+++ 
b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
@@ -195,6 +195,7 @@ App.TestDbConnectionWidgetView = 
App.ConfigWidgetView.extend({
**/
   createCustomAction: function () {
 var connectionProperties = 
this.getProperties('db_connection_url','user_name', 'user_passwd');
+var isServiceInstalled = 
App.Service.find(this.get('config.serviceName')).get('isLoaded');
 for (var key in connectionProperties) {
   if (connectionProperties.hasOwnProperty(key)) {
 connectionProperties[key] = connectionProperties[key].value;
@@ -203,7 +204,7 @@ App.TestDbConnectionWidgetView = 
App.ConfigWidgetView.extend({
 var params = $.extend(true, {}, {db_name: 
this.get('db_type').toLowerCase()}, connectionProperties, 
this.get('ambariProperties'));
 var filteredHosts =  Array.isArray(this.get('masterHostName.value')) ? 
this.get('masterHostName.value') : [this.get('masterHostName.value')];
 App.ajax.send({
-  name: 'custom_action.create',
+  name: (isServiceInstalled) ? 'cluster.custom_action.create' : 
'custom_action.create',
   sender: this,
   data: {
 requestInfo: {



[1/2] ambari git commit: AMBARI-13700. hbase.root dir for metrics server does not get updated after NN HA is enabled

2015-11-03 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 eb7b2903f -> 30855f280


AMBARI-13700. hbase.root dir for metrics server does not get updated after NN 
HA is enabled


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

Branch: refs/heads/branch-2.1
Commit: 30855f280487d4624896fcef0546e4d9dd859752
Parents: c1fc2af
Author: Alex Antonenko 
Authored: Tue Nov 3 19:13:33 2015 +0200
Committer: Alex Antonenko 
Committed: Tue Nov 3 19:22:42 2015 +0200

--
 .../nameNode/step3_controller.js| 32 ++--
 ambari-web/app/data/HDP2/ha_properties.js   | 17 +--
 2 files changed, 38 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/30855f28/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
index 20b6ce7..3cb7be7 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
@@ -79,6 +79,11 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
   urlParams.push('(type=accumulo-site=' + accumuloSiteTag + ')');
   this.set("accumuloSiteTag", {name : "accumuloSiteTag", value : 
accumuloSiteTag});
 }
+if (App.Service.find().someProperty('serviceName', 'AMBARI_METRICS')) {
+  var amsHbaseSiteTag = 
data.Clusters.desired_configs['ams-hbase-site'].tag;
+  urlParams.push('(type=ams-hbase-site=' + amsHbaseSiteTag + ')');
+  this.set("amsHbaseSiteTag", {name : "amsHbaseSiteTag", value : 
amsHbaseSiteTag});
+}
 App.ajax.send({
   name: 'admin.get.all_configurations',
   sender: this,
@@ -120,10 +125,12 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
   },
 
   tweakServiceConfigValues: function(configs,nameServiceId) {
-var currentNameNodeHost = 
this.get('content.masterComponentHosts').filterProperty('component', 
'NAMENODE').findProperty('isInstalled', true).hostName;
-var newNameNodeHost = 
this.get('content.masterComponentHosts').filterProperty('component', 
'NAMENODE').findProperty('isInstalled', false).hostName;
-var journalNodeHosts = 
this.get('content.masterComponentHosts').filterProperty('component', 
'JOURNALNODE').mapProperty('hostName');
-var zooKeeperHosts = 
this.get('content.masterComponentHosts').filterProperty('component', 
'ZOOKEEPER_SERVER').mapProperty('hostName');
+var
+  value = "",
+  currentNameNodeHost = 
this.get('content.masterComponentHosts').filterProperty('component', 
'NAMENODE').findProperty('isInstalled', true).hostName,
+  newNameNodeHost = 
this.get('content.masterComponentHosts').filterProperty('component', 
'NAMENODE').findProperty('isInstalled', false).hostName,
+  journalNodeHosts = 
this.get('content.masterComponentHosts').filterProperty('component', 
'JOURNALNODE').mapProperty('hostName'),
+  zooKeeperHosts = 
this.get('content.masterComponentHosts').filterProperty('component', 
'ZOOKEEPER_SERVER').mapProperty('hostName');
 
 var nnHttpPort = 50070;
 if 
(this.get('serverConfigData').items.findProperty('type','hdfs-site').properties['dfs.namenode.http-address'])
@@ -154,23 +161,30 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
 this.setConfigInitialValue(config,'qjournal://' + journalNodeHosts[0] + 
':8485;' + journalNodeHosts[1] + ':8485;' + journalNodeHosts[2] + ':8485/' + 
nameServiceId);
 config = configs.findProperty('name','ha.zookeeper.quorum');
 this.setConfigInitialValue(config,zooKeeperHosts[0] + ':' + zkClientPort + 
',' + zooKeeperHosts[1] + ':' + zkClientPort + ',' + zooKeeperHosts[2] + ':'+ 
zkClientPort  );
-config = configs.findProperty('name','hbase.rootdir');
 if (App.Service.find().someProperty('serviceName', 'HBASE')) {
- var value = this.get('serverConfigData.items').findProperty('type', 
'hbase-site').properties['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + 
nameServiceId);
+  config = configs.filterProperty('filename', 
'hbase-site').findProperty('name','hbase.rootdir');
+  value = this.get('serverConfigData.items').findProperty('type', 
'hbase-site').properties['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + 
nameServiceId);
  this.setConfigInitialValue(config,value);
 }
+if 

[2/2] ambari git commit: AMBARI-13699. Exported metrics have values in different units than widgets

2015-11-03 Thread alexantonenko
AMBARI-13699. Exported metrics have values in different units than widgets


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

Branch: refs/heads/trunk
Commit: 3cb80cfc16365861596e3fd3b9a94d6774db9f50
Parents: 8aba9a4
Author: Alex Antonenko 
Authored: Tue Nov 3 17:43:36 2015 +0200
Committer: Alex Antonenko 
Committed: Tue Nov 3 19:19:41 2015 +0200

--
 .../common/widgets/export_metrics_mixin.js  | 26 +--
 .../app/views/common/chart/linear_time.js   | 25 +-
 .../views/common/widget/graph_widget_view.js| 14 ++--
 .../views/main/dashboard/cluster_metrics/cpu.js |  2 +-
 .../main/dashboard/cluster_metrics/memory.js|  2 +-
 .../main/dashboard/cluster_metrics/network.js   |  2 +-
 ambari-web/app/views/main/host/metrics/cpu.js   |  2 +-
 ambari-web/app/views/main/host/metrics/disk.js  |  2 +-
 .../app/views/main/host/metrics/memory.js   |  2 +-
 .../app/views/main/host/metrics/network.js  |  2 +-
 .../regionserver_block_cache_hit_percent.js |  2 +-
 .../info/metrics/flume/channel_fill_pct.js  |  2 +-
 .../info/metrics/flume/channel_size_mma.js  |  3 +-
 .../service/info/metrics/flume/channel_sum.js   |  2 +-
 .../main/service/info/metrics/flume/cpu_user.js |  2 +-
 .../info/metrics/flume/flume_incoming_mma.js|  3 +-
 .../info/metrics/flume/flume_outgoing_mma.js|  3 +-
 .../views/main/service/info/metrics/flume/gc.js |  2 +-
 .../main/service/info/metrics/flume/jvm_heap.js |  2 +-
 .../common/widgets/export_metrics_mixin_test.js | 80 ++--
 .../test/views/common/chart/linear_time_test.js | 54 +
 .../common/widget/graph_widget_view_test.js | 22 ++
 22 files changed, 217 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3cb80cfc/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
--
diff --git a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js 
b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
index 84a2194..2ecb045 100644
--- a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
@@ -70,7 +70,7 @@ App.ExportMetricsMixin = Em.Mixin.create({
 } else {
   var fileType = params.isCSV ? 'csv' : 'json',
 fileName = 'data.' + fileType,
-data = params.isCSV ? this.prepareCSV(seriesData) : 
JSON.stringify(seriesData, null, 4);
+data = params.isCSV ? this.prepareCSV(seriesData) : 
JSON.stringify(seriesData, this.jsonReplacer(), 4);
   fileUtils.downloadTextFile(data, fileType, fileName);
 }
   },
@@ -80,16 +80,17 @@ App.ExportMetricsMixin = Em.Mixin.create({
   },
 
   prepareCSV: function (data) {
-var titles,
+var displayUnit = this.get('targetView.displayUnit'),
+  titles,
   ticksNumber,
   metricsNumber,
   metricsArray;
-if (Em.isArray(data)) {
-  titles = data.mapProperty('name');
-  titles.unshift(Em.I18n.t('common.timestamp'));
-  ticksNumber = data[0].data.length;
-  metricsNumber = data.length;
-}
+titles = data.map(function (item) {
+  return displayUnit ? item.name + ' (' + displayUnit + ')' : item.name;
+}, this);
+titles.unshift(Em.I18n.t('common.timestamp'));
+ticksNumber = data[0].data.length;
+metricsNumber = data.length;
 metricsArray = [titles];
 for (var i = 0; i < ticksNumber; i++) {
   metricsArray.push([data[0].data[i][1]]);
@@ -98,6 +99,15 @@ App.ExportMetricsMixin = Em.Mixin.create({
   };
 }
 return stringUtils.arrayToCSV(metricsArray);
+  },
+
+  jsonReplacer: function () {
+var displayUnit = this.get('targetView.displayUnit');
+return function (key, value) {
+  if (['name', 'data'].contains(key) || (!isNaN(key))) {
+return key == 'name' && displayUnit ? value + ' (' + displayUnit + ')' 
: value;
+  }
+}
   }
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/3cb80cfc/ambari-web/app/views/common/chart/linear_time.js
--
diff --git a/ambari-web/app/views/common/chart/linear_time.js 
b/ambari-web/app/views/common/chart/linear_time.js
index 24ca450..a6bd9a4 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -177,6 +177,7 @@ App.ChartLinearTimeView = 
Ember.View.extend(App.ExportMetricsMixin, {
 
   didInsertElement: function () {
 var self = this;
+this.setYAxisFormatter();
 this.loadData();
 

ambari git commit: AMBARI-13693. Ambari Blueprint sets inconsistent Yarn RM values (DIPAYAN BHOWMICK via srimanth)

2015-11-03 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 30855f280 -> 80d36ec7c


AMBARI-13693. Ambari Blueprint sets inconsistent Yarn RM values (DIPAYAN 
BHOWMICK via srimanth)


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

Branch: refs/heads/branch-2.1
Commit: 80d36ec7c0f2ccf51a2f62253bfb60b9234ba1ce
Parents: 30855f2
Author: Srimanth Gunturi 
Authored: Tue Nov 3 10:09:32 2015 -0800
Committer: Srimanth Gunturi 
Committed: Tue Nov 3 10:09:32 2015 -0800

--
 .../ambari/view/utils/ambari/Services.java  | 67 +++
 .../ambari/view/utils/ambari/ServicesTest.java  | 70 
 2 files changed, 111 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/80d36ec7/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
--
diff --git 
a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
 
b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
index 421a365..8a50012 100644
--- 
a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
+++ 
b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
@@ -45,6 +45,11 @@ public class Services {
   private static final String YARN_RESOURCEMANAGER_HA_RM_IDS_KEY = 
"yarn.resourcemanager.ha.rm-ids";
   private static final String YARN_RESOURCEMANAGER_HTTP_HA_PARTIAL_KEY = 
"yarn.resourcemanager.webapp.address.";
   private static final String YARN_RESOURCEMANAGER_HTTPS_HA_PARTIAL_KEY = 
"yarn.resourcemanager.webapp.https.address.";
+  private static final String YARN_RESOURCEMANAGER_HOSTNAME_KEY = 
"yarn.resourcemanager.hostname";
+  private static final String YARN_RESOURCEMANAGER_HOSTNAME_PARTIAL_KEY = 
YARN_RESOURCEMANAGER_HOSTNAME_KEY + ".";
+  private static final String YARN_RESOURCEMANAGER_DEFAULT_HTTP_PORT = "8088";
+  private static final String YARN_RESOURCEMANAGER_DEFAULT_HTTPS_PORT = "8090";
+
 
   private static final String YARN_ATS_URL = "yarn.timeline-server.url";
   private final static String YARN_TIMELINE_WEBAPP_HTTP_ADDRESS_KEY = 
"yarn.timeline-service.webapp.address";
@@ -80,10 +85,9 @@ public class Services {
 
   private String getRMUrlFromClusterConfig() {
 String url;
-String protocol;
 
-String haEnabled = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HA_ENABLED);
-String httpPolicy = 
ambariApi.getCluster().getConfigurationValue(YARN_SITE, YARN_HTTP_POLICY);
+String haEnabled = getYarnConfig(YARN_RESOURCEMANAGER_HA_ENABLED);
+String httpPolicy = getYarnConfig(YARN_HTTP_POLICY);
 
 if (!(HTTP_ONLY.equals(httpPolicy) || HTTPS_ONLY.equals(httpPolicy))) {
   LOG.error(String.format("RA030 Unknown value %s of 
yarn-site/yarn.http.policy. HTTP_ONLY assumed.", httpPolicy));
@@ -94,34 +98,32 @@ public class Services {
   String[] urls = getRMHAUrls(httpPolicy);
   url = getActiveRMUrl(urls);
 } else {
-  if (httpPolicy.equals(HTTPS_ONLY)) {
-protocol = "https";
-url = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HTTPS_KEY);
-  } else {
-protocol = "http";
-url = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HTTP_KEY);
+  url =  (httpPolicy.equals(HTTPS_ONLY)) ? 
getYarnConfig(YARN_RESOURCEMANAGER_HTTPS_KEY)
+: getYarnConfig(YARN_RESOURCEMANAGER_HTTP_KEY);
+
+  if (url == null || url.isEmpty()) {
+url = getYarnConfig(YARN_RESOURCEMANAGER_HOSTNAME_KEY).trim() + ":" + 
getDefaultRMPort(httpPolicy);
   }
-  url = addProtocolIfMissing(url, protocol);
+
+  url = addProtocolIfMissing(url, getProtocol(httpPolicy));
 }
 return url;
   }
 
   private String[] getRMHAUrls(String httpPolicy) {
-String haRmIds = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HA_RM_IDS_KEY);
+String haRmIds = getYarnConfig(YARN_RESOURCEMANAGER_HA_RM_IDS_KEY);
 String[] ids = haRmIds.split(",");
 int index = 0;
 String[] urls = new String[ids.length];
 for (String id : ids) {
-  String url, protocol;
-  if (HTTPS_ONLY.equals(httpPolicy)) {
-url = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HTTPS_HA_PARTIAL_KEY + id);
-protocol = "https";
-  } else {
-url = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HTTP_HA_PARTIAL_KEY + id);
-   

ambari git commit: AMBARI-13693. Ambari Blueprint sets inconsistent Yarn RM values (DIPAYAN BHOWMICK via srimanth)

2015-11-03 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/trunk de3147d5d -> 1e86d690d


AMBARI-13693. Ambari Blueprint sets inconsistent Yarn RM values (DIPAYAN 
BHOWMICK via srimanth)


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

Branch: refs/heads/trunk
Commit: 1e86d690d308451481e9043c393e60d3ba089f04
Parents: de3147d
Author: Srimanth Gunturi 
Authored: Tue Nov 3 10:09:32 2015 -0800
Committer: Srimanth Gunturi 
Committed: Tue Nov 3 10:10:08 2015 -0800

--
 .../ambari/view/utils/ambari/Services.java  | 67 +++
 .../ambari/view/utils/ambari/ServicesTest.java  | 70 
 2 files changed, 111 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1e86d690/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
--
diff --git 
a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
 
b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
index 421a365..8a50012 100644
--- 
a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
+++ 
b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/ambari/Services.java
@@ -45,6 +45,11 @@ public class Services {
   private static final String YARN_RESOURCEMANAGER_HA_RM_IDS_KEY = 
"yarn.resourcemanager.ha.rm-ids";
   private static final String YARN_RESOURCEMANAGER_HTTP_HA_PARTIAL_KEY = 
"yarn.resourcemanager.webapp.address.";
   private static final String YARN_RESOURCEMANAGER_HTTPS_HA_PARTIAL_KEY = 
"yarn.resourcemanager.webapp.https.address.";
+  private static final String YARN_RESOURCEMANAGER_HOSTNAME_KEY = 
"yarn.resourcemanager.hostname";
+  private static final String YARN_RESOURCEMANAGER_HOSTNAME_PARTIAL_KEY = 
YARN_RESOURCEMANAGER_HOSTNAME_KEY + ".";
+  private static final String YARN_RESOURCEMANAGER_DEFAULT_HTTP_PORT = "8088";
+  private static final String YARN_RESOURCEMANAGER_DEFAULT_HTTPS_PORT = "8090";
+
 
   private static final String YARN_ATS_URL = "yarn.timeline-server.url";
   private final static String YARN_TIMELINE_WEBAPP_HTTP_ADDRESS_KEY = 
"yarn.timeline-service.webapp.address";
@@ -80,10 +85,9 @@ public class Services {
 
   private String getRMUrlFromClusterConfig() {
 String url;
-String protocol;
 
-String haEnabled = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HA_ENABLED);
-String httpPolicy = 
ambariApi.getCluster().getConfigurationValue(YARN_SITE, YARN_HTTP_POLICY);
+String haEnabled = getYarnConfig(YARN_RESOURCEMANAGER_HA_ENABLED);
+String httpPolicy = getYarnConfig(YARN_HTTP_POLICY);
 
 if (!(HTTP_ONLY.equals(httpPolicy) || HTTPS_ONLY.equals(httpPolicy))) {
   LOG.error(String.format("RA030 Unknown value %s of 
yarn-site/yarn.http.policy. HTTP_ONLY assumed.", httpPolicy));
@@ -94,34 +98,32 @@ public class Services {
   String[] urls = getRMHAUrls(httpPolicy);
   url = getActiveRMUrl(urls);
 } else {
-  if (httpPolicy.equals(HTTPS_ONLY)) {
-protocol = "https";
-url = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HTTPS_KEY);
-  } else {
-protocol = "http";
-url = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HTTP_KEY);
+  url =  (httpPolicy.equals(HTTPS_ONLY)) ? 
getYarnConfig(YARN_RESOURCEMANAGER_HTTPS_KEY)
+: getYarnConfig(YARN_RESOURCEMANAGER_HTTP_KEY);
+
+  if (url == null || url.isEmpty()) {
+url = getYarnConfig(YARN_RESOURCEMANAGER_HOSTNAME_KEY).trim() + ":" + 
getDefaultRMPort(httpPolicy);
   }
-  url = addProtocolIfMissing(url, protocol);
+
+  url = addProtocolIfMissing(url, getProtocol(httpPolicy));
 }
 return url;
   }
 
   private String[] getRMHAUrls(String httpPolicy) {
-String haRmIds = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HA_RM_IDS_KEY);
+String haRmIds = getYarnConfig(YARN_RESOURCEMANAGER_HA_RM_IDS_KEY);
 String[] ids = haRmIds.split(",");
 int index = 0;
 String[] urls = new String[ids.length];
 for (String id : ids) {
-  String url, protocol;
-  if (HTTPS_ONLY.equals(httpPolicy)) {
-url = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HTTPS_HA_PARTIAL_KEY + id);
-protocol = "https";
-  } else {
-url = ambariApi.getCluster().getConfigurationValue(YARN_SITE, 
YARN_RESOURCEMANAGER_HTTP_HA_PARTIAL_KEY + id);
-protocol 

[2/2] ambari git commit: AMBARI-13699. Exported metrics have values in different units than widgets

2015-11-03 Thread alexantonenko
AMBARI-13699. Exported metrics have values in different units than widgets


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

Branch: refs/heads/branch-2.1
Commit: c1fc2af89a41f607cc265a094585a0c98884c71c
Parents: eb7b290
Author: Alex Antonenko 
Authored: Tue Nov 3 17:43:36 2015 +0200
Committer: Alex Antonenko 
Committed: Tue Nov 3 19:22:42 2015 +0200

--
 .../common/widgets/export_metrics_mixin.js  | 26 +--
 .../app/views/common/chart/linear_time.js   | 25 +-
 .../views/common/widget/graph_widget_view.js| 14 ++--
 .../views/main/dashboard/cluster_metrics/cpu.js |  2 +-
 .../main/dashboard/cluster_metrics/memory.js|  2 +-
 .../main/dashboard/cluster_metrics/network.js   |  2 +-
 ambari-web/app/views/main/host/metrics/cpu.js   |  2 +-
 ambari-web/app/views/main/host/metrics/disk.js  |  2 +-
 .../app/views/main/host/metrics/memory.js   |  2 +-
 .../app/views/main/host/metrics/network.js  |  2 +-
 .../regionserver_block_cache_hit_percent.js |  2 +-
 .../info/metrics/flume/channel_fill_pct.js  |  2 +-
 .../info/metrics/flume/channel_size_mma.js  |  3 +-
 .../service/info/metrics/flume/channel_sum.js   |  2 +-
 .../main/service/info/metrics/flume/cpu_user.js |  2 +-
 .../info/metrics/flume/flume_incoming_mma.js|  3 +-
 .../info/metrics/flume/flume_outgoing_mma.js|  3 +-
 .../views/main/service/info/metrics/flume/gc.js |  2 +-
 .../main/service/info/metrics/flume/jvm_heap.js |  2 +-
 .../common/widgets/export_metrics_mixin_test.js | 80 ++--
 .../test/views/common/chart/linear_time_test.js | 54 +
 .../common/widget/graph_widget_view_test.js | 22 ++
 22 files changed, 217 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c1fc2af8/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
--
diff --git a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js 
b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
index 84a2194..2ecb045 100644
--- a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
@@ -70,7 +70,7 @@ App.ExportMetricsMixin = Em.Mixin.create({
 } else {
   var fileType = params.isCSV ? 'csv' : 'json',
 fileName = 'data.' + fileType,
-data = params.isCSV ? this.prepareCSV(seriesData) : 
JSON.stringify(seriesData, null, 4);
+data = params.isCSV ? this.prepareCSV(seriesData) : 
JSON.stringify(seriesData, this.jsonReplacer(), 4);
   fileUtils.downloadTextFile(data, fileType, fileName);
 }
   },
@@ -80,16 +80,17 @@ App.ExportMetricsMixin = Em.Mixin.create({
   },
 
   prepareCSV: function (data) {
-var titles,
+var displayUnit = this.get('targetView.displayUnit'),
+  titles,
   ticksNumber,
   metricsNumber,
   metricsArray;
-if (Em.isArray(data)) {
-  titles = data.mapProperty('name');
-  titles.unshift(Em.I18n.t('common.timestamp'));
-  ticksNumber = data[0].data.length;
-  metricsNumber = data.length;
-}
+titles = data.map(function (item) {
+  return displayUnit ? item.name + ' (' + displayUnit + ')' : item.name;
+}, this);
+titles.unshift(Em.I18n.t('common.timestamp'));
+ticksNumber = data[0].data.length;
+metricsNumber = data.length;
 metricsArray = [titles];
 for (var i = 0; i < ticksNumber; i++) {
   metricsArray.push([data[0].data[i][1]]);
@@ -98,6 +99,15 @@ App.ExportMetricsMixin = Em.Mixin.create({
   };
 }
 return stringUtils.arrayToCSV(metricsArray);
+  },
+
+  jsonReplacer: function () {
+var displayUnit = this.get('targetView.displayUnit');
+return function (key, value) {
+  if (['name', 'data'].contains(key) || (!isNaN(key))) {
+return key == 'name' && displayUnit ? value + ' (' + displayUnit + ')' 
: value;
+  }
+}
   }
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/c1fc2af8/ambari-web/app/views/common/chart/linear_time.js
--
diff --git a/ambari-web/app/views/common/chart/linear_time.js 
b/ambari-web/app/views/common/chart/linear_time.js
index 24ca450..a6bd9a4 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -177,6 +177,7 @@ App.ChartLinearTimeView = 
Ember.View.extend(App.ExportMetricsMixin, {
 
   didInsertElement: function () {
 var self = this;
+this.setYAxisFormatter();
 this.loadData();
 

[1/2] ambari git commit: AMBARI-13700. hbase.root dir for metrics server does not get updated after NN HA is enabled

2015-11-03 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 8aba9a4d6 -> de3147d5d


AMBARI-13700. hbase.root dir for metrics server does not get updated after NN 
HA is enabled


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

Branch: refs/heads/trunk
Commit: de3147d5dece64ab1c64366ef99f8a3de75afc96
Parents: 3cb80cf
Author: Alex Antonenko 
Authored: Tue Nov 3 19:13:33 2015 +0200
Committer: Alex Antonenko 
Committed: Tue Nov 3 19:19:41 2015 +0200

--
 .../nameNode/step3_controller.js| 32 ++--
 ambari-web/app/data/HDP2/ha_properties.js   | 17 +--
 2 files changed, 38 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/de3147d5/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
index 20b6ce7..3cb7be7 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step3_controller.js
@@ -79,6 +79,11 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
   urlParams.push('(type=accumulo-site=' + accumuloSiteTag + ')');
   this.set("accumuloSiteTag", {name : "accumuloSiteTag", value : 
accumuloSiteTag});
 }
+if (App.Service.find().someProperty('serviceName', 'AMBARI_METRICS')) {
+  var amsHbaseSiteTag = 
data.Clusters.desired_configs['ams-hbase-site'].tag;
+  urlParams.push('(type=ams-hbase-site=' + amsHbaseSiteTag + ')');
+  this.set("amsHbaseSiteTag", {name : "amsHbaseSiteTag", value : 
amsHbaseSiteTag});
+}
 App.ajax.send({
   name: 'admin.get.all_configurations',
   sender: this,
@@ -120,10 +125,12 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
   },
 
   tweakServiceConfigValues: function(configs,nameServiceId) {
-var currentNameNodeHost = 
this.get('content.masterComponentHosts').filterProperty('component', 
'NAMENODE').findProperty('isInstalled', true).hostName;
-var newNameNodeHost = 
this.get('content.masterComponentHosts').filterProperty('component', 
'NAMENODE').findProperty('isInstalled', false).hostName;
-var journalNodeHosts = 
this.get('content.masterComponentHosts').filterProperty('component', 
'JOURNALNODE').mapProperty('hostName');
-var zooKeeperHosts = 
this.get('content.masterComponentHosts').filterProperty('component', 
'ZOOKEEPER_SERVER').mapProperty('hostName');
+var
+  value = "",
+  currentNameNodeHost = 
this.get('content.masterComponentHosts').filterProperty('component', 
'NAMENODE').findProperty('isInstalled', true).hostName,
+  newNameNodeHost = 
this.get('content.masterComponentHosts').filterProperty('component', 
'NAMENODE').findProperty('isInstalled', false).hostName,
+  journalNodeHosts = 
this.get('content.masterComponentHosts').filterProperty('component', 
'JOURNALNODE').mapProperty('hostName'),
+  zooKeeperHosts = 
this.get('content.masterComponentHosts').filterProperty('component', 
'ZOOKEEPER_SERVER').mapProperty('hostName');
 
 var nnHttpPort = 50070;
 if 
(this.get('serverConfigData').items.findProperty('type','hdfs-site').properties['dfs.namenode.http-address'])
@@ -154,23 +161,30 @@ App.HighAvailabilityWizardStep3Controller = 
Em.Controller.extend({
 this.setConfigInitialValue(config,'qjournal://' + journalNodeHosts[0] + 
':8485;' + journalNodeHosts[1] + ':8485;' + journalNodeHosts[2] + ':8485/' + 
nameServiceId);
 config = configs.findProperty('name','ha.zookeeper.quorum');
 this.setConfigInitialValue(config,zooKeeperHosts[0] + ':' + zkClientPort + 
',' + zooKeeperHosts[1] + ':' + zkClientPort + ',' + zooKeeperHosts[2] + ':'+ 
zkClientPort  );
-config = configs.findProperty('name','hbase.rootdir');
 if (App.Service.find().someProperty('serviceName', 'HBASE')) {
- var value = this.get('serverConfigData.items').findProperty('type', 
'hbase-site').properties['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + 
nameServiceId);
+  config = configs.filterProperty('filename', 
'hbase-site').findProperty('name','hbase.rootdir');
+  value = this.get('serverConfigData.items').findProperty('type', 
'hbase-site').properties['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + 
nameServiceId);
  this.setConfigInitialValue(config,value);
 }
+if 

ambari git commit: AMBARI-13703. Admin view throws javascript error when user timeout is not defined (rzang)

2015-11-03 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 80d36ec7c -> bed766879


AMBARI-13703. Admin view throws javascript error when user timeout is not 
defined (rzang)


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

Branch: refs/heads/branch-2.1
Commit: bed766879bb7d66a9cd97138b96a40118a43c726
Parents: 80d36ec
Author: Richard Zang 
Authored: Tue Nov 3 12:46:08 2015 -0800
Committer: Richard Zang 
Committed: Tue Nov 3 12:47:48 2015 -0800

--
 .../main/resources/ui/admin-web/app/scripts/services/Cluster.js  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bed76687/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
index a602cba..fdfb8e2 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
@@ -65,7 +65,9 @@ angular.module('ambariAdminConsole')
   var url = 
'/services/AMBARI/components/AMBARI_SERVER?fields=RootServiceComponents/properties/user.inactivity.timeout.default'
   $http.get(Settings.baseUrl + url)
   .then(function(data) {
-
deferred.resolve(data.data.RootServiceComponents.properties['user.inactivity.timeout.default']);
+var properties = data.data.RootServiceComponents.properties;
+var timeout = properties? 
properties['user.inactivity.timeout.default'] : 0;
+deferred.resolve(timeout);
   })
   .catch(function(data) {
 deferred.reject(data);



ambari git commit: AMBARI-13618: Add configure / start / stop / status operations for Apache HAWQ's PXF (mithmatt via jaoki)

2015-11-03 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/trunk 1e86d690d -> 4763c759c


AMBARI-13618: Add configure / start / stop / status operations for Apache 
HAWQ's PXF (mithmatt via jaoki)


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

Branch: refs/heads/trunk
Commit: 4763c759cc728d9fd8f24402c90012ae527985e5
Parents: 1e86d69
Author: Jun Aoki 
Authored: Tue Nov 3 12:14:45 2015 -0800
Committer: Jun Aoki 
Committed: Tue Nov 3 12:14:45 2015 -0800

--
 .../PXF/3.0.0.0/configuration/pxf-site.xml  |  19 +++
 .../common-services/PXF/3.0.0.0/metainfo.xml|   2 +-
 .../PXF/3.0.0.0/package/scripts/params.py   |  42 +++
 .../PXF/3.0.0.0/package/scripts/pxf.py  | 120 +++
 .../PXF/3.0.0.0/package/scripts/pxfservice.py   |  41 ---
 .../PXF/3.0.0.0/package/templates/pxf-env.j2|  34 ++
 6 files changed, 216 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4763c759/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/configuration/pxf-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/configuration/pxf-site.xml
 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/configuration/pxf-site.xml
new file mode 100644
index 000..0b3a36e
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/configuration/pxf-site.xml
@@ -0,0 +1,19 @@
+
+
+ 
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/4763c759/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/metainfo.xml 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/metainfo.xml
index 4df1bd6..f578d64 100644
--- a/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/metainfo.xml
@@ -32,7 +32,7 @@
   SLAVE
   1+
   
-scripts/pxfservice.py
+scripts/pxf.py
 PYTHON
 600
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/4763c759/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/package/scripts/params.py
new file mode 100644
index 000..a4986c9
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/package/scripts/params.py
@@ -0,0 +1,42 @@
+"""
+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.
+"""
+
+from resource_management import Script
+
+config = Script.get_config()
+
+
+pxf_service_name = "pxf-service"
+stack_name = str(config["hostLevelParams"]["stack_name"])
+
+# Users and Groups
+pxf_user = "pxf"
+pxf_group = pxf_user
+hdfs_superuser_group = 
config["configurations"]["hdfs-site"]["dfs.permissions.superusergroup"]
+user_group = config["configurations"]["cluster-env"]["user_group"]
+tomcat_group = "tomcat"
+
+# Directories
+pxf_conf_dir = "/etc/pxf/conf"
+pxf_instance_dir = "/var/pxf"
+
+# Java home path
+java_home = config["hostLevelParams"]["java_home"] if "java_home" in 
config["hostLevelParams"] else None
+
+# Timeouts
+default_exec_timeout = 600

http://git-wip-us.apache.org/repos/asf/ambari/blob/4763c759/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/package/scripts/pxf.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/PXF/3.0.0.0/package/scripts/pxf.py
 

ambari git commit: AMBARI-13703. Admin view throws javascript error when user timeout is not defined (rzang)

2015-11-03 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/trunk 4763c759c -> 463ed4bd9


AMBARI-13703. Admin view throws javascript error when user timeout is not 
defined (rzang)


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

Branch: refs/heads/trunk
Commit: 463ed4bd91cfc4ac7a0f199deed1a42b1f511ef9
Parents: 4763c75
Author: Richard Zang 
Authored: Tue Nov 3 12:46:08 2015 -0800
Committer: Richard Zang 
Committed: Tue Nov 3 12:46:08 2015 -0800

--
 .../main/resources/ui/admin-web/app/scripts/services/Cluster.js  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/463ed4bd/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
index a602cba..fdfb8e2 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Cluster.js
@@ -65,7 +65,9 @@ angular.module('ambariAdminConsole')
   var url = 
'/services/AMBARI/components/AMBARI_SERVER?fields=RootServiceComponents/properties/user.inactivity.timeout.default'
   $http.get(Settings.baseUrl + url)
   .then(function(data) {
-
deferred.resolve(data.data.RootServiceComponents.properties['user.inactivity.timeout.default']);
+var properties = data.data.RootServiceComponents.properties;
+var timeout = properties? 
properties['user.inactivity.timeout.default'] : 0;
+deferred.resolve(timeout);
   })
   .catch(function(data) {
 deferred.reject(data);



ambari git commit: AMBARI-13301. Kerberos support to ECS stack (Vijay Srinivasaraghavan via smohanty)

2015-11-03 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk 463ed4bd9 -> b179d8de9


AMBARI-13301. Kerberos support to ECS stack (Vijay Srinivasaraghavan via 
smohanty)


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

Branch: refs/heads/trunk
Commit: b179d8de9551d8963f4903fc1736cde548050434
Parents: 463ed4b
Author: Sumit Mohanty 
Authored: Tue Nov 3 15:33:57 2015 -0800
Committer: Sumit Mohanty 
Committed: Tue Nov 3 15:33:57 2015 -0800

--
 ambari-server/sbin/ambari-server|   6 +-
 ambari-server/src/main/python/ambari-server.py  |  27 ++-
 .../main/python/ambari_server/enableStack.py|  94 
 .../main/python/ambari_server/setupActions.py   |   1 +
 .../2.0.6/hooks/before-START/scripts/params.py  |  34 +++
 .../scripts/shared_initialization.py|  21 ++
 .../stacks/HDP/2.3.ECS/repos/repoinfo.xml   |  30 ++-
 .../stacks/HDP/2.3.ECS/role_command_order.json  |   3 +-
 .../services/ECS/configuration/core-site.xml| 197 +
 .../HDP/2.3.ECS/services/ECS/kerberos.json  |  53 +
 .../HDP/2.3.ECS/services/ECS/metainfo.xml   |   4 +-
 .../services/ECS/package/scripts/ecs_client.py  |   2 +
 .../services/ECS/package/scripts/params.py  |   7 +-
 .../ECS/package/scripts/service_check.py|  19 +-
 .../HDP/2.3.ECS/services/HBASE/kerberos.json| 132 
 .../HDP/2.3.ECS/services/YARN/kerberos.json | 215 +++
 16 files changed, 735 insertions(+), 110 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b179d8de/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index 490d54d..c773718 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -148,9 +148,13 @@ case "$1" in
 echo -e "Updating host names"
 $PYTHON /usr/sbin/ambari-server.py $@
 ;;
+  enable-stack)
+echo -e "Enabling stack(s)..."
+$PYTHON /usr/sbin/ambari-server.py $@
+;;
   *)
 echo "Usage: /usr/sbin/ambari-server
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|refresh-stack-hash|backup|restore|update-host-names}
 [options]
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|refresh-stack-hash|backup|restore|update-host-names|enable-stack}
 [options]
 Use usr/sbin/ambari-server  --help to get details on options 
available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/b179d8de/ambari-server/src/main/python/ambari-server.py
--
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 56dfecc..3ea608c 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -37,10 +37,11 @@ from ambari_server.serverSetup import reset, setup, 
setup_jce_policy
 from ambari_server.serverUpgrade import upgrade, upgrade_stack, set_current
 from ambari_server.setupHttps import setup_https, setup_truststore
 from ambari_server.hostUpdate import update_host_names
+from ambari_server.enableStack import enable_stack_version
 
 from ambari_server.setupActions import BACKUP_ACTION, LDAP_SETUP_ACTION, 
LDAP_SYNC_ACTION, PSTART_ACTION, \
   REFRESH_STACK_HASH_ACTION, RESET_ACTION, RESTORE_ACTION, 
UPDATE_HOST_NAMES_ACTION, SETUP_ACTION, SETUP_SECURITY_ACTION, \
-  START_ACTION, STATUS_ACTION, STOP_ACTION, UPGRADE_ACTION, 
UPGRADE_STACK_ACTION, SETUP_JCE_ACTION, SET_CURRENT_ACTION
+  START_ACTION, STATUS_ACTION, STOP_ACTION, UPGRADE_ACTION, 
UPGRADE_STACK_ACTION, SETUP_JCE_ACTION, SET_CURRENT_ACTION, ENABLE_STACK_ACTION
 from ambari_server.setupSecurity import setup_ldap, sync_ldap, 
setup_master_key, setup_ambari_krb5_jaas
 from ambari_server.userInput import get_validated_string_input
 
@@ -373,6 +374,10 @@ def init_parser_options(parser):
   parser.add_option('--cluster-name', default=None, help="Cluster name", 
dest="cluster_name")
   parser.add_option('--version-display-name', default=None, help="Display name 
of desired repo version", dest="desired_repo_version")
   parser.add_option('--force-version', action="store_true", default=False, 
help="Force version to current", dest="force_repo_version")
+  parser.add_option('--version', 

[1/2] ambari git commit: AMBARI-13663. Add support of api operations retry. (mpapirkovskyy)

2015-11-03 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 bed766879 -> ee7c3bdc2
  refs/heads/trunk b179d8de9 -> 6bc870f6c


AMBARI-13663. Add support of api operations retry. (mpapirkovskyy)


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

Branch: refs/heads/trunk
Commit: 6bc870f6c955aec07a19c1b7d222c99a2701d999
Parents: b179d8d
Author: Myroslav Papirkovskyi 
Authored: Wed Nov 4 01:54:35 2015 +0200
Committer: Myroslav Papirkovskyi 
Committed: Wed Nov 4 02:02:26 2015 +0200

--
 .../ambari/server/api/services/BaseService.java |  2 +
 .../server/configuration/Configuration.java | 43 +
 .../ambari/server/controller/AmbariServer.java  |  3 +
 .../internal/AbstractResourceProvider.java  | 34 +++-
 .../org/apache/ambari/server/state/Cluster.java |  5 ++
 .../server/state/cluster/ClusterImpl.java   | 92 +++-
 .../server/state/cluster/ClustersImpl.java  |  3 +-
 .../apache/ambari/server/utils/RetryHelper.java | 85 ++
 8 files changed, 261 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6bc870f6/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
index 1016ed7..7945599 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
@@ -28,6 +28,7 @@ import 
org.apache.ambari.server.api.services.serializers.CsvSerializer;
 import org.apache.ambari.server.api.services.serializers.JsonSerializer;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
 import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.utils.RetryHelper;
 import org.eclipse.jetty.util.ajax.JSON;
 
 import javax.ws.rs.core.HttpHeaders;
@@ -117,6 +118,7 @@ public abstract class BaseService {
   builder.type(mediaType);
 }
 
+RetryHelper.clearAffectedClusters();
 return builder.build();
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6bc870f6/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 3a282ed..b4d5de8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -202,6 +202,12 @@ public class Configuration {
   public static final String 
SERVER_JDBC_CONNECTION_POOL_ACQUISITION_RETRY_ATTEMPTS = 
"server.jdbc.connection-pool.acquisition-retry-attempts";
   public static final String 
SERVER_JDBC_CONNECTION_POOL_ACQUISITION_RETRY_DELAY = 
"server.jdbc.connection-pool.acquisition-retry-delay";
 
+  public static final String API_OPERATIONS_RETRY_ATTEMPTS_KEY = 
"api.operations.retry-attempts";
+  public static final String BLUEPRINTS_OPERATIONS_RETRY_ATTEMPTS_KEY = 
"blueprints.operations.retry-attempts";
+  public static final String API_OPERATIONS_RETRY_ATTEMPTS_DEFAULT = "0";
+  public static final String BLUEPRINTS_OPERATIONS_RETRY_ATTEMPTS_DEFAULT = 
"0";
+  public static final int RETRY_ATTEMPTS_LIMIT = 10;
+
   public static final String SERVER_JDBC_RCA_USER_NAME_KEY = 
"server.jdbc.rca.user.name";
   public static final String SERVER_JDBC_RCA_USER_PASSWD_KEY = 
"server.jdbc.rca.user.passwd";
   public static final String SERVER_JDBC_RCA_DRIVER_KEY = 
"server.jdbc.rca.driver";
@@ -2351,4 +2357,41 @@ public class Configuration {
   public int getAlertCacheSize() {
 return Integer.parseInt(properties.getProperty(ALERTS_CACHE_SIZE, 
ALERTS_CACHE_SIZE_DEFAULT));
   }
+
+  /**
+   * @return number of retry attempts for API update requests
+   */
+  public int getApiOperationsRetryAttempts() {
+String property = 
properties.getProperty(API_OPERATIONS_RETRY_ATTEMPTS_KEY, 
API_OPERATIONS_RETRY_ATTEMPTS_DEFAULT);
+Integer attempts = Integer.valueOf(property);
+if (attempts < 0) {
+  LOG.warn("Invalid API retry attempts number ({}), should be [0,{}]. 
Value reset to default {}",
+  attempts, 

[2/2] ambari git commit: AMBARI-13663. Add support of api operations retry. (mpapirkovskyy)

2015-11-03 Thread mpapirkovskyy
AMBARI-13663. Add support of api operations retry. (mpapirkovskyy)


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

Branch: refs/heads/branch-2.1
Commit: ee7c3bdc2d968b1ee6d12a77c3cbe458ca76ae2a
Parents: bed7668
Author: Myroslav Papirkovskyi 
Authored: Wed Nov 4 01:54:35 2015 +0200
Committer: Myroslav Papirkovskyi 
Committed: Wed Nov 4 02:04:47 2015 +0200

--
 .../ambari/server/api/services/BaseService.java |  2 +
 .../server/configuration/Configuration.java | 43 +
 .../ambari/server/controller/AmbariServer.java  |  3 +
 .../internal/AbstractResourceProvider.java  | 34 +++-
 .../org/apache/ambari/server/state/Cluster.java |  5 ++
 .../server/state/cluster/ClusterImpl.java   | 92 +++-
 .../server/state/cluster/ClustersImpl.java  |  3 +-
 .../apache/ambari/server/utils/RetryHelper.java | 85 ++
 8 files changed, 261 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ee7c3bdc/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
index 1016ed7..7945599 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseService.java
@@ -28,6 +28,7 @@ import 
org.apache.ambari.server.api.services.serializers.CsvSerializer;
 import org.apache.ambari.server.api.services.serializers.JsonSerializer;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
 import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.utils.RetryHelper;
 import org.eclipse.jetty.util.ajax.JSON;
 
 import javax.ws.rs.core.HttpHeaders;
@@ -117,6 +118,7 @@ public abstract class BaseService {
   builder.type(mediaType);
 }
 
+RetryHelper.clearAffectedClusters();
 return builder.build();
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee7c3bdc/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index dd8e832..f50aeda 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -202,6 +202,12 @@ public class Configuration {
   public static final String 
SERVER_JDBC_CONNECTION_POOL_ACQUISITION_RETRY_ATTEMPTS = 
"server.jdbc.connection-pool.acquisition-retry-attempts";
   public static final String 
SERVER_JDBC_CONNECTION_POOL_ACQUISITION_RETRY_DELAY = 
"server.jdbc.connection-pool.acquisition-retry-delay";
 
+  public static final String API_OPERATIONS_RETRY_ATTEMPTS_KEY = 
"api.operations.retry-attempts";
+  public static final String BLUEPRINTS_OPERATIONS_RETRY_ATTEMPTS_KEY = 
"blueprints.operations.retry-attempts";
+  public static final String API_OPERATIONS_RETRY_ATTEMPTS_DEFAULT = "0";
+  public static final String BLUEPRINTS_OPERATIONS_RETRY_ATTEMPTS_DEFAULT = 
"0";
+  public static final int RETRY_ATTEMPTS_LIMIT = 10;
+
   public static final String SERVER_JDBC_RCA_USER_NAME_KEY = 
"server.jdbc.rca.user.name";
   public static final String SERVER_JDBC_RCA_USER_PASSWD_KEY = 
"server.jdbc.rca.user.passwd";
   public static final String SERVER_JDBC_RCA_DRIVER_KEY = 
"server.jdbc.rca.driver";
@@ -2342,4 +2348,41 @@ public class Configuration {
   public int getAlertCacheSize() {
 return Integer.parseInt(properties.getProperty(ALERTS_CACHE_SIZE, 
ALERTS_CACHE_SIZE_DEFAULT));
   }
+
+  /**
+   * @return number of retry attempts for API update requests
+   */
+  public int getApiOperationsRetryAttempts() {
+String property = 
properties.getProperty(API_OPERATIONS_RETRY_ATTEMPTS_KEY, 
API_OPERATIONS_RETRY_ATTEMPTS_DEFAULT);
+Integer attempts = Integer.valueOf(property);
+if (attempts < 0) {
+  LOG.warn("Invalid API retry attempts number ({}), should be [0,{}]. 
Value reset to default {}",
+  attempts, RETRY_ATTEMPTS_LIMIT, 
API_OPERATIONS_RETRY_ATTEMPTS_DEFAULT);
+  attempts = Integer.valueOf(API_OPERATIONS_RETRY_ATTEMPTS_DEFAULT);

ambari git commit: AMBARI-13701. Introduce cluster wide MINUTE aggregator in Ambari Metrics service. (Aravindan Vijayan via swagle)

2015-11-03 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 6bc870f6c -> 4c3be3975


AMBARI-13701. Introduce cluster wide MINUTE aggregator in Ambari Metrics 
service. (Aravindan Vijayan via swagle)


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

Branch: refs/heads/trunk
Commit: 4c3be3975ace624be966639c9575d5b38aa038c9
Parents: 6bc870f
Author: Siddharth Wagle 
Authored: Tue Nov 3 21:33:52 2015 -0800
Committer: Siddharth Wagle 
Committed: Tue Nov 3 21:33:52 2015 -0800

--
 .../timeline/HBaseTimelineMetricStore.java  |  10 +-
 .../metrics/timeline/PhoenixHBaseAccessor.java  |  33 ++-
 .../timeline/TimelineMetricConfiguration.java   |  14 +-
 .../TimelineMetricAggregatorFactory.java|  79 +-
 .../TimelineMetricClusterAggregatorMinute.java  | 248 ---
 .../TimelineMetricClusterAggregatorSecond.java  | 248 +++
 .../timeline/query/PhoenixTransactSQL.java  |   9 +-
 .../metrics/timeline/ITClusterAggregator.java   |  92 ++-
 .../timeline/ITPhoenixHBaseAccessor.java|   7 +-
 .../cache/TimelineMetricCacheEntryFactory.java  |  19 +-
 .../server/upgrade/UpgradeCatalog213.java   |  22 ++
 .../0.1.0/configuration/ams-site.xml|  54 +++-
 .../0.1.0/package/scripts/split_points.py   |   2 +-
 .../server/upgrade/UpgradeCatalog213Test.java   |  76 ++
 14 files changed, 601 insertions(+), 312 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4c3be397/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
index 17df629..aed5fed 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
@@ -76,7 +76,15 @@ public class HBaseTimelineMetricStore extends 
AbstractService implements Timelin
 LOG.info("Using group by aggregators for aggregating host and cluster 
metrics.");
   }
 
-  // Start the cluster aggregator minute
+  // Start the cluster aggregator second
+  TimelineMetricAggregator secondClusterAggregator =
+
TimelineMetricAggregatorFactory.createTimelineClusterAggregatorSecond(hBaseAccessor,
 metricsConf);
+  if (!secondClusterAggregator.isDisabled()) {
+Thread aggregatorThread = new Thread(secondClusterAggregator);
+aggregatorThread.start();
+  }
+
+  // Start the minute cluster aggregator
   TimelineMetricAggregator minuteClusterAggregator =
 
TimelineMetricAggregatorFactory.createTimelineClusterAggregatorMinute(hBaseAccessor,
 metricsConf);
   if (!minuteClusterAggregator.isDisabled()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c3be397/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index 3ce30fd..be06650 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -51,8 +51,6 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -63,6 +61,7 @@ import static 

ambari git commit: AMBARI-13694 Code to read keysdir cannot handle space in the front (dsen)

2015-11-03 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk f24058f79 -> b5406c597


AMBARI-13694 Code to read keysdir cannot handle space in the front (dsen)


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

Branch: refs/heads/trunk
Commit: b5406c597f2b7bf83a070fd6f0c69a233a2e1064
Parents: f24058f
Author: Dmytro Sen 
Authored: Tue Nov 3 11:43:59 2015 +0200
Committer: Dmytro Sen 
Committed: Tue Nov 3 16:54:23 2015 +0200

--
 ambari-agent/conf/unix/ambari-agent |  3 ++
 .../main/python/ambari_agent/AmbariConfig.py|  4 +-
 .../test/python/ambari_agent/TestActionQueue.py |  3 --
 .../python/ambari_agent/TestAmbariConfig.py | 47 
 4 files changed, 51 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b5406c59/ambari-agent/conf/unix/ambari-agent
--
diff --git a/ambari-agent/conf/unix/ambari-agent 
b/ambari-agent/conf/unix/ambari-agent
index ea59216..c1e7fe7 100755
--- a/ambari-agent/conf/unix/ambari-agent
+++ b/ambari-agent/conf/unix/ambari-agent
@@ -59,6 +59,9 @@ if [ "$EUID" -ne 0 ] ; then
 fi
 
 keysdir=$(awk -F "=" '/keysdir/ {print $2}' 
/etc/ambari-agent/conf/ambari-agent.ini)
+# trim spaces
+keysdir=${keysdir// }
+keysdir=${keysdir%% }
 
 change_files_permissions() {
 if [ ! -z "$keysdir" ]; then

http://git-wip-us.apache.org/repos/asf/ambari/blob/b5406c59/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py 
b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
index 03e14ad..2c82ca5 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
@@ -140,8 +140,6 @@ pidPathVars = [
 ]
 
 
-
-
 class AmbariConfig:
   TWO_WAY_SSL_PROPERTY = "security.server.two_way_ssl"
   AMBARI_PROPERTIES_CATEGORY = 'agentConfig'
@@ -159,7 +157,7 @@ class AmbariConfig:
 
   def get(self, section, value, default=None):
 try:
-  return self.config.get(section, value)
+  return str(self.config.get(section, value)).strip()
 except ConfigParser.Error, err:
   if default != None:
 return default

http://git-wip-us.apache.org/repos/asf/ambari/blob/b5406c59/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py 
b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
index a583131..10bfe1a 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
@@ -24,7 +24,6 @@ from ambari_agent.LiveStatus import LiveStatus
 from ambari_agent.ActionQueue import ActionQueue
 from ambari_agent.AmbariConfig import AmbariConfig
 import os, errno, time, pprint, tempfile, threading
-import StringIO
 import sys
 from threading import Thread
 import copy
@@ -33,10 +32,8 @@ from mock.mock import patch, MagicMock, call
 from ambari_agent.StackVersionsFileHandler import StackVersionsFileHandler
 from ambari_agent.CustomServiceOrchestrator import CustomServiceOrchestrator
 from ambari_agent.PythonExecutor import PythonExecutor
-from ambari_agent.CommandStatusDict import CommandStatusDict
 from ambari_agent.ActualConfigHandler import ActualConfigHandler
 from ambari_agent.RecoveryManager import RecoveryManager
-from ambari_agent.FileCache import FileCache
 from ambari_commons import OSCheck
 from only_for_platform import not_for_platform, os_distro_value, 
PLATFORM_WINDOWS, PLATFORM_LINUX
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b5406c59/ambari-agent/src/test/python/ambari_agent/TestAmbariConfig.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestAmbariConfig.py 
b/ambari-agent/src/test/python/ambari_agent/TestAmbariConfig.py
new file mode 100644
index 000..78f29fe
--- /dev/null
+++ b/ambari-agent/src/test/python/ambari_agent/TestAmbariConfig.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You 

ambari git commit: AMBARI-13681. Changing 'Skip service check failure' and 'Skip slave component failure' options after RU is kicked off does not work (ncole)

2015-11-03 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 64ac71514 -> c4bc11e0d


AMBARI-13681. Changing 'Skip service check failure' and 'Skip slave component 
failure' options after RU is kicked off does not work (ncole)


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

Branch: refs/heads/branch-2.1
Commit: c4bc11e0d7956f5234b54fcbd53c14e30550d620
Parents: 64ac715
Author: Nate Cole 
Authored: Tue Nov 3 08:40:41 2015 -0500
Committer: Nate Cole 
Committed: Tue Nov 3 08:40:41 2015 -0500

--
 .../internal/UpgradeResourceProvider.java   | 11 +--
 .../server/orm/dao/HostRoleCommandDAO.java  | 72 +--
 .../internal/UpgradeResourceProviderTest.java   | 75 
 .../server/orm/dao/HostRoleCommandDAOTest.java  | 39 --
 4 files changed, 97 insertions(+), 100 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c4bc11e0/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index b33c480..8d53808 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -96,10 +96,8 @@ import 
org.apache.ambari.server.state.stack.upgrade.ConfigureTask;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
 import org.apache.ambari.server.state.stack.upgrade.Grouping;
 import org.apache.ambari.server.state.stack.upgrade.ManualTask;
-import org.apache.ambari.server.state.stack.upgrade.RestartGrouping;
 import org.apache.ambari.server.state.stack.upgrade.ServerSideActionTask;
 import org.apache.ambari.server.state.stack.upgrade.StageWrapper;
-import org.apache.ambari.server.state.stack.upgrade.StopGrouping;
 import org.apache.ambari.server.state.stack.upgrade.Task;
 import org.apache.ambari.server.state.stack.upgrade.TaskWrapper;
 import org.apache.ambari.server.state.stack.upgrade.UpdateStackGrouping;
@@ -438,23 +436,20 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
   boolean skipFailures = upgradeEntity.isComponentFailureAutoSkipped();
   boolean skipServiceCheckFailures = 
upgradeEntity.isServiceCheckFailureAutoSkipped();
 
-  // update skipping failures on commands which are not SERVICE_CHECKs
   if (null != skipFailuresRequestProperty) {
 skipFailures = Boolean.parseBoolean(skipFailuresRequestProperty);
-s_hostRoleCommandDAO.updateAutomaticSkipOnFailure(requestId, 
skipFailures);
   }
 
-  // if the service check failure skip is present, then update all role
-  // commands that are SERVICE_CHECKs
   if (null != skipServiceCheckFailuresRequestProperty) {
 skipServiceCheckFailures = 
Boolean.parseBoolean(skipServiceCheckFailuresRequestProperty);
-s_hostRoleCommandDAO.updateAutomaticSkipServiceCheckFailure(requestId,
-skipServiceCheckFailures);
   }
 
+  s_hostRoleCommandDAO.updateAutomaticSkipOnFailure(requestId, 
skipFailures, skipServiceCheckFailures);
+
   upgradeEntity.setAutoSkipComponentFailures(skipFailures);
   upgradeEntity.setAutoSkipServiceCheckFailures(skipServiceCheckFailures);
   upgradeEntity = s_upgradeDAO.merge(upgradeEntity);
+
 }
 
 return getRequestStatus(null);

http://git-wip-us.apache.org/repos/asf/ambari/blob/c4bc11e0/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 0a02610..bf1f5d5 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
@@ -478,67 +478,33 @@ public class HostRoleCommandDAO {
 
   /**
* Updates the {@link HostRoleCommandEntity#isFailureAutoSkipped()} flag for
-   * all commands which are not {@link RoleCommand#SERVICE_CHECK}.
+   * all commands for the given request
* 
-   * This will execute a JPQL {@code UPDATE} statement, bypassing the
-   * {@link 

ambari git commit: AMBARI-13681. Changing 'Skip service check failure' and 'Skip slave component failure' options after RU is kicked off does not work (ncole)

2015-11-03 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/trunk 76dd478e5 -> 60b835847


AMBARI-13681. Changing 'Skip service check failure' and 'Skip slave component 
failure' options after RU is kicked off does not work (ncole)


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

Branch: refs/heads/trunk
Commit: 60b835847603c165f4235856a1ae04981cc10bd8
Parents: 76dd478
Author: Nate Cole 
Authored: Mon Nov 2 13:28:24 2015 -0500
Committer: Nate Cole 
Committed: Tue Nov 3 07:58:29 2015 -0500

--
 .../internal/UpgradeResourceProvider.java   | 11 +--
 .../server/orm/dao/HostRoleCommandDAO.java  | 72 +--
 .../internal/UpgradeResourceProviderTest.java   | 75 
 .../server/orm/dao/HostRoleCommandDAOTest.java  | 39 --
 4 files changed, 97 insertions(+), 100 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/60b83584/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index 7978a7a..915e431 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -96,10 +96,8 @@ import 
org.apache.ambari.server.state.stack.upgrade.ConfigureTask;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
 import org.apache.ambari.server.state.stack.upgrade.Grouping;
 import org.apache.ambari.server.state.stack.upgrade.ManualTask;
-import org.apache.ambari.server.state.stack.upgrade.RestartGrouping;
 import org.apache.ambari.server.state.stack.upgrade.ServerSideActionTask;
 import org.apache.ambari.server.state.stack.upgrade.StageWrapper;
-import org.apache.ambari.server.state.stack.upgrade.StopGrouping;
 import org.apache.ambari.server.state.stack.upgrade.Task;
 import org.apache.ambari.server.state.stack.upgrade.TaskWrapper;
 import org.apache.ambari.server.state.stack.upgrade.UpdateStackGrouping;
@@ -438,23 +436,20 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
   boolean skipFailures = upgradeEntity.isComponentFailureAutoSkipped();
   boolean skipServiceCheckFailures = 
upgradeEntity.isServiceCheckFailureAutoSkipped();
 
-  // update skipping failures on commands which are not SERVICE_CHECKs
   if (null != skipFailuresRequestProperty) {
 skipFailures = Boolean.parseBoolean(skipFailuresRequestProperty);
-s_hostRoleCommandDAO.updateAutomaticSkipOnFailure(requestId, 
skipFailures);
   }
 
-  // if the service check failure skip is present, then update all role
-  // commands that are SERVICE_CHECKs
   if (null != skipServiceCheckFailuresRequestProperty) {
 skipServiceCheckFailures = 
Boolean.parseBoolean(skipServiceCheckFailuresRequestProperty);
-s_hostRoleCommandDAO.updateAutomaticSkipServiceCheckFailure(requestId,
-skipServiceCheckFailures);
   }
 
+  s_hostRoleCommandDAO.updateAutomaticSkipOnFailure(requestId, 
skipFailures, skipServiceCheckFailures);
+
   upgradeEntity.setAutoSkipComponentFailures(skipFailures);
   upgradeEntity.setAutoSkipServiceCheckFailures(skipServiceCheckFailures);
   upgradeEntity = s_upgradeDAO.merge(upgradeEntity);
+
 }
 
 return getRequestStatus(null);

http://git-wip-us.apache.org/repos/asf/ambari/blob/60b83584/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 14af03d..8b167ca 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
@@ -478,67 +478,33 @@ public class HostRoleCommandDAO {
 
   /**
* Updates the {@link HostRoleCommandEntity#isFailureAutoSkipped()} flag for
-   * all commands which are not {@link RoleCommand#SERVICE_CHECK}.
+   * all commands for the given request
* 
-   * This will execute a JPQL {@code UPDATE} statement, bypassing the
-   * {@link 

ambari git commit: AMBARI-13603. Alerts: Rename "Ambari Agent Disk Usage" alert (aonishuk)

2015-11-03 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 2ddd0b453 -> 4813cd34c


AMBARI-13603. Alerts: Rename "Ambari Agent Disk Usage" alert (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: 4813cd34cbe117a784ea9fc102e84a63a12e32b1
Parents: 2ddd0b4
Author: Andrew Onishuk 
Authored: Tue Nov 3 16:27:45 2015 +0200
Committer: Andrew Onishuk 
Committed: Tue Nov 3 16:28:28 2015 +0200

--
 ambari-server/docs/api/v1/alerts.md |  4 +-
 .../server/upgrade/UpgradeCatalog213.java   | 28 +++---
 ambari-server/src/main/resources/alerts.json|  6 +--
 .../server/upgrade/UpgradeCatalog213Test.java   | 55 ++--
 .../assets/data/alerts/alertDefinitions.json|  4 +-
 .../app/assets/data/alerts/alert_instances.json |  2 +-
 .../app/assets/data/alerts/alert_summary.json   |  2 +-
 .../test/mappers/alert_instances_mapper_test.js |  2 +-
 8 files changed, 81 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4813cd34/ambari-server/docs/api/v1/alerts.md
--
diff --git a/ambari-server/docs/api/v1/alerts.md 
b/ambari-server/docs/api/v1/alerts.md
index f2c50a8..1ee13c5 100644
--- a/ambari-server/docs/api/v1/alerts.md
+++ b/ambari-server/docs/api/v1/alerts.md
@@ -48,7 +48,7 @@ Current alerts can be exposed on the following resource 
endpoints:
 "host_name" : "",
 "id" : 2,
 "instance" : null,
-"label" : "Ambari Agent Disk Usage",
+"label" : "Host Disk Usage",
 "latest_timestamp" : 1425704842163,
 "maintenance_state" : "OFF",
 "original_timestamp" : 1425600467615,
@@ -188,4 +188,4 @@ History can be exposed on the following resource endpoints:
 
 # All alerting events for HDFS and YARN
 GET 
api/v1/clusters/c1/alert_history?(AlertHistory/service_name.in(HDFS,YARN))
-
\ No newline at end of file
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/4813cd34/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
index 2823a07..8f1a481 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
@@ -628,19 +628,31 @@ public class UpgradeCatalog213 extends 
AbstractUpgradeCatalog {
 
 Map clusterMap = getCheckedClusterMap(clusters);
 for (final Cluster cluster : clusterMap.values()) {
-  final AlertDefinitionEntity alertDefinitionEntity = 
alertDefinitionDAO.findByName(
-  cluster.getClusterId(), "journalnode_process");
+  long clusterID = cluster.getClusterId();
+  final AlertDefinitionEntity journalNodeProcessAlertDefinitionEntity = 
alertDefinitionDAO.findByName(
+  clusterID, "journalnode_process");
+  final AlertDefinitionEntity hostDiskUsageAlertDefinitionEntity = 
alertDefinitionDAO.findByName(
+  clusterID, "ambari_agent_disk_usage");
 
-  if (alertDefinitionEntity != null) {
-String source = alertDefinitionEntity.getSource();
+  if (journalNodeProcessAlertDefinitionEntity != null) {
+String source = journalNodeProcessAlertDefinitionEntity.getSource();
 
-
alertDefinitionEntity.setSource(modifyJournalnodeProcessAlertSource(source));
-alertDefinitionEntity.setSourceType(SourceType.WEB);
-alertDefinitionEntity.setHash(UUID.randomUUID().toString());
+
journalNodeProcessAlertDefinitionEntity.setSource(modifyJournalnodeProcessAlertSource(source));
+journalNodeProcessAlertDefinitionEntity.setSourceType(SourceType.WEB);
+
journalNodeProcessAlertDefinitionEntity.setHash(UUID.randomUUID().toString());
 
-alertDefinitionDAO.merge(alertDefinitionEntity);
+alertDefinitionDAO.merge(journalNodeProcessAlertDefinitionEntity);
 LOG.info("journalnode_process alert definition was updated.");
   }
+
+  if (hostDiskUsageAlertDefinitionEntity != null) {
+hostDiskUsageAlertDefinitionEntity.setDescription("This host-level 
alert is triggered if the amount of disk " +
+"space used goes above specific thresholds. The default threshold 
values are 50% for 

ambari git commit: AMBARI-13682. RU Progress: skipped failure during service check it has a green tick mark (ncole)

2015-11-03 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 c4bc11e0d -> 2ddd0b453


AMBARI-13682. RU Progress: skipped failure during service check it has a green 
tick mark (ncole)


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

Branch: refs/heads/branch-2.1
Commit: 2ddd0b453204ae6438e0472e44b2e70c1f6ceafb
Parents: c4bc11e
Author: Nate Cole 
Authored: Tue Nov 3 08:43:04 2015 -0500
Committer: Nate Cole 
Committed: Tue Nov 3 08:43:04 2015 -0500

--
 .../ambari/server/controller/internal/CalculatedStatus.java  | 1 +
 .../ambari/server/controller/internal/CalculatedStatusTest.java  | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ddd0b45/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
index 55d91c7..f87c32c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
@@ -342,6 +342,7 @@ public class CalculatedStatus {
 counters.get(HostRoleStatus.HOLDING) > 0 ? HostRoleStatus.HOLDING :
 counters.get(HostRoleStatus.HOLDING_FAILED) > 0 ? 
HostRoleStatus.HOLDING_FAILED :
 counters.get(HostRoleStatus.HOLDING_TIMEDOUT) > 0 ? 
HostRoleStatus.HOLDING_TIMEDOUT :
+counters.get(HostRoleStatus.SKIPPED_FAILED) > 0 ? 
HostRoleStatus.SKIPPED_FAILED :
 counters.get(HostRoleStatus.FAILED) > 0 && !skippable ? 
HostRoleStatus.FAILED :
 counters.get(HostRoleStatus.ABORTED) > 0 ? HostRoleStatus.ABORTED:
 counters.get(HostRoleStatus.TIMEDOUT) > 0 && !skippable ? 
HostRoleStatus.TIMEDOUT :

http://git-wip-us.apache.org/repos/asf/ambari/blob/2ddd0b45/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
index f3295ac..4b8587f 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
@@ -498,6 +498,8 @@ public class CalculatedStatusTest {
 assertEquals(80d, calc.getPercent(), 0.1d);
   }
 
+
+
   /**
* Tests that a SKIPPED_FAILED status means the stage has completed.
*
@@ -509,7 +511,7 @@ public class CalculatedStatusTest {
 
 CalculatedStatus status = CalculatedStatus.statusFromTaskEntities(tasks, 
false);
 
-assertEquals(HostRoleStatus.COMPLETED, status.getStatus());
+assertEquals(HostRoleStatus.SKIPPED_FAILED, status.getStatus());
   }
 
   private Collection getTaskEntities(HostRoleStatus... 
statuses) {



ambari git commit: AMBARI-13682. RU Progress: skipped failure during service check it has a green tick mark (ncole)

2015-11-03 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/trunk 60b835847 -> 9ce6311f6


AMBARI-13682. RU Progress: skipped failure during service check it has a green 
tick mark (ncole)


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

Branch: refs/heads/trunk
Commit: 9ce6311f6c644b629e268101b3dd6ea8277c9fb4
Parents: 60b8358
Author: Nate Cole 
Authored: Mon Nov 2 16:17:56 2015 -0500
Committer: Nate Cole 
Committed: Tue Nov 3 08:42:45 2015 -0500

--
 .../ambari/server/controller/internal/CalculatedStatus.java  | 1 +
 .../ambari/server/controller/internal/CalculatedStatusTest.java  | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9ce6311f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
index 55d91c7..f87c32c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
@@ -342,6 +342,7 @@ public class CalculatedStatus {
 counters.get(HostRoleStatus.HOLDING) > 0 ? HostRoleStatus.HOLDING :
 counters.get(HostRoleStatus.HOLDING_FAILED) > 0 ? 
HostRoleStatus.HOLDING_FAILED :
 counters.get(HostRoleStatus.HOLDING_TIMEDOUT) > 0 ? 
HostRoleStatus.HOLDING_TIMEDOUT :
+counters.get(HostRoleStatus.SKIPPED_FAILED) > 0 ? 
HostRoleStatus.SKIPPED_FAILED :
 counters.get(HostRoleStatus.FAILED) > 0 && !skippable ? 
HostRoleStatus.FAILED :
 counters.get(HostRoleStatus.ABORTED) > 0 ? HostRoleStatus.ABORTED:
 counters.get(HostRoleStatus.TIMEDOUT) > 0 && !skippable ? 
HostRoleStatus.TIMEDOUT :

http://git-wip-us.apache.org/repos/asf/ambari/blob/9ce6311f/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
index f3295ac..4b8587f 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
@@ -498,6 +498,8 @@ public class CalculatedStatusTest {
 assertEquals(80d, calc.getPercent(), 0.1d);
   }
 
+
+
   /**
* Tests that a SKIPPED_FAILED status means the stage has completed.
*
@@ -509,7 +511,7 @@ public class CalculatedStatusTest {
 
 CalculatedStatus status = CalculatedStatus.statusFromTaskEntities(tasks, 
false);
 
-assertEquals(HostRoleStatus.COMPLETED, status.getStatus());
+assertEquals(HostRoleStatus.SKIPPED_FAILED, status.getStatus());
   }
 
   private Collection getTaskEntities(HostRoleStatus... 
statuses) {



ambari git commit: AMBARI-13603. Alerts: Rename "Ambari Agent Disk Usage" alert (aonishuk)

2015-11-03 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 9ce6311f6 -> f24058f79


AMBARI-13603. Alerts: Rename "Ambari Agent Disk Usage" alert (aonishuk)


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

Branch: refs/heads/trunk
Commit: f24058f79e9b12e8c80aa4c03f6b82b0123ce7c3
Parents: 9ce6311
Author: Andrew Onishuk 
Authored: Tue Nov 3 16:29:16 2015 +0200
Committer: Andrew Onishuk 
Committed: Tue Nov 3 16:29:16 2015 +0200

--
 ambari-server/docs/api/v1/alerts.md |  4 +-
 .../server/upgrade/UpgradeCatalog213.java   | 34 ++---
 ambari-server/src/main/resources/alerts.json|  6 +-
 .../server/upgrade/UpgradeCatalog213Test.java   | 76 
 .../assets/data/alerts/alertDefinitions.json|  4 +-
 .../app/assets/data/alerts/alert_instances.json |  2 +-
 .../app/assets/data/alerts/alert_summary.json   |  2 +-
 .../test/mappers/alert_instances_mapper_test.js |  2 +-
 8 files changed, 95 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f24058f7/ambari-server/docs/api/v1/alerts.md
--
diff --git a/ambari-server/docs/api/v1/alerts.md 
b/ambari-server/docs/api/v1/alerts.md
index f2c50a8..1ee13c5 100644
--- a/ambari-server/docs/api/v1/alerts.md
+++ b/ambari-server/docs/api/v1/alerts.md
@@ -48,7 +48,7 @@ Current alerts can be exposed on the following resource 
endpoints:
 "host_name" : "",
 "id" : 2,
 "instance" : null,
-"label" : "Ambari Agent Disk Usage",
+"label" : "Host Disk Usage",
 "latest_timestamp" : 1425704842163,
 "maintenance_state" : "OFF",
 "original_timestamp" : 1425600467615,
@@ -188,4 +188,4 @@ History can be exposed on the following resource endpoints:
 
 # All alerting events for HDFS and YARN
 GET 
api/v1/clusters/c1/alert_history?(AlertHistory/service_name.in(HDFS,YARN))
-
\ No newline at end of file
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f24058f7/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
index 34072dc..895d24b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
@@ -202,9 +202,9 @@ public class UpgradeCatalog213 extends 
AbstractUpgradeCatalog {
 
   private void executeBlueprintDDLUpdates() throws AmbariException, 
SQLException {
 dbAccessor.addColumn(BLUEPRINT_TABLE, new 
DBAccessor.DBColumnInfo(SECURITY_TYPE_COLUMN,
-  String.class, 32, "NONE", false));
+String.class, 32, "NONE", false));
 dbAccessor.addColumn(BLUEPRINT_TABLE, new 
DBAccessor.DBColumnInfo(SECURITY_DESCRIPTOR_REF_COLUMN,
-  String.class, null, null, true));
+String.class, null, null, true));
   }
 
 /**
@@ -628,19 +628,33 @@ public class UpgradeCatalog213 extends 
AbstractUpgradeCatalog {
 
 Map clusterMap = getCheckedClusterMap(clusters);
 for (final Cluster cluster : clusterMap.values()) {
-  final AlertDefinitionEntity alertDefinitionEntity = 
alertDefinitionDAO.findByName(
-cluster.getClusterId(), "journalnode_process");
+  long clusterID = cluster.getClusterId();
 
-  if (alertDefinitionEntity != null) {
-String source = alertDefinitionEntity.getSource();
+  final AlertDefinitionEntity journalNodeProcessAlertDefinitionEntity = 
alertDefinitionDAO.findByName(
+  clusterID, "journalnode_process");
+  final AlertDefinitionEntity hostDiskUsageAlertDefinitionEntity = 
alertDefinitionDAO.findByName(
+  clusterID, "ambari_agent_disk_usage");
 
-
alertDefinitionEntity.setSource(modifyJournalnodeProcessAlertSource(source));
-alertDefinitionEntity.setSourceType(SourceType.WEB);
-alertDefinitionEntity.setHash(UUID.randomUUID().toString());
+  if (journalNodeProcessAlertDefinitionEntity != null) {
+String source = journalNodeProcessAlertDefinitionEntity.getSource();
 
-alertDefinitionDAO.merge(alertDefinitionEntity);
+
journalNodeProcessAlertDefinitionEntity.setSource(modifyJournalnodeProcessAlertSource(source));
+

ambari git commit: AMBARI-13676. Unit tests are consistently failing on builds.apache.org (aonishuk)

2015-11-03 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 16fccc48a -> e596d775a


AMBARI-13676. Unit tests are consistently failing on builds.apache.org 
(aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: e596d775a6076920a866b20c2c693428256d0ee6
Parents: 16fccc4
Author: Andrew Onishuk 
Authored: Tue Nov 3 12:15:49 2015 +0200
Committer: Andrew Onishuk 
Committed: Tue Nov 3 12:15:49 2015 +0200

--
 .../metrics/timeline/TestClusterSuite.java | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e596d775/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
index 8405b49..640604d 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
@@ -18,13 +18,11 @@
 package 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline;
 
 
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
 import static org.junit.runners.Suite.SuiteClasses;
 
-@Ignore
 @RunWith(Suite.class)
 @SuiteClasses({ITMetricAggregator.class, ITClusterAggregator.class, 
ITPhoenixHBaseAccessor.class})
 public class TestClusterSuite {



ambari git commit: AMBARI-13676. Unit tests are consistently failing on builds.apache.org (aonishuk)

2015-11-03 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk a2062703c -> dc0ac133d


AMBARI-13676. Unit tests are consistently failing on builds.apache.org 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: dc0ac133dedef8a59550cb060e6afe9a225542ec
Parents: a206270
Author: Andrew Onishuk 
Authored: Tue Nov 3 12:14:37 2015 +0200
Committer: Andrew Onishuk 
Committed: Tue Nov 3 12:15:02 2015 +0200

--
 .../metrics/timeline/TestClusterSuite.java | 2 --
 1 file changed, 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/dc0ac133/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
index 8405b49..640604d 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/TestClusterSuite.java
@@ -18,13 +18,11 @@
 package 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline;
 
 
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
 
 import static org.junit.runners.Suite.SuiteClasses;
 
-@Ignore
 @RunWith(Suite.class)
 @SuiteClasses({ITMetricAggregator.class, ITClusterAggregator.class, 
ITPhoenixHBaseAccessor.class})
 public class TestClusterSuite {