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

2016-12-01 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/trunk 615438b27 -> d24beb17e


AMBARI-19051. Stage is sometimes marked as failed on command reschedule. 
(mpapirkovskyy)


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

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

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


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

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

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

2016-12-01 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 033989e7f -> 83adcf667


AMBARI-19051. Stage is sometimes marked as failed on command reschedule. 
(mpapirkovskyy)


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

Branch: refs/heads/branch-2.5
Commit: 83adcf66763cc4b398388723689ea164527bafba
Parents: 033989e
Author: Myroslav Papirkovskyi 
Authored: Thu Dec 1 18:48:25 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Fri Dec 2 09:49:23 2016 +0200

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


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

http://git-wip-us.apache.org/repos/asf/ambari/blob/83adcf66/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 7d04d42..d5dde8b 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
@@ -27,6 +27,7 @@ import os, errno, time, pprint, tempfile, threading
 import sys
 from threading import Thread
 import copy
+import signal
 
 from mock.mock import patch, MagicMock, call
 from ambari_agent.CustomServiceOrchestrator import CustomServiceOrchestrator
@@ -703,6 +704,53 @@ class TestActionQueue(TestCase):
 report = actionQueue.result()
 self.assertEqual(len(report['reports']), 0)
 
+  def test_cancel_with_reschedule_command(self):
+config = AmbariConfig()
+tempdir = tempfile.gettempdir()
+config.set('agent', 'prefix', tempdir)
+config.set('agent', 'cache_dir', "/var/lib/ambari-agent/cache")
+config.set('agent', 'tolerate_download_failures', "true")
+dummy_controller = MagicMock()
+actionQueue = ActionQueue(config, dummy_controller)
+unfreeze_flag = threading.Event()
+python_execution_result_dict = {
+  'stdout': 'out',
+  'stderr': 'stderr',
+  'structuredOut' : '',
+  'status' : '',
+  'exitcode' : 

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

2016-12-01 Thread smnaha
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 788b46698 -> 033989e7f


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


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

Branch: refs/heads/branch-2.5
Commit: 033989e7fd5a28a431eb9bdf64bd68d732e5ee69
Parents: 788b466
Author: Nahappan Somasundaram 
Authored: Tue Nov 29 13:36:16 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Thu Dec 1 15:47:54 2016 -0800

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


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

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

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

2016-12-01 Thread smnaha
Repository: ambari
Updated Branches:
  refs/heads/trunk 7577ebb26 -> 615438b27


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


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

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

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


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

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

ambari git commit: AMBARI-19056. Add two new options from Ambari to LlapServiceDriver. (1). --skiphadoopversion (2). --skiphbasecp.

2016-12-01 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-18901 333c70150 -> 1b90011eb


AMBARI-19056. Add two new options from Ambari to LlapServiceDriver. (1). 
--skiphadoopversion (2). --skiphbasecp.


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 1b90011ebfc13f14db236e11cd9532b63bd03404
Parents: 333c701
Author: Swapan Shridhar 
Authored: Thu Dec 1 13:04:35 2016 -0800
Committer: Swapan Shridhar 
Committed: Thu Dec 1 13:04:41 2016 -0800

--
 .../HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1b90011e/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
index 2c5ebeb..055c690 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
@@ -291,7 +291,7 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
" --slider-am-container-mb {params.slider_am_container_mb} 
--size {params.llap_daemon_container_size}m"
" --cache {params.hive_llap_io_mem_size}m --xmx 
{params.llap_heap_size}m --loglevel {params.llap_log_level}"
" --slider-placement {slider_placement} --output 
{LLAP_PACKAGE_CREATION_PATH}/{unique_name}"
-   " {params.llap_extra_slider_opts} --output 
{LLAP_PACKAGE_CREATION_PATH}/{unique_name}")
+   " {params.llap_extra_slider_opts} --skiphadoopversion 
--skiphbasecp --output {LLAP_PACKAGE_CREATION_PATH}/{unique_name}")
   if params.security_enabled:
 llap_keytab_splits = params.hive_llap_keytab_file.split("/")
 Logger.debug("llap_keytab_splits : {0}".format(llap_keytab_splits))



ambari git commit: AMBARI-19054 : Grafana failed to start at deployment (avijayan)

2016-12-01 Thread avijayan
Repository: ambari
Updated Branches:
  refs/heads/trunk 406b245ef -> 7577ebb26


AMBARI-19054 : Grafana failed to start at deployment (avijayan)


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

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

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


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



ambari git commit: AMBARI-19054 : Grafana failed to start at deployment (avijayan)

2016-12-01 Thread avijayan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 6e893251f -> 788b46698


AMBARI-19054 : Grafana failed to start at deployment (avijayan)


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

Branch: refs/heads/branch-2.5
Commit: 788b46698d20dc0942abd52d48c132d3f29e74b0
Parents: 6e89325
Author: Aravindan Vijayan 
Authored: Thu Dec 1 13:26:35 2016 -0800
Committer: Aravindan Vijayan 
Committed: Thu Dec 1 13:26:35 2016 -0800

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


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



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

2016-12-01 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 63c0f2e58 -> 406b245ef


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


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

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

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


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


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

2016-12-01 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 9976fb741 -> ab3d72914


AMBARI-19052. Re-arrange "Role Based Access Control" info table (akovalenko)


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

Branch: refs/heads/branch-2.5
Commit: ab3d72914254b9ee13708cb8a5987d0a2c4459a9
Parents: 9976fb7
Author: Aleksandr Kovalenko 
Authored: Thu Dec 1 19:22:02 2016 +0200
Committer: Aleksandr Kovalenko 
Committed: Thu Dec 1 20:25:26 2016 +0200

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


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

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

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

2016-12-01 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 63938e09c -> 63c0f2e58


AMBARI-19052. Re-arrange "Role Based Access Control" info table (akovalenko)


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

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

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


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

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

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

2016-12-01 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d6877d721 -> 9976fb741


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


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

Branch: refs/heads/branch-2.5
Commit: 9976fb741273cbeb05b4d4d81f0d1120870ed6dd
Parents: d6877d7
Author: Alejandro Fernandez 
Authored: Thu Dec 1 09:57:06 2016 -0800
Committer: Alejandro Fernandez 
Committed: Thu Dec 1 09:57:06 2016 -0800

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


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

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

2016-12-01 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk 88e0c29e0 -> 63938e09c


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


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

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

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


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

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

2016-12-01 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 00c832c47 -> d6877d721


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


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

Branch: refs/heads/branch-2.5
Commit: d6877d721b83220f4b43736d9a80e2f3be67ff7f
Parents: 00c832c
Author: Alejandro Fernandez 
Authored: Thu Dec 1 09:46:53 2016 -0800
Committer: Alejandro Fernandez 
Committed: Thu Dec 1 09:46:53 2016 -0800

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


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

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

2016-12-01 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk 6100be638 -> 88e0c29e0


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


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

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

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


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

[02/32] ambari git commit: AMBARI-18792. Update some configuration properties for hive interactive for the HDP 2.6 stack (Siddharth Seth via smohanty)

2016-12-01 Thread jonathanhurley
AMBARI-18792. Update some configuration properties for hive interactive for the 
HDP 2.6 stack (Siddharth Seth via smohanty)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: ca7e071f044d70186c7bf9d18bf24c29f3767730
Parents: 2cc4c9e
Author: Sumit Mohanty 
Authored: Tue Nov 29 11:39:53 2016 -0800
Committer: Sumit Mohanty 
Committed: Tue Nov 29 15:28:46 2016 -0800

--
 .../server/upgrade/UpgradeCatalog250.java   | 52 +
 .../configuration/hive-interactive-site.xml | 58 +++
 .../HIVE/configuration/tez-interactive-site.xml | 78 
 3 files changed, 188 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ca7e071f/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index e81568c..3b2cdd3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -23,6 +23,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.CommandExecutionType;
@@ -134,6 +135,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 addNewConfigurationsFromXml();
 updateAMSConfigs();
 updateKafkaConfigs();
+updateHiveLlapConfigs();
   }
 
   protected void updateHostVersionTable() throws SQLException {
@@ -151,6 +153,56 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 dbAccessor.addUniqueConstraint(GROUPS_TABLE, "UNQ_groups_0", "group_name", 
"group_type");
   }
 
+  protected void updateHiveLlapConfigs() throws AmbariException {
+AmbariManagementController ambariManagementController = 
injector.getInstance(AmbariManagementController.class);
+Clusters clusters = ambariManagementController.getClusters();
+
+if (clusters != null) {
+  Map clusterMap = clusters.getClusters();
+
+  if (clusterMap != null && !clusterMap.isEmpty()) {
+for (final Cluster cluster : clusterMap.values()) {
+  Set installedServices = cluster.getServices().keySet();
+
+  if (installedServices.contains("HIVE")) {
+Config hiveSite = 
cluster.getDesiredConfigByType("hive-interactive-site");
+if (hiveSite != null) {
+  Map hiveSiteProperties = 
hiveSite.getProperties();
+  String schedulerDelay = 
hiveSiteProperties.get("hive.llap.task.scheduler.locality.delay");
+  if (schedulerDelay != null) {
+// Property exists. Change to new default if set to -1.
+if (schedulerDelay.length() != 0) {
+  try {
+int schedulerDelayInt = Integer.parseInt(schedulerDelay);
+if (schedulerDelayInt == -1) {
+  // Old default. Set to new default.
+  updateConfigurationProperties("hive-interactive-site", 
Collections
+
.singletonMap("hive.llap.task.scheduler.locality.delay", "8000"), true,
+false);
+}
+  } catch (NumberFormatException e) {
+// Invalid existing value. Set to new default.
+updateConfigurationProperties("hive-interactive-site", 
Collections
+  
.singletonMap("hive.llap.task.scheduler.locality.delay", "8000"), true,
+  false);
+  }
+}
+  }
+  updateConfigurationProperties("hive-interactive-site",
+
Collections.singletonMap("hive.mapjoin.hybridgrace.hashtable", "true"), true,
+false);
+  updateConfigurationProperties("tez-interactive-site",
+
Collections.singletonMap("tez.session.am.dag.submit.timeout.secs", "1209600"), 
true,
+false);
+  // 

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

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


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

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

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


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

[19/32] ambari git commit: AMBARI-19040. Fix NPE in UpgradeCatalog250Test.testExecuteDMLUpdates (rlevas)

2016-12-01 Thread jonathanhurley
AMBARI-19040. Fix NPE in UpgradeCatalog250Test.testExecuteDMLUpdates (rlevas)


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

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

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


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



[09/32] ambari git commit: AMBARI-18949 Extend current quick link JSON with properties

2016-12-01 Thread jonathanhurley
AMBARI-18949 Extend current quick link JSON with properties

Change-Id: I209e594e74964b2bab71a454c2b77f785bb02a82


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

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

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


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

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

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

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


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

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

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


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

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

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

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

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


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

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

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


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

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



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

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


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

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

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


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

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

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

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


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

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

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


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

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



[03/32] ambari git commit: AMBARI-19022: Ambari-server: Remove credential store from KNOX stack definition since it does not support credential store

2016-12-01 Thread jonathanhurley
AMBARI-19022: Ambari-server: Remove credential store from KNOX stack definition 
since it does not support credential store


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 1fb8d0799eb9117868eb2a5df2312569fd07ed43
Parents: ca7e071
Author: Nahappan Somasundaram 
Authored: Tue Nov 29 14:44:39 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Tue Nov 29 16:26:13 2016 -0800

--
 .../src/main/resources/stacks/HDP/2.5/services/KNOX/metainfo.xml | 4 
 1 file changed, 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1fb8d079/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/metainfo.xml
index 01af67c..8f303a5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/metainfo.xml
@@ -21,10 +21,6 @@
 
   KNOX
   0.9.0.2.5
-  
-true
-false
-  
 
   
 



[23/32] ambari git commit: AMBARI-19034 Upgrade History Displays Wrong Upgrade Type (atkach)

2016-12-01 Thread jonathanhurley
AMBARI-19034 Upgrade History Displays Wrong Upgrade Type (atkach)


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

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

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


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

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

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

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

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

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

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


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

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

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


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

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

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

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

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

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


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

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

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


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

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

[22/32] ambari git commit: AMBARI-19045 Remove unnecessary Log Feeder Date Mapper tests

2016-12-01 Thread jonathanhurley
AMBARI-19045 Remove unnecessary Log Feeder Date Mapper tests

Change-Id: Ia8d613c0c53bff04c5ccee0579a337b8cbb3a00a


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

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

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


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

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

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


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

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

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


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



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

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


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 087de8b789d157aa8f4fd12963b0262ea6c40461
Parents: 276d124 6100be6
Author: Jonathan Hurley 
Authored: Thu Dec 1 10:57:35 2016 -0500
Committer: Jonathan Hurley 
Committed: Thu Dec 1 10:57:35 2016 -0500

--
 .../src/main/python/ambari_agent/ActionQueue.py |   10 +-
 .../ambari_agent/CustomServiceOrchestrator.py   |4 +-
 .../simulate_perf_cluster_alert_behaviour.py|  108 ++
 .../libraries/script/script.py  |   15 +-
 .../ambari/logfeeder/mapper/MapperDateTest.java |   56 -
 .../ambari/logsearch/dao/SolrCollectionDao.java |   64 +-
 ambari-server/conf/unix/ambari.properties   |4 +-
 ambari-server/conf/windows/ambari.properties|2 +
 ambari-server/docs/configuration/index.md   |   33 +-
 .../ambari/server/agent/HeartBeatHandler.java   |2 +-
 .../ambari/server/agent/HeartbeatProcessor.java |2 +-
 .../server/checks/ServicePresenceCheck.java |   55 +-
 .../server/configuration/Configuration.java |   53 +
 .../security/AbstractSecurityHeaderFilter.java  |   14 +
 .../AmbariServerSecurityHeaderFilter.java   |1 +
 .../AmbariViewsSecurityHeaderFilter.java|1 +
 .../kerberos/MITKerberosOperationHandler.java   |   22 +-
 .../ambari/server/state/quicklinks/Link.java|   21 +
 .../services/RetryUpgradeActionService.java |2 +-
 .../server/upgrade/UpgradeCatalog250.java   |   52 +
 .../ambari/server/utils/ShellCommandUtil.java   |   11 +-
 ambari-server/src/main/python/ambari-server.py  |   12 +-
 .../main/python/ambari_server/serverUtils.py|   11 +
 .../src/main/python/ambari_server/utils.py  |   60 +-
 .../src/main/python/ambari_server_main.py   |   70 +-
 .../package/scripts/metadata_server.py  |   18 +
 .../RANGER/0.4.0/package/scripts/params.py  |   14 +
 .../0.4.0/package/scripts/setup_ranger_xml.py   |   21 +
 .../common-services/RANGER/0.6.0/metainfo.xml   |2 +
 .../custom_actions/scripts/install_packages.py  |2 +-
 .../src/main/resources/scripts/stack_advisor.py |   11 +-
 .../HDP/2.0.6/configuration/cluster-env.xml |   10 +
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |   47 +-
 .../stacks/HDP/2.1/services/stack_advisor.py|   20 +-
 .../stacks/HDP/2.2/services/stack_advisor.py|7 +
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml |5 +-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml |5 +-
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml |5 +-
 .../stacks/HDP/2.3/upgrades/upgrade-2.6.xml |5 +-
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml |5 +-
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml |5 +-
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml |5 +-
 .../stacks/HDP/2.4/upgrades/upgrade-2.6.xml |5 +-
 .../stacks/HDP/2.5/services/KNOX/metainfo.xml   |4 -
 .../stacks/HDP/2.5/services/OOZIE/metainfo.xml  |4 +
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml  |   12 +
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml |4 +
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml |3 +
 .../configuration/hive-interactive-site.xml |   58 +
 .../HIVE/configuration/tez-interactive-site.xml |   78 +
 .../stacks/PERF/1.0/services/HAPPY/alerts.json  |   20 +
 .../HAPPY/configuration/happy-alert-config.xml  |   75 +
 .../stacks/PERF/1.0/services/HAPPY/metainfo.xml |5 +
 .../HAPPY/package/alerts/alert_happy_process.py |   59 +
 .../stacks/PERF/1.0/services/HBASE/alerts.json  |  110 +-
 .../HBASE/configuration/hbase-alert-config.xml  |   75 +
 .../stacks/PERF/1.0/services/HBASE/metainfo.xml |1 +
 .../package/alerts/hbase_master_process.py  |   59 +
 .../alerts/hbase_regionserver_process.py|   59 +
 .../stacks/PERF/1.0/services/HDFS/alerts.json   | 1728 +-
 .../HDFS/configuration/hdfs-alert-config.xml|   75 +
 .../stacks/PERF/1.0/services/HDFS/metainfo.xml  |1 +
 .../package/alerts/alert_checkpoint_time.py |   38 +-
 .../alerts/alert_datanode_unmounted_data_dir.py |   47 +-
 .../package/alerts/alert_ha_namenode_health.py  |   75 -
 .../package/alerts/alert_metrics_deviation.py   |   85 -
 .../package/alerts/alert_nfs_gateway_process.py |   59 +
 .../package/alerts/alert_snamenode_process.py   |   59 +
 .../package/alerts/alert_upgrade_finalized.py   |   49 +-
 .../stacks/PERF/1.0/services/SLEEPY/alerts.json |   20 +
 .../configuration/sleepy-alert-config.xml   |   75 +
 .../PERF/1.0/services/SLEEPY/metainfo.xml   |5 +
 .../package/alerts/alert_sleepy_process.py  |   59 +
 

[04/32] ambari git commit: AMBARI-18997 ambari-server.pid might not be created on slow hardware (dsen)

2016-12-01 Thread jonathanhurley
AMBARI-18997 ambari-server.pid might not be created on slow hardware (dsen)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: d8ba7f1bad5f9bb96256a5ca64c0568d74b874f8
Parents: 1fb8d07
Author: Dmytro Sen 
Authored: Wed Nov 30 13:50:37 2016 +0200
Committer: Dmytro Sen 
Committed: Wed Nov 30 13:50:37 2016 +0200

--
 .../src/main/python/ambari_server/utils.py  | 60 -
 .../src/main/python/ambari_server_main.py   | 70 ++--
 .../src/test/python/TestAmbariServer.py |  6 +-
 ambari-server/src/test/python/TestUtils.py  | 37 +--
 4 files changed, 66 insertions(+), 107 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d8ba7f1b/ambari-server/src/main/python/ambari_server/utils.py
--
diff --git a/ambari-server/src/main/python/ambari_server/utils.py 
b/ambari-server/src/main/python/ambari_server/utils.py
index 5188a48..26e59ae 100644
--- a/ambari-server/src/main/python/ambari_server/utils.py
+++ b/ambari-server/src/main/python/ambari_server/utils.py
@@ -119,19 +119,19 @@ def save_pid(pid, pidfile):
   pass
 
 
-def save_main_pid_ex(pids, pidfile, exclude_list=[], kill_exclude_list=False, 
skip_daemonize=False):
+def save_main_pid_ex(pids, pidfile, exclude_list=[], skip_daemonize=False):
   """
 Save pid which is not included to exclude_list to pidfile.
-If kill_exclude_list is set to true,  all processes in that
-list would be killed. It's might be useful to daemonize child process
 
 exclude_list contains list of full executable paths which should be 
excluded
   """
+  pid_saved = False
   try:
 pfile = open(pidfile, "w")
 for item in pids:
   if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
 pfile.write("%s\n" % item["pid"])
+pid_saved = True
 logger.info("Ambari server started with PID " + str(item["pid"]))
   if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not 
skip_daemonize:
 try:
@@ -147,67 +147,33 @@ def save_main_pid_ex(pids, pidfile, exclude_list=[], 
kill_exclude_list=False, sk
 except Exception as e:
   logger.error("Failed to close PID file " + pidfile + " due to " + str(e))
   pass
+  return pid_saved
 
-
-def wait_for_pid(pids, server_init_timeout, occupy_port_timeout, 
init_web_ui_timeout,
- server_out_file, db_check_log, properties):
+def get_live_pids_count(pids):
   """
-Check pid for existence during timeout
+Check pids for existence
   """
-  from ambari_server.serverConfiguration import get_ambari_server_ui_port
-  ambari_server_ui_port = int(get_ambari_server_ui_port(properties))
-  server_ui_port_occupied = False
-  tstart = time.time()
-  pid_live = 0
-  while int(time.time()-tstart) <= occupy_port_timeout and len(pids) > 0:
-sys.stdout.write('.')
-sys.stdout.flush()
-pid_live = 0
-for item in pids:
-  if pid_exists(item["pid"]):
-pid_live += 1
-time.sleep(1)
+  return len([pid for pid in pids if pid_exists(pid)])
+
+def wait_for_ui_start(ambari_server_ui_port, timeout=1):
 
+  tstart = time.time()
+  while int(time.time()-tstart) <= timeout:
 try:
   sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   sock.settimeout(1)
   sock.connect(('localhost', ambari_server_ui_port))
   print "\nServer started listening on " + str(ambari_server_ui_port)
-  server_ui_port_occupied = True
-  break
+  return True
 except Exception as e:
   #print str(e)
   pass
 
-  if 'Database consistency check: failed' in open(server_out_file).read():
-print "\nDB configs consistency check failed. Run \"ambari-server start 
--skip-database-check\" to skip. " \
-  "If you use this \"--skip-database-check\" option, do not make any 
changes to your cluster topology " \
-  "or perform a cluster upgrade until you correct the database 
consistency issues. See " + \
-  db_check_log + "for more details on the consistency issues."
-  elif 'Database consistency check: warning' in open(server_out_file).read():
-print "\nDB configs consistency check found warnings. See " + db_check_log 
+ " for more details."
-  else:
-print "\nDB configs consistency check: no errors and warnings were found."
-
-
-  if not server_ui_port_occupied:
-raise FatalException(1, "Server not yet listening on http port " + 
str(ambari_server_ui_port) +
-" after " + str(occupy_port_timeout + 

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

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

This reverts commit 3a14b4afc9572b9aeb0310cdc0cd80700f27ee8d.


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

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

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


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



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

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


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

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

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


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

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

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


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

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

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
new file mode 100644
index 000..736e5e3
--- /dev/null
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
@@ -0,0 +1,108 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+__all__ = ["simulate_perf_cluster_alert_behaviour"]
+
+import logging
+import random
+import time
+
+from datetime import datetime
+from resource_management.core.exceptions import Fail
+
+RESULT_CODE_OK = 'OK'
+RESULT_CODE_CRITICAL = 'CRITICAL'
+RESULT_CODE_UNKNOWN = 'UNKNOWN'
+
+OK_MESSAGE 

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

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


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

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

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


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

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

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

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

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


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

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

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


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

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



[01/32] ambari git commit: AMBARI-18871 HTTP responses needs to have the character encoding specified in the content type header (Anita Jebaraj via sangeetar)

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


AMBARI-18871 HTTP responses needs to have the character encoding specified in 
the content type header (Anita Jebaraj via sangeetar)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: 2cc4c9ed7009be2e894fec7d24c3cb4f0dd9f24c
Parents: 85c9104
Author: Sangeeta Ravindran 
Authored: Tue Nov 29 13:57:50 2016 -0800
Committer: Sangeeta Ravindran 
Committed: Tue Nov 29 13:57:50 2016 -0800

--
 ambari-server/conf/unix/ambari.properties   |  4 +-
 ambari-server/conf/windows/ambari.properties|  2 +
 .../server/configuration/Configuration.java | 46 
 .../security/AbstractSecurityHeaderFilter.java  | 14 ++
 .../AmbariServerSecurityHeaderFilter.java   |  1 +
 .../AmbariViewsSecurityHeaderFilter.java|  1 +
 .../AbstractSecurityHeaderFilterTest.java   | 29 
 7 files changed, 87 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2cc4c9ed/ambari-server/conf/unix/ambari.properties
--
diff --git a/ambari-server/conf/unix/ambari.properties 
b/ambari-server/conf/unix/ambari.properties
index 371653f..30a22d1 100644
--- a/ambari-server/conf/unix/ambari.properties
+++ b/ambari-server/conf/unix/ambari.properties
@@ -116,6 +116,7 @@ http.x-frame-options=DENY
 http.x-content-type-options=nosniff
 http.cache-control=no-store
 http.pragma=no-cache
+http.charset=utf-8
 
 # HTTP Header settings for Ambari Views
 views.http.strict-transport-security=max-age=31536000
@@ -124,6 +125,7 @@ views.http.x-frame-options=SAMEORIGIN
 views.http.x-content-type-options=nosniff
 views.http.cache-control=no-store
 views.http.pragma=no-cache
+views.http.charset=utf-8
 
 mpacks.staging.path=$ROOT/var/lib/ambari-server/resources/mpacks
 
@@ -132,4 +134,4 @@ 
security.server.disabled.ciphers=TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384|TLS_ECD
 
 server.python.log.name=ambari-server-command.log
 # server.pyton.log.level=(INFO/DEBUG)
-server.python.log.level=INFO
\ No newline at end of file
+server.python.log.level=INFO

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cc4c9ed/ambari-server/conf/windows/ambari.properties
--
diff --git a/ambari-server/conf/windows/ambari.properties 
b/ambari-server/conf/windows/ambari.properties
index e47319e..d84cf4b 100644
--- a/ambari-server/conf/windows/ambari.properties
+++ b/ambari-server/conf/windows/ambari.properties
@@ -97,6 +97,7 @@ http.x-frame-options=DENY
 http.x-content-type-options=nosniff
 http.cache-control=no-store
 http.pragma=no-cache
+http.charset=utf-8
 
 # HTTP Header settings for Ambari Views
 views.http.strict-transport-security=max-age=31536000
@@ -105,5 +106,6 @@ views.http.x-frame-options=SAMEORIGIN
 views.http.x-content-type-options=nosniff
 views.http.cache-control=no-store
 views.http.pragma=no-cache
+views.http.charset=utf-8
 
 mpacks.staging.path=resources\\mpacks

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cc4c9ed/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 5676091..9be8751 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
@@ -2290,6 +2290,14 @@ public class Configuration {
   public static final ConfigurationProperty HTTP_PRAGMA_HEADER_VALUE = 
new ConfigurationProperty<>(
   "http.pragma", "no-cache");
 
+   /**
+   * The value that will be used to set the {@code Charset} HTTP response 
header.
+   */
+  @Markdown(description = "The value that will be used to set the Character 
encoding to HTTP response header.")
+  public static final ConfigurationProperty HTTP_CHARSET = new 
ConfigurationProperty<>(
+  "http.charset", "utf-8");
+
+
   /**
* The value that will be used to set the {@code Strict-Transport-Security}
* HTTP response header for Ambari View requests.
@@ -2339,6 +2347,14 @@ public class Configuration {
   public static final ConfigurationProperty 
VIEWS_HTTP_PRAGMA_HEADER_VALUE = new ConfigurationProperty<>(
   "views.http.pragma", 

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

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


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

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

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


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



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

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


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

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

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


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

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



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

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

Change-Id: I44fa2c96befa2eff3d6f2acfb608eff8ed45f021


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

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

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


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

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

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

[05/32] ambari git commit: AMBARI-19027. Manage JournalNode tweaks (onechiporenko)

2016-12-01 Thread jonathanhurley
AMBARI-19027. Manage JournalNode tweaks (onechiporenko)


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

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

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


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

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



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

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


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

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

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


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

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



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

2016-12-01 Thread jonathanhurley
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
deleted file mode 100644
index 0946c85..000
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-"""
-
-import logging
-
-RESULT_STATE_OK = 'OK'
-RESULT_STATE_CRITICAL = 'CRITICAL'
-RESULT_STATE_WARNING = 'WARNING'
-RESULT_STATE_UNKNOWN = 'UNKNOWN'
-RESULT_STATE_SKIPPED = 'SKIPPED'
-
-OK_MESSAGE = 'Ok'
-
-HDFS_SITE_KEY = '{{hdfs-site}}'
-NAMESERVICE_KEY = '{{hdfs-site/dfs.internal.nameservices}}'
-NN_HTTP_ADDRESS_KEY = '{{hdfs-site/dfs.namenode.http-address}}'
-NN_HTTPS_ADDRESS_KEY = '{{hdfs-site/dfs.namenode.https-address}}'
-DFS_POLICY_KEY = '{{hdfs-site/dfs.http.policy}}'
-
-KERBEROS_KEYTAB = '{{hdfs-site/dfs.web.authentication.kerberos.keytab}}'
-KERBEROS_PRINCIPAL = '{{hdfs-site/dfs.web.authentication.kerberos.principal}}'
-SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}'
-SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
-EXECUTABLE_SEARCH_PATHS = '{{kerberos-env/executable_search_paths}}'
-
-METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY = 
'{{ams-site/timeline.metrics.service.webapp.address}}'
-METRICS_COLLECTOR_VIP_HOST_KEY = '{{cluster-env/metrics_collector_vip_host}}'
-METRICS_COLLECTOR_VIP_PORT_KEY = '{{cluster-env/metrics_collector_vip_port}}'
-
-logger = logging.getLogger()
-
-
-def get_tokens():
-  """
-  Returns a tuple of tokens in the format {{site/property}} that will be used
-  to build the dictionary passed into execute
-  """
-  return (HDFS_SITE_KEY, NAMESERVICE_KEY, NN_HTTP_ADDRESS_KEY, DFS_POLICY_KEY,
-  EXECUTABLE_SEARCH_PATHS, NN_HTTPS_ADDRESS_KEY, SMOKEUSER_KEY,
-  KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, SECURITY_ENABLED_KEY,
-  METRICS_COLLECTOR_VIP_HOST_KEY, METRICS_COLLECTOR_VIP_PORT_KEY,
-  METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY)
-
-def execute(configurations={}, parameters={}, host_name=None):
-  """
-  Returns a tuple containing the result code and a pre-formatted result label
-
-  Keyword arguments:
-  configurations : a mapping of configuration key to value
-  parameters : a mapping of script parameter key to value
-  host_name : the name of this host where the alert is running
-
-  :type configurations dict
-  :type parameters dict
-  :type host_name str
-  """
-
-  #parse configuration
-  if configurations is None:
-return (RESULT_STATE_UNKNOWN, ['There were no configurations supplied to 
the script.'])
-
-  # hdfs-site is required
-  if not HDFS_SITE_KEY in configurations:
-return (RESULT_STATE_UNKNOWN, ['{0} is a required parameter for the 
script'.format(HDFS_SITE_KEY)])
-
-  result_code = RESULT_STATE_OK
-  label = OK_MESSAGE
-  return (result_code, [label])
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
new file mode 100644
index 000..73bc168
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance

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

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


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

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

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


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

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

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



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

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


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

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

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


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



ambari git commit: AMBARI-18780. Fix livy configuration upgrade from HDP 2.5 to HDP 2.6 (Jeff Zhang via smohanty)

2016-12-01 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 ab6d55234 -> 00c832c47


AMBARI-18780. Fix livy configuration upgrade from HDP 2.5 to HDP 2.6 (Jeff 
Zhang via smohanty)


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

Branch: refs/heads/branch-2.5
Commit: 00c832c472f745c6ed75e82d69dff6b119aef7b5
Parents: ab6d552
Author: Sumit Mohanty 
Authored: Thu Dec 1 07:46:20 2016 -0800
Committer: Sumit Mohanty 
Committed: Thu Dec 1 07:46:20 2016 -0800

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


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

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

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



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

2016-12-01 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 3a3421388 -> ab6d55234
  refs/heads/trunk 9b21f30b5 -> bb8be5ba6


AMBARI-18713. use exclude list of mount device types on docker containers 
(dgrinenko via dlysnichenko)


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

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

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


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

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

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

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

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


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

Branch: refs/heads/branch-2.5
Commit: ab6d552340bbe601209509556c5dead8ba7d14ae
Parents: 3a34213
Author: Lisnichenko Dmitro 
Authored: Thu Dec 1 17:38:40 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Thu Dec 1 17:38:40 2016 +0200

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


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

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

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

ambari git commit: AMBARI-19048 Delete service action should show the config recommendation popup. (ababiichuk)

2016-12-01 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk ef63373ef -> 9b21f30b5


AMBARI-19048 Delete service action should show the config recommendation popup. 
(ababiichuk)


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

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

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


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

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

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

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

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

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


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

Branch: refs/heads/branch-2.5
Commit: 3a342138832357f38a2114fa520f5bb217a654bb
Parents: d036e0e
Author: Vitaly Brodetskyi 
Authored: Thu Dec 1 16:51:17 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Thu Dec 1 16:51:17 2016 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/3a342138/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
new file mode 100644
index 000..736e5e3
--- /dev/null
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
@@ -0,0 +1,108 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+__all__ = ["simulate_perf_cluster_alert_behaviour"]
+
+import logging
+import random
+import time
+
+from datetime import datetime
+from resource_management.core.exceptions import Fail
+
+RESULT_CODE_OK = 'OK'
+RESULT_CODE_CRITICAL = 'CRITICAL'
+RESULT_CODE_UNKNOWN = 'UNKNOWN'
+
+OK_MESSAGE = 'Ok'

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

2016-12-01 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d036e0e21 -> 3a3421388


http://git-wip-us.apache.org/repos/asf/ambari/blob/3a342138/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
deleted file mode 100644
index 0946c85..000
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-"""
-
-import logging
-
-RESULT_STATE_OK = 'OK'
-RESULT_STATE_CRITICAL = 'CRITICAL'
-RESULT_STATE_WARNING = 'WARNING'
-RESULT_STATE_UNKNOWN = 'UNKNOWN'
-RESULT_STATE_SKIPPED = 'SKIPPED'
-
-OK_MESSAGE = 'Ok'
-
-HDFS_SITE_KEY = '{{hdfs-site}}'
-NAMESERVICE_KEY = '{{hdfs-site/dfs.internal.nameservices}}'
-NN_HTTP_ADDRESS_KEY = '{{hdfs-site/dfs.namenode.http-address}}'
-NN_HTTPS_ADDRESS_KEY = '{{hdfs-site/dfs.namenode.https-address}}'
-DFS_POLICY_KEY = '{{hdfs-site/dfs.http.policy}}'
-
-KERBEROS_KEYTAB = '{{hdfs-site/dfs.web.authentication.kerberos.keytab}}'
-KERBEROS_PRINCIPAL = '{{hdfs-site/dfs.web.authentication.kerberos.principal}}'
-SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}'
-SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
-EXECUTABLE_SEARCH_PATHS = '{{kerberos-env/executable_search_paths}}'
-
-METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY = 
'{{ams-site/timeline.metrics.service.webapp.address}}'
-METRICS_COLLECTOR_VIP_HOST_KEY = '{{cluster-env/metrics_collector_vip_host}}'
-METRICS_COLLECTOR_VIP_PORT_KEY = '{{cluster-env/metrics_collector_vip_port}}'
-
-logger = logging.getLogger()
-
-
-def get_tokens():
-  """
-  Returns a tuple of tokens in the format {{site/property}} that will be used
-  to build the dictionary passed into execute
-  """
-  return (HDFS_SITE_KEY, NAMESERVICE_KEY, NN_HTTP_ADDRESS_KEY, DFS_POLICY_KEY,
-  EXECUTABLE_SEARCH_PATHS, NN_HTTPS_ADDRESS_KEY, SMOKEUSER_KEY,
-  KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, SECURITY_ENABLED_KEY,
-  METRICS_COLLECTOR_VIP_HOST_KEY, METRICS_COLLECTOR_VIP_PORT_KEY,
-  METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY)
-
-def execute(configurations={}, parameters={}, host_name=None):
-  """
-  Returns a tuple containing the result code and a pre-formatted result label
-
-  Keyword arguments:
-  configurations : a mapping of configuration key to value
-  parameters : a mapping of script parameter key to value
-  host_name : the name of this host where the alert is running
-
-  :type configurations dict
-  :type parameters dict
-  :type host_name str
-  """
-
-  #parse configuration
-  if configurations is None:
-return (RESULT_STATE_UNKNOWN, ['There were no configurations supplied to 
the script.'])
-
-  # hdfs-site is required
-  if not HDFS_SITE_KEY in configurations:
-return (RESULT_STATE_UNKNOWN, ['{0} is a required parameter for the 
script'.format(HDFS_SITE_KEY)])
-
-  result_code = RESULT_STATE_OK
-  label = OK_MESSAGE
-  return (result_code, [label])
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/3a342138/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
new file mode 100644
index 000..73bc168
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache 

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

2016-12-01 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/trunk 9a72a6009 -> ef63373ef


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
deleted file mode 100644
index 0946c85..000
--- 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_metrics_deviation.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-"""
-
-import logging
-
-RESULT_STATE_OK = 'OK'
-RESULT_STATE_CRITICAL = 'CRITICAL'
-RESULT_STATE_WARNING = 'WARNING'
-RESULT_STATE_UNKNOWN = 'UNKNOWN'
-RESULT_STATE_SKIPPED = 'SKIPPED'
-
-OK_MESSAGE = 'Ok'
-
-HDFS_SITE_KEY = '{{hdfs-site}}'
-NAMESERVICE_KEY = '{{hdfs-site/dfs.internal.nameservices}}'
-NN_HTTP_ADDRESS_KEY = '{{hdfs-site/dfs.namenode.http-address}}'
-NN_HTTPS_ADDRESS_KEY = '{{hdfs-site/dfs.namenode.https-address}}'
-DFS_POLICY_KEY = '{{hdfs-site/dfs.http.policy}}'
-
-KERBEROS_KEYTAB = '{{hdfs-site/dfs.web.authentication.kerberos.keytab}}'
-KERBEROS_PRINCIPAL = '{{hdfs-site/dfs.web.authentication.kerberos.principal}}'
-SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}'
-SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
-EXECUTABLE_SEARCH_PATHS = '{{kerberos-env/executable_search_paths}}'
-
-METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY = 
'{{ams-site/timeline.metrics.service.webapp.address}}'
-METRICS_COLLECTOR_VIP_HOST_KEY = '{{cluster-env/metrics_collector_vip_host}}'
-METRICS_COLLECTOR_VIP_PORT_KEY = '{{cluster-env/metrics_collector_vip_port}}'
-
-logger = logging.getLogger()
-
-
-def get_tokens():
-  """
-  Returns a tuple of tokens in the format {{site/property}} that will be used
-  to build the dictionary passed into execute
-  """
-  return (HDFS_SITE_KEY, NAMESERVICE_KEY, NN_HTTP_ADDRESS_KEY, DFS_POLICY_KEY,
-  EXECUTABLE_SEARCH_PATHS, NN_HTTPS_ADDRESS_KEY, SMOKEUSER_KEY,
-  KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, SECURITY_ENABLED_KEY,
-  METRICS_COLLECTOR_VIP_HOST_KEY, METRICS_COLLECTOR_VIP_PORT_KEY,
-  METRICS_COLLECTOR_WEBAPP_ADDRESS_KEY)
-
-def execute(configurations={}, parameters={}, host_name=None):
-  """
-  Returns a tuple containing the result code and a pre-formatted result label
-
-  Keyword arguments:
-  configurations : a mapping of configuration key to value
-  parameters : a mapping of script parameter key to value
-  host_name : the name of this host where the alert is running
-
-  :type configurations dict
-  :type parameters dict
-  :type host_name str
-  """
-
-  #parse configuration
-  if configurations is None:
-return (RESULT_STATE_UNKNOWN, ['There were no configurations supplied to 
the script.'])
-
-  # hdfs-site is required
-  if not HDFS_SITE_KEY in configurations:
-return (RESULT_STATE_UNKNOWN, ['{0} is a required parameter for the 
script'.format(HDFS_SITE_KEY)])
-
-  result_code = RESULT_STATE_OK
-  label = OK_MESSAGE
-  return (result_code, [label])
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
new file mode 100644
index 000..73bc168
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/PERF/1.0/services/HDFS/package/alerts/alert_nfs_gateway_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache 

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

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


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

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

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef63373e/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
new file mode 100644
index 000..736e5e3
--- /dev/null
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/simulate_perf_cluster_alert_behaviour.py
@@ -0,0 +1,108 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+__all__ = ["simulate_perf_cluster_alert_behaviour"]
+
+import logging
+import random
+import time
+
+from datetime import datetime
+from resource_management.core.exceptions import Fail
+
+RESULT_CODE_OK = 'OK'
+RESULT_CODE_CRITICAL = 'CRITICAL'
+RESULT_CODE_UNKNOWN = 'UNKNOWN'
+
+OK_MESSAGE = 'Ok'
+FAIL_MESSAGE = 

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

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

ambari git commit: AMBARI-19047. Select Versions page: 'Remove' tooltip does not disappear (onechiporenko)

2016-12-01 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 7c07dd359 -> 9a72a6009


AMBARI-19047. Select Versions page: 'Remove' tooltip does not disappear 
(onechiporenko)


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

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

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


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

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



ambari git commit: AMBARI-19043 : CAPACITY-SCHEDULER & PIG View not loading for Ambari-2.5.0 (Akhil PB via nitirajrathore)

2016-12-01 Thread nitiraj
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 8aa88e167 -> d036e0e21


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


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

Branch: refs/heads/branch-2.5
Commit: d036e0e2145a4b5c240803cd6b5c7fc4572ed128
Parents: 8aa88e1
Author: Nitiraj Rathore 
Authored: Thu Dec 1 17:46:00 2016 +0530
Committer: Nitiraj Rathore 
Committed: Thu Dec 1 17:51:53 2016 +0530

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


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

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



ambari git commit: AMBARI-19043 : CAPACITY-SCHEDULER & PIG View not loading for Ambari-2.5.0 (Akhil PB via nitirajrathore)

2016-12-01 Thread nitiraj
Repository: ambari
Updated Branches:
  refs/heads/trunk 4b3879151 -> 7c07dd359


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


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

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

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


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

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



ambari git commit: AMBARI-19034 Upgrade History Displays Wrong Upgrade Type (atkach)

2016-12-01 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 5709f438b -> 8aa88e167


AMBARI-19034 Upgrade History Displays Wrong Upgrade Type (atkach)


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

Branch: refs/heads/branch-2.5
Commit: 8aa88e1675806d6e7a4dc9e801d63c9f1fcdaf65
Parents: 5709f43
Author: Andrii Tkach 
Authored: Wed Nov 30 21:07:28 2016 +0200
Committer: Andrii Tkach 
Committed: Thu Dec 1 12:49:09 2016 +0200

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


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

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

http://git-wip-us.apache.org/repos/asf/ambari/blob/8aa88e16/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 5c7e0e8..22720a9 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -344,6 +344,7 @@ Em.I18n.translations = {
   'common.end.time': 'End Time',
   'common.rolling': 'Rolling',
   'common.express': 'Express',
+  'common.hostOrdered': 'Host Ordered',
   'common.rolling.downgrade': 'Rolling Downgrade',
   'common.express.downgrade': 'Express Downgrade',
 

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

http://git-wip-us.apache.org/repos/asf/ambari/blob/8aa88e16/ambari-web/app/styles/stack_versions.less
--
diff --git a/ambari-web/app/styles/stack_versions.less 
b/ambari-web/app/styles/stack_versions.less
index 715bbe3..a721596 100644
--- a/ambari-web/app/styles/stack_versions.less
+++ b/ambari-web/app/styles/stack_versions.less
@@ -507,8 +507,13 @@
 margin: 10px;
 .method-option {
   width: 43.5%;
+  margin-bottom: 5px;
 }
 .thumbnail {
+  background-color: #e4e4e4;
+  .method-name,.method-icon,.method-description {
+color: #33;
+  }
 
   cursor: pointer;
   border: none;
@@ -528,12 +533,6 @@
   }
 }
 
-.ROLLING, .NON_ROLLING {
-  background-color: #e4e4e4;
-

ambari git commit: AMBARI-19034 Upgrade History Displays Wrong Upgrade Type (atkach)

2016-12-01 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk dc5f4e259 -> 4b3879151


AMBARI-19034 Upgrade History Displays Wrong Upgrade Type (atkach)


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

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

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


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

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

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

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

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

ambari git commit: AMBARI-19045 Remove unnecessary Log Feeder Date Mapper tests

2016-12-01 Thread mgergely
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 80b5348ca -> 5709f438b


AMBARI-19045 Remove unnecessary Log Feeder Date Mapper tests

Change-Id: I9f47bfc5a18b63d1a3f4dd208e7186952f804430


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

Branch: refs/heads/branch-2.5
Commit: 5709f438b5b52aecd1f1fdf93fadbb8630b77e6d
Parents: 80b5348
Author: Miklos Gergely 
Authored: Thu Dec 1 11:41:42 2016 +0100
Committer: Miklos Gergely 
Committed: Thu Dec 1 11:41:42 2016 +0100

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


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

ambari git commit: AMBARI-19045 Remove unnecessary Log Feeder Date Mapper tests

2016-12-01 Thread mgergely
Repository: ambari
Updated Branches:
  refs/heads/trunk 195b7456c -> dc5f4e259


AMBARI-19045 Remove unnecessary Log Feeder Date Mapper tests

Change-Id: Ia8d613c0c53bff04c5ccee0579a337b8cbb3a00a


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

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

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


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

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

2016-12-01 Thread oleewere
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 7f60b1f17 -> 80b5348ca


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

Change-Id: I44fa2c96befa2eff3d6f2acfb608eff8ed45f021


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

Branch: refs/heads/branch-2.5
Commit: 80b5348cac1c54942ca33d92dbc392faa74c9662
Parents: 7f60b1f
Author: oleewere 
Authored: Thu Dec 1 11:34:45 2016 +0100
Committer: oleewere 
Committed: Thu Dec 1 11:39:07 2016 +0100

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


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

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

2016-12-01 Thread oleewere
Repository: ambari
Updated Branches:
  refs/heads/trunk 337c5f29f -> 195b7456c


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

Change-Id: I44fa2c96befa2eff3d6f2acfb608eff8ed45f021


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

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

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


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

[23/50] ambari git commit: AMBARI-19016 - RegionServer Restart During Upgrade Fails Because of Missing Import When Formatting PID (jonathanhurley)

2016-12-01 Thread swapan
AMBARI-19016 - RegionServer Restart During Upgrade Fails Because of Missing 
Import When Formatting PID (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 6f4055fa11d956113d7d6b95db762e4806e5dd81
Parents: 04c6b12
Author: Jonathan Hurley 
Authored: Tue Nov 29 08:40:58 2016 -0500
Committer: Jonathan Hurley 
Committed: Tue Nov 29 11:21:11 2016 -0500

--
 .../common-services/HBASE/0.96.0.2.0/package/scripts/upgrade.py   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6f4055fa/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/upgrade.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/upgrade.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/upgrade.py
index afdc244..43c7ff4 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/upgrade.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/upgrade.py
@@ -29,8 +29,10 @@ from resource_management.libraries.functions import 
conf_select, stack_select
 from resource_management.libraries.functions.constants import StackFeature
 from resource_management.libraries.functions.stack_features import 
check_stack_feature
 from resource_management.libraries.functions.decorator import retry
+from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions import check_process_status
 
+
 def prestart(env, stack_component):
   import params
 
@@ -63,7 +65,6 @@ def is_regionserver_registered(cmd, user, hostname, 
regex_search_flags):
   Queries HBase through the HBase shell to see which servers have successfully 
registered. This is
   useful in cases, such as upgrades, where we must ensure that a RegionServer 
has not only started,
   but also completed it's registration handshake before moving into upgrading 
the next RegionServer.
-
   The hbase shell is used along with the "show 'simple'" command in order to 
determine if the
   specified host has registered.
   :param cmd:



[09/50] ambari git commit: Revert "temp scv"

2016-12-01 Thread swapan
Revert "temp scv"

This reverts commit 59d11cf36b9fa283ba9592c8440f6be53debadd0.


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 1df9b46615710a2232eb38e975fbcd6f9dec8cb9
Parents: ce4d4fa
Author: Myroslav Papirkovskyi 
Authored: Mon Nov 28 18:41:12 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Mon Nov 28 18:41:12 2016 +0200

--
 .../internal/ClusterControllerImpl.java |  2 +-
 .../ServiceConfigVersionResourceProvider.java   |  3 +--
 .../logging/LoggingSearchPropertyProvider.java  | 11 ++---
 .../ambari/server/orm/dao/ClusterDAO.java   | 24 
 .../ambari/server/orm/dao/ServiceConfigDAO.java | 13 ++-
 .../orm/entities/ClusterConfigEntity.java   |  7 +-
 .../entities/ClusterConfigMappingEntity.java|  6 -
 .../orm/entities/ServiceConfigEntity.java   |  5 ++--
 8 files changed, 14 insertions(+), 57 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1df9b466/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
index c752e80..32bed7b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
@@ -858,7 +858,7 @@ public class ClusterControllerImpl implements 
ClusterController {
   if (compVal == 0) {
 Schema schema = getSchema(resourceType);
 
-for (Type type : schema.getKeyTypes()) {
+for (Type type : Type.values()) {
   String keyPropertyId = schema.getKeyPropertyId(type);
   if (keyPropertyId != null) {
 compVal = compareValues(resource1.getPropertyValue(keyPropertyId),

http://git-wip-us.apache.org/repos/asf/ambari/blob/1df9b466/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
index e5ca389..2edbe9b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
@@ -91,9 +91,8 @@ public class ServiceConfigVersionResourceProvider extends
 PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_IS_COMPATIBLE_PROPERTY_ID);
 
 // keys
-
KEY_PROPERTY_IDS.put(Resource.Type.Service,SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
+
KEY_PROPERTY_IDS.put(Resource.Type.ServiceConfigVersion,SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
 
KEY_PROPERTY_IDS.put(Resource.Type.Cluster,SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID);
-
KEY_PROPERTY_IDS.put(Resource.Type.ServiceConfigVersion,SERVICE_CONFIG_VERSION_PROPERTY_ID);
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1df9b466/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
index 16788ed..d9db290 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
@@ -39,10 +39,8 @@ import org.apache.log4j.Logger;
 
 import java.util.Collections;
 import java.util.EnumSet;
-import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -75,7 +73,7 @@ public class LoggingSearchPropertyProvider implements 
PropertyProvider {
 
   @Override
   public Set 

[29/50] ambari git commit: Revert "AMBARI-18912. Implement Create Alerts: step 1 select alert type.(XIWANG)"

2016-12-01 Thread swapan
Revert "AMBARI-18912. Implement Create Alerts: step 1 select alert 
type.(XIWANG)"

This reverts commit 86ecd898e7045c67cee85ca25c6c746298bd5ef8.


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: be8354a5a987e9e92ca79cffb72496fc9a34fb4f
Parents: 2073588
Author: Xi Wang 
Authored: Tue Nov 29 17:07:33 2016 -0800
Committer: Xi Wang 
Committed: Tue Nov 29 17:09:19 2016 -0800

--
 .../add_alert_definition/step1_controller.js| 41 +++-
 .../alerts/definition_configs_controller.js | 40 ++--
 ambari-web/app/messages.js  | 17 ++---
 .../app/models/alerts/alert_definition.js   | 54 
 ambari-web/app/styles/alerts.less   | 66 +---
 .../main/alerts/add_alert_definition/step1.hbs  | 29 +++--
 .../alerts/add_alert_definition/step1_view.js   |  3 -
 .../step1_controller_test.js| 24 ++-
 8 files changed, 80 insertions(+), 194 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/be8354a5/ambari-web/app/controllers/main/alerts/add_alert_definition/step1_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/add_alert_definition/step1_controller.js
 
b/ambari-web/app/controllers/main/alerts/add_alert_definition/step1_controller.js
index c758fc0..43e25c8 100644
--- 
a/ambari-web/app/controllers/main/alerts/add_alert_definition/step1_controller.js
+++ 
b/ambari-web/app/controllers/main/alerts/add_alert_definition/step1_controller.js
@@ -24,25 +24,34 @@ App.AddAlertDefinitionStep1Controller = 
Em.Controller.extend({
 
   /**
* List of available alert definition types
-   * @type {{name: string, isActive: boolean}[]}
+   * @type {{value: string, isActive: boolean}[]}
*/
-  alertDefinitionsTypes: function () {
-return App.AlertType.find().map(function(option) {
-  return Em.Object.create({
-name: option.get('name'),
-displayName: option.get('displayName'),
-icon: option.get('iconPath'),
-description: option.get('description')
-  });
-});
-  }.property(),
+  alertDefinitionsTypes: [
+Em.Object.create({value: 'PORT', isActive: false, icon: 'icon-signal'}),
+Em.Object.create({value: 'METRIC', isActive: false, icon: 'icon-bolt'}),
+Em.Object.create({value: 'WEB', isActive: false, icon: 'icon-globe'}),
+Em.Object.create({value: 'AGGREGATE', isActive: false, icon: 
'icon-plus-sign-alt'}),
+Em.Object.create({value: 'SCRIPT', isActive: false, icon: 'icon-code'}),
+Em.Object.create({value: 'SERVER', isActive: false, icon: 'icon-desktop'}),
+Em.Object.create({value: 'RECOVERY', isActive: false, icon: 
'icon-desktop'})
+  ],
+
+  /**
+   * "Next"-button is disabled if user doesn't select any alert definition type
+   * @type {boolean}
+   */
+  isSubmitDisabled: Em.computed.everyBy('alertDefinitionsTypes', 'isActive', 
false),
 
   /**
* Set selectedType if it exists in the wizard controller
* @method loadStep
*/
   loadStep: function() {
-this.set('content.selectedType', '');
+this.get('alertDefinitionsTypes').setEach('isActive', false);
+var selectedType = this.get('content.selectedType');
+if(selectedType) {
+  this.selectType({context: {value: selectedType}});
+}
   },
 
   /**
@@ -52,10 +61,10 @@ App.AddAlertDefinitionStep1Controller = 
Em.Controller.extend({
*/
   selectType: function(e) {
 var type = e.context,
-types = this.get('alertDefinitionsTypes');
-this.set('content.selectedType', type.name);
-$("[rel='selectable-tooltip']").trigger('mouseleave');
-App.router.send('next');
+  types = this.get('alertDefinitionsTypes');
+types.setEach('isActive', false);
+types.findProperty('value', type.value).set('isActive', true);
+this.set('content.selectedType', type.value);
   }
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/be8354a5/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js 
b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
index 138aaa4..4c82556 100644
--- a/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
+++ b/ambari-web/app/controllers/main/alerts/definition_configs_controller.js
@@ -225,7 +225,7 @@ App.MainAlertDefinitionConfigsController = 
Em.Controller.extend({
 var result = 

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

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

This reverts commit 1632f9b5c6f7822c1fe59c4532250b47ae902513.


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 7632917d5c7dc24e2025358e176a53ff1b6fe430
Parents: 1632f9b
Author: Nate Cole 
Authored: Wed Nov 30 14:53:18 2016 -0500
Committer: Nate Cole 
Committed: Wed Nov 30 14:53:18 2016 -0500

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


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



[17/50] ambari git commit: AMBARI-18946 Ambari Integration for Zeppelin and Spark 2.0 (r-kamath)

2016-12-01 Thread swapan
AMBARI-18946 Ambari Integration for Zeppelin and Spark 2.0 (r-kamath)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 182479d3ce0324422379ca87ec369b7025dfe91f
Parents: d3c7555
Author: Renjith Kamath 
Authored: Tue Nov 29 11:57:41 2016 +0530
Committer: Renjith Kamath 
Committed: Tue Nov 29 11:57:41 2016 +0530

--
 .../0.6.0.2.5/package/scripts/master.py | 15 +++
 .../0.6.0.2.5/package/scripts/params.py | 28 +++-
 2 files changed, 31 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/182479d3/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index 33a2a14..e82b53c 100644
--- 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -58,8 +58,12 @@ class Master(Script):
 # update the configs specified by user
 self.configure(env)
 
-Execute('echo spark_version:' + params.spark_version + ' detected for 
spark_home: '
-+ params.spark_home + ' >> ' + params.zeppelin_log_file, 
user=params.zeppelin_user)
+if params.spark_version:
+  Execute('echo spark_version:' + str(params.spark_version) + ' detected 
for spark_home: '
+  + params.spark_home + ' >> ' + params.zeppelin_log_file, 
user=params.zeppelin_user)
+if params.spark2_version:
+  Execute('echo spark2_version:' + str(params.spark2_version) + ' detected 
for spark2_home: '
+  + params.spark2_home + ' >> ' + params.zeppelin_log_file, 
user=params.zeppelin_user)
 
   def create_zeppelin_dir(self, params):
 params.HdfsResource(format("/user/{zeppelin_user}"),
@@ -138,9 +142,10 @@ class Master(Script):
 File(format("{params.conf_dir}/log4j.properties"), 
content=params.log4j_properties_content,
  owner=params.zeppelin_user, group=params.zeppelin_group)
 
-# copy hive-site.xml
-File(format("{params.conf_dir}/hive-site.xml"), 
content=StaticFile("/etc/spark/conf/hive-site.xml"),
- owner=params.zeppelin_user, group=params.zeppelin_group)
+# copy hive-site.xml only if Spark 1.x is installed
+if 'spark-defaults' in params.config['configurations']:
+File(format("{params.conf_dir}/hive-site.xml"), 
content=StaticFile("/etc/spark/conf/hive-site.xml"),
+ owner=params.zeppelin_user, group=params.zeppelin_group)
 
 if len(params.hbase_master_hosts) > 0:
   # copy hbase-site.xml

http://git-wip-us.apache.org/repos/asf/ambari/blob/182479d3/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
index 27ed150..5a3174f 100644
--- 
a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/params.py
@@ -39,6 +39,14 @@ def get_port_from_url(address):
   else:
 return address
 
+def extract_spark_version(spark_home):
+  try:
+with open(spark_home + "/RELEASE") as fline:
+  return re.search('Spark (\d\.\d).+', fline.readline().rstrip()).group(1)
+  except:
+pass
+  return None
+
 
 # server configurations
 config = Script.get_config()
@@ -58,13 +66,17 @@ spark_jar_dir = 
config['configurations']['zeppelin-env']['zeppelin.spark.jar.dir
 spark_jar = format("{spark_jar_dir}/zeppelin-spark-0.5.5-SNAPSHOT.jar")
 setup_view = True
 temp_file = config['configurations']['zeppelin-env']['zeppelin.temp.file']
-spark_home = os.path.join(stack_root, "current", "spark-client")
 
-try:
-  fline = open(spark_home + "/RELEASE").readline().rstrip()
-  spark_version = re.search('Spark (\d\.\d).+', fline).group(1)
-except:
-  pass
+spark_home = None
+spark_version = None
+spark2_home = None
+spark2_version = None
+if 'spark-defaults' in config['configurations']:
+  spark_home = os.path.join(stack_root, "current", 'spark-client')
+  

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

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


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: c578a370722907361393cde668a6b9dedb678829
Parents: 47d2f70
Author: Alejandro Fernandez 
Authored: Wed Nov 30 13:51:02 2016 -0800
Committer: Alejandro Fernandez 
Committed: Wed Nov 30 13:51:02 2016 -0800

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


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

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



[14/50] ambari git commit: AMBARI-18992: Stack version input text field on Register Version page should align properly even when resizing the page (dili)

2016-12-01 Thread swapan
AMBARI-18992: Stack version input text field on Register Version page should 
align properly even when resizing the page (dili)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 17d2ab1f9b0086d12b6be49167606e43741ae702
Parents: 1b63b90
Author: Di Li 
Authored: Mon Nov 28 15:09:54 2016 -0500
Committer: Di Li 
Committed: Mon Nov 28 15:16:47 2016 -0500

--
 .../ui/admin-web/app/views/stackVersions/stackVersionPage.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/17d2ab1f/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
 
b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
index a614a0d..b31e2c5 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/views/stackVersions/stackVersionPage.html
@@ -83,7 +83,7 @@
 
   
 
-
+
   Name:
   
 



[28/50] ambari git commit: AMBARI-18792. Update some configuration properties for hive interactive for the HDP 2.6 stack - minor fix (Siddharth Seth via smohanty)

2016-12-01 Thread swapan
AMBARI-18792. Update some configuration properties for hive interactive for the 
HDP 2.6 stack - minor fix (Siddharth Seth via smohanty)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 20735887018d4de6e4e5d67839a2aa30eea0f2ad
Parents: 052da57
Author: Sumit Mohanty 
Authored: Tue Nov 29 15:35:20 2016 -0800
Committer: Sumit Mohanty 
Committed: Tue Nov 29 15:35:20 2016 -0800

--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/20735887/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 44ce895..52de784 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -124,7 +124,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
*/
   @Override
   protected void executePreDMLUpdates() throws AmbariException, SQLException {
-updateHiveLlapConfigs();
+
   }
 
   /**
@@ -135,6 +135,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 addNewConfigurationsFromXml();
 updateAMSConfigs();
 updateKafkaConfigs();
+updateHiveLlapConfigs();
   }
 
   protected void updateHostVersionTable() throws SQLException {



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

2016-12-01 Thread swapan
AMBARI-19030 Service Auto Start operations are permitted during Upgrade. 
(atkach)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 1bd562a1803efa12a4afcbf312c5a898f63bff41
Parents: adde3db
Author: Andrii Tkach 
Authored: Wed Nov 30 14:19:52 2016 +0200
Committer: Andrii Tkach 
Committed: Wed Nov 30 15:45:04 2016 +0200

--
 .../app/templates/main/admin/service_auto_start.hbs   | 10 ++
 ambari-web/app/views/main/admin.js|  3 ++-
 ambari-web/app/views/main/admin/service_auto_start.js |  4 
 .../main/admin/service_auto_start/component_auto_start.js |  1 +
 .../admin/stack_upgrade/upgrade_version_box_view_test.js  |  2 +-
 5 files changed, 14 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1bd562a1/ambari-web/app/templates/main/admin/service_auto_start.hbs
--
diff --git a/ambari-web/app/templates/main/admin/service_auto_start.hbs 
b/ambari-web/app/templates/main/admin/service_auto_start.hbs
index e2eb192..a14add2 100644
--- a/ambari-web/app/templates/main/admin/service_auto_start.hbs
+++ b/ambari-web/app/templates/main/admin/service_auto_start.hbs
@@ -63,10 +63,12 @@
 
 
 {{/each}}
-
-{{t common.enableAll}} |
-{{t common.disableAll}}
-
+{{#isAuthorized "SERVICE.START_STOP, 
CLUSTER.MODIFY_CONFIGS"}}
+
+{{t common.enableAll}} |
+{{t common.disableAll}}
+
+{{/isAuthorized}}
 
 {{/each}}
 

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

http://git-wip-us.apache.org/repos/asf/ambari/blob/1bd562a1/ambari-web/app/views/main/admin/service_auto_start.js
--
diff --git a/ambari-web/app/views/main/admin/service_auto_start.js 
b/ambari-web/app/views/main/admin/service_auto_start.js
index 5b10d1b..51512a2 100644
--- a/ambari-web/app/views/main/admin/service_auto_start.js
+++ b/ambari-web/app/views/main/admin/service_auto_start.js
@@ -30,8 +30,11 @@ App.MainAdminServiceAutoStartView = Em.View.extend({
 
   savedRecoveryEnabled: false,
 
+  isDisabled: false,
+
   didInsertElement: function () {
 var self = this;
+this.set('isDisabled', !App.isAuthorized('SERVICE.START_STOP, 
CLUSTER.MODIFY_CONFIGS'));
 this.get('controller').loadClusterConfig().done(function (data) {
   var tag = [
 {
@@ -77,6 +80,7 @@ App.MainAdminServiceAutoStartView = Em.View.extend({
 offText: Em.I18n.t('common.disabled'),
 offColor: 'default',
 onColor: 'success',
+disabled: this.get('isDisabled'),
 handleWidth: Math.max(Em.I18n.t('common.enabled').length, 
Em.I18n.t('common.disabled').length) * 8,
 onSwitchChange: function (event, state) {
   self.updateClusterConfigs(state);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1bd562a1/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js
--
diff --git 
a/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js 
b/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js
index ceafd21..9794d6f 100644
--- a/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js
+++ b/ambari-web/app/views/main/admin/service_auto_start/component_auto_start.js
@@ -56,6 +56,7 @@ App.MainAdminServiceAutoStartComponentView = Em.View.extend({
 offText: 

[18/50] ambari git commit: AMBARI-19002 Ambari widgets and service checks to honor LLAP clusters with 100% allocation to LLAP daemons. (atkach)

2016-12-01 Thread swapan
AMBARI-19002 Ambari widgets and service checks to honor LLAP clusters with 100% 
allocation to LLAP daemons. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 616e97ea3655f54db3d1a19c2af43672ea971de2
Parents: 182479d
Author: Andrii Tkach 
Authored: Tue Nov 29 13:40:37 2016 +0200
Committer: Andrii Tkach 
Committed: Tue Nov 29 13:40:37 2016 +0200

--
 .../stacks/HDP/2.0.6/configuration/cluster-env.xml |  6 ++
 ambari-web/app/views/main/dashboard/widgets.js | 17 +++--
 .../test/views/main/dashboard/widgets_test.js  | 11 ++-
 3 files changed, 31 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/616e97ea/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 0d313cc..cc6c8a3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -274,4 +274,10 @@ gpgcheck=0
 For properties handled by handle_mounted_dirs this will make 
Ambari 
 
   
+  
+hide_yarn_memory_widget
+false
+YARN Memory widget should be hidden by default on the 
dashboard.
+
+  
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/616e97ea/ambari-web/app/views/main/dashboard/widgets.js
--
diff --git a/ambari-web/app/views/main/dashboard/widgets.js 
b/ambari-web/app/views/main/dashboard/widgets.js
index 48293d3..c5eaafc 100644
--- a/ambari-web/app/views/main/dashboard/widgets.js
+++ b/ambari-web/app/views/main/dashboard/widgets.js
@@ -116,6 +116,16 @@ App.MainDashboardWidgetsView = 
Em.View.extend(App.UserPref, App.LocalStorage, Ap
 }, this);
   },
 
+  resolveConfigDependencies: function(visibleFull, hiddenFull) {
+var clusterEnv = App.router.get('clusterController.clusterEnv').properties;
+
+if (clusterEnv['hide_yarn_memory_widget'] === 'true') {
+  hiddenFull.push(['20', 'YARN Memory']);
+} else {
+  visibleFull.splice(visibleFull.indexOf('19'), 0, '20');
+}
+  },
+
   /**
* Load widget statuses to initPrefObject
*/
@@ -126,7 +136,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, 
App.LocalStorage, Ap
   '6', '7', '8', '9', //host metrics
   '1', '5', '3', '10', //hdfs
   '13', '12', '14', '16', //hbase
-  '17', '18', '19', '20', '23', // all yarn
+  '17', '18', '19', '23', // all yarn
   '21', // storm
   '22', // flume
   '24', // hawq
@@ -135,6 +145,7 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, 
App.LocalStorage, Ap
 var hiddenFull = [
   ['15', 'Region In Transition']
 ];
+this.resolveConfigDependencies(visibleFull, hiddenFull);
 
 // Display widgets for host metrics if the stack definition has a host 
metrics service to display it.
 if (this.get('host_metrics_model') == null) {
@@ -155,7 +166,9 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, 
App.LocalStorage, Ap
   hbase.forEach(function (item) {
 visibleFull = visibleFull.without(item);
   }, this);
-  hiddenFull = [];
+  hiddenFull = hiddenFull.filter(function(item) {
+return item[0] !== '15';
+  });
 }
 if (this.get('yarn_model') == null) {
   var yarn = ['17', '18', '19', '20', '23'];

http://git-wip-us.apache.org/repos/asf/ambari/blob/616e97ea/ambari-web/test/views/main/dashboard/widgets_test.js
--
diff --git a/ambari-web/test/views/main/dashboard/widgets_test.js 
b/ambari-web/test/views/main/dashboard/widgets_test.js
index 49a06a4..0781c79 100644
--- a/ambari-web/test/views/main/dashboard/widgets_test.js
+++ b/ambari-web/test/views/main/dashboard/widgets_test.js
@@ -107,12 +107,21 @@ describe('App.MainDashboardWidgetsView', function () {
   yarn_model: {}
 },
 e: {
-  visibleL: totalWidgetsCount,
+  visibleL: totalWidgetsCount - 1,
   hiddenL: 1
 },
 m: 'All models are not null'
   }
 ]);
+
+beforeEach(function() {
+  sinon.stub(view, 'resolveConfigDependencies');
+});
+
+afterEach(function() {
+  view.resolveConfigDependencies.restore();
+ 

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

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


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 7f60b1f176d9add5ceacfc631d00245623a6edd5
Parents: 7b53d07
Author: Nahappan Somasundaram 
Authored: Wed Nov 30 17:50:21 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Wed Nov 30 22:07:44 2016 -0800

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


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



[13/50] ambari git commit: AMBARI-18841 : Grafana fails to start (Commit 2) (avijayan)

2016-12-01 Thread swapan
AMBARI-18841 : Grafana fails to start (Commit 2) (avijayan)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 1b63b9094f28b04fa361d8ad3c7ab122716d544d
Parents: 98e41c6
Author: Aravindan Vijayan 
Authored: Mon Nov 28 10:06:32 2016 -0800
Committer: Aravindan Vijayan 
Committed: Mon Nov 28 10:06:32 2016 -0800

--
 .../conf/unix/ambari-metrics-grafana| 34 ++--
 1 file changed, 9 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1b63b909/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
--
diff --git 
a/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana 
b/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
index eeb189b..472942e 100644
--- a/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
+++ b/ambari-metrics/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
@@ -94,30 +94,14 @@ function isRunning() {
 
 case "$1" in
   start)
-echo -n $"Starting $DESC:  "
+echo $"Starting $DESC:  " >> $LOG_FILE
 
 isRunning
 if [ $? -eq 0 ]; then
-  echo "Already running."
+  echo "Already running." >> $LOG_FILE
   exit 0
 fi
 
-echo "$(date) Checking for previously running Grafana with out of sync 
PID..." >> $LOG_FILE
-if [ -n "`ps ax | grep -w ambari-metrics-grafana/bin/grafana-server`" ]; 
then
-  PID=`ps aux | grep -w ambari-metrics-grafana/bin/grafana-server | head 
-n 1 | awk '{print $2}'`
-  echo "$(date) Grafana Server already running with PID: ${PID}. Killing 
that instance"  >> $LOG_FILE
-  kill "${PID}" >/dev/null 2>&1
-  sleep "${STOP_TIMEOUT}"
-
-  if kill -0 "${PID}" > /dev/null 2>&1; then
-echo "$(date) WARNING: Grafana Server did not stop gracefully. Trying 
to kill with kill -9" >> $LOG_FILE
-kill -9 "${PID}" >/dev/null 2>&1
-  fi
-
-else
-  echo "$(date) No out of sync Grafana server process found" >> $LOG_FILE
-fi
-
 # Prepare environment
 # mkdir -p "$LOG_DIR" "$DATA_DIR" && chown 
"$GRAFANA_USER":"$GRAFANA_GROUP" "$LOG_DIR" "$DATA_DIR"
 # touch "$PID_FILE" && chown "$GRAFANA_USER":"$GRAFANA_GROUP" "$PID_FILE"
@@ -135,7 +119,7 @@ case "$1" in
   sleep 1
   # check if pid file has been written two
   if ! [[ -s $PID_FILE ]]; then
-echo "FAILED"
+echo "Start FAILED" >> $LOG_FILE
 exit 1
   fi
   i=0
@@ -152,11 +136,11 @@ case "$1" in
   done
 fi
 
-echo "OK"
+echo "OK" >> $LOG_FILE
 exit $return
 ;;
   stop)
-echo -n "Stopping $DESC ..."
+echo -n "Stopping $DESC ..." >> $LOG_FILE
 
 if [ -f "$PID_FILE" ]; then
   pid=$(cat "$PID_FILE")
@@ -165,18 +149,18 @@ case "$1" in
   sleep "${STOP_TIMEOUT}"
 
   if kill -0 "${pid}" > /dev/null 2>&1; then
-echo "WARNING: $DESC did not stop gracefully after ${STOP_TIMEOUT} 
seconds: Trying to kill with kill -9"
+echo "WARNING: $DESC did not stop gracefully after ${STOP_TIMEOUT} 
seconds: Trying to kill with kill -9" >> $LOG_FILE
 kill -9 "${pid}" >/dev/null 2>&1
   fi
 
   if ps -p "${pid}" > /dev/null 2>&1; then
-echo "ERROR: Unable to kill ${pid}"
+echo "ERROR: Unable to kill ${pid}" >> $LOG_FILE
   else
-rm -f "${pidfile}" >/dev/null 2>&1
+rm -f "$PID_FILE" >/dev/null 2>&1
   fi
   echo "OK"
 else
-  echo -n "(not running)"
+  echo -n "(not running)" >> $LOG_FILE
 fi
 exit 0
 ;;



[08/50] ambari git commit: temp scv

2016-12-01 Thread swapan
temp scv


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 59d11cf36b9fa283ba9592c8440f6be53debadd0
Parents: e62bf6e
Author: Myroslav Papirkovskyi 
Authored: Mon Nov 21 19:56:33 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Mon Nov 28 18:39:06 2016 +0200

--
 .../internal/ClusterControllerImpl.java |  2 +-
 .../ServiceConfigVersionResourceProvider.java   |  3 ++-
 .../logging/LoggingSearchPropertyProvider.java  | 11 +++--
 .../ambari/server/orm/dao/ClusterDAO.java   | 24 
 .../ambari/server/orm/dao/ServiceConfigDAO.java | 13 +--
 .../orm/entities/ClusterConfigEntity.java   |  7 +-
 .../entities/ClusterConfigMappingEntity.java|  6 +
 .../orm/entities/ServiceConfigEntity.java   |  5 ++--
 8 files changed, 57 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/59d11cf3/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
index 32bed7b..c752e80 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
@@ -858,7 +858,7 @@ public class ClusterControllerImpl implements 
ClusterController {
   if (compVal == 0) {
 Schema schema = getSchema(resourceType);
 
-for (Type type : Type.values()) {
+for (Type type : schema.getKeyTypes()) {
   String keyPropertyId = schema.getKeyPropertyId(type);
   if (keyPropertyId != null) {
 compVal = compareValues(resource1.getPropertyValue(keyPropertyId),

http://git-wip-us.apache.org/repos/asf/ambari/blob/59d11cf3/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
index 2edbe9b..e5ca389 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
@@ -91,8 +91,9 @@ public class ServiceConfigVersionResourceProvider extends
 PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_IS_COMPATIBLE_PROPERTY_ID);
 
 // keys
-
KEY_PROPERTY_IDS.put(Resource.Type.ServiceConfigVersion,SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
+
KEY_PROPERTY_IDS.put(Resource.Type.Service,SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
 
KEY_PROPERTY_IDS.put(Resource.Type.Cluster,SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID);
+
KEY_PROPERTY_IDS.put(Resource.Type.ServiceConfigVersion,SERVICE_CONFIG_VERSION_PROPERTY_ID);
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/59d11cf3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
index d9db290..16788ed 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
@@ -39,8 +39,10 @@ import org.apache.log4j.Logger;
 
 import java.util.Collections;
 import java.util.EnumSet;
+import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -73,7 +75,7 @@ public class LoggingSearchPropertyProvider implements 
PropertyProvider {
 
   @Override
   public Set populateResources(Set resources, Request 
request, Predicate predicate) 

[25/50] ambari git commit: AMBARI-18980. Add manual confirm task before finalizing host-ordered upgrade (Duc Le via ncole)

2016-12-01 Thread swapan
AMBARI-18980. Add manual confirm task before finalizing host-ordered upgrade 
(Duc Le via ncole)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: aba9640623d3dd7c33d8544d15876926fece5ab9
Parents: 2686832
Author: Nate Cole 
Authored: Tue Nov 29 12:45:47 2016 -0500
Committer: Nate Cole 
Committed: Tue Nov 29 12:54:15 2016 -0500

--
 .../stacks/HDP/2.5/upgrades/host-upgrade-2.5.xml | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/aba96406/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-upgrade-2.5.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-upgrade-2.5.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-upgrade-2.5.xml
index 72241eea..64c79a8 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-upgrade-2.5.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-upgrade-2.5.xml
@@ -117,14 +117,21 @@
 
   true
   false
-  
+
+  
+UPGRADE
+
+  Please confirm you are ready to finalize.
+
+  
+
   
 
   scripts/namenode.py
   finalize_rolling_upgrade
 
   
-  
+
   
 
 



[32/50] ambari git commit: AMBARI-18979. Optimize loading of views in cloud environments (Laszlo Puskas via magyari_sandor)

2016-12-01 Thread swapan
AMBARI-18979. Optimize loading of views in cloud environments (Laszlo Puskas 
via magyari_sandor)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: fbff7f7e4d1574fcd25bd6c0384a5bbf71d98d35
Parents: 8036eb2
Author: Laszlo Puskas 
Authored: Fri Nov 25 17:35:42 2016 +0100
Committer: Sandor Magyari 
Committed: Wed Nov 30 09:09:49 2016 +0100

--
 .../server/configuration/Configuration.java |  23 +-
 .../ambari/server/events/AmbariEvent.java   |   5 +
 .../events/ClusterConfigFinishedEvent.java  |  53 +++
 .../ambari/server/topology/TopologyManager.java |  16 +-
 .../ambari/server/view/ViewExtractor.java   |   2 +-
 .../apache/ambari/server/view/ViewRegistry.java | 381 +++
 .../ClusterDeployWithStartOnlyTest.java |   2 +-
 ...InstallWithoutStartOnComponentLevelTest.java |   2 +-
 .../ClusterInstallWithoutStartTest.java |   2 +-
 .../ambari/server/view/ViewRegistryTest.java|   2 +
 10 files changed, 314 insertions(+), 174 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fbff7f7e/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 4a322e0..ef35ce8 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
@@ -1839,6 +1839,22 @@ public class Configuration {
   "server.stages.parallel", Boolean.TRUE);
 
   /**
+   *
+   * Property driving the view extraction.
+   * It only applies to  blueprint deployments.
+   *
+   * If set to TRUE on ambari-server startup only the system views are loaded; 
non-system views are extracted upon a cluster
+   * creation request is received and the cluster configuration is 
successfully performed
+   *
+   * It is advised to use this property only in cases when ambari-server 
startup time is critical (eg. cloud environments)
+   *
+   * By default this is FALSE so all views are extracted and deployed at 
server startup.
+   */
+  @Markdown(description = "Drives view extraction in case of blueprint 
deployments; non-system views are deployed when cluster configuration is 
successful")
+  public static final ConfigurationProperty 
VIEW_EXTRACT_AFTER_CLUSTER_CONFIG =  new 
ConfigurationProperty<>("view.extract-after-cluster-config", Boolean.FALSE);
+
+
+  /**
* In case this is set to DEPENDENCY_ORDERED one stage is created for each 
request and command dependencies are
* handled directly by ActionScheduler. In case of STAGE (which is the 
default) one or more stages are
* created depending on dependencies.
@@ -4286,6 +4302,11 @@ public class Configuration {
 return Integer.parseInt(getProperty(VIEW_REQUEST_THREADPOOL_MAX_SIZE));
   }
 
+  public Boolean extractViewsAfterClusterConfig() {
+return 
Boolean.parseBoolean(getProperty(VIEW_EXTRACT_AFTER_CLUSTER_CONFIG));
+  }
+
+
   /**
* Get the time, in ms, that a request to a view will wait for an available
* thread to handle the request before returning an error.
@@ -5605,7 +5626,7 @@ public class Configuration {
 String acceptors = getProperty(SRVR_API_ACCEPTOR_THREAD_COUNT);
 return StringUtils.isEmpty(acceptors) ? null : Integer.parseInt(acceptors);
   }
- 
+
   public String getPamConfigurationFile() {
 return getProperty(PAM_CONFIGURATION_FILE);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbff7f7e/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java 
b/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java
index 7ec5972..868ce3f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/events/AmbariEvent.java
@@ -128,6 +128,11 @@ public abstract class AmbariEvent {
 CLUSTER_CONFIG_CHANGED,
 
 /**
+ * Cluster configuration finished.
+ */
+CLUSTER_CONFIG_FINISHED,
+
+/**
  * Metrics Collector force refresh needed.
  */
 METRICS_COLLECTOR_HOST_DOWN,


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

2016-12-01 Thread swapan
AMBARI-19040. Fix NPE in UpgradeCatalog250Test.testExecuteDMLUpdates (rlevas)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 7b53d07040fee054fa3592da69d9d7f68b3adfd9
Parents: a5ce823
Author: Robert Levas 
Authored: Wed Nov 30 20:40:12 2016 -0500
Committer: Robert Levas 
Committed: Wed Nov 30 20:40:12 2016 -0500

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/7b53d070/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
index 4135919..ce0b387 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
@@ -211,11 +211,13 @@ public class UpgradeCatalog250Test {
   public void testExecuteDMLUpdates() throws Exception {
 Method updateAmsConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateAMSConfigs");
 Method updateKafkaConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateKafkaConfigs");
+Method updateHiveLlapConfigs = 
UpgradeCatalog250.class.getDeclaredMethod("updateHiveLlapConfigs");
 Method addNewConfigurationsFromXml = 
AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
 
 UpgradeCatalog250 upgradeCatalog250 = 
createMockBuilder(UpgradeCatalog250.class)
   .addMockedMethod(updateAmsConfigs)
   .addMockedMethod(updateKafkaConfigs)
+  .addMockedMethod(updateHiveLlapConfigs)
   .addMockedMethod(addNewConfigurationsFromXml)
   .createMock();
 
@@ -229,6 +231,9 @@ public class UpgradeCatalog250Test {
 upgradeCatalog250.updateKafkaConfigs();
 expectLastCall().once();
 
+upgradeCatalog250.updateHiveLlapConfigs();
+expectLastCall().once();
+
 replay(upgradeCatalog250);
 
 upgradeCatalog250.executeDMLUpdates();



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

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


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 841a064d47410184e8bc5101660aa957ac78e268
Parents: eec985b
Author: Di Li 
Authored: Wed Nov 30 11:13:19 2016 -0500
Committer: Di Li 
Committed: Wed Nov 30 11:22:15 2016 -0500

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


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

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



[16/50] ambari git commit: AMBARI-18834 Add Ranger proxy user under Ranger KMS config during stack upgrade (mugdha)

2016-12-01 Thread swapan
AMBARI-18834 Add Ranger proxy user under Ranger KMS config during stack upgrade 
(mugdha)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: d3c75557ec7bc20fa9b2782137a6412aa09a8afb
Parents: 68a881e
Author: Mugdha Varadkar 
Authored: Wed Nov 23 10:55:03 2016 +0530
Committer: Mugdha Varadkar 
Committed: Tue Nov 29 09:31:12 2016 +0530

--
 .../upgrades/RangerKmsProxyConfig.java  |  95 +
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml |   7 +
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml |   7 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml |  11 ++
 .../stacks/HDP/2.3/upgrades/upgrade-2.6.xml |  11 ++
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml |   7 +
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml |   7 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml |  11 ++
 .../stacks/HDP/2.4/upgrades/upgrade-2.6.xml |  11 ++
 .../upgrades/RangerKmsProxyConfigTest.java  | 141 +++
 10 files changed, 308 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d3c75557/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKmsProxyConfig.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKmsProxyConfig.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKmsProxyConfig.java
new file mode 100644
index 000..bb88f55
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerKmsProxyConfig.java
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.serveraction.upgrades;
+
+import java.text.MessageFormat;
+import java.util.Map;
+import java.util.concurrent.ConcurrentMap;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.actionmanager.HostRoleStatus;
+import org.apache.ambari.server.agent.CommandReport;
+import org.apache.ambari.server.serveraction.AbstractServerAction;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.ambari.server.state.SecurityType;
+import org.apache.commons.lang.StringUtils;
+
+import com.google.inject.Inject;
+
+/**
+* Computes Ranger KMS Proxy properties in kms-site
+*/
+
+public class RangerKmsProxyConfig extends AbstractServerAction {
+  private static final String RANGER_ENV_CONFIG_TYPE = "ranger-env";
+  private static final String RANGER_KMS_SITE_CONFIG_TYPE = "kms-site";
+
+  @Inject
+  private Clusters m_clusters;
+
+  @Override
+  public CommandReport execute(ConcurrentMap 
requestSharedDataContext)
+throws AmbariException, InterruptedException {
+
+String clusterName = getExecutionCommand().getClusterName();
+Cluster cluster = m_clusters.getCluster(clusterName);
+String outputMsg = "";
+
+Config rangerEnv = cluster.getDesiredConfigByType(RANGER_ENV_CONFIG_TYPE);
+
+if (null == rangerEnv) {
+  return createCommandReport(0, HostRoleStatus.COMPLETED, "{}",
+MessageFormat.format("Config source type {0} not found, skipping 
adding properties to {1}.", RANGER_ENV_CONFIG_TYPE, 
RANGER_KMS_SITE_CONFIG_TYPE), "");
+}
+
+String rangerUserProp = "ranger_user";
+String rangerUser = rangerEnv.getProperties().get(rangerUserProp);
+
+if (null == rangerUser) {
+  return createCommandReport(0, HostRoleStatus.COMPLETED, "{}",
+MessageFormat.format("Required user service user value from {0}/{1} 
not found, skipping adding properties to {2}.", RANGER_ENV_CONFIG_TYPE, 
rangerUserProp, RANGER_KMS_SITE_CONFIG_TYPE), "");
+}
+
+Config kmsSite = 

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

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


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 1632f9b5c6f7822c1fe59c4532250b47ae902513
Parents: ef41837
Author: Nate Cole 
Authored: Wed Nov 30 12:49:48 2016 -0500
Committer: Nate Cole 
Committed: Wed Nov 30 14:08:39 2016 -0500

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


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



[02/50] ambari git commit: AMBARI-18986. Deployment failure when command does not have role (smohanty)

2016-12-01 Thread swapan
AMBARI-18986. Deployment failure when command does not have role (smohanty)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 7afe172d20c88abe6b51110364c5200ae1e29618
Parents: 92823a7
Author: Sumit Mohanty 
Authored: Thu Nov 24 10:15:30 2016 -0800
Committer: Sumit Mohanty 
Committed: Thu Nov 24 10:15:30 2016 -0800

--
 .../main/python/ambari_agent/CustomServiceOrchestrator.py| 8 ++--
 .../python/ambari_agent/TestCustomServiceOrchestrator.py | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7afe172d/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index b814334..770484d 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -42,6 +42,7 @@ class CustomServiceOrchestrator():
   """
 
   SCRIPT_TYPE_PYTHON = "PYTHON"
+  COMMAND_TYPE = "commandType"
   COMMAND_NAME_STATUS = "STATUS"
   COMMAND_NAME_SECURITY_STATUS = "SECURITY_STATUS"
   CUSTOM_ACTION_COMMAND = 'ACTIONEXECUTE'
@@ -58,7 +59,6 @@ class CustomServiceOrchestrator():
   AMBARI_SERVER_HOST = "ambari_server_host"
   AMBARI_SERVER_PORT = "ambari_server_port"
   AMBARI_SERVER_USE_SSL = "ambari_server_use_ssl"
-  METRICS_GRAFANA = "METRICS_GRAFANA"
 
   FREQUENT_COMMANDS = [COMMAND_NAME_SECURITY_STATUS, COMMAND_NAME_STATUS]
   DONT_DEBUG_FAILURES_FOR_COMMANDS = FREQUENT_COMMANDS
@@ -154,7 +154,11 @@ class CustomServiceOrchestrator():
 self.file_cache.get_host_scripts_base_dir(server_url_prefix)  
 hook_dir = self.file_cache.get_hook_base_dir(command, 
server_url_prefix)
 base_dir = self.file_cache.get_service_base_dir(command, 
server_url_prefix)
-if command['role'] == self.METRICS_GRAFANA:
+from ActionQueue import ActionQueue  # To avoid cyclic dependency
+if self.COMMAND_TYPE in command and command[self.COMMAND_TYPE] == 
ActionQueue.EXECUTION_COMMAND:
+  logger.info("Found it - " + str(command[self.COMMAND_TYPE]) + " 
yeah")
+  # limiting to only EXECUTION_COMMANDs for now
+  # TODO need a design for limiting to specific role/component such as 
METRICS_GRAFANA
   self.file_cache.get_dashboard_base_dir(server_url_prefix)
 
 script_path = self.resolve_script_path(base_dir, script)

http://git-wip-us.apache.org/repos/asf/ambari/blob/7afe172d/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 
b/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
index d0d6ac4..2be6e1a 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
@@ -239,6 +239,7 @@ class TestCustomServiceOrchestrator(TestCase):
 
 FileCache_mock.return_value = None
 command = {
+  'commandType' : 'EXECUTION_COMMAND',
   'role' : 'REGION_SERVER',
   'hostLevelParams' : {
 'stack_name' : 'HDP',
@@ -277,8 +278,7 @@ class TestCustomServiceOrchestrator(TestCase):
 self.assertEqual(ret['exitcode'], 0)
 self.assertTrue(run_file_mock.called)
 self.assertEqual(run_file_mock.call_count, 3)
-# Should only be called for METRICS_GRAFANA
-self.assertFalse(get_dashboard_base_dir_mock.called)
+self.assertTrue(get_dashboard_base_dir_mock.called)
 
 run_file_mock.reset_mock()
 



[30/50] ambari git commit: Revert "AMBARI-18903. Implement Create Alerts: Create a base wizard for all steps.(xiwang)"

2016-12-01 Thread swapan
Revert "AMBARI-18903. Implement Create Alerts: Create a base wizard for all 
steps.(xiwang)"

This reverts commit 521995f4a9884ee62bd92f9f226b152f0155afc9.


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 40fde4a65a4d21477db53d402af422348f1821eb
Parents: be8354a
Author: Xi Wang 
Authored: Tue Nov 29 17:22:39 2016 -0800
Committer: Xi Wang 
Committed: Tue Nov 29 17:23:52 2016 -0800

--
 .../main/alerts/alert_definitions_actions_controller.js  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/40fde4a6/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
 
b/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
index ad239c6..f3f0387 100644
--- 
a/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
+++ 
b/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
@@ -27,12 +27,12 @@ App.MainAlertDefinitionActionsController = 
Em.ArrayController.extend({
* @type {{title: string, icon: string, action: string, showDivider: 
boolean}[]}
*/
   content: [
-{
+/*{
   title: Em.I18n.t('alerts.actions.create'),
   icon: 'icon-plus',
   action: 'createNewAlertDefinition',
   showDivider: true
-},
+},*/
 {
   title: Em.I18n.t('alerts.actions.manageGroups'),
   icon: 'icon-th-large',



[04/50] ambari git commit: AMBARI-18993. Perf: Status commands return INSTALLED even if component in STARTED state.(vbrodetskyi)

2016-12-01 Thread swapan
AMBARI-18993. Perf: Status commands return INSTALLED even if component in 
STARTED state.(vbrodetskyi)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 4e4a1f92b48b0de703acbb1028c29b62a99d4c02
Parents: 8278384
Author: Vitaly Brodetskyi 
Authored: Sun Nov 27 19:17:58 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Sun Nov 27 19:17:58 2016 +0200

--
 ambari-agent/conf/unix/agent-multiplier.py | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4e4a1f92/ambari-agent/conf/unix/agent-multiplier.py
--
diff --git a/ambari-agent/conf/unix/agent-multiplier.py 
b/ambari-agent/conf/unix/agent-multiplier.py
index dec79eb..7c0774c 100644
--- a/ambari-agent/conf/unix/agent-multiplier.py
+++ b/ambari-agent/conf/unix/agent-multiplier.py
@@ -59,10 +59,12 @@ class Multiplier:
 self.log_dir = "/var/log/ambari-agent"
 self.config_dir = "/etc/ambari-agent/conf"
 self.pid_file = "/var/run/ambari-agent/ambari-agent.pid"
+self.prefix_dir = "/var/lib/ambari-agent/data"
 
 # Ambari Agent config file to use as a template
 # Will change hostname and port after copying
 self.source_config_file = "/etc/ambari-agent/conf/ambari-agent.ini"
+self.source_version_file = "/var/lib/ambari-agent/data/version"
 self.base_ping_port = 5000
 
 self.start = 0
@@ -159,11 +161,12 @@ class Multiplier:
   host_config_dir = host_home_dir + self.config_dir
   host_pid_file = host_home_dir + self.pid_file
   host_pid_dir = os.path.dirname(host_pid_file)
+  host_prefix = host_home_dir + self.prefix_dir
 
   if self.verbose:
 print "Analyzing host %s with port %d" % (host_name, host.ping_port)
 
-  for dir in [host_home_dir, host_log_dir, host_config_dir, host_pid_dir]:
+  for dir in [host_home_dir, host_log_dir, host_config_dir, host_pid_dir, 
host_prefix]:
 if not os.path.isdir(dir):
   print "Creating dir %s" % (dir)
   os.makedirs(dir)
@@ -174,6 +177,12 @@ class Multiplier:
 print "Copying config file %s" % str(host_config_file)
 shutil.copyfile(self.source_config_file, host_config_file)
 
+  # Copy version file
+  version_file = os.path.join(host_prefix, "version")
+  if not os.path.isfile(version_file):
+print "Copying version file %s" % str(version_file)
+shutil.copyfile(self.source_version_file, version_file)
+
   # Create hostname.sh script to use custom FQDN for each agent.
   host_name_script = os.path.join(host_config_dir, "hostname.sh")
   self.create_host_name_script(host_name, host_name_script)
@@ -183,7 +192,8 @@ class Multiplier:
  "hostname_script": host_name_script,
  "public_hostname_script": host_name_script,
  "logdir": host_log_dir,
- "piddir": host_pid_dir}
+ "piddir": host_pid_dir,
+ "prefix": host_prefix}
   self.change_config(host_config_file, config_dict)
 
   # Change /etc/hosts file by appending each hostname.



[05/50] ambari git commit: AMBARI-18982. Failures due to timeout don't report any reason (aonishuk)

2016-12-01 Thread swapan
AMBARI-18982. Failures due to timeout don't report any reason (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 5bdcc418f404220f04c604413ebbf8ddd48470df
Parents: 4e4a1f9
Author: Andrew Onishuk 
Authored: Mon Nov 28 12:37:44 2016 +0200
Committer: Andrew Onishuk 
Committed: Mon Nov 28 12:37:44 2016 +0200

--
 .../main/python/ambari_agent/CustomServiceOrchestrator.py   | 9 +
 .../python/ambari_agent/TestCustomServiceOrchestrator.py| 4 ++--
 .../apache/ambari/server/actionmanager/ActionScheduler.java | 2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdcc418/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py 
b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
index 770484d..ebd3506 100644
--- a/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
+++ b/ambari-agent/src/main/python/ambari_agent/CustomServiceOrchestrator.py
@@ -223,7 +223,7 @@ class CustomServiceOrchestrator():
   # if canceled and not background command
   if handle is None:
 cancel_reason = self.command_canceled_reason(task_id)
-if cancel_reason:
+if cancel_reason is not None:
   ret['stdout'] += cancel_reason
   ret['stderr'] += cancel_reason
 
@@ -251,10 +251,11 @@ class CustomServiceOrchestrator():
 logger.debug('Pop with taskId %s' % task_id)
 pid = self.commands_in_progress.pop(task_id)
 if not isinstance(pid, int):
-  if pid:
-return '\nCommand aborted. ' + pid
+  reason = pid
+  if reason:
+return "\nCommand aborted. Reason: '{0}'".format(reason)
   else:
-return ''
+return "\nCommand aborted."
 return None
 
   def requestComponentStatus(self, command):

http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdcc418/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
--
diff --git 
a/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py 
b/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
index 2be6e1a..0304adc 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestCustomServiceOrchestrator.py
@@ -400,8 +400,8 @@ class TestCustomServiceOrchestrator(TestCase):
 ret = async_result.get()
 
 self.assertEqual(ret['exitcode'], 1)
-self.assertEquals(ret['stdout'], 'killed\nCommand aborted. reason')
-self.assertEquals(ret['stderr'], 'killed\nCommand aborted. reason')
+self.assertEquals(ret['stdout'], 'killed\nCommand aborted. Reason: 
\'reason\'')
+self.assertEquals(ret['stderr'], 'killed\nCommand aborted. Reason: 
\'reason\'')
 
 self.assertTrue(kill_process_with_children_mock.called)
 self.assertFalse(command['taskId'] in 
orchestrator.commands_in_progress.keys())

http://git-wip-us.apache.org/repos/asf/ambari/blob/5bdcc418/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
index 7a84536..e80b020 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
@@ -1246,7 +1246,7 @@ class ActionScheduler implements Runnable {
   hostRoleCommand.getStatus() == HostRoleStatus.IN_PROGRESS) {
   CancelCommand cancelCommand = new CancelCommand();
   cancelCommand.setTargetTaskId(hostRoleCommand.getTaskId());
-  cancelCommand.setReason("");
+  cancelCommand.setReason("Stage timeout");
   actionQueue.enqueue(hostRoleCommand.getHostName(), cancelCommand);
 }
   }



[33/50] ambari git commit: AMBARI-18997 ambari-server.pid might not be created on slow hardware (dsen)

2016-12-01 Thread swapan
AMBARI-18997 ambari-server.pid might not be created on slow hardware (dsen)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 67292971c4b87246bb9f1df96939e89073af6dbc
Parents: fbff7f7
Author: Dmytro Sen 
Authored: Wed Nov 30 14:04:51 2016 +0200
Committer: Dmytro Sen 
Committed: Wed Nov 30 14:04:51 2016 +0200

--
 .../src/main/python/ambari_server/utils.py  | 24 ---
 .../src/main/python/ambari_server_main.py   | 44 
 .../src/test/python/TestAmbariServer.py |  4 +-
 ambari-server/src/test/python/TestUtils.py  | 26 +---
 4 files changed, 36 insertions(+), 62 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/67292971/ambari-server/src/main/python/ambari_server/utils.py
--
diff --git a/ambari-server/src/main/python/ambari_server/utils.py 
b/ambari-server/src/main/python/ambari_server/utils.py
index f505444..62c93ae 100644
--- a/ambari-server/src/main/python/ambari_server/utils.py
+++ b/ambari-server/src/main/python/ambari_server/utils.py
@@ -117,19 +117,19 @@ def save_pid(pid, pidfile):
   pass
 
 
-def save_main_pid_ex(pids, pidfile, exclude_list=[], kill_exclude_list=False, 
skip_daemonize=False):
+def save_main_pid_ex(pids, pidfile, exclude_list=[], skip_daemonize=False):
   """
 Save pid which is not included to exclude_list to pidfile.
-If kill_exclude_list is set to true,  all processes in that
-list would be killed. It's might be useful to daemonize child process
 
 exclude_list contains list of full executable paths which should be 
excluded
   """
+  pid_saved = False
   try:
 pfile = open(pidfile, "w")
 for item in pids:
   if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
 pfile.write("%s\n" % item["pid"])
+pid_saved = True
 logger.info("Ambari server started with PID " + str(item["pid"]))
   if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not 
skip_daemonize:
 try:
@@ -145,23 +145,13 @@ def save_main_pid_ex(pids, pidfile, exclude_list=[], 
kill_exclude_list=False, sk
 except Exception as e:
   logger.error("Failed to close PID file " + pidfile + " due to " + str(e))
   pass
+  return pid_saved
 
-
-def wait_for_pid(pids, timeout):
+def get_live_pids_count(pids):
   """
-Check pid for existence during timeout
+Check pids for existence
   """
-  tstart = time.time()
-  pid_live = 0
-  while int(time.time()-tstart) <= timeout and len(pids) > 0:
-sys.stdout.write('.')
-sys.stdout.flush()
-pid_live = 0
-for item in pids:
-  if pid_exists(item["pid"]):
-pid_live += 1
-time.sleep(1)
-  return pid_live
+  return len([pid for pid in pids if pid_exists(pid)])
 
 
 def get_symlink_path(path_to_link):

http://git-wip-us.apache.org/repos/asf/ambari/blob/67292971/ambari-server/src/main/python/ambari_server_main.py
--
diff --git a/ambari-server/src/main/python/ambari_server_main.py 
b/ambari-server/src/main/python/ambari_server_main.py
index b35cfc9..572de4e 100644
--- a/ambari-server/src/main/python/ambari_server_main.py
+++ b/ambari-server/src/main/python/ambari_server_main.py
@@ -38,8 +38,8 @@ from ambari_server.serverUtils import refresh_stack_hash
 from ambari_server.setupHttps import get_fqdn
 from ambari_server.setupSecurity import generate_env, \
   ensure_can_start_under_current_user
-from ambari_server.utils import check_reverse_lookup, save_pid, locate_file, 
locate_all_file_paths, looking_for_pid, wait_for_pid, \
-  save_main_pid_ex, check_exitcode
+from ambari_server.utils import check_reverse_lookup, save_pid, locate_file, 
locate_all_file_paths, looking_for_pid, \
+  save_main_pid_ex, check_exitcode, get_live_pids_count
 from ambari_server.serverClassPath import ServerClassPath
 
 logger = logging.getLogger(__name__)
@@ -101,8 +101,8 @@ SERVER_START_CMD_DEBUG_WINDOWS = "{0} " \
 "-cp {3} " \
 "org.apache.ambari.server.controller.AmbariServer"
 
-SERVER_INIT_TIMEOUT = 5
-SERVER_START_TIMEOUT = 30
+SERVER_START_TIMEOUT = 5
+SERVER_START_RETRIES = 4
 
 SERVER_PING_TIMEOUT_WINDOWS = 5
 SERVER_PING_ATTEMPTS_WINDOWS = 4
@@ -114,6 +114,7 @@ EXITCODE_NAME = "ambari-server.exitcode"
 CHECK_DATABASE_SKIPPED_PROPERTY = "check_database_skipped"
 
 AMBARI_SERVER_DIE_MSG = "Ambari Server java process died with exitcode {0}. 
Check {1} for more information."
+AMBARI_SERVER_NOT_STARTED_MSG = "Ambari Server java 

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

2016-12-01 Thread swapan
AMBARI-18949 Extend current quick link JSON with properties

Change-Id: Ie994b82cea7abddcb6d4c32afc6b8597b608f025


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: eec985b1675d35f407913c66b405bfee95527931
Parents: 964c56e
Author: Balazs Bence Sari 
Authored: Wed Nov 30 16:23:40 2016 +0100
Committer: Miklos Gergely 
Committed: Wed Nov 30 16:23:40 2016 +0100

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


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

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

[26/50] ambari git commit: AMBARI-18792. Update some configuration properties for hive interactive for the HDP 2.6 stack (Siddharth Seth via smohanty)

2016-12-01 Thread swapan
AMBARI-18792. Update some configuration properties for hive interactive for the 
HDP 2.6 stack (Siddharth Seth via smohanty)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: f8bfa056574d1f8dc695615eea70fae74b156fc2
Parents: aba9640
Author: Sumit Mohanty 
Authored: Tue Nov 29 11:39:53 2016 -0800
Committer: Sumit Mohanty 
Committed: Tue Nov 29 11:39:53 2016 -0800

--
 .../server/upgrade/UpgradeCatalog250.java   | 53 -
 .../configuration/hive-interactive-site.xml | 58 +++
 .../HIVE/configuration/tez-interactive-site.xml | 78 
 3 files changed, 188 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f8bfa056/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index bc3c120..44ce895 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -23,6 +23,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.CommandExecutionType;
@@ -123,7 +124,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
*/
   @Override
   protected void executePreDMLUpdates() throws AmbariException, SQLException {
-
+updateHiveLlapConfigs();
   }
 
   /**
@@ -201,6 +202,56 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 return content;
   }
 
+  protected void updateHiveLlapConfigs() throws AmbariException {
+AmbariManagementController ambariManagementController = 
injector.getInstance(AmbariManagementController.class);
+Clusters clusters = ambariManagementController.getClusters();
+
+if (clusters != null) {
+  Map clusterMap = clusters.getClusters();
+
+  if (clusterMap != null && !clusterMap.isEmpty()) {
+for (final Cluster cluster : clusterMap.values()) {
+  Set installedServices = cluster.getServices().keySet();
+
+  if (installedServices.contains("HIVE")) {
+Config hiveSite = 
cluster.getDesiredConfigByType("hive-interactive-site");
+if (hiveSite != null) {
+  Map hiveSiteProperties = 
hiveSite.getProperties();
+  String schedulerDelay = 
hiveSiteProperties.get("hive.llap.task.scheduler.locality.delay");
+  if (schedulerDelay != null) {
+// Property exists. Change to new default if set to -1.
+if (schedulerDelay.length() != 0) {
+  try {
+int schedulerDelayInt = Integer.parseInt(schedulerDelay);
+if (schedulerDelayInt == -1) {
+  // Old default. Set to new default.
+  updateConfigurationProperties("hive-interactive-site", 
Collections
+  
.singletonMap("hive.llap.task.scheduler.locality.delay", "8000"), true,
+  false);
+}
+  } catch (NumberFormatException e) {
+// Invalid existing value. Set to new default.
+updateConfigurationProperties("hive-interactive-site", 
Collections
+
.singletonMap("hive.llap.task.scheduler.locality.delay", "8000"), true,
+false);
+  }
+}
+  }
+  updateConfigurationProperties("hive-interactive-site",
+  
Collections.singletonMap("hive.mapjoin.hybridgrace.hashtable", "true"), true,
+  false);
+  updateConfigurationProperties("tez-interactive-site",
+  
Collections.singletonMap("tez.session.am.dag.submit.timeout.secs", "1209600"), 
true,
+  false);
+  // Explicitly skipping hive.llap.allow.permanent.fns during 
upgrades, since it's related to security,
+  // and we don't know if the value is set by the user or as a 
result of the previous default.
+}
+  }
+}
+  }
+}
+  }
+
   /**
* Creates the 

[50/50] ambari git commit: Merge from branch-2.5

2016-12-01 Thread swapan
Merge from branch-2.5


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 333c70150963e9bee4388d03356443d9e35b5f7f
Parents: b749054 7f60b1f
Author: Swapan Shridhar 
Authored: Thu Dec 1 00:13:14 2016 -0800
Committer: Swapan Shridhar 
Committed: Thu Dec 1 00:13:14 2016 -0800

--
 .../views/stackVersions/stackVersionPage.html   |   2 +-
 ambari-agent/conf/unix/agent-multiplier.py  |  14 +-
 .../src/main/python/ambari_agent/ActionQueue.py |  10 +-
 .../ambari_agent/CustomServiceOrchestrator.py   |  21 +-
 .../TestCustomServiceOrchestrator.py|  25 +-
 .../libraries/script/script.py  |  15 +-
 .../logfeeder/metrics/LogFeederAMSClient.java   |   3 +-
 .../logfeeder/metrics/MetricsManager.java   |   2 +-
 .../org/apache/ambari/logsearch/LogSearch.java  |  15 +-
 .../logsearch/common/ExternalServerClient.java  |  12 +-
 .../logsearch/common/LogSearchConstants.java|   1 +
 .../AbstractOperationHolderConverter.java   |   9 +
 ...actServiceLogRequestFacetQueryConverter.java |  44 ++
 .../BaseServiceLogRequestQueryConverter.java|   1 +
 ...ServiceLogAnyGraphRequestQueryConverter.java |  13 +
 ...eLogComponentLevelRequestQueryConverter.java |  15 +-
 ...eLogComponentRequestFacetQueryConverter.java |  15 +-
 ...rviceLogLevelCountRequestQueryConverter.java |  16 +
 ...eLogLevelDateRangeRequestQueryConverter.java |  16 +-
 ...erviceLogTreeRequestFacetQueryConverter.java |  17 +-
 .../ambari/logsearch/doc/DocConstants.java  |   1 +
 .../logsearch/graph/GraphDataGenerator.java |  26 +-
 .../logsearch/manager/ServiceLogsManager.java   |   2 +-
 .../request/ServiceLogParamDefinition.java  |   6 +
 .../request/impl/BaseServiceLogRequest.java |  13 +
 .../LogsearchKRBAuthenticationFilter.java   |   4 +-
 .../src/main/resources/logsearch.properties |   2 +-
 .../dashboard/BubbleGraphTableLayoutView.js |   4 +-
 .../views/dashboard/ComponentListView.js|   2 +-
 .../scripts/views/dashboard/HostListView.js |  14 +-
 .../main/webapp/scripts/views/tabs/TreeView.js  |  10 +-
 .../webapp/templates/tabs/TreeView_tmpl.html| 115 ++--
 ...ComponentLevelRequestQueryConverterTest.java |   7 +-
 ...ComponentRequestFacetQueryConverterTest.java |   4 +-
 .../ambari-metrics/datasource.js|   6 +-
 .../conf/unix/ambari-metrics-grafana|  34 +-
 ambari-server/docs/configuration/index.md   |  25 +-
 ambari-server/pom.xml   |   2 +
 ambari-server/sbin/ambari-server|   6 +-
 .../server/actionmanager/ActionScheduler.java   |   2 +-
 .../ambari/server/agent/HeartBeatHandler.java   |   2 +-
 .../ambari/server/agent/HeartbeatProcessor.java |   2 +-
 .../ambari/server/checks/CheckDescription.java  |  13 +
 .../checks/DatabaseConsistencyCheckHelper.java  |  10 +-
 .../server/checks/ServicePresenceCheck.java | 172 ++
 .../server/configuration/Configuration.java |  30 +-
 .../internal/ClusterControllerImpl.java |   2 +-
 .../ServiceConfigVersionResourceProvider.java   |   3 +-
 .../logging/LoggingSearchPropertyProvider.java  |  11 +-
 .../ambari/server/events/AmbariEvent.java   |   5 +
 .../events/ClusterConfigFinishedEvent.java  |  53 ++
 .../ambari/server/orm/dao/ClusterDAO.java   |  24 +
 .../ambari/server/orm/dao/ServiceConfigDAO.java |  13 +-
 .../orm/entities/ClusterConfigEntity.java   |   7 +-
 .../entities/ClusterConfigMappingEntity.java|   6 +
 .../orm/entities/ServiceConfigEntity.java   |   5 +-
 .../server/orm/helpers/dbms/MySqlHelper.java|  18 +
 .../AmbariLdapAuthenticationProvider.java   |  23 +-
 .../AmbariLdapBindAuthenticator.java| 233 ++-
 .../kerberos/MITKerberosOperationHandler.java   |  22 +-
 .../upgrades/RangerKmsProxyConfig.java  |  95 +++
 .../server/state/cluster/ClusterImpl.java   |  42 +-
 .../ambari/server/state/quicklinks/Link.java|  21 +
 .../services/RetryUpgradeActionService.java |   2 +-
 .../ambari/server/topology/TopologyManager.java |  16 +-
 .../server/upgrade/SchemaUpgradeHelper.java |  35 +-
 .../server/upgrade/UpgradeCatalog250.java   |  66 +-
 .../ambari/server/utils/ShellCommandUtil.java   |  11 +-
 .../ambari/server/view/ViewExtractor.java   |   2 +-
 .../apache/ambari/server/view/ViewRegistry.java | 381 +++-
 ambari-server/src/main/python/ambari-server.py  | 149 -
 .../python/ambari_server/serverConfiguration.py |   9 +-
 .../main/python/ambari_server/serverUtils.py|  11 +
 .../main/python/ambari_server/setupActions.py   |   1 +
 

[22/50] ambari git commit: AMBARI-19009. Remove Spark History Server dependency Zeppelin (magyari_sandor)

2016-12-01 Thread swapan
AMBARI-19009. Remove Spark History Server dependency Zeppelin (magyari_sandor)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 04c6b12232179522ccbe7f70e1c69534e3651b5f
Parents: c295941
Author: Sandor Magyari 
Authored: Tue Nov 29 16:33:03 2016 +0100
Committer: Sandor Magyari 
Committed: Tue Nov 29 16:33:03 2016 +0100

--
 .../src/main/resources/stacks/HDP/2.5/role_command_order.json  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/04c6b122/ambari-server/src/main/resources/stacks/HDP/2.5/role_command_order.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/role_command_order.json 
b/ambari-server/src/main/resources/stacks/HDP/2.5/role_command_order.json
index 0e1319a..f9207f6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/role_command_order.json
@@ -3,7 +3,7 @@
   "_comment" : "blockedRole-blockedCommand: [blockerRole1-blockerCommand1, 
blockerRole2-blockerCommand2, ...]",
   "general_deps" : {
 "_comment" : "dependencies for all cases",
-"ZEPPELIN_MASTER-START" : ["NAMENODE-START", 
"SPARK_JOBHISTORYSERVER-START"],
+"ZEPPELIN_MASTER-START" : ["NAMENODE-START"],
 "ZEPPELIN_SERVICE_CHECK-SERVICE_CHECK" : ["ZEPPELIN_MASTER-START"],
 "HIVE_SERVER_INTERACTIVE-START": ["RESOURCEMANAGER-START", 
"NODEMANAGER-START", "MYSQL_SERVER-START"],
 "RESOURCEMANAGER-STOP": ["HIVE_SERVER_INTERACTIVE-STOP", 
"SPARK_THRIFTSERVER-STOP", "SPARK2_THRIFTSERVER-STOP"],



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

2016-12-01 Thread swapan
AMBARI-18951. Force InnoDB usage for MySQL. (mpapirkovskyy)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 98e41c677b2e22e694eda27ee6217d560ac4dbe2
Parents: 911b917
Author: Myroslav Papirkovskyi 
Authored: Mon Nov 28 18:25:07 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Mon Nov 28 18:44:23 2016 +0200

--
 .../server/orm/helpers/dbms/MySqlHelper.java| 18 ++
 .../server/upgrade/SchemaUpgradeHelper.java | 35 +++-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  1 +
 3 files changed, 53 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/98e41c67/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
index 38fe062..8a83c90 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/helpers/dbms/MySqlHelper.java
@@ -19,8 +19,13 @@
 package org.apache.ambari.server.orm.helpers.dbms;
 
 import org.apache.ambari.server.orm.DBAccessor;
+import org.eclipse.persistence.exceptions.ValidationException;
 import org.eclipse.persistence.platform.database.DatabasePlatform;
 
+import java.io.IOException;
+import java.io.Writer;
+import java.util.List;
+
 public class MySqlHelper extends GenericDbmsHelper {
   public MySqlHelper(DatabasePlatform databasePlatform) {
 super(databasePlatform);
@@ -75,4 +80,17 @@ public class MySqlHelper extends GenericDbmsHelper {
 .append("AND constraints.TABLE_NAME = 
\"").append(tableName).append("\"");
 return statement.toString();
   }
+
+  @Override
+  public Writer writeCreateTableStatement(Writer writer, String tableName,
+  List 
columns,
+  List primaryKeyColumns) {
+Writer defaultWriter = super.writeCreateTableStatement(writer, tableName, 
columns, primaryKeyColumns);
+try {
+  defaultWriter.write(" ENGINE=INNODB");
+} catch (IOException e) {
+  throw ValidationException.fileError(e);
+}
+return defaultWriter;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/98e41c67/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
index f772024..1b5503e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
@@ -45,6 +45,7 @@ import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.multibindings.Multibinder;
 import com.google.inject.persist.PersistService;
+import org.springframework.jdbc.support.JdbcUtils;
 
 public class SchemaUpgradeHelper {
   private static final Logger LOG = LoggerFactory.getLogger
@@ -330,7 +331,7 @@ public class SchemaUpgradeHelper {
   /**
* Checks if source version meets minimal requirements for upgrade
*
-   * @param minUpgradeVersion min allowed version for the upgrade, could be 
obtained via {@link SchemaUpgradeHelper.getMinimalUpgradeCatalogVersion}
+   * @param minUpgradeVersion min allowed version for the upgrade, could be 
obtained via {@link #getMinimalUpgradeCatalogVersion()}
* @param sourceVersion current version of the Database, which need to be 
upgraded
*
* @return  true if upgrade is allowed or false if not
@@ -343,6 +344,29 @@ public class SchemaUpgradeHelper {
 return VersionUtils.compareVersions(sourceVersion, minUpgradeVersion) >= 0;
   }
 
+  private List getMyISAMTables() throws SQLException {
+if 
(!configuration.getDatabaseType().equals(Configuration.DatabaseType.MYSQL)) {
+  return Collections.emptyList();
+}
+List myISAMTables = new ArrayList<>();
+String query = String.format("SELECT table_name FROM 
information_schema.tables WHERE table_schema = '%s' " +
+  "AND engine = 'MyISAM' AND table_type = 'BASE TABLE'", 

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

2016-12-01 Thread swapan
AMBARI-19027. Manage JournalNode tweaks (onechiporenko)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: adde3db032bf538ba4c872c931c46e28feef3fc1
Parents: 6729297
Author: Oleg Nechiporenko 
Authored: Wed Nov 30 13:19:43 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Wed Nov 30 14:28:12 2016 +0200

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


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

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

[27/50] ambari git commit: AMBARI-19003. Perf: Fix deploy-gce-perf-cluster.py to deploy separate server onto own cluster with different settings for more cores and MySQL DB (alejandro)

2016-12-01 Thread swapan
AMBARI-19003. Perf: Fix deploy-gce-perf-cluster.py to deploy separate server 
onto own cluster with different settings for more cores and MySQL DB (alejandro)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 052da577bcf5c3130337b7e783bda2b9c0207127
Parents: f8bfa05
Author: Alejandro Fernandez 
Authored: Tue Nov 29 12:43:58 2016 -0800
Committer: Alejandro Fernandez 
Committed: Tue Nov 29 12:43:58 2016 -0800

--
 contrib/utils/perf/deploy-gce-perf-cluster.py | 243 ++---
 1 file changed, 169 insertions(+), 74 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/052da577/contrib/utils/perf/deploy-gce-perf-cluster.py
--
diff --git a/contrib/utils/perf/deploy-gce-perf-cluster.py 
b/contrib/utils/perf/deploy-gce-perf-cluster.py
index 95ed98f..4737c6f 100644
--- a/contrib/utils/perf/deploy-gce-perf-cluster.py
+++ b/contrib/utils/perf/deploy-gce-perf-cluster.py
@@ -148,6 +148,7 @@ class SCP:
 
 return {"exitstatus": scpstat.returncode, "log": log, "errormsg": errorMsg}
 
+
 # main method to parse arguments from user and start work
 def main():
   parser = argparse.ArgumentParser(
@@ -178,6 +179,30 @@ def main():
   args = parser.parse_args()
   do_work(args)
 
+
+def do_work(args):
+  """
+  Check that all required args are passed in. If so, deploy the cluster.
+  :param args: Command line args
+  """
+  if not args.controller:
+raise Exception("GCE controller ip address is not defined!")
+
+  if not args.key:
+raise Exception("Path to gce ssh key is not defined!")
+
+  if not args.cluster_suffix:
+raise Exception("Cluster name suffix is not defined!")
+
+  if not args.agent_prefix:
+raise Exception("Agent name prefix is not defined!")
+
+  if not args.agents_count:
+raise Exception("Agents count for whole cluster is not defined (will put 
50 Agents per VM)!")
+
+  deploy_cluster(args)
+
+
 def deploy_cluster(args):
   """
   Process cluster deployment
@@ -186,49 +211,54 @@ def deploy_cluster(args):
   # When dividing, need to get the ceil.
   number_of_nodes = ((args.agents_count - 1) / NUMBER_OF_AGENTS_ON_HOST) + 1
 
-  # trying to create cluster with needed params
-  print "Creating cluster {0}-{1} with {2} large nodes on 
centos6...".format(cluster_prefix, args.cluster_suffix, str(number_of_nodes))
-  execute_command(args, args.controller, "/usr/sbin/gce up {0}-{1} {2} 
--centos6 --large".format(cluster_prefix, args.cluster_suffix, 
str(number_of_nodes)),
-  "Failed to create cluster, probably not enough resources!", 
"-tt")
-
-  # VMs are not accessible immediately
-  time.sleep(10)
+  # In case of an error after creating VMs, can simply comment out this 
function to run again without creating VMs.
+  create_vms(args, number_of_nodes)
 
   # getting list of vms information like hostname and ip address
   print "Getting list of virtual machines from cluster..."
   # Dictionary from host name to IP
-  vms = get_vms_list(args)
+  (server_dict, agents_dict) = get_vms_list(args)
 
   # check number of nodes in cluster to be the same as user asked
   print "Checking count of created nodes in cluster..."
-  if not vms or len(vms) < number_of_nodes:
-raise Exception("Cannot bring up enough nodes. Requested {0}, but got {1}. 
Probably not enough resources!".format(number_of_nodes, len(vms)))
+  if not agents_dict or len(agents_dict) < number_of_nodes:
+raise Exception("Cannot bring up enough nodes. Requested {0}, but got {1}. 
Probably not enough resources!".format(number_of_nodes, len(agents_dict)))
 
-  print "GCE cluster was successfully created!"
-  pretty_print_vms(vms)
+  print "GCE cluster was successfully created!\n"
 
   # installing/starting ambari-server and ambari-agents on each host
-  server_host_name = sorted(vms.items())[0][0]
-  server_installed = False
+  server_item = server_dict.items()[0]
+  server_host_name = server_item[0]
+  server_ip = server_item[1]
+  print "=="
+  print "Server Hostname: %s" % server_host_name
+  print "Server IP: %s" % server_ip
+  print "==\n"
+
+  # Sort the agents by hostname into a list.
+  sorted_agents = sort_hosts(agents_dict)
+  pretty_print_vms(sorted_agents)
 
-  print "Creating server.sh script (which will be executed on server to 
install/configure/start ambari-server and ambari-agent)..."
-  create_server_script(args, server_host_name)
+  print "Creating server.sh script (which will be executed on server to 

[06/50] ambari git commit: AMBARI-18995. HBASE service check fails if run with tty=true (aonishuk)

2016-12-01 Thread swapan
AMBARI-18995. HBASE service check fails if run with tty=true (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: e62bf6ec8d1fee99c562a0d9b4d9ea34525cfaae
Parents: 5bdcc41
Author: Andrew Onishuk 
Authored: Mon Nov 28 17:01:36 2016 +0200
Committer: Andrew Onishuk 
Committed: Mon Nov 28 17:01:36 2016 +0200

--
 .../HBASE/0.96.0.2.0/package/files/hbaseSmokeVerify.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e62bf6ec/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbaseSmokeVerify.sh
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbaseSmokeVerify.sh
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbaseSmokeVerify.sh
index 5c320c0..8b085e8 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbaseSmokeVerify.sh
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/files/hbaseSmokeVerify.sh
@@ -25,7 +25,7 @@ hbase_cmd=$3
 echo "scan 'ambarismoketest'" | $hbase_cmd --config $conf_dir shell > 
/tmp/hbase_chk_verify
 cat /tmp/hbase_chk_verify
 echo "Looking for $data"
-grep -q $data /tmp/hbase_chk_verify
+tr -d '\n|\t| ' < /tmp/hbase_chk_verify | grep -q $data
 if [ "$?" -ne 0 ]
 then
   exit 1



[10/50] ambari git commit: Revert "AMBARI-18976. Config History request execution time depends on config versions count. (mpapirkovskyy)"

2016-12-01 Thread swapan
Revert "AMBARI-18976. Config History request execution time depends on config 
versions count. (mpapirkovskyy)"

This reverts commit ce4d4fa768375aac631703dbfceac44fd8faa151.


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 568d1e656b1f1c651e594a54f3b3744f62984653
Parents: 1df9b46
Author: Myroslav Papirkovskyi 
Authored: Mon Nov 28 18:41:20 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Mon Nov 28 18:41:20 2016 +0200

--
 .../server/state/cluster/ClusterImpl.java   | 42 +++-
 1 file changed, 32 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/568d1e65/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 7bf24ce..8b157c7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -2534,10 +2534,12 @@ public class ClusterImpl implements Cluster {
 if (serviceConfigEntity.getGroupId() == null) {
   Collection configTypes = serviceConfigTypes.get(serviceName);
   List mappingEntities =
-  clusterDAO.getSelectedConfigMappingByTypes(getClusterId(), new 
ArrayList<>(configTypes));
+  clusterDAO.getClusterConfigMappingEntitiesByCluster(getClusterId());
   for (ClusterConfigMappingEntity entity : mappingEntities) {
-entity.setSelected(0);
-clusterDAO.mergeConfigMapping(entity);
+if (configTypes.contains(entity.getType()) && entity.isSelected() > 0) 
{
+  entity.setSelected(0);
+  entity = clusterDAO.mergeConfigMapping(entity);
+}
   }
 
   for (ClusterConfigEntity configEntity : 
serviceConfigEntity.getClusterConfigEntities()) {
@@ -2597,12 +2599,14 @@ public class ClusterImpl implements Cluster {
   @Transactional
   void selectConfig(String type, String tag, String user) {
 Collection entities =
-  clusterDAO.getLatestClusterConfigMappingsEntityByType(getClusterId(), 
type);
+clusterDAO.getClusterConfigMappingEntitiesByCluster(getClusterId());
 
 //disable previous config
 for (ClusterConfigMappingEntity e : entities) {
-  e.setSelected(0);
-  clusterDAO.mergeConfigMapping(e);
+  if (e.isSelected() > 0 && e.getType().equals(type)) {
+e.setSelected(0);
+e = clusterDAO.mergeConfigMapping(e);
+  }
 }
 
 ClusterEntity clusterEntity = getClusterEntity();
@@ -2668,15 +2672,32 @@ public class ClusterImpl implements Cluster {
   }
 
   private List getClusterConfigEntitiesByService(String 
serviceName) {
+List configEntities = new 
ArrayList();
+
+//add configs from this service
 Collection configTypes = serviceConfigTypes.get(serviceName);
-return clusterDAO.getLatestClusterConfigsByTypes(getClusterId(), new 
ArrayList<>(configTypes));
+for (ClusterConfigMappingEntity mappingEntity : 
clusterDAO.getClusterConfigMappingEntitiesByCluster(getClusterId())) {
+  if (mappingEntity.isSelected() > 0 && 
configTypes.contains(mappingEntity.getType())) {
+ClusterConfigEntity configEntity =
+  clusterDAO.findConfig(getClusterId(), mappingEntity.getType(), 
mappingEntity.getTag());
+if (configEntity != null) {
+  configEntities.add(configEntity);
+} else {
+  LOG.error("Desired cluster config type={}, tag={} is not present in 
database," +
+" unable to add to service config version");
+}
+  }
+}
+return configEntities;
   }
 
   @Override
   public Config getDesiredConfigByType(String configType) {
-List entities = 
clusterDAO.getLatestClusterConfigMappingsEntityByType(getClusterId(), 
configType);
-if (!entities.isEmpty()) {
-  return getConfig(configType, entities.get(0).getTag());
+for (ClusterConfigMappingEntity e : 
clusterDAO.getClusterConfigMappingEntitiesByCluster(
+getClusterId())) {
+  if (e.isSelected() > 0 && e.getType().equals(configType)) {
+return getConfig(e.getType(), e.getTag());
+  }
 }
 
 return null;
@@ -3433,4 +3454,5 @@ public class ClusterImpl implements Cluster {
 
 m_clusterPropertyCache.clear();
   }
+
 }



[11/50] ambari git commit: AMBARI-18976. Config History request execution time depends on config versions count. (mpapirkovskyy)

2016-12-01 Thread swapan
AMBARI-18976. Config History request execution time depends on config versions 
count. (mpapirkovskyy)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 911b917783d66a44958e791e49d76b755d943f85
Parents: 568d1e6
Author: Myroslav Papirkovskyi 
Authored: Wed Nov 23 19:03:14 2016 +0200
Committer: Myroslav Papirkovskyi 
Committed: Mon Nov 28 18:42:05 2016 +0200

--
 .../internal/ClusterControllerImpl.java |  2 +-
 .../ServiceConfigVersionResourceProvider.java   |  3 +-
 .../logging/LoggingSearchPropertyProvider.java  | 11 -
 .../ambari/server/orm/dao/ClusterDAO.java   | 24 +++
 .../ambari/server/orm/dao/ServiceConfigDAO.java | 13 +++---
 .../orm/entities/ClusterConfigEntity.java   |  7 +++-
 .../entities/ClusterConfigMappingEntity.java|  6 +++
 .../orm/entities/ServiceConfigEntity.java   |  5 ++-
 .../server/state/cluster/ClusterImpl.java   | 42 +---
 9 files changed, 67 insertions(+), 46 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/911b9177/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
index 32bed7b..c752e80 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java
@@ -858,7 +858,7 @@ public class ClusterControllerImpl implements 
ClusterController {
   if (compVal == 0) {
 Schema schema = getSchema(resourceType);
 
-for (Type type : Type.values()) {
+for (Type type : schema.getKeyTypes()) {
   String keyPropertyId = schema.getKeyPropertyId(type);
   if (keyPropertyId != null) {
 compVal = compareValues(resource1.getPropertyValue(keyPropertyId),

http://git-wip-us.apache.org/repos/asf/ambari/blob/911b9177/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
index 2edbe9b..e5ca389 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceConfigVersionResourceProvider.java
@@ -91,8 +91,9 @@ public class ServiceConfigVersionResourceProvider extends
 PROPERTY_IDS.add(SERVICE_CONFIG_VERSION_IS_COMPATIBLE_PROPERTY_ID);
 
 // keys
-
KEY_PROPERTY_IDS.put(Resource.Type.ServiceConfigVersion,SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
+
KEY_PROPERTY_IDS.put(Resource.Type.Service,SERVICE_CONFIG_VERSION_SERVICE_NAME_PROPERTY_ID);
 
KEY_PROPERTY_IDS.put(Resource.Type.Cluster,SERVICE_CONFIG_VERSION_CLUSTER_NAME_PROPERTY_ID);
+
KEY_PROPERTY_IDS.put(Resource.Type.ServiceConfigVersion,SERVICE_CONFIG_VERSION_PROPERTY_ID);
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/911b9177/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
index d9db290..16788ed 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
@@ -39,8 +39,10 @@ import org.apache.log4j.Logger;
 
 import java.util.Collections;
 import java.util.EnumSet;
+import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -73,7 +75,7 @@ public class 

[19/50] ambari git commit: AMBARI-18989. Log level filter labels not getting updated with host name filter (oleewere)

2016-12-01 Thread swapan
AMBARI-18989. Log level filter labels not getting updated with host name filter
 (oleewere)

Change-Id: I8f86056048f85f6a5de5763c59d68a9b023e5abb


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 2591ba11300a25264b5796868c3de2d448bfb380
Parents: 616e97e
Author: oleewere 
Authored: Fri Nov 25 16:30:37 2016 +0100
Committer: oleewere 
Committed: Tue Nov 29 15:15:41 2016 +0100

--
 .../org/apache/ambari/logsearch/LogSearch.java  |  15 +--
 .../logsearch/common/LogSearchConstants.java|   1 +
 .../AbstractOperationHolderConverter.java   |   9 ++
 ...actServiceLogRequestFacetQueryConverter.java |  44 +++
 .../BaseServiceLogRequestQueryConverter.java|   1 +
 ...ServiceLogAnyGraphRequestQueryConverter.java |  13 +++
 ...eLogComponentLevelRequestQueryConverter.java |  15 +--
 ...eLogComponentRequestFacetQueryConverter.java |  15 +--
 ...rviceLogLevelCountRequestQueryConverter.java |  16 +++
 ...eLogLevelDateRangeRequestQueryConverter.java |  16 ++-
 ...erviceLogTreeRequestFacetQueryConverter.java |  17 +--
 .../ambari/logsearch/doc/DocConstants.java  |   1 +
 .../logsearch/graph/GraphDataGenerator.java |  26 +++--
 .../logsearch/manager/ServiceLogsManager.java   |   2 +-
 .../request/ServiceLogParamDefinition.java  |   6 +
 .../request/impl/BaseServiceLogRequest.java |  13 +++
 .../dashboard/BubbleGraphTableLayoutView.js |   4 +-
 .../views/dashboard/ComponentListView.js|   2 +-
 .../scripts/views/dashboard/HostListView.js |  14 +--
 .../main/webapp/scripts/views/tabs/TreeView.js  |  10 +-
 .../webapp/templates/tabs/TreeView_tmpl.html| 115 ++-
 ...ComponentLevelRequestQueryConverterTest.java |   7 +-
 ...ComponentRequestFacetQueryConverterTest.java |   4 +-
 23 files changed, 202 insertions(+), 164 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2591ba11/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
--
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
index d4be790..2c3f4f5 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
@@ -63,12 +63,12 @@ public class LogSearch {
   private static final String HTTP_PROTOCOL = "http";
   private static final String HTTPS_PORT = "61889";
   private static final String HTTP_PORT = "61888";
-  
+
   private static final String WEB_RESOURCE_FOLDER = "webapps/app";
   private static final String ROOT_CONTEXT = "/";
   private static final Integer SESSION_TIMEOUT = 30;
 
- 
+
   public static void main(String[] argv) {
 LogSearch logSearch = new LogSearch();
 ManageStartEndTime.manage();
@@ -78,7 +78,7 @@ public class LogSearch {
   logger.error("Error running logsearch server", e);
 }
   }
-  
+
   public void run(String[] argv) throws Exception {
 Server server = buildSever(argv);
 HandlerList handlers = new HandlerList();
@@ -98,9 +98,10 @@ public class LogSearch {
 
   public Server buildSever(String argv[]) {
 Server server = new Server();
-ServerConnector connector = new ServerConnector(server);
 boolean portSpecified = argv.length > 0;
 String protcolProperty = 
PropertiesHelper.getProperty(LOGSEARCH_PROTOCOL_PROP,HTTP_PROTOCOL);
+HttpConfiguration httpConfiguration = new HttpConfiguration();
+httpConfiguration.setRequestHeaderSize(65535);
 if (StringUtils.isEmpty(protcolProperty)) {
   protcolProperty = HTTP_PROTOCOL;
 }
@@ -109,18 +110,18 @@ public class LogSearch {
   logger.info("Building https server...");
   port = portSpecified ? argv[0] : HTTPS_PORT;
   checkPort(Integer.parseInt(port));
-  HttpConfiguration https = new HttpConfiguration();
-  https.addCustomizer(new SecureRequestCustomizer());
+  httpConfiguration.addCustomizer(new SecureRequestCustomizer());
   SslContextFactory sslContextFactory = SSLUtil.getSslContextFactory();
   ServerConnector sslConnector = new ServerConnector(server,
   new SslConnectionFactory(sslContextFactory, "http/1.1"),
-  new HttpConnectionFactory(https));
+  new HttpConnectionFactory(httpConfiguration));
   

[40/50] ambari git commit: AMBARI-12697 Rolling upgrade: Ambari UI should be able to display rolling upgrade history (dili via atkach)

2016-12-01 Thread swapan
AMBARI-12697 Rolling upgrade: Ambari UI should be able to display rolling 
upgrade history (dili via atkach)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: ef41837712fee03772aca344b2edc337396974a0
Parents: 502cffb
Author: Andrii Tkach 
Authored: Wed Nov 30 20:32:16 2016 +0200
Committer: Andrii Tkach 
Committed: Wed Nov 30 20:32:16 2016 +0200

--
 ambari-web/app/assets/test/tests.js |   5 +
 ambari-web/app/controllers.js   |   1 +
 .../admin/stack_upgrade_history_controller.js   | 217 +++
 ambari-web/app/mappers.js   |   3 +-
 .../app/mappers/stack_upgrade_history_mapper.js |  54 +++
 ambari-web/app/messages.js  |  28 ++
 ambari-web/app/models.js|   2 +
 .../app/models/finished_upgrade_entity.js   |  92 +
 .../stack_version/stack_upgrade_history.js  |  37 ++
 ambari-web/app/routes/main.js   |   7 +
 ambari-web/app/styles/stack_versions.less   |  69 
 .../admin/stack_upgrade/upgrade_history.hbs | 105 ++
 .../stack_upgrade/upgrade_history_details.hbs   |  46 +++
 ambari-web/app/views.js |   2 +
 .../views/main/admin/stack_upgrade/menu_view.js |   6 +
 .../upgrade_history_details_view.js |  85 +
 .../admin/stack_upgrade/upgrade_history_view.js | 303 +++
 .../stack_upgrade_history_controller_test.js| 125 +++
 .../stack_upgrade_history_mapper_test.js| 372 +++
 .../test/models/finished_upgrade_entity_test.js | 197 ++
 .../upgrade_history_details_view_test.js| 248 +
 .../stack_upgrade/upgrade_history_view_test.js  | 173 +
 22 files changed, 2176 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef418377/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 8571fc4..7440819 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -70,6 +70,7 @@ var files = [
   'test/controllers/main/admin/kerberos/step8_controller_test',
 
   'test/controllers/main/admin/stack_and_upgrade_controller_test',
+  'test/controllers/main/admin/stack_upgrade_history_controller_test',
   'test/controllers/main/admin/serviceAccounts_controller_test',
   'test/controllers/main/admin/highAvailability_controller_test',
   'test/controllers/main/admin/highAvailability/progress_controller_test',
@@ -145,6 +146,7 @@ var files = [
   'test/mappers/users_mapper_test',
   'test/mappers/stack_mapper_test',
   'test/mappers/stack_service_mapper_test',
+  'test/mappers/stack_upgrade_history_mapper_test',
   'test/mappers/repository_version_mapper_test',
   'test/mappers/configs/config_groups_mapper_test',
   'test/mappers/configs/service_config_version_mapper_test',
@@ -251,6 +253,8 @@ var files = [
   'test/views/main/admin/stack_upgrade/upgrade_group_view_test',
   'test/views/main/admin/stack_upgrade/upgrade_task_view_test',
   'test/views/main/admin/stack_upgrade/upgrade_wizard_view_test',
+  'test/views/main/admin/stack_upgrade/upgrade_history_view_test',
+  'test/views/main/admin/stack_upgrade/upgrade_history_details_view_test',
   'test/views/main/admin/stack_upgrade/version_view_test',
   'test/views/main/admin/stack_upgrade/services_view_test',
   'test/views/main/admin/stack_upgrade/menu_view_test',
@@ -384,6 +388,7 @@ var files = [
   'test/models/widget_property_test',
   'test/models/host_stack_version_test',
   'test/models/upgrade_entity_test',
+  'test/models/finished_upgrade_entity_test',
   'test/models/configs/sub_section_test',
   'test/models/configs/section_test',
   'test/models/configs/service_config_version_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef418377/ambari-web/app/controllers.js
--
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 5664029..81e5eb7 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -85,6 +85,7 @@ 
require('controllers/main/admin/highAvailability/journalNode/step6_controller');
 
require('controllers/main/admin/highAvailability/journalNode/step7_controller');
 
require('controllers/main/admin/highAvailability/journalNode/step8_controller');
 require('controllers/main/admin/stack_and_upgrade_controller');

  1   2   >