ambari git commit: AMBARI-22489. Port AMBARI-22467 to BigInsight (aonishuk)

2017-11-22 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22457 c7457a820 -> aea1a3c48


AMBARI-22489. Port AMBARI-22467 to BigInsight (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: aea1a3c48fdf58be5fad04d7b983c65d28a248f9
Parents: c7457a8
Author: Andrew Onishuk 
Authored: Wed Nov 22 12:32:04 2017 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 22 12:32:04 2017 +0200

--
 .../BigInsights/4.0/services/HDFS/metainfo.xml  | 17 
 .../BigInsights/4.2/services/HDFS/metainfo.xml  | 20 --
 .../4.2/services/HDFS/package/scripts/hdfs.py   |  5 ++--
 .../4.2/services/HIVE/package/scripts/hive.py   |  3 +++
 .../4.2/services/OOZIE/package/scripts/oozie.py | 12 +
 .../services/OOZIE/package/scripts/params.py| 28 ++--
 .../4.2/services/YARN/package/scripts/yarn.py   |  3 +++
 7 files changed, 17 insertions(+), 71 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/aea1a3c4/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/metainfo.xml
index 918cdb3..82c82d0 100755
--- 
a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/metainfo.xml
@@ -152,10 +152,6 @@
 
   hadoop
 
-
-  hadoop-lzo
-  should_install_lzo
-
   
 
 
@@ -165,15 +161,6 @@
 
   snappy
 
-
-  lzo
-  should_install_lzo
-
-
-  hadoop-lzo-native
-  should_install_lzo
-
-
   hadoop-libhdfs
 
 
@@ -192,10 +179,6 @@
   libsnappy-dev
 
 
-  liblzo2-2
-  should_install_lzo
-
-
   hadoop-hdfs
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/aea1a3c4/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/metainfo.xml
index 72ce2be..4253eb1 100755
--- 
a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/metainfo.xml
@@ -182,11 +182,6 @@
 
   hadoop_4_2_*
 
-
-  hadoop-lzo
-  true
-  should_install_lzo
-
   
 
 
@@ -196,16 +191,6 @@
   snappy
 
 
-  lzo
-  true
-  should_install_lzo
-
-
-  hadoop-lzo-native
-  true
-  should_install_lzo
-
-
   hadoop_4_2_*-libhdfs
 
 
@@ -229,11 +214,6 @@
   libsnappy-dev
 
 
-  liblzo2-2
-  true
-  should_install_lzo
-
-
   hadoop-hdfs
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/aea1a3c4/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/package/scripts/hdfs.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/package/scripts/hdfs.py
 
b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/package/scripts/hdfs.py
index 2b158bd..9334de0 100755
--- 
a/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/package/scripts/hdfs.py
+++ 
b/ambari-server/src/main/resources/stacks/BigInsights/4.2/services/HDFS/package/scripts/hdfs.py
@@ -20,10 +20,10 @@ Ambari Agent
 """
 
 from resource_management import *
+from resource_management.libraries.functions.lzo_utils import 
install_lzo_if_needed
 import sys
 import os
 
-
 def hdfs(name=None):
   

[5/7] ambari git commit: AMBARI-22488 RU: Restarting HiveServer2 on RU failed (dgrinenko)

2017-11-22 Thread aonishuk
AMBARI-22488 RU: Restarting HiveServer2 on RU failed (dgrinenko)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: a49be4af86484a55816cf8bf3aba06d24e176335
Parents: eecd851
Author: Dmytro Grinenko 
Authored: Tue Nov 21 16:59:17 2017 +0200
Committer: Dmytro Grinenko 
Committed: Tue Nov 21 16:59:17 2017 +0200

--
 .../libraries/functions/copy_tarball.py | 60 ++--
 1 file changed, 29 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a49be4af/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
index b05c97c..d1c295d 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
@@ -190,6 +190,7 @@ def get_sysprep_skip_copy_tarballs_hdfs():
 sysprep_skip_copy_tarballs_hdfs = 
default("/configurations/cluster-env/sysprep_skip_copy_tarballs_hdfs", False)
   return sysprep_skip_copy_tarballs_hdfs
 
+
 def get_tarball_paths(name, use_upgrading_version_during_upgrade=True, 
custom_source_file=None, custom_dest_file=None):
   """
   For a given tarball name, get the source and destination paths to use.
@@ -197,50 +198,47 @@ def get_tarball_paths(name, 
use_upgrading_version_during_upgrade=True, custom_so
   :param use_upgrading_version_during_upgrade:
   :param custom_source_file: If specified, use this source path instead of the 
default one from the map.
   :param custom_dest_file: If specified, use this destination path instead of 
the default one from the map.
-  :return: A tuple of (success status, source path, destination path, optional 
preparation function which is invoked to setup the tarball)
+  :return: A tuple of success status, source path, destination path, optional 
preparation function which is invoked to setup the tarball
   """
   stack_name = Script.get_stack_name()
 
-  if not stack_name:
-Logger.error("Cannot copy {0} tarball to HDFS because stack name could not 
be determined.".format(str(name)))
-return False, None, None
+  try:
+if not stack_name:
+  raise ValueError("Cannot copy {0} tarball to HDFS because stack name 
could not be determined.".format(str(name)))
 
-  if name is None or name.lower() not in TARBALL_MAP:
-Logger.error("Cannot copy tarball to HDFS because {0} is not supported in 
stack {1} for this operation.".format(str(name), str(stack_name)))
-return False, None, None
+if name is None or name.lower() not in TARBALL_MAP:
+  raise ValueError("Cannot copy tarball to HDFS because {0} is not 
supported in stack {1} for this operation.".format(str(name), str(stack_name)))
 
-  service = TARBALL_MAP[name.lower()]['service']
+service = TARBALL_MAP[name.lower()]
+service_name = service['service']
+stack_version = get_current_version(service=service_name, 
use_upgrading_version_during_upgrade=use_upgrading_version_during_upgrade)
+stack_root = Script.get_stack_root()
 
-  stack_version = get_current_version(service=service, 
use_upgrading_version_during_upgrade=use_upgrading_version_during_upgrade)
-  if not stack_version:
-Logger.error("Cannot copy {0} tarball to HDFS because stack version could 
be be determined.".format(str(name)))
-return False, None, None
+if not stack_version or not stack_root:
+  raise ValueError("Cannot copy {0} tarball to HDFS because stack version 
could be be determined.".format(str(name)))
 
-  stack_root = Script.get_stack_root()
-  if not stack_root:
-Logger.error("Cannot copy {0} tarball to HDFS because stack root could be 
be determined.".format(str(name)))
-return False, None, None
+source_file, dest_file = service['dirs']
 
-  (source_file, dest_file) = TARBALL_MAP[name.lower()]['dirs']
+if custom_source_file is not None:
+  source_file = custom_source_file
 
-  if custom_source_file is not None:
-source_file = custom_source_file
+if custom_dest_file is not None:
+  dest_file = custom_dest_file
 
-  if custom_dest_file is not None:
-dest_file = custom_dest_file
+source_file = source_file.replace(STACK_NAME_PATTERN, stack_name.lower())
+dest_file = dest_file.replace(STACK_NAME_PATTERN, stack_name.lower())
 
-  source_file 

[2/7] ambari git commit: AMBARI-22136 Enable server_action tasks defined in EU/RU upgrade pack xml files to take parameters (push to branch-2.6) (dili)

2017-11-22 Thread aonishuk
AMBARI-22136 Enable server_action tasks defined in EU/RU upgrade pack xml files 
to take parameters (push to branch-2.6) (dili)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: fb65aab92ea3024728b2e100b0a90a8f6bbf13d9
Parents: a1d59b7
Author: Di Li 
Authored: Fri Nov 17 15:43:02 2017 -0500
Committer: Di Li 
Committed: Fri Nov 17 15:43:02 2017 -0500

--
 .../ambari/server/actionmanager/Stage.java  |  3 +-
 .../internal/UpgradeResourceProvider.java   |  2 +
 .../stack/upgrade/ServerSideActionTask.java | 15 +++
 .../state/stack/upgrade/TaskParameter.java  | 41 
 .../src/main/resources/upgrade-pack.xsd |  9 +
 5 files changed, 69 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fb65aab9/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
index 1d6ceaf..0563bfd 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Stage.java
@@ -443,7 +443,8 @@ public class Stage {
* @param retryAllowed
*  indicates whether retry after failure is allowed
*/
-  public synchronized void addServerActionCommand(String actionName, @Nullable 
String userName,
+  public synchronized void addServerActionCommand(String actionName,
+  @Nullable String userName,
   Role role, RoleCommand command, String clusterName,
   ServiceComponentHostServerActionEvent event, @Nullable Map commandParams,
   @Nullable String commandDetail, @Nullable Map> configTags,

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb65aab9/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index b6846f7..ff326aa 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -1409,6 +1409,8 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 stage.setStageId(stageId);
 entity.setStageId(Long.valueOf(stageId));
 
+Map taskParameters = task.getParameters();
+commandParams.putAll(taskParameters);
 stage.addServerActionCommand(task.getImplementationClass(),
 getManagementController().getAuthName(), Role.AMBARI_SERVER_ACTION, 
RoleCommand.EXECUTE,
 cluster.getClusterName(),

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb65aab9/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServerSideActionTask.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServerSideActionTask.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServerSideActionTask.java
index 045c9ac..ee16bf7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServerSideActionTask.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ServerSideActionTask.java
@@ -18,7 +18,9 @@
 package org.apache.ambari.server.state.stack.upgrade;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
@@ -31,6 +33,19 @@ public abstract class ServerSideActionTask extends Task {
   @XmlAttribute(name="class")
   protected String implClass;
 
+  @XmlElement(name = "parameter")
+  public List parameters;
+
+  public Map getParameters(){
+Map result = new HashMap();
+if (parameters != null) {
+  for (TaskParameter parameter : parameters) {
+result.put(parameter.name, parameter.value);
+  }
+}
+return result;
+  }
+
   public 

[1/7] ambari git commit: AMBARI-22468 : enabling hdfs and hive ranger plugin fails (mradhakrishnan)

2017-11-22 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22457 58c7f784a -> c7457a820


AMBARI-22468 : enabling hdfs and hive ranger plugin fails (mradhakrishnan)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: a1d59b7dde13b8e3cad5a1e1687911ca4afc340b
Parents: c09c69b
Author: Madhuvanthi Radhakrishnan 
Authored: Fri Nov 17 12:39:07 2017 -0800
Committer: Madhuvanthi Radhakrishnan 
Committed: Fri Nov 17 12:40:21 2017 -0800

--
 .../resources/stacks/HDP/2.6/services/stack_advisor.py   | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a1d59b7d/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
index a16fdb7..a5f54a3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
@@ -66,11 +66,12 @@ class HDP26StackAdvisor(HDP25StackAdvisor):
 if storm_env and storm_site and security_enabled and 'STREAMLINE' in 
servicesList:
   storm_nimbus_impersonation_acl = storm_site["nimbus.impersonation.acl"] 
if "nimbus.impersonation.acl" in storm_site else None
   streamline_env = self.getServicesSiteProperties(services, 
"streamline-env")
-  _streamline_principal_name = streamline_env['streamline_principal_name'] 
if 'streamline_principal_name' in streamline_env else None
-  if _streamline_principal_name is not None and 
storm_nimbus_impersonation_acl is not None:
-streamline_bare_principal = 
get_bare_principal(_streamline_principal_name)
-
storm_nimbus_impersonation_acl.replace('{{streamline_bare_principal}}', 
streamline_bare_principal)
-putStormSiteProperty('nimbus.impersonation.acl', 
storm_nimbus_impersonation_acl)
+  if streamline_env:
+_streamline_principal_name = 
streamline_env['streamline_principal_name'] if 'streamline_principal_name' in 
streamline_env else None
+if _streamline_principal_name is not None and 
storm_nimbus_impersonation_acl is not None:
+  streamline_bare_principal = 
get_bare_principal(_streamline_principal_name)
+  
storm_nimbus_impersonation_acl.replace('{{streamline_bare_principal}}', 
streamline_bare_principal)
+  putStormSiteProperty('nimbus.impersonation.acl', 
storm_nimbus_impersonation_acl)
   
   storm_nimbus_autocred_plugin_classes = 
storm_site["nimbus.autocredential.plugins.classes"] if 
"nimbus.autocredential.plugins.classes" in storm_site else None
   if storm_nimbus_autocred_plugin_classes is not None:



[4/7] ambari git commit: AMBARI-22337 each service should be able to implement server actions, package them add a jar to be loaded during EU (port from trunk to branch-26)(dili)

2017-11-22 Thread aonishuk
AMBARI-22337 each service should be able to implement server actions, package 
them add a jar to be loaded during EU (port from trunk to branch-26)(dili)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: eecd8513a304641617cc8602f5805eee8aaf3c69
Parents: 17f89c0
Author: Di Li 
Authored: Mon Nov 20 13:54:31 2017 -0500
Committer: Di Li 
Committed: Mon Nov 20 13:54:31 2017 -0500

--
 ambari-server/pom.xml   |  12 ++
 .../serveraction/ServerActionExecutor.java  | 147 +--
 .../ambari/server/stack/ServiceDirectory.java   |  29 
 .../ambari/server/stack/ServiceModule.java  |   8 +
 .../apache/ambari/server/state/ServiceInfo.java |  14 ++
 .../ambari/server/stack/ServiceModuleTest.java  |  30 
 .../server/stack/StackManagerExtensionTest.java |   6 +
 7 files changed, 232 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/eecd8513/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 342b3c0..eece739 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -165,6 +165,18 @@
   
 
   
+  
+generate-test-oozie2-server-actions-dir
+process-test-classes
+
+  run
+
+
+  
+
+  
+
+  
 
   
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/eecd8513/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
index 50e3cfe..e219dc3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/ServerActionExecutor.java
@@ -18,10 +18,17 @@
 
 package org.apache.ambari.server.serveraction;
 
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.StringTokenizer;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.ConcurrentHashMap;
@@ -38,11 +45,17 @@ import 
org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.actionmanager.Stage;
 import org.apache.ambari.server.agent.CommandReport;
 import org.apache.ambari.server.agent.ExecutionCommand;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.controller.AmbariManagementController;
 import 
org.apache.ambari.server.security.authorization.internal.InternalAuthenticationToken;
+import org.apache.ambari.server.state.ServiceInfo;
+import org.apache.ambari.server.state.UpgradeContext.UpgradeServiceSummary;
+import org.apache.ambari.server.state.UpgradeContext.UpgradeSummary;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.util.ClassUtils;
 
 import com.google.inject.Inject;
 import com.google.inject.Injector;
@@ -495,7 +508,6 @@ public class ServerActionExecutor {
 throw new AmbariException("Missing ExecutionCommand data");
   } else {
 Map roleParams = executionCommand.getRoleParams();
-
 if (roleParams == null) {
   throw new AmbariException("Missing RoleParams data");
 } else {
@@ -504,8 +516,30 @@ public class ServerActionExecutor {
   if (actionClassname == null) {
 throw new AmbariException("Missing action classname for server 
action");
   } else {
-ServerAction action = createServerAction(actionClassname);
-
+Map services = new HashMap();
+UpgradeSummary upgradeSummary = 
executionCommand.getUpgradeSummary();
+if (upgradeSummary != null) {
+  Map upgradeServiceSummaries = 
upgradeSummary.services;
+  

[6/7] ambari git commit: BUG-91896. Moving Metrics Collector Forces ZooKeeper Server Install on Target Host (alexantonenko)

2017-11-22 Thread aonishuk
BUG-91896. Moving Metrics Collector Forces ZooKeeper Server Install on Target 
Host (alexantonenko)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 0615fa0f6fa0bd90cd2e9b1001b2406f89be2543
Parents: a49be4a
Author: Alex Antonenko 
Authored: Tue Nov 21 20:08:30 2017 +0300
Committer: Alex Antonenko 
Committed: Tue Nov 21 20:08:30 2017 +0300

--
 .../main/service/reassign/step3_controller.js   |  3 +++
 .../main/service/reassign/step4_controller.js   | 12 ++--
 .../main/service/reassign/step4_controller_test.js  |  9 ++---
 3 files changed, 19 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0615fa0f/ambari-web/app/controllers/main/service/reassign/step3_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step3_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step3_controller.js
index 4898b75..d994aaf 100644
--- a/ambari-web/app/controllers/main/service/reassign/step3_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step3_controller.js
@@ -286,6 +286,9 @@ App.ReassignMasterWizardStep3Controller = 
Em.Controller.extend({
 success: 'onLoadConfigsTags'
   });
 }
+else{
+  this.set('isLoaded', true);
+}
   },
 
   clearStep: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0615fa0f/ambari-web/app/controllers/main/service/reassign/step4_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step4_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index c610b13..daa28f8 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -108,13 +108,21 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
*/
   setDependentHostComponents: function (componentName) {
 var installedServices = App.Service.find().mapProperty('serviceName');
-var installedComponents = 
App.Host.find(this.get('content.reassignHosts.target'))
+var hostInstalledComponents = 
App.Host.find(this.get('content.reassignHosts.target'))
 .get('hostComponents')
 .mapProperty('componentName');
+var clusterInstalledComponents = App.MasterComponent.find().toArray()
+.concat(App.ClientComponent.find().toArray())
+.concat(App.SlaveComponent.find().toArray())
+.filter(function(service){
+  return service.get("installedCount") > 0;
+})
+.mapProperty('componentName');
+
 var dependenciesToInstall = App.StackServiceComponent.find(componentName)
 .get('dependencies')
 .filter(function (component) {
-  return !installedComponents.contains(component.componentName) && 
installedServices.contains(component.serviceName);
+  return !(component.scope == 'host' ? hostInstalledComponents : 
clusterInstalledComponents).contains(component.componentName) && 
(installedServices.contains(component.serviceName));
 })
 .mapProperty('componentName');
 this.set('dependentHostComponents', dependenciesToInstall);

http://git-wip-us.apache.org/repos/asf/ambari/blob/0615fa0f/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
--
diff --git 
a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js 
b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
index 8eb9c9f..42f6f91 100644
--- a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
@@ -1104,15 +1104,18 @@ describe('App.ReassignMasterWizardStep4Controller', 
function () {
 dependencies: [
   Em.Object.create({
 componentName: 'C1',
-serviceName: 'S1'
+serviceName: 'S1',
+scope: 'host'
   }),
   Em.Object.create({
 componentName: 'C2',
-serviceName: 'S2'
+serviceName: 'S2',
+scope: 'host'
   }),
   Em.Object.create({
 componentName: 'C3',
-serviceName: 'S3'
+serviceName: 'S3',
+scope: 'host'
   })
 ]
   

[7/7] ambari git commit: Merge branch 'branch-2.6' into branch-feature-AMBARI-22457

2017-11-22 Thread aonishuk
Merge branch 'branch-2.6' into branch-feature-AMBARI-22457


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: c7457a820046392dfaf5ca06202143d06c4f143b
Parents: 58c7f78 0615fa0
Author: Andrew Onishuk 
Authored: Wed Nov 22 10:44:42 2017 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 22 10:44:42 2017 +0200

--
 .../libraries/functions/copy_tarball.py |  60 
 ambari-metrics/ambari-metrics-assembly/pom.xml  |   1 -
 ambari-server/pom.xml   |  12 ++
 .../ambari/server/actionmanager/Stage.java  |   3 +-
 .../internal/UpgradeResourceProvider.java   |   2 +
 .../serveraction/ServerActionExecutor.java  | 147 +--
 .../ambari/server/stack/ServiceDirectory.java   |  29 
 .../ambari/server/stack/ServiceModule.java  |   8 +
 .../apache/ambari/server/state/ServiceInfo.java |  14 ++
 .../stack/upgrade/ServerSideActionTask.java |  15 ++
 .../state/stack/upgrade/TaskParameter.java  |  41 ++
 .../stacks/HDP/2.6/services/stack_advisor.py|  11 +-
 .../src/main/resources/upgrade-pack.xsd |   9 ++
 .../ambari/server/stack/ServiceModuleTest.java  |  30 
 .../server/stack/StackManagerExtensionTest.java |   6 +
 .../main/service/reassign/step3_controller.js   |   3 +
 .../main/service/reassign/step4_controller.js   |  12 +-
 .../service/reassign/step4_controller_test.js   |   9 +-
 18 files changed, 355 insertions(+), 57 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c7457a82/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
--



[3/7] ambari git commit: AMBARI-22471 : 'yum remove snappy' deletes ambari-metrics-collector. (avijayan)

2017-11-22 Thread aonishuk
AMBARI-22471 : 'yum remove snappy' deletes ambari-metrics-collector. (avijayan)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 17f89c01f2153498e09997d00b528cb83ceec4f5
Parents: fb65aab
Author: Aravindan Vijayan 
Authored: Mon Nov 20 10:43:27 2017 -0800
Committer: Aravindan Vijayan 
Committed: Mon Nov 20 10:43:27 2017 -0800

--
 ambari-metrics/ambari-metrics-assembly/pom.xml | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/17f89c01/ambari-metrics/ambari-metrics-assembly/pom.xml
--
diff --git a/ambari-metrics/ambari-metrics-assembly/pom.xml 
b/ambari-metrics/ambari-metrics-assembly/pom.xml
index 74d4ae3..f8f27e9 100644
--- a/ambari-metrics/ambari-metrics-assembly/pom.xml
+++ b/ambari-metrics/ambari-metrics-assembly/pom.xml
@@ -225,7 +225,6 @@
   Maven Recipe: RPM Package.
   false
   
-snappy
 ${python.ver}
   
 



ambari git commit: AMBARI-22297. Code cleanup (adoroszlai)

2017-11-22 Thread adoroszlai
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-14714-blueprintv2 c49a0a5ff -> 45ac9fabd


AMBARI-22297. Code cleanup (adoroszlai)

 * ServiceId.equals/hashCode
 * ServiceId.NULL
 * some lambdas
 * ? extends Object
 * useless ?:


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

Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2
Commit: 45ac9fabd9d64593d1b39de3633523f059c7fed1
Parents: c49a0a5
Author: Attila Doroszlai 
Authored: Wed Nov 22 09:48:16 2017 +0100
Committer: Attila Doroszlai 
Committed: Wed Nov 22 09:48:23 2017 +0100

--
 .../controller/AmbariManagementControllerImpl.java  |  2 +-
 .../server/controller/ConfigurationRequest.java |  4 ++--
 .../ambari/server/topology/BlueprintV2Impl.java | 11 +--
 .../apache/ambari/server/topology/ComponentV2.java  |  9 ++---
 .../apache/ambari/server/topology/Configurable.java |  6 +++---
 .../org/apache/ambari/server/topology/Service.java  |  2 +-
 .../apache/ambari/server/topology/ServiceGroup.java |  7 ++-
 .../apache/ambari/server/topology/ServiceId.java| 16 +---
 .../ambari/server/topology/TopologyTemplate.java| 11 +++
 9 files changed, 24 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/45ac9fab/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 37eb613..6896a9b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -1014,7 +1014,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 }
 
 Config config = createConfig(cluster, stackId, request.getType(), 
requestProperties,
-  request.getVersionTag(), propertiesAttributes, request.getServiceId() == 
null? null : request.getServiceId());
+  request.getVersionTag(), propertiesAttributes, request.getServiceId());
 
 LOG.info(MessageFormat.format("Creating configuration with tag ''{0}'' to 
cluster ''{1}''  for configuration type {2}",
 request.getVersionTag(),

http://git-wip-us.apache.org/repos/asf/ambari/blob/45ac9fab/ambari-server/src/main/java/org/apache/ambari/server/controller/ConfigurationRequest.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ConfigurationRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ConfigurationRequest.java
index d26cf16..3c83fed 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ConfigurationRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ConfigurationRequest.java
@@ -57,8 +57,8 @@ public class ConfigurationRequest {
 this.configs = configs;
 this.configsAttributes = configsAttributes;
 this.includeProperties = (type != null && tag != null);
-this.serviceId = serviceId == null ? null : serviceId;
-this.serviceGroupId = serviceGroupId == null ? null : serviceGroupId;
+this.serviceId = serviceId;
+this.serviceGroupId = serviceGroupId;
 
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/45ac9fab/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java
index b27ab79..77fe5d8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java
@@ -263,12 +263,6 @@ public class BlueprintV2Impl implements BlueprintV2 {
 return configuration;
   }
 
-  private void addChildConfiguration(Configuration parent, Configuration 
child) {
-child.setParentConfiguration(parent);
-parent.getProperties().putAll(child.getProperties());
-parent.getAttributes().putAll(child.getAttributes());
-  }
-
   @Override
   @JsonIgnore
   public Setting getSetting() {
@@ -354,10 +348,7 @@ 

ambari git commit: AMBARI-22503 Log Search UI: refine time range picker. (ababiichuk)

2017-11-22 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 5d421b7ab -> bce0bd8f9


AMBARI-22503 Log Search UI: refine time range picker. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: bce0bd8f9424828d0d43ad5e427dff7259496e64
Parents: 5d421b7
Author: ababiichuk 
Authored: Wed Nov 22 19:54:00 2017 +0200
Committer: ababiichuk 
Committed: Thu Nov 23 00:47:34 2017 +0200

--
 .../date-picker/date-picker.component.spec.ts   |  2 ++
 .../date-picker/date-picker.component.ts| 35 +---
 .../time-range-picker.component.html|  6 ++--
 .../time-range-picker.component.ts  | 12 ---
 .../src/app/services/logs-container.service.ts  | 20 ---
 .../src/assets/i18n/en.json |  4 ++-
 6 files changed, 61 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bce0bd8f/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.spec.ts
--
diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.spec.ts
 
b/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.spec.ts
index e6c0bfe..dfd9711 100644
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.spec.ts
+++ 
b/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.spec.ts
@@ -18,6 +18,7 @@
 
 import {async, ComponentFixture, TestBed} from '@angular/core/testing';
 import {StoreModule} from '@ngrx/store';
+import * as moment from 'moment-timezone';
 import {AppSettingsService, appSettings} from 
'@app/services/storage/app-settings.service';
 
 import {DatePickerComponent} from './date-picker.component';
@@ -42,6 +43,7 @@ describe('DatePickerComponent', () => {
   beforeEach(() => {
 fixture = TestBed.createComponent(DatePickerComponent);
 component = fixture.componentInstance;
+component.time = moment();
 fixture.detectChanges();
   });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/bce0bd8f/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.ts
--
diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.ts
 
b/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.ts
index efb5e34..e33d71e 100644
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.ts
+++ 
b/ambari-logsearch/ambari-logsearch-web/src/app/components/date-picker/date-picker.component.ts
@@ -16,8 +16,11 @@
  * limitations under the License.
  */
 
-import {Component, OnInit, OnDestroy, Output, EventEmitter, ViewChild, 
ElementRef} from '@angular/core';
+import {
+  Component, OnInit, OnChanges, OnDestroy, SimpleChanges, Input, Output, 
EventEmitter, ViewChild, ElementRef
+} from '@angular/core';
 import * as $ from 'jquery';
+import {Moment} from 'moment-timezone';
 import '@vendor/js/bootstrap-datetimepicker.min';
 import {AppSettingsService} from '@app/services/storage/app-settings.service';
 
@@ -25,10 +28,10 @@ import {AppSettingsService} from 
'@app/services/storage/app-settings.service';
   selector: 'date-picker',
   templateUrl: './date-picker.component.html'
 })
-export class DatePickerComponent implements OnInit, OnDestroy {
+export class DatePickerComponent implements OnInit, OnChanges, OnDestroy {
 
   constructor(private appSettings: AppSettingsService) {
-appSettings.getParameter('timeZone').subscribe(value => {
+appSettings.getParameter('timeZone').subscribe((value: string): void => {
   this.destroyDatePicker();
   this.timeZone = value;
   if (this.datePickerElement) {
@@ -37,14 +40,27 @@ export class DatePickerComponent implements OnInit, 
OnDestroy {
 });
   }
 
-  ngOnInit() {
+  ngOnInit(): void {
 this.createDatePicker();
   }
 
-  ngOnDestroy() {
+  ngOnChanges(changes: SimpleChanges): void {
+if (changes.hasOwnProperty('time') && this.datePickerElement) {
+  this.setTime(changes.time.currentValue);
+}
+  }
+
+  ngOnDestroy(): void {
 this.destroyDatePicker();
   }
 
+  /**
+   * Value of time input field passed from parent component
+   * @type {Moment}
+   */
+  @Input()
+  time: Moment;
+
   @Output()
   timeChange: EventEmitter = new EventEmitter();
 
@@ -60,6 +76,7 @@ export 

ambari git commit: AMBARI-22499. Ambari server becomes unusable when config properties are misconfigured (adoroszlai) [Forced Update!]

2017-11-22 Thread adoroszlai
Repository: ambari
Updated Branches:
  refs/heads/trunk a878047ad -> 1d4cbc8ac (forced update)


AMBARI-22499. Ambari server becomes unusable when config properties are 
misconfigured (adoroszlai)


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

Branch: refs/heads/trunk
Commit: 1d4cbc8aca2eddd0294b27755ec5769c66bf6b80
Parents: bce0bd8
Author: Attila Doroszlai 
Authored: Wed Nov 22 13:30:05 2017 +0100
Committer: Doroszlai, Attila 
Committed: Thu Nov 23 00:35:09 2017 +0100

--
 .../ambari/server/state/ConfigHelper.java   | 28 ++--
 .../ambari/server/state/ConfigHelperTest.java   | 47 
 2 files changed, 61 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1d4cbc8a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index eade914..6813fc0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -1503,22 +1503,22 @@ public class ConfigHelper {
   }
 
   /**
-   * Compares values as double in case they are numbers.
-   * @param actualValue
-   * @param newValue
-   * @return
+   * Checks for equality of parsed numbers if both values are numeric,
+   * otherwise using regular equality.
*/
-  private  boolean valuesAreEqual(String actualValue, String newValue) {
-boolean actualValueIsNumber = NumberUtils.isNumber(actualValue);
-boolean newValueIsNumber = NumberUtils.isNumber(newValue);
-if (actualValueIsNumber && newValueIsNumber) {
-  Double ab = Double.parseDouble(actualValue);
-  Double bb = Double.parseDouble(newValue);
-  return ab.equals(bb);
-} else if (!actualValueIsNumber && !newValueIsNumber) {
-  return actualValue.equals(newValue);
+  static boolean valuesAreEqual(String value1, String value2) { // exposed for 
unit test
+if (NumberUtils.isNumber(value1) && NumberUtils.isNumber(value2)) {
+  try {
+Number number1 = NumberUtils.createNumber(value1);
+Number number2 = NumberUtils.createNumber(value2);
+return Objects.equal(number1, number2) ||
+  number1.doubleValue() == number2.doubleValue();
+  } catch (NumberFormatException e) {
+// fall back to regular equality
+  }
 }
-return false;
+
+return Objects.equal(value1, value2);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/1d4cbc8a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
index 8a0a782..ff0bf59 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
@@ -22,6 +22,8 @@ import static org.easymock.EasyMock.createStrictMock;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
 import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.sql.SQLException;
 import java.util.ArrayList;
@@ -1212,4 +1214,49 @@ public class ConfigHelperTest {
   verify(mockAmbariMetaInfo, mockStackVersion, mockServiceInfo, 
mockPropertyInfo1, mockPropertyInfo2);
 }
   }
+
+  public static class RunWithoutModules {
+@Test
+public void nullsAreEqual() {
+  assertTrue(ConfigHelper.valuesAreEqual(null, null));
+}
+
+@Test
+public void equalStringsAreEqual() {
+  assertTrue(ConfigHelper.valuesAreEqual("asdf", "asdf"));
+  assertTrue(ConfigHelper.valuesAreEqual("qwerty", "qwerty"));
+}
+
+@Test
+public void nullIsNotEqualWithNonNull() {
+  assertFalse(ConfigHelper.valuesAreEqual(null, "asdf"));
+  assertFalse(ConfigHelper.valuesAreEqual("asdf", null));
+}
+
+@Test
+public void equalNumbersInDifferentFormsAreEqual() {
+  assertTrue(ConfigHelper.valuesAreEqual("1.234", "1.2340"));
+  assertTrue(ConfigHelper.valuesAreEqual("12.34", "1.234e1"));
+  assertTrue(ConfigHelper.valuesAreEqual("123L", "123l"));
+ 

ambari git commit: BUG-92020. Ambari server becomes unusable when config properties are misconfigured (adoroszlai)

2017-11-22 Thread adoroszlai
Repository: ambari
Updated Branches:
  refs/heads/trunk bce0bd8f9 -> a878047ad


BUG-92020. Ambari server becomes unusable when config properties are 
misconfigured (adoroszlai)


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

Branch: refs/heads/trunk
Commit: a878047ad984760ecf3ace8e0bd47099b8f73fe3
Parents: bce0bd8
Author: Attila Doroszlai 
Authored: Wed Nov 22 13:30:05 2017 +0100
Committer: Doroszlai, Attila 
Committed: Thu Nov 23 00:31:09 2017 +0100

--
 .../ambari/server/state/ConfigHelper.java   | 28 ++--
 .../ambari/server/state/ConfigHelperTest.java   | 47 
 2 files changed, 61 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a878047a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index eade914..6813fc0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -1503,22 +1503,22 @@ public class ConfigHelper {
   }
 
   /**
-   * Compares values as double in case they are numbers.
-   * @param actualValue
-   * @param newValue
-   * @return
+   * Checks for equality of parsed numbers if both values are numeric,
+   * otherwise using regular equality.
*/
-  private  boolean valuesAreEqual(String actualValue, String newValue) {
-boolean actualValueIsNumber = NumberUtils.isNumber(actualValue);
-boolean newValueIsNumber = NumberUtils.isNumber(newValue);
-if (actualValueIsNumber && newValueIsNumber) {
-  Double ab = Double.parseDouble(actualValue);
-  Double bb = Double.parseDouble(newValue);
-  return ab.equals(bb);
-} else if (!actualValueIsNumber && !newValueIsNumber) {
-  return actualValue.equals(newValue);
+  static boolean valuesAreEqual(String value1, String value2) { // exposed for 
unit test
+if (NumberUtils.isNumber(value1) && NumberUtils.isNumber(value2)) {
+  try {
+Number number1 = NumberUtils.createNumber(value1);
+Number number2 = NumberUtils.createNumber(value2);
+return Objects.equal(number1, number2) ||
+  number1.doubleValue() == number2.doubleValue();
+  } catch (NumberFormatException e) {
+// fall back to regular equality
+  }
 }
-return false;
+
+return Objects.equal(value1, value2);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/a878047a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
index 8a0a782..ff0bf59 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
@@ -22,6 +22,8 @@ import static org.easymock.EasyMock.createStrictMock;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.replay;
 import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.sql.SQLException;
 import java.util.ArrayList;
@@ -1212,4 +1214,49 @@ public class ConfigHelperTest {
   verify(mockAmbariMetaInfo, mockStackVersion, mockServiceInfo, 
mockPropertyInfo1, mockPropertyInfo2);
 }
   }
+
+  public static class RunWithoutModules {
+@Test
+public void nullsAreEqual() {
+  assertTrue(ConfigHelper.valuesAreEqual(null, null));
+}
+
+@Test
+public void equalStringsAreEqual() {
+  assertTrue(ConfigHelper.valuesAreEqual("asdf", "asdf"));
+  assertTrue(ConfigHelper.valuesAreEqual("qwerty", "qwerty"));
+}
+
+@Test
+public void nullIsNotEqualWithNonNull() {
+  assertFalse(ConfigHelper.valuesAreEqual(null, "asdf"));
+  assertFalse(ConfigHelper.valuesAreEqual("asdf", null));
+}
+
+@Test
+public void equalNumbersInDifferentFormsAreEqual() {
+  assertTrue(ConfigHelper.valuesAreEqual("1.234", "1.2340"));
+  assertTrue(ConfigHelper.valuesAreEqual("12.34", "1.234e1"));
+  assertTrue(ConfigHelper.valuesAreEqual("123L", "123l"));
+  

ambari git commit: AMBARI-22496. Admin View - Manage Versions page should show HDP-GPL repo if necessary (vsubramanian)

2017-11-22 Thread vivekratnavel
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22457 ba957a869 -> 059fadf46


AMBARI-22496. Admin View - Manage Versions page should show HDP-GPL repo if 
necessary (vsubramanian)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 059fadf460f2fc59ecb60403141c8b36a4c89668
Parents: ba957a8
Author: Vivek Ratnavel Subramanian 
Authored: Wed Nov 22 16:59:13 2017 -0800
Committer: Vivek Ratnavel Subramanian 
Committed: Wed Nov 22 16:59:13 2017 -0800

--
 .../stackVersions/StackVersionsEditCtrl.js  | 27 ++-
 .../ui/admin-web/app/scripts/services/Stack.js  | 14 ++
 .../views/stackVersions/stackVersionPage.html   | 28 +++-
 3 files changed, 55 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/059fadf4/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
index 09e3c28..b7fa741 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
@@ -33,6 +33,15 @@ angular.module('ambariAdminConsole')
 display_name: ''
   };
   $scope.defaulfOSRepos = {}; // a copy of initial loaded repo info for 
"changed" check later
+  $scope.isGPLAccepted = false;
+  
+  $scope.isGPLRepo = function (repository) {
+return repository.Repositories.tags.indexOf('GPL') >= 0;
+  };
+
+  $scope.showRepo = function (repository) {
+return $scope.isGPLAccepted || !$scope.isGPLRepo(repository);
+  };
 
   $scope.loadStackVersionInfo = function () {
 return Stack.getRepo($routeParams.versionId, 
$routeParams.stackName).then(function (response) {
@@ -67,6 +76,9 @@ angular.module('ambariAdminConsole')
   // load supported os type base on stack version
   $scope.afterStackVersionRead();
 
+  // Load GPL license accepted value
+  $scope.fetchGPLLicenseAccepted();
+
   // if user reach here from UI click, repo status should be cached
   // otherwise re-fetch repo status from cluster end point.
   $scope.repoStatus = Cluster.repoStatusCache[$scope.id];
@@ -85,6 +97,15 @@ angular.module('ambariAdminConsole')
   };
 
   /**
+   * Load GPL License Accepted value
+   */
+  $scope.fetchGPLLicenseAccepted = function () {
+Stack.getGPLLicenseAccepted().then(function (data) {
+  $scope.isGPLAccepted = data === 'true';
+})
+  };
+
+  /**
* Load supported OS list
*/
   $scope.afterStackVersionRead = function () {
@@ -170,7 +191,11 @@ angular.module('ambariAdminConsole')
 
   $scope.updateRepoVersions = function () {
 var skip = $scope.skipValidation || $scope.useRedhatSatellite;
-return Stack.validateBaseUrls(skip, $scope.osList, 
$scope.upgradeStack).then(function (invalidUrls) {
+// Filter out repositories that are not shown in the UI
+var osList = Object.assign([], $scope.osList).map(function(os) {
+  return Object.assign({}, os, {repositories: 
os.repositories.filter(function(repo) { return $scope.showRepo(repo); })});
+});
+return Stack.validateBaseUrls(skip, osList, 
$scope.upgradeStack).then(function (invalidUrls) {
   if (invalidUrls.length === 0) {
 Stack.updateRepo($scope.upgradeStack.stack_name, 
$scope.upgradeStack.stack_version, $scope.id, $scope.updateObj).then(function 
() {
   Alert.success($t('versions.alerts.versionEdited', {

http://git-wip-us.apache.org/repos/asf/ambari/blob/059fadf4/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index d5f4401..46f4f42 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -87,6 +87,20 @@ angular.module('ambariAdminConsole')
   return deferred.promise;
 },
 
+getGPLLicenseAccepted: function() {
+  var deferred = $q.defer();
+
+  

ambari git commit: AMBARI-22495. Installer - Select Version page should show HDP-GPL repo if necessary (vsubramanian)

2017-11-22 Thread vivekratnavel
Repository: ambari
Updated Branches:
  refs/heads/trunk 9fc7223df -> 6b17d0142


AMBARI-22495. Installer - Select Version page should show HDP-GPL repo if 
necessary (vsubramanian)


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

Branch: refs/heads/trunk
Commit: 6b17d0142266f714807bd06e3ce1afbe535a0a73
Parents: 9fc7223
Author: Vivek Ratnavel Subramanian 
Authored: Wed Nov 22 18:00:32 2017 -0800
Committer: Vivek Ratnavel Subramanian 
Committed: Wed Nov 22 18:00:32 2017 -0800

--
 ambari-web/app/controllers/installer.js | 53 +++-
 .../app/controllers/wizard/step8_controller.js  | 12 +++--
 .../app/mappers/repository_version_mapper.js|  3 +-
 ambari-web/app/mappers/stack_mapper.js  |  3 +-
 ambari-web/app/models/repository.js | 17 +++
 .../app/models/stack_version/repository.js  |  3 +-
 ambari-web/app/templates/wizard/step1.hbs   | 36 +
 ambari-web/test/controllers/installer_test.js   | 14 --
 8 files changed, 103 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6b17d014/ambari-web/app/controllers/installer.js
--
diff --git a/ambari-web/app/controllers/installer.js 
b/ambari-web/app/controllers/installer.js
index 3c50b26..d6be78d 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -813,6 +813,7 @@ App.InstallerController = 
App.WizardController.extend(App.Persist, {
 "repo_id": repository.get('repoId'),
 "repo_name": repository.get('repoName'),
 "components": repository.get('components'),
+"tags": repository.get('tags'),
 "distribution": repository.get('distribution')
   }
 });
@@ -833,7 +834,7 @@ App.InstallerController = 
App.WizardController.extend(App.Persist, {
 var dfd = $.Deferred();
 if (selectedStack && selectedStack.get('operatingSystems')) {
   this.set('validationCnt', 
selectedStack.get('operatingSystems').filterProperty('isSelected').filterProperty('isEmpty',
 false).map(function (os) {
-return os.get('repositories.length');
+return os.get('repositories').filterProperty('showRepo', true).length;
   }).reduce(Em.sum, 0));
   var verifyBaseUrl = !wizardStep1Controller.get('skipValidationChecked') 
&& !wizardStep1Controller.get('selectedStack.useRedhatSatellite');
   if (!verifyBaseUrl) {
@@ -842,32 +843,34 @@ App.InstallerController = 
App.WizardController.extend(App.Persist, {
   selectedStack.get('operatingSystems').forEach(function (os) {
 if (os.get('isSelected') && !os.get('isEmpty')) {
   os.get('repositories').forEach(function (repo) {
-repo.setProperties({
-  errorTitle: '',
-  errorContent: '',
-  validation: 'INPROGRESS'
-});
-this.set('content.isCheckInProgress', true);
-App.ajax.send({
-  name: 'wizard.advanced_repositories.valid_url',
-  sender: this,
-  data: {
-stackName: stackName,
-stackVersion: stackVersion,
-repoId: repo.get('repoId'),
-osType: os.get('osType'),
-osId: os.get('id'),
-dfd: dfd,
+if (repo.get('showRepo')) {
+  repo.setProperties({
+errorTitle: '',
+errorContent: '',
+validation: 'INPROGRESS'
+  });
+  this.set('content.isCheckInProgress', true);
+  App.ajax.send({
+name: 'wizard.advanced_repositories.valid_url',
+sender: this,
 data: {
-  'Repositories': {
-'base_url': repo.get('baseUrl'),
-"verify_base_url": verifyBaseUrl
+  stackName: stackName,
+  stackVersion: stackVersion,
+  repoId: repo.get('repoId'),
+  osType: os.get('osType'),
+  osId: os.get('id'),
+  dfd: dfd,
+  data: {
+'Repositories': {
+  'base_url': repo.get('baseUrl'),
+  "verify_base_url": verifyBaseUrl
+}
   }
-}
-  },
-  success: 'checkRepoURLSuccessCallback',
-  error: 'checkRepoURLErrorCallback'
-});
+},
+

ambari git commit: AMBARI-22496. Admin View - Manage Versions page should show HDP-GPL repo if necessary (vsubramanian)

2017-11-22 Thread vivekratnavel
Repository: ambari
Updated Branches:
  refs/heads/trunk 1d4cbc8ac -> 9fc7223df


AMBARI-22496. Admin View - Manage Versions page should show HDP-GPL repo if 
necessary (vsubramanian)


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

Branch: refs/heads/trunk
Commit: 9fc7223df9a50fe69f4d8884939718b3f3bcf31b
Parents: 1d4cbc8
Author: Vivek Ratnavel Subramanian 
Authored: Wed Nov 22 17:01:15 2017 -0800
Committer: Vivek Ratnavel Subramanian 
Committed: Wed Nov 22 17:01:15 2017 -0800

--
 .../stackVersions/StackVersionsEditCtrl.js  | 27 ++-
 .../ui/admin-web/app/scripts/services/Stack.js  | 14 ++
 .../views/stackVersions/stackVersionPage.html   | 28 +++-
 3 files changed, 55 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9fc7223d/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
index 09e3c28..542772e 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
@@ -33,6 +33,15 @@ angular.module('ambariAdminConsole')
 display_name: ''
   };
   $scope.defaulfOSRepos = {}; // a copy of initial loaded repo info for 
"changed" check later
+  $scope.isGPLAccepted = false;
+
+  $scope.isGPLRepo = function (repository) {
+return repository.Repositories.tags.indexOf('GPL') >= 0;
+  };
+
+  $scope.showRepo = function (repository) {
+return $scope.isGPLAccepted || !$scope.isGPLRepo(repository);
+  };
 
   $scope.loadStackVersionInfo = function () {
 return Stack.getRepo($routeParams.versionId, 
$routeParams.stackName).then(function (response) {
@@ -67,6 +76,9 @@ angular.module('ambariAdminConsole')
   // load supported os type base on stack version
   $scope.afterStackVersionRead();
 
+  // Load GPL license accepted value
+  $scope.fetchGPLLicenseAccepted();
+
   // if user reach here from UI click, repo status should be cached
   // otherwise re-fetch repo status from cluster end point.
   $scope.repoStatus = Cluster.repoStatusCache[$scope.id];
@@ -85,6 +97,15 @@ angular.module('ambariAdminConsole')
   };
 
   /**
+   * Load GPL License Accepted value
+   */
+  $scope.fetchGPLLicenseAccepted = function () {
+Stack.getGPLLicenseAccepted().then(function (data) {
+  $scope.isGPLAccepted = data === 'true';
+})
+  };
+
+  /**
* Load supported OS list
*/
   $scope.afterStackVersionRead = function () {
@@ -170,7 +191,11 @@ angular.module('ambariAdminConsole')
 
   $scope.updateRepoVersions = function () {
 var skip = $scope.skipValidation || $scope.useRedhatSatellite;
-return Stack.validateBaseUrls(skip, $scope.osList, 
$scope.upgradeStack).then(function (invalidUrls) {
+// Filter out repositories that are not shown in the UI
+var osList = Object.assign([], $scope.osList).map(function(os) {
+  return Object.assign({}, os, {repositories: 
os.repositories.filter(function(repo) { return $scope.showRepo(repo); })});
+});
+return Stack.validateBaseUrls(skip, osList, 
$scope.upgradeStack).then(function (invalidUrls) {
   if (invalidUrls.length === 0) {
 Stack.updateRepo($scope.upgradeStack.stack_name, 
$scope.upgradeStack.stack_version, $scope.id, $scope.updateObj).then(function 
() {
   Alert.success($t('versions.alerts.versionEdited', {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9fc7223d/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index 8003dd1..90f4f48 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -87,6 +87,20 @@ angular.module('ambariAdminConsole')
   return deferred.promise;
 },
 
+getGPLLicenseAccepted: function() {
+  var deferred = $q.defer();
+
+  $http.get(Settings.baseUrl + 

ambari git commit: AMBARI-22495. Installer - Select Version page should show HDP-GPL repo if necessary (vsubramanian)

2017-11-22 Thread vivekratnavel
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22457 059fadf46 -> 854182987


AMBARI-22495. Installer - Select Version page should show HDP-GPL repo if 
necessary (vsubramanian)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 8541829876ae3edcfbe96587270ecedad86f36e8
Parents: 059fadf
Author: Vivek Ratnavel Subramanian 
Authored: Wed Nov 22 17:55:46 2017 -0800
Committer: Vivek Ratnavel Subramanian 
Committed: Wed Nov 22 17:55:46 2017 -0800

--
 ambari-web/app/controllers/installer.js | 53 +++-
 .../app/controllers/wizard/step8_controller.js  | 12 +++--
 .../app/mappers/repository_version_mapper.js|  3 +-
 ambari-web/app/mappers/stack_mapper.js  |  3 +-
 ambari-web/app/models/repository.js | 17 +++
 .../app/models/stack_version/repository.js  |  3 +-
 ambari-web/app/templates/wizard/step1.hbs   |  2 +
 ambari-web/test/controllers/installer_test.js   | 14 --
 8 files changed, 69 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/85418298/ambari-web/app/controllers/installer.js
--
diff --git a/ambari-web/app/controllers/installer.js 
b/ambari-web/app/controllers/installer.js
index a45ac57..afce91a 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -807,6 +807,7 @@ App.InstallerController = 
App.WizardController.extend(App.UserPref, {
 "repo_id": repository.get('repoId'),
 "repo_name": repository.get('repoName'),
 "components": repository.get('components'),
+"tags": repository.get('tags'),
 "distribution": repository.get('distribution')
   }
 });
@@ -827,7 +828,7 @@ App.InstallerController = 
App.WizardController.extend(App.UserPref, {
 var dfd = $.Deferred();
 if (selectedStack && selectedStack.get('operatingSystems')) {
   this.set('validationCnt', 
selectedStack.get('operatingSystems').filterProperty('isSelected').filterProperty('isEmpty',
 false).map(function (os) {
-return os.get('repositories.length');
+return os.get('repositories').filterProperty('showRepo', true).length;
   }).reduce(Em.sum, 0));
   var verifyBaseUrl = !wizardStep1Controller.get('skipValidationChecked') 
&& !wizardStep1Controller.get('selectedStack.useRedhatSatellite');
   if (!verifyBaseUrl) {
@@ -836,32 +837,34 @@ App.InstallerController = 
App.WizardController.extend(App.UserPref, {
   selectedStack.get('operatingSystems').forEach(function (os) {
 if (os.get('isSelected') && !os.get('isEmpty')) {
   os.get('repositories').forEach(function (repo) {
-repo.setProperties({
-  errorTitle: '',
-  errorContent: '',
-  validation: App.Repository.validation.INPROGRESS
-});
-this.set('content.isCheckInProgress', true);
-App.ajax.send({
-  name: 'wizard.advanced_repositories.valid_url',
-  sender: this,
-  data: {
-stackName: stackName,
-stackVersion: stackVersion,
-repoId: repo.get('repoId'),
-osType: os.get('osType'),
-osId: os.get('id'),
-dfd: dfd,
+if (repo.get('showRepo')) {
+  repo.setProperties({
+errorTitle: '',
+errorContent: '',
+validation: App.Repository.validation.INPROGRESS
+  });
+  this.set('content.isCheckInProgress', true);
+  App.ajax.send({
+name: 'wizard.advanced_repositories.valid_url',
+sender: this,
 data: {
-  'Repositories': {
-'base_url': repo.get('baseUrl'),
-"verify_base_url": verifyBaseUrl
+  stackName: stackName,
+  stackVersion: stackVersion,
+  repoId: repo.get('repoId'),
+  osType: os.get('osType'),
+  osId: os.get('id'),
+  dfd: dfd,
+  data: {
+'Repositories': {
+  'base_url': repo.get('baseUrl'),
+  "verify_base_url": verifyBaseUrl
+}
   }
-}
-  },
-  success: 'checkRepoURLSuccessCallback',
-  error: 

ambari git commit: AMBARI-22453. ambari-server setup should surface GPL software agreement (aonishuk)

2017-11-22 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 3f836c0a5 -> f331f86d1


AMBARI-22453. ambari-server setup should surface GPL software agreement 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: f331f86d1b3d4414d3ccfe4102c1fde31b517830
Parents: 3f836c0
Author: Andrew Onishuk 
Authored: Wed Nov 22 13:11:10 2017 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 22 13:11:10 2017 +0200

--
 .../ambari/server/agent/ExecutionCommand.java   |1 +
 .../server/configuration/Configuration.java |   12 +
 .../AmbariCustomCommandExecutionHelper.java |2 +
 .../internal/ClientConfigResourceProvider.java  |2 +
 ambari-server/src/main/python/ambari-server.py  |2 +
 .../python/ambari_server/serverConfiguration.py | 1515 --
 .../main/python/ambari_server/serverSetup.py|   21 +-
 .../AmbariManagementControllerImplTest.java |3 +-
 .../ClientConfigResourceProviderTest.java   |2 +
 .../src/test/python/TestAmbariServer.py |5 +-
 10 files changed, 45 insertions(+), 1520 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f331f86d/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
index e475c05..5ee4bf6 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
@@ -456,6 +456,7 @@ public class ExecutionCommand extends AgentCommand {
 String PACKAGE_LIST = "package_list";
 String JDK_LOCATION = "jdk_location";
 String JAVA_HOME = "java_home";
+String GPL_LICENSE_ACCEPTED = "gpl_license_accepted";
 String AMBARI_JAVA_HOME = "ambari_java_home";
 String AMBARI_JDK_NAME = "ambari_jdk_name";
 String AMBARI_JCE_NAME = "ambari_jce_name";

http://git-wip-us.apache.org/repos/asf/ambari/blob/f331f86d/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 3b2baad..a53aebd 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
@@ -730,6 +730,14 @@ public class Configuration {
   "server.version.file", null);
 
   /**
+   * Whether user accepted GPL license
+   */
+  @Markdown(
+  description = "Whether user accepted GPL license.")
+  public static final ConfigurationProperty GPL_LICENSE_ACCEPTED = 
new ConfigurationProperty<>(
+  "gpl.license.accepted", false);
+
+  /**
* The location of the JDK on the Ambari Agent hosts.
*/
   @Markdown(
@@ -5437,6 +5445,10 @@ public class Configuration {
 return NumberUtils.toInt(getProperty(VERSION_DEFINITION_READ_TIMEOUT));
   }
 
+  public Boolean getGplLicenseAccepted(){
+return Boolean.valueOf(getProperty(GPL_LICENSE_ACCEPTED));
+  }
+
   public String getAgentStackRetryOnInstallCount(){
 return getProperty(AGENT_STACK_RETRY_COUNT);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f331f86d/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 9f95f7a..7c52877 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -28,6 +28,7 @@ import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_DRIVER
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_NAME;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GROUP_LIST;
 import static 

ambari git commit: AMBARI-22494 Unable to install the cluster. (atkach)

2017-11-22 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 0615fa0f6 -> b7ed9aaa5


AMBARI-22494 Unable to install the cluster. (atkach)


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

Branch: refs/heads/branch-2.6
Commit: b7ed9aaa517d6da788d073e85f4198697e0fc9ca
Parents: 0615fa0
Author: Andrii Tkach 
Authored: Wed Nov 22 12:23:10 2017 +0200
Committer: Andrii Tkach 
Committed: Wed Nov 22 12:23:10 2017 +0200

--
 ambari-web/app/controllers/wizard/step3_controller.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b7ed9aaa/ambari-web/app/controllers/wizard/step3_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js 
b/ambari-web/app/controllers/wizard/step3_controller.js
index fb41516..abc745d 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -1093,7 +1093,7 @@ App.WizardStep3Controller = 
Em.Controller.extend(App.ReloadPopupMixin, {
   return {
 hostName: Em.get(task, 'Tasks.host_name'),
 transparentHugePage: Em.get(task, 
'Tasks.structured_out.transparentHugePage.message'),
-installedPackages: installed_packages ? installed_packages : []
+installedPackages: installed_packages && 
Array.isArray(installed_packages) ? installed_packages : []
   };
 }));
 



[46/50] [abbrv] ambari git commit: AMBARI-22449. Improved service/component dependency support (amagyar)

2017-11-22 Thread amagyar
AMBARI-22449. Improved service/component dependency support (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 97cea11f3d378fa4f53de9d2b403bb384b0698b9
Parents: 6fedb9f
Author: Attila Magyar 
Authored: Thu Nov 16 12:27:13 2017 +0100
Committer: Attila Magyar 
Committed: Wed Nov 22 10:55:11 2017 +0100

--
 .../app/controllers/wizard/step4_controller.js  | 115 ++-
 ambari-web/app/messages.js  |   3 +-
 ambari-web/app/models/stack_service.js  |  82 +
 .../test/controllers/wizard/step4_test.js   |  16 +--
 4 files changed, 155 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/97cea11f/ambari-web/app/controllers/wizard/step4_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js 
b/ambari-web/app/controllers/wizard/step4_controller.js
index d82bf34..d39164b 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -386,61 +386,29 @@ App.WizardStep4Controller = Em.ArrayController.extend({
*/
   serviceDependencyValidation: function(callback) {
 var selectedServices = this.filterProperty('isSelected', true);
+var availableServices = this.get('content');
 var missingDependencies = [];
-var missingDependenciesDisplayName = [];
 selectedServices.forEach(function(service) {
-  var requiredServices = service.get('requiredServices');
-  if (!!requiredServices && requiredServices.length) {
-requiredServices.forEach(function(_requiredService){
-  var requiredService = this.findProperty('serviceName', 
_requiredService);
-  if (requiredService) {
-if(requiredService.get('isSelected') === false) {
-   if(missingDependencies.indexOf(_requiredService) === -1) {
- missingDependencies.push(_requiredService);
- 
missingDependenciesDisplayName.push(requiredService.get('displayNameOnSelectServicePage'));
-   }
-}
-else {
-   //required service is selected, remove the service error from 
errorObject array
-   var serviceName = requiredService.get('serviceName');
-   var serviceError = 
this.get('errorStack').filterProperty('id',"serviceCheck_"+serviceName);
-   if(serviceError) {
-  this.get('errorStack').removeObject(serviceError[0]);
-   }
-}
-  }
-},this);
-  }
-},this);
+  service.collectMissingDependencies(selectedServices, availableServices, 
missingDependencies);
+});
+this.cleanExistingServiceCheckErrors();
+this.addServiceCheckErrors(missingDependencies, callback);
+  },
 
-//create a copy of the errorStack, reset it
-//and add the dependencies in the correct order
-var errorStackCopy = this.get('errorStack');
-this.set('errorStack', []);
+  cleanExistingServiceCheckErrors() {
+var existingServiceCheckErrors = this.get('errorStack').filter(function 
(error) {
+  return error.id.startsWith('serviceCheck_');
+});
+this.get('errorStack').removeObjects(existingServiceCheckErrors);
+  },
 
-if (missingDependencies.length > 0) {
-  for(var i = 0; i < missingDependencies.length; i++) {
-this.addValidationError({
-  id: 'serviceCheck_' + missingDependencies[i],
-  callback: this.needToAddServicePopup,
-  callbackParams: [{serviceName: missingDependencies[i], selected: 
true}, 'serviceCheck', missingDependenciesDisplayName[i], callback]
-});
-  }
-}
-
-//iterate through the errorStackCopy array and add to errorStack array, 
the error objects that have no matching entry in the errorStack 
-//and that are not related to serviceChecks since serviceCheck errors have 
already been added when iterating through the missing dependencies list
-//Only add Ranger, Ambari Metrics, Spark and file system service 
validation errors if they exist in the errorStackCopy array
-var ctr = 0;
-while(ctr < errorStackCopy.length) {
-  //no matching entry in errorStack array
-  if (!this.get('errorStack').someProperty('id', errorStackCopy[ctr].id)) {
-//not serviceCheck error
-if(!errorStackCopy[ctr].id.startsWith('serviceCheck_')) {
-  this.get('errorStack').push(this.createError(errorStackCopy[ctr]));
-}
-  }
-  

[12/50] [abbrv] ambari git commit: AMBARI-22416 Log Search UI: fixes for filtering form. (ababiichuk)

2017-11-22 Thread amagyar
http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.spec.ts
--
diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.spec.ts
 
b/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.spec.ts
deleted file mode 100644
index 2b3e326..000
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.spec.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * 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 {TestBed, inject} from '@angular/core/testing';
-import {StoreModule} from '@ngrx/store';
-import {AppSettingsService, appSettings} from 
'@app/services/storage/app-settings.service';
-import {AppStateService, appState} from 
'@app/services/storage/app-state.service';
-import {ClustersService, clusters} from 
'@app/services/storage/clusters.service';
-import {ComponentsService, components} from 
'@app/services/storage/components.service';
-import {HostsService, hosts} from '@app/services/storage/hosts.service';
-import {UtilsService} from '@app/services/utils.service';
-import {HttpClientService} from '@app/services/http-client.service';
-import {ListItem} from '@app/classes/list-item';
-import {Node} from '@app/classes/models/node';
-
-import {FilteringService} from './filtering.service';
-
-describe('FilteringService', () => {
-  beforeEach(() => {
-const httpClient = {
-  get: () => {
-return {
-  subscribe: () => {
-  }
-}
-  }
-};
-TestBed.configureTestingModule({
-  imports: [
-StoreModule.provideStore({
-  appSettings,
-  appState,
-  clusters,
-  components,
-  hosts
-})
-  ],
-  providers: [
-FilteringService,
-AppSettingsService,
-AppStateService,
-ClustersService,
-ComponentsService,
-HostsService,
-UtilsService,
-{
-  provide: HttpClientService,
-  useValue: httpClient
-}
-  ]
-});
-  });
-
-  it('should create service', inject([FilteringService], (service: 
FilteringService) => {
-expect(service).toBeTruthy();
-  }));
-
-  describe('#getListItemFromString()', () => {
-it('should convert string to ListItem', inject([FilteringService], 
(service: FilteringService) => {
-  const getListItemFromString: (name: string) => ListItem = 
service['getListItemFromString'];
-  expect(getListItemFromString('customName')).toEqual({
-label: 'customName',
-value: 'customName'
-  });
-}));
-  });
-
-  describe('#getListItemFromNode()', () => {
-it('should convert Node to ListItem', inject([FilteringService], (service: 
FilteringService) => {
-  const getListItemFromNode: (node: Node) => ListItem = 
service['getListItemFromNode'];
-  expect(getListItemFromNode({
-name: 'customName',
-value: '1',
-isParent: true,
-isRoot: true
-  })).toEqual({
-label: 'customName (1)',
-value: 'customName'
-  });
-}));
-  });
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
--
diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts 
b/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
deleted file mode 100644
index 85dc408..000
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/filtering.service.ts
+++ /dev/null
@@ -1,253 +0,0 @@
-/**
- * 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
- 

[03/50] [abbrv] ambari git commit: AMBARI-22398. Upstart is not able to stop the ambari-agent (aonishuk)

2017-11-22 Thread amagyar
AMBARI-22398. Upstart is not able to stop the ambari-agent (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: e968b12186848edd7b4e8b7103e8283b61f59c50
Parents: 780e91e
Author: Andrew Onishuk 
Authored: Thu Nov 9 16:37:58 2017 +0200
Committer: Andrew Onishuk 
Committed: Thu Nov 9 16:37:58 2017 +0200

--
 ambari-agent/src/main/python/ambari_agent/AmbariAgent.py | 3 ---
 1 file changed, 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e968b121/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py 
b/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
index 28b9528..aeb200c 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
@@ -49,9 +49,6 @@ def main():
 
   mergedArgs = [PYTHON, AGENT_SCRIPT] + args
 
-  # Become a parent for all subprocesses
-  os.setpgrp()
-
   try:
 while status == AGENT_AUTO_RESTART_EXIT_CODE:
   mainProcess = subprocess.Popen(mergedArgs)



[49/50] [abbrv] ambari git commit: AMBARI-22449. Improved service/component dependency support (amagyar)

2017-11-22 Thread amagyar
AMBARI-22449. Improved service/component dependency support (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 91087e62d5f3105ae19662a18358e61fb0d5b771
Parents: 97cea11
Author: Attila Magyar 
Authored: Thu Nov 16 15:35:41 2017 +0100
Committer: Attila Magyar 
Committed: Wed Nov 22 10:55:12 2017 +0100

--
 .../app/controllers/wizard/step4_controller.js  |  4 +--
 ambari-web/app/messages.js  |  3 +-
 ambari-web/app/models/stack_service.js  | 30 +++-
 3 files changed, 21 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/91087e62/ambari-web/app/controllers/wizard/step4_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js 
b/ambari-web/app/controllers/wizard/step4_controller.js
index d39164b..8a62f3b 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -480,11 +480,11 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   needToAddMissingDependency: function (missingDependency, i18nSuffix, 
callback, id) {
 var self = this;
 var displayName = missingDependency.get('displayName');
-if (missingDependency.hasMultipleOptions()) {
+if (missingDependency.get('hasMultipleOptions')) {
   return this.showDependencyPopup(
 id,
 Em.I18n.t('installer.step4.' + i18nSuffix + 
'.popup.header').format(displayName),
-Em.I18n.t('installer.step4.' + i18nSuffix + 
'.popup.body2').format(displayName, missingDependency.displayOptions()),
+Em.I18n.t('installer.step4.' + i18nSuffix + 
'.popup.body.multiOptions').format(displayName, 
missingDependency.get('displayOptions')),
 callback
   );
 } else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/91087e62/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 1afb6fe..9ca51de 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -880,7 +880,8 @@ Em.I18n.translations = {
   'installer.step4.multipleDFS.popup.body':'You selected more than one file 
system. We will automatically select only {0}. Is this OK?',
   'installer.step4.serviceCheck.popup.header':'{0} Needed',
   'installer.step4.serviceCheck.popup.body':'You did not select {0}, but it is 
needed by other services you selected. We will automatically add {1}. Is this 
OK?',
-  'installer.step4.serviceCheck.popup.body2':'You did not select {0}, but it 
is needed by other services you selected. Select a compatible service from the 
following list: {1}',
+  'installer.step4.serviceCheck.popup.body.multiOptions':'You did not select 
{0}, but it is needed by other services you selected. Select a compatible 
service from the following list: {1}',
+  'installer.step4.hcfs.displayName':'a Hadoop Compatible File System',
   'installer.step4.limitedFunctionality.popup.header':'Limited Functionality 
Warning',
   'installer.step4.ambariMetricsCheck.popup.body':'Ambari Metrics collects 
metrics from the cluster and makes them available to Ambari.  If you do not 
install Ambari Metrics service, metrics will not be accessible from Ambari.  
Are you sure you want to proceed without Ambari Metrics?',
   'installer.step4.ambariInfraCheck.popup.body':'Since Ambari Infra is not 
selected, you must supply your own Solr to make Atlas work. Are you sure you 
want to proceed?',

http://git-wip-us.apache.org/repos/asf/ambari/blob/91087e62/ambari-web/app/models/stack_service.js
--
diff --git a/ambari-web/app/models/stack_service.js 
b/ambari-web/app/models/stack_service.js
index 46dfee5..a84816e 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -23,11 +23,11 @@ require('models/configs/objects/service_config_category');
 
 var Dependency = Ember.Object.extend({
   name: Ember.computed('service', function() {
-return this.get('service').get('serviceName');
+return this.get('service.serviceName');
   }),
 
   displayName: Ember.computed('service', function() {
-return this.get('service').get('displayNameOnSelectServicePage');
+return this.get('service.displayNameOnSelectServicePage');
   }),
 
   compatibleServices: function(services) {
@@ -40,8 +40,8 @@ var Dependency = Ember.Object.extend({
 });
 
 

[18/50] [abbrv] ambari git commit: AMBARI-22347. Simplify Ambari configuration tables from AMBARI-21307 (rlevas)

2017-11-22 Thread amagyar
http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
index c2a1421..a2ecb27 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariConfigurationResourceProviderTest.java
@@ -14,238 +14,364 @@
 
 package org.apache.ambari.server.controller.internal;
 
+import static 
org.apache.ambari.server.controller.internal.AmbariConfigurationResourceProvider.AMBARI_CONFIGURATION_CATEGORY_PROPERTY_ID;
+import static 
org.apache.ambari.server.controller.internal.AmbariConfigurationResourceProvider.AMBARI_CONFIGURATION_PROPERTIES_PROPERTY_ID;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.newCapture;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeMap;
+
+import javax.persistence.EntityManager;
 
 import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.ResourceProvider;
 import org.apache.ambari.server.controller.utilities.PredicateBuilder;
-import org.apache.ambari.server.events.AmbariLdapConfigChangedEvent;
+import org.apache.ambari.server.events.AmbariConfigurationChangedEvent;
 import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
 import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
 import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
-import org.apache.ambari.server.orm.entities.ConfigurationBaseEntity;
+import org.apache.ambari.server.security.TestAuthenticationFactory;
+import org.apache.ambari.server.security.authorization.AuthorizationException;
 import org.easymock.Capture;
-import org.easymock.EasyMock;
-import org.easymock.EasyMockRule;
 import org.easymock.EasyMockSupport;
-import org.easymock.Mock;
-import org.easymock.TestSubject;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
+import org.junit.After;
 import org.junit.Test;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
 
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
 
 public class AmbariConfigurationResourceProviderTest extends EasyMockSupport {
 
-  @Rule
-  public EasyMockRule mocks = new EasyMockRule(this);
+  private static final String CATEGORY_NAME_1 = "test-category-1";
+  private static final String CATEGORY_NAME_2 = "test-category-2";
 
-  @Mock
-  private Request requestMock;
+  @After
+  public void clearAuthentication() {
+SecurityContextHolder.getContext().setAuthentication(null);
+  }
 
-  @Mock
-  private AmbariConfigurationDAO ambariConfigurationDAO;
+  @Test
+  public void testCreateResources_Administrator() throws Exception {
+testCreateResources(TestAuthenticationFactory.createAdministrator());
+  }
 
-  @Mock
-  private AmbariEventPublisher publisher;
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ClusterAdministrator() throws Exception {
+
testCreateResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
 
-  private Capture ambariConfigurationEntityCapture;
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ClusterOperator() throws Exception {
+testCreateResources(TestAuthenticationFactory.createClusterOperator());
+  }
 
-  private Gson gson;
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ServiceAdministrator() throws Exception {
+
testCreateResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
 
-  private static final String DATA_MOCK_STR = "[\n" +
-"  {\n" +
-"\"authentication.ldap.baseDn\" : 
\"dc=ambari,dc=apache,dc=org\",\n" +
-"\"authentication.ldap.primaryUrl\" : \"localhost:33389\",\n" +
-"

[34/50] [abbrv] ambari git commit: AMBARI-22418. Make Ambari configuration API consistent with existing API. (rlevas)

2017-11-22 Thread amagyar
AMBARI-22418.  Make Ambari configuration API consistent with existing API. 
(rlevas)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 3f2743b58ba65c4bdc7d37df5348d17124bf305a
Parents: 2d81d49
Author: Robert Levas 
Authored: Wed Nov 15 12:11:34 2017 -0500
Committer: Robert Levas 
Committed: Wed Nov 15 12:11:34 2017 -0500

--
 .../resources/ResourceInstanceFactoryImpl.java  |   9 +-
 .../RootServiceComponentResourceDefinition.java |   9 +-
 .../AmbariConfigurationRequestSwagger.java  |  37 --
 .../AmbariConfigurationResponseSwagger.java |  40 --
 .../services/AmbariConfigurationService.java| 193 
 .../server/api/services/AmbariMetaInfo.java |   4 +-
 ...iceComponentConfigurationRequestSwagger.java |  43 ++
 ...ceComponentConfigurationResponseSwagger.java |  43 ++
 ...ootServiceComponentConfigurationService.java | 226 +
 .../server/api/services/RootServiceService.java |   7 +
 .../api/services/ldap/AmbariConfiguration.java  |   6 +-
 .../services/ldap/LdapConfigurationRequest.java |   2 +-
 .../services/ldap/LdapConfigurationService.java |   6 +-
 .../commands/StackAdvisorCommand.java   |  62 ++-
 .../server/controller/ControllerModule.java |   4 +-
 .../controller/MaintenanceStateHelper.java  |   3 +-
 .../controller/ResourceProviderFactory.java |   4 +-
 .../ambari/server/controller/RootComponent.java |  27 ++
 .../ambari/server/controller/RootService.java   |  36 ++
 .../controller/RootServiceResponseFactory.java  |  44 +-
 .../AbstractControllerResourceProvider.java |   4 +-
 .../AmbariConfigurationResourceProvider.java| 302 
 ...eComponentConfigurationResourceProvider.java | 476 +++
 .../RootServiceComponentPropertyProvider.java   |   4 +-
 .../RootServiceComponentResourceProvider.java   |   4 +-
 .../ambari/server/controller/spi/Resource.java  |   6 +-
 .../listeners/alerts/AlertReceivedListener.java |  10 +-
 .../alerts/AlertStateChangedListener.java   |   6 +-
 .../ldap/domain/AmbariLdapConfiguration.java|   6 +-
 .../domain/AmbariLdapConfigurationFactory.java  |   2 +-
 .../AmbariLdapConfigurationProvider.java|   6 +-
 .../metadata/AmbariServiceAlertDefinitions.java |  20 +-
 .../server/orm/dao/AlertDefinitionDAO.java  |   7 +-
 .../ambari/server/orm/dao/AlertDispatchDAO.java |   4 +-
 .../server/state/alert/AlertDefinitionHash.java |   8 +-
 .../server/state/cluster/ClusterImpl.java   |   4 +-
 .../services/AmbariServerAlertService.java  |   4 +-
 .../commands/StackAdvisorCommandTest.java   |   8 +-
 .../AmbariManagementControllerTest.java |  16 +-
 .../RootServiceResponseFactoryTest.java |  27 +-
 ...AmbariConfigurationResourceProviderTest.java | 377 ---
 ...ponentConfigurationResourceProviderTest.java | 393 +++
 ...ootServiceComponentPropertyProviderTest.java |  15 +-
 ...ootServiceComponentResourceProviderTest.java |   9 +-
 .../server/ldap/LdapModuleFunctionalTest.java   |   4 +-
 .../TestAmbariLdapConfigurationFactory.java |   2 +-
 .../ldap/service/AmbariLdapFacadeTest.java  |   4 +-
 ...efaultLdapAttributeDetectionServiceTest.java |   8 +-
 .../DefaultLdapConfigurationServiceTest.java|  12 +-
 .../metadata/AgentAlertDefinitionsTest.java |   6 +-
 .../server/orm/dao/AlertDefinitionDAOTest.java  |   7 +-
 .../state/alerts/AlertReceivedListenerTest.java |  16 +-
 .../alerts/AlertStateChangedEventTest.java  |   4 +-
 53 files changed, 1444 insertions(+), 1142 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
index f5fb6e9..fecaedc 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
@@ -237,6 +237,11 @@ public class ResourceInstanceFactoryImpl implements 
ResourceInstanceFactory {
 resourceDefinition = new RootServiceComponentResourceDefinition();
 break;
 
+  case RootServiceComponentConfiguration:
+resourceDefinition = new 

[44/50] [abbrv] ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

2017-11-22 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: b8f75de52e2bdeb43190052e9c56e3e72604ff4a
Parents: ae45a55
Author: Attila Magyar 
Authored: Thu Oct 26 11:49:18 2017 +0200
Committer: Attila Magyar 
Committed: Wed Nov 22 10:55:11 2017 +0100

--
 .../server/controller/jmx/JMXMetricHolder.java  |  55 +++-
 .../ambari/server/state/alert/Reporting.java|   9 +-
 .../controller/jmx/JMXMetricHolderTest.java |  14 +
 .../addon-services/ONEFS/1.0.0/alerts.json  | 112 ++--
 .../ONEFS/1.0.0/configuration/hadoop-env.xml|  18 ++
 .../addon-services/ONEFS/1.0.0/metainfo.xml |   1 +
 .../addon-services/ONEFS/1.0.0/metrics.json | 256 +++
 .../ONEFS/1.0.0/package/scripts/params_linux.py |   2 +-
 .../addon-services/ONEFS/1.0.0/widgets.json | 191 +-
 9 files changed, 565 insertions(+), 93 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
index f6ae54f..53227e5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
@@ -22,8 +22,11 @@ import static java.util.stream.Collectors.toList;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.annotation.Nullable;
 
 /**
  *
@@ -61,17 +64,51 @@ public final class JMXMetricHolder {
   .collect(toList());
   }
 
-  public Optional find(String property) {
-String propertyName = property.split("/")[0];
-String propertyValue = property.split("/")[1];
+  public Optional find(String pattern) {
+JmxPattern jmxPattern = JmxPattern.parse(pattern);
 return beans.stream()
-  .filter(each -> propertyName.equals(name(each)))
-  .map(each -> each.get(propertyValue))
-  .filter(Objects::nonNull)
+  .map(jmxPattern::extract)
+  .filter(Optional::isPresent)
+  .map(Optional::get)
   .findFirst();
   }
 
-  private String name(Map bean) {
-return bean.containsKey(NAME_KEY) ? (String) bean.get(NAME_KEY) : null;
+  private static class JmxPattern {
+private static final Pattern PATTERN = 
Pattern.compile("(.*?)\\[(\\S+?)\\]");
+private final String beanName;
+private final String propertyName;
+private final @Nullable String key;
+
+public static JmxPattern parse(String property) {
+  String beanName = property.split("/")[0];
+  String propertyName = property.split("/")[1];
+  String key = null;
+  Matcher matcher = PATTERN.matcher(propertyName);
+  if (matcher.matches()) {
+propertyName = matcher.group(1);
+key = matcher.group(2);
+  }
+  return new JmxPattern(beanName, propertyName, key);
+}
+
+private JmxPattern(String beanName, String propertyName, String key) {
+  this.beanName = beanName;
+  this.propertyName = propertyName;
+  this.key = key;
+}
+
+public Optional extract(Map bean) {
+  return beanName.equals(name(bean))
+? Optional.ofNullable(lookupByKey(bean.get(propertyName)))
+: Optional.empty();
+}
+
+public Object lookupByKey(Object bean) {
+  return key != null && bean instanceof Map ? ((Map) bean).get(key) : bean;
+}
+
+private String name(Map bean) {
+  return bean.containsKey(NAME_KEY) ? (String) bean.get(NAME_KEY) : null;
+}
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/b8f75de5/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index a7e11e1..66d09a5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,9 +17,8 @@
  */
 package 

[15/50] [abbrv] ambari git commit: AMBARI-22387. Create a Pre-Upgrade Check Warning About LZO (dlysnichenko)

2017-11-22 Thread amagyar
AMBARI-22387. Create a Pre-Upgrade Check Warning About LZO (dlysnichenko)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 76349ac20d8955b3f25383b6f4f209a690b38bef
Parents: 5122671
Author: Lisnichenko Dmitro 
Authored: Mon Nov 13 13:29:52 2017 +0200
Committer: Lisnichenko Dmitro 
Committed: Mon Nov 13 13:30:26 2017 +0200

--
 .../ambari/server/checks/CheckDescription.java  |   9 ++
 .../apache/ambari/server/checks/LZOCheck.java   |  77 ++
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml |   1 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.6.xml |   1 +
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml |   1 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.6.xml |   1 +
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml |   1 +
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml |   1 +
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |   1 +
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml |   1 +
 .../ambari/server/checks/LZOCheckTest.java  | 145 +++
 11 files changed, 239 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
index 3caac14..20bb1b0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
@@ -327,6 +327,15 @@ public class CheckDescription {
 "As Ranger is SSL enabled, Ranger SSL configurations will need to be 
changed from default value of /etc/ranger/*/conf folder to 
/etc/ranger/security. " +
 "Since the certificates/keystores/truststores in this path may affect 
the upgrade/downgrade process, it is recommended to manually move the 
certificates/keystores/truststores out of the conf folders and change the 
appropriate config values before proceeding.").build());
 
+  public static CheckDescription LZO_CONFIG_CHECK = new 
CheckDescription("LZO_CONFIG_CHECK",
+  PrereqCheckType.CLUSTER,
+  "LZO Codec Check",
+  new ImmutableMap.Builder()
+  .put(AbstractCheckDescriptor.DEFAULT,
+  "You have LZO codec enabled in the core-site config of your 
cluster. LZO is no longer installed automatically. " +
+  "If any hosts require LZO, it should be installed before 
starting the upgrade. " +
+  "Consult Ambari documentation for instructions on how to do 
this.").build());
+
   public static CheckDescription JAVA_VERSION = new 
CheckDescription("JAVA_VERSION",
   PrereqCheckType.CLUSTER,
   "Verify Java version requirement",

http://git-wip-us.apache.org/repos/asf/ambari/blob/76349ac2/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
new file mode 100644
index 000..3000b79
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.checks;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.PrereqCheckRequest;
+import org.apache.ambari.server.state.stack.PrereqCheckStatus;

[50/50] [abbrv] ambari git commit: Merge branch 'branch-feature-AMBARI-22008' of https://git-wip-us.apache.org/repos/asf/ambari into branch-feature-AMBARI-22008

2017-11-22 Thread amagyar
Merge branch 'branch-feature-AMBARI-22008' of 
https://git-wip-us.apache.org/repos/asf/ambari into branch-feature-AMBARI-22008


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: bd5320232d911dec5adf1e253cb2497226841163
Parents: 91087e6 8f2ccf9
Author: Attila Magyar 
Authored: Wed Nov 22 12:16:32 2017 +0100
Committer: Attila Magyar 
Committed: Wed Nov 22 12:16:32 2017 +0100

--

--




[42/50] [abbrv] ambari git commit: AMBARI-22115. Alerts for OneFS mpack (amagyar)

2017-11-22 Thread amagyar
AMBARI-22115. Alerts for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 362b4f0044eb901fd6470579d54212aec0f7c903
Parents: 2a1c2e4
Author: Attila Magyar 
Authored: Thu Oct 12 15:21:13 2017 +0200
Committer: Attila Magyar 
Committed: Wed Nov 22 10:50:40 2017 +0100

--
 ambari-server/docs/configuration/index.md   |   1 +
 .../server/alerts/JmxServerSideAlert.java   | 104 +++
 .../apache/ambari/server/alerts/Threshold.java  |  73 +
 .../server/configuration/Configuration.java |  11 ++
 .../server/controller/ControllerModule.java |   1 +
 .../server/controller/jmx/JMXMetricHolder.java  |  27 +
 .../org/apache/ambari/server/state/Alert.java   |   1 +
 .../ambari/server/state/alert/AlertUri.java |  41 
 .../ambari/server/state/alert/MetricSource.java |   7 ++
 .../ambari/server/state/alert/Reporting.java|  43 
 .../ambari/server/state/alert/ServerSource.java |  15 +++
 .../services/AmbariServerAlertService.java  |   7 +-
 .../ambari/server/alerts/ThresholdTest.java |  90 
 .../controller/jmx/JMXMetricHolderTest.java |  61 +++
 .../ambari/server/state/alert/AlertUriTest.java |  60 +++
 15 files changed, 541 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/docs/configuration/index.md
--
diff --git a/ambari-server/docs/configuration/index.md 
b/ambari-server/docs/configuration/index.md
index 9dbe9c4..8f1531b 100644
--- a/ambari-server/docs/configuration/index.md
+++ b/ambari-server/docs/configuration/index.md
@@ -57,6 +57,7 @@ The following are the properties which can be used to 
configure Ambari.
 | alerts.execution.scheduler.threadpool.size.core | The core number of threads 
used to process incoming alert events. The value should be increased as the 
size of the cluster increases. |`2` | 
 | alerts.execution.scheduler.threadpool.size.max | 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.execution.scheduler.threadpool.worker.size | The number of queued 
alerts allowed before discarding old alerts which have not been handled. The 
value should be increased as the size of the cluster increases. |`2000` | 
+| alerts.server.side.scheduler.threadpool.size.core | The core pool size of 
the executor service that runs server side alerts. |`4` | 
 | 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.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` | | 

http://git-wip-us.apache.org/repos/asf/ambari/blob/362b4f00/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
new file mode 100644
index 000..a4b86f8
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -0,0 +1,104 @@
+/*
+ * 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.alerts;
+
+import static java.util.Collections.emptyList;
+import static 

[05/50] [abbrv] ambari git commit: AMBARI-22338 : Review Request for new HDP StackFeatures entry(mradhakrishnan on behalf of ydavis)

2017-11-22 Thread amagyar
AMBARI-22338 : Review Request for new HDP StackFeatures entry(mradhakrishnan on 
behalf of ydavis)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: c693de3650d9b115a3da7639dbd97931c6ebb61b
Parents: 430dcbf
Author: Madhuvanthi Radhakrishnan 
Authored: Thu Nov 9 11:09:32 2017 -0800
Committer: Madhuvanthi Radhakrishnan 
Committed: Thu Nov 9 11:09:32 2017 -0800

--
 .../resources/stacks/HDP/2.0.6/properties/stack_features.json   | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c693de36/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
index 86de20d..702fb13 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
@@ -427,6 +427,11 @@
 "name": "hadoop_custom_extensions",
 "description": "Support hadoop custom extensions",
 "min_version": "2.6.0.0"
+  },
+  {
+"name": "sam_storage_core_in_registry",
+"description": "Storage core module moved to registry",
+"min_version": "2.6.0.0"
   }
 ]
   }



[22/50] [abbrv] ambari git commit: AMBARI-22439 Host check operation is being performed on all hosts during host add should not get stuck. (atkach)

2017-11-22 Thread amagyar
AMBARI-22439 Host check operation is being performed on all hosts during host 
add should not get stuck. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: d0ef1449af23e22ee6b95726ce4ca0b1f3544cc4
Parents: d11faab
Author: Andrii Tkach 
Authored: Tue Nov 14 18:11:56 2017 +0200
Committer: Andrii Tkach 
Committed: Tue Nov 14 18:11:56 2017 +0200

--
 ambari-web/app/mixins/main/host/details/actions/check_host.js | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d0ef1449/ambari-web/app/mixins/main/host/details/actions/check_host.js
--
diff --git a/ambari-web/app/mixins/main/host/details/actions/check_host.js 
b/ambari-web/app/mixins/main/host/details/actions/check_host.js
index 2e2e021..66baf5a 100644
--- a/ambari-web/app/mixins/main/host/details/actions/check_host.js
+++ b/ambari-web/app/mixins/main/host/details/actions/check_host.js
@@ -111,6 +111,8 @@ App.CheckHostMixin = Em.Mixin.create({
*/
   warningsTimeInterval: 6,
 
+  finishStates: ["FAILED", "COMPLETED", "TIMEDOUT", "ABORTED"],
+
   /**
* disables host check on Add host wizard as per the experimental flag
*/
@@ -206,7 +208,7 @@ App.CheckHostMixin = Em.Mixin.create({
   //if resolution host check has corrupted data then skip it
   return this.getGeneralHostCheck();
 }
-if (["FAILED", "COMPLETED", 
"TIMEDOUT"].contains(data.Requests.request_status)) {
+if (this.get('finishStates').contains(data.Requests.request_status)) {
   if (data.Requests.inputs.indexOf("last_agent_env_check") != -1) {
 this.set('stopChecking', true);
 this.set('hostsPackagesData', data.tasks.map(function (task) {
@@ -369,7 +371,7 @@ App.CheckHostMixin = Em.Mixin.create({
 data.tasks.forEach(function (task) {
   var name = 
Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.error');
   var hostInfo = this.get("hostCheckWarnings").findProperty('name', name);
-  if (["FAILED", "COMPLETED", "TIMEDOUT"].contains(task.Tasks.status)) {
+  if (this.get('finishStates').contains(task.Tasks.status)) {
 if (task.Tasks.status === "COMPLETED" && !!Em.get(task, 
"Tasks.structured_out.host_resolution_check.failed_count")) {
   var targetHostName = Em.get(task, "Tasks.host_name");
   var relatedHostNames = Em.get(task, 
"Tasks.structured_out.host_resolution_check.hosts_with_failures") || [];



[24/50] [abbrv] ambari git commit: AMBARI-22426. Push down Logger instances (adoroszlai)

2017-11-22 Thread amagyar
AMBARI-22426. Push down Logger instances (adoroszlai)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: ed7e121f3aee519ee18e53b4d0b05661cca4b48a
Parents: d0ef144
Author: Attila Doroszlai 
Authored: Mon Nov 13 14:01:15 2017 +0100
Committer: Attila Doroszlai 
Committed: Tue Nov 14 18:30:01 2017 +0100

--
 .../ambari/server/api/handlers/BaseManagementHandler.java| 8 
 .../org/apache/ambari/server/api/handlers/CreateHandler.java | 4 
 .../org/apache/ambari/server/api/services/BaseService.java   | 5 +
 .../apache/ambari/server/api/services/LoggingService.java| 4 
 .../services/stackadvisor/commands/StackAdvisorCommand.java  | 2 +-
 .../ambari/server/checks/DatabaseConsistencyCheckHelper.java | 2 +-
 .../apache/ambari/server/controller/AmbariHandlerList.java   | 5 +
 .../server/controller/internal/AbstractPropertyProvider.java | 4 
 .../server/controller/internal/AbstractProviderModule.java   | 2 +-
 .../server/controller/internal/AbstractResourceProvider.java | 2 +-
 .../server/controller/internal/ActionResourceProvider.java   | 4 
 .../controller/internal/AlertDefinitionResourceProvider.java | 4 
 .../controller/internal/AlertGroupResourceProvider.java  | 4 
 .../server/controller/internal/AlertResourceProvider.java| 4 
 .../controller/internal/AlertTargetResourceProvider.java | 4 
 .../server/controller/internal/ArtifactResourceProvider.java | 4 
 .../ambari/server/controller/internal/BaseProvider.java  | 6 +-
 .../controller/internal/BlueprintConfigurationProcessor.java | 2 +-
 .../controller/internal/BlueprintResourceProvider.java   | 4 
 .../server/controller/internal/ClusterResourceProvider.java  | 4 
 .../internal/ClusterStackVersionResourceProvider.java| 4 
 .../CompatibleRepositoryVersionResourceProvider.java | 4 
 .../controller/internal/ComponentResourceProvider.java   | 4 
 .../controller/internal/CredentialResourceProvider.java  | 4 
 .../server/controller/internal/GroupResourceProvider.java| 4 
 .../controller/internal/HostComponentResourceProvider.java   | 4 
 .../server/controller/internal/HostResourceProvider.java | 2 ++
 .../internal/HostStackVersionResourceProvider.java   | 4 
 .../ambari/server/controller/internal/HostStatusHelper.java  | 2 +-
 .../server/controller/internal/HttpPropertyProvider.java | 2 +-
 .../server/controller/internal/JsonHttpPropertyRequest.java  | 2 +-
 .../controller/internal/LdapSyncEventResourceProvider.java   | 2 +-
 .../server/controller/internal/MemberResourceProvider.java   | 4 
 .../internal/QuickLinkArtifactResourceProvider.java  | 4 
 .../controller/internal/RecommendationResourceProvider.java  | 4 
 .../server/controller/internal/RequestResourceProvider.java  | 4 
 .../internal/RoleAuthorizationResourceProvider.java  | 4 
 .../server/controller/internal/ServiceResourceProvider.java  | 5 +
 .../controller/internal/StackAdvisorResourceProvider.java| 4 
 .../controller/internal/StackArtifactResourceProvider.java   | 5 +
 .../server/controller/internal/StageResourceProvider.java| 4 
 .../server/controller/internal/TaskResourceProvider.java | 4 
 .../controller/internal/ThemeArtifactResourceProvider.java   | 4 
 .../controller/internal/UpgradeItemResourceProvider.java | 4 
 .../server/controller/internal/UserResourceProvider.java | 4 
 .../controller/internal/ValidationResourceProvider.java  | 4 
 .../internal/VersionDefinitionResourceProvider.java  | 4 
 .../ambari/server/controller/jdbc/JDBCResourceProvider.java  | 2 +-
 .../ambari/server/controller/jmx/JMXPropertyProvider.java| 2 +-
 .../controller/metrics/MetricsCollectorHAClusterState.java   | 2 +-
 .../server/controller/metrics/MetricsCollectorHAManager.java | 2 +-
 .../server/controller/metrics/MetricsDownsamplingMethod.java | 2 +-
 .../server/controller/metrics/MetricsPropertyProvider.java   | 2 +-
 .../controller/metrics/MetricsReportPropertyProvider.java| 2 +-
 .../controller/metrics/RestMetricsPropertyProvider.java  | 2 +-
 .../metrics/ThreadPoolEnabledPropertyProvider.java   | 4 
 .../controller/metrics/ganglia/GangliaPropertyProvider.java  | 2 +-
 .../metrics/ganglia/GangliaReportPropertyProvider.java   | 2 +-
 .../controller/metrics/timeline/AMSPropertyProvider.java | 3 +++
 .../metrics/timeline/AMSReportPropertyProvider.java  | 3 +++
 .../ambari/server/controller/utilities/DatabaseChecker.java  | 2 +-
 

[25/50] [abbrv] ambari git commit: AMBARI-22438 Disable plugins for yum on yum list command (dgrinenko)

2017-11-22 Thread amagyar
AMBARI-22438 Disable plugins for yum on yum list command (dgrinenko)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 3297dfa6542f9cffef2ae36ef0e777fe4c3e829c
Parents: ed7e121
Author: Dmytro Grinenko 
Authored: Tue Nov 14 20:12:47 2017 +0200
Committer: Dmytro Grinenko 
Committed: Tue Nov 14 20:12:47 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/3297dfa6/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
 
b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
index 9117510..8426479 100644
--- 
a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
+++ 
b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
@@ -46,8 +46,8 @@ REMOVE_WITHOUT_DEPENDENCIES_CMD = ['rpm', '-e', '--nodeps']
 
 YUM_REPO_LOCATION = "/etc/yum.repos.d"
 REPO_UPDATE_CMD = ['/usr/bin/yum', 'clean', 'metadata']
-ALL_INSTALLED_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "installed"]
-ALL_AVAILABLE_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "available"]
+ALL_INSTALLED_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "installed", 
"--noplugins"]
+ALL_AVAILABLE_PACKAGES_CMD = [AMBARI_SUDO_BINARY, "yum", "list", "available", 
"--noplugins"]
 VERIFY_DEPENDENCY_CMD = ['/usr/bin/yum', '-d', '0', '-e', '0', 'check', 
'dependencies']
 
 # base command output sample:



[09/50] [abbrv] ambari git commit: AMBARI-22412. Remove IPA integration from experimental status (rlevas)

2017-11-22 Thread amagyar
AMBARI-22412. Remove IPA integration from experimental status (rlevas)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 22b2d55f646ebd965834e43536056c5f229e236e
Parents: 98915a1
Author: Robert Levas 
Authored: Fri Nov 10 10:46:01 2017 -0500
Committer: Robert Levas 
Committed: Fri Nov 10 10:46:01 2017 -0500

--
 ambari-web/app/config.js|  1 -
 .../main/admin/kerberos/step1_controller.js | 52 +---
 ambari-web/app/messages.js  |  2 +-
 .../admin/kerberos/step1_controller_test.js | 17 ---
 4 files changed, 23 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/22b2d55f/ambari-web/app/config.js
--
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 0963f70..8dbbde3 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -82,7 +82,6 @@ App.supports = {
   serviceAutoStart: true,
   logSearch: true,
   redhatSatellite: false,
-  enableIpa: false,
   addingNewRepository: false,
   kerberosStackAdvisor: true,
   logCountVizualization: false,

http://git-wip-us.apache.org/repos/asf/ambari/blob/22b2d55f/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
index 2e41e3d..9c864a8 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step1_controller.js
@@ -25,29 +25,6 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
 
   isSubmitDisabled: Em.computed.someBy('selectedOption.preConditions', 
'checked', false),
 
-  ipaOption: Em.Object.create({
-displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
-value: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
-preConditions: [
-  Em.Object.create({
-displayText: 
Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.1'),
-checked: false
-  }),
-  Em.Object.create({
-displayText: 
Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.2'),
-checked: false
-  }),
-  Em.Object.create({
-displayText: 
Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.3'),
-checked: false
-  }),
-  Em.Object.create({
-displayText: 
Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.4'),
-checked: false
-  })
-]
-  }),
-
   options: Em.A([
 Em.Object.create({
   displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
@@ -94,6 +71,28 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
   ]
 }),
 Em.Object.create({
+  displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
+  value: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
+  preConditions: [
+Em.Object.create({
+  displayText: 
Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.1'),
+  checked: false
+}),
+Em.Object.create({
+  displayText: 
Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.2'),
+  checked: false
+}),
+Em.Object.create({
+  displayText: 
Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.3'),
+  checked: false
+}),
+Em.Object.create({
+  displayText: 
Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.4'),
+  checked: false
+})
+  ]
+}),
+Em.Object.create({
   displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
   value: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
   preConditions: [
@@ -135,13 +134,6 @@ App.KerberosWizardStep1Controller = Em.Controller.extend({
 
 
   loadStep: function () {
-if (App.get('supports.enableIpa')) {
-  var ipaOption = this.get('ipaOption');
-  var options = this.get('options');
-  if (options.indexOf(ipaOption) === -1){
-options.pushObject(ipaOption);
-  }
-}
   },
 
   submit: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/22b2d55f/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index bee581a..390f803 100644
--- 

[32/50] [abbrv] ambari git commit: AMBARI-22418. Make Ambari configuration API consistent with existing API. (rlevas)

2017-11-22 Thread amagyar
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
new file mode 100644
index 000..5016160
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProviderTest.java
@@ -0,0 +1,393 @@
+/*
+ * Licensed 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.controller.internal;
+
+import static 
org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider.CONFIGURATION_CATEGORY_PROPERTY_ID;
+import static 
org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider.CONFIGURATION_COMPONENT_NAME_PROPERTY_ID;
+import static 
org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider.CONFIGURATION_PROPERTIES_PROPERTY_ID;
+import static 
org.apache.ambari.server.controller.internal.RootServiceComponentConfigurationResourceProvider.CONFIGURATION_SERVICE_NAME_PROPERTY_ID;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.newCapture;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import javax.persistence.EntityManager;
+
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
+import org.apache.ambari.server.controller.predicate.AndPredicate;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.ResourceProvider;
+import org.apache.ambari.server.controller.utilities.PredicateBuilder;
+import org.apache.ambari.server.events.AmbariConfigurationChangedEvent;
+import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
+import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
+import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
+import org.apache.ambari.server.security.TestAuthenticationFactory;
+import org.apache.ambari.server.security.authorization.AuthorizationException;
+import org.easymock.Capture;
+import org.easymock.EasyMockSupport;
+import org.junit.After;
+import org.junit.Test;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
+import junit.framework.Assert;
+
+public class RootServiceComponentConfigurationResourceProviderTest extends 
EasyMockSupport {
+
+  private static final String CATEGORY_NAME_1 = "test-category-1";
+  private static final String CATEGORY_NAME_2 = "test-category-2";
+
+  @After
+  public void clearAuthentication() {
+SecurityContextHolder.getContext().setAuthentication(null);
+  }
+
+  @Test
+  public void testCreateResources_Administrator() throws Exception {
+testCreateResources(TestAuthenticationFactory.createAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ClusterAdministrator() throws Exception {
+
testCreateResources(TestAuthenticationFactory.createClusterAdministrator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ClusterOperator() throws Exception {
+testCreateResources(TestAuthenticationFactory.createClusterOperator());
+  }
+
+  @Test(expected = AuthorizationException.class)
+  public void testCreateResources_ServiceAdministrator() throws Exception {
+
testCreateResources(TestAuthenticationFactory.createServiceAdministrator());
+  }
+
+  

[17/50] [abbrv] ambari git commit: AMBARI-22390. Implement many-to-many relation between keytabs and principals (echekanskiy)

2017-11-22 Thread amagyar
AMBARI-22390. Implement many-to-many relation between keytabs and principals 
(echekanskiy)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 18e549034e893aac4ade80e49bda70604d5147f3
Parents: 6e706d4
Author: Eugene Chekanskiy 
Authored: Mon Nov 13 17:01:16 2017 +0200
Committer: Eugene Chekanskiy 
Committed: Mon Nov 13 17:01:29 2017 +0200

--
 .../server/controller/KerberosHelperImpl.java   | 59 ++--
 .../AbstractPrepareKerberosServerAction.java| 23 +++-
 .../kerberos/CreatePrincipalsServerAction.java  |  6 +-
 .../kerberos/KerberosServerAction.java  | 21 +++
 .../stageutils/ResolvedKerberosKeytab.java  | 16 +++---
 5 files changed, 82 insertions(+), 43 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/18e54903/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
index f913831..474c335 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
@@ -1546,19 +1546,21 @@ public class KerberosHelperImpl implements 
KerberosHelper {
 keytabFileOwnerAccess,
 keytabFileGroupName,
 keytabFileGroupAccess,
-Sets.newHashSet(Pair.of(hostId, evaluatedPrincipal)),
+Sets.newHashSet(Pair.of(hostId, Pair.of(evaluatedPrincipal, 
principalType))),
 serviceName.equalsIgnoreCase("AMBARI"),
 componentName.equalsIgnoreCase("AMBARI_SERVER_SELF")
 );
 if (resolvedKeytabs.containsKey(keytabFilePath)) {
   ResolvedKerberosKeytab sameKeytab = 
resolvedKeytabs.get(keytabFilePath);
   // validating owner and group
-  String warnTemplate = "Keytab '{}' on host '{}' have different 
{}, originally set to '{}' and '{}:{}' has '{}', using '{}'";
+  boolean differentOwners = false;
+  String warnTemplate = "Keytab '{}' on host '{}' has different 
{}, originally set to '{}' and '{}:{}' has '{}', using '{}'";
   if 
(!resolvedKeytab.getOwnerName().equals(sameKeytab.getOwnerName())) {
 LOG.warn(warnTemplate,
 keytabFilePath, hostname, "owners", 
sameKeytab.getOwnerName(),
 serviceName, componentName, resolvedKeytab.getOwnerName(),
 sameKeytab.getOwnerName());
+differentOwners = true;
   }
   if 
(!resolvedKeytab.getOwnerAccess().equals(sameKeytab.getOwnerAccess())) {
 LOG.warn(warnTemplate,
@@ -1570,16 +1572,39 @@ public class KerberosHelperImpl implements 
KerberosHelper {
   // TODO with different owners, so make sure that keytabs are 
accessible through group acls
   // TODO this includes same group name and group 'r' mode
   if 
(!resolvedKeytab.getGroupName().equals(sameKeytab.getGroupName())) {
-LOG.warn(warnTemplate,
-keytabFilePath, hostname, "groups", 
sameKeytab.getGroupName(),
-serviceName, componentName, resolvedKeytab.getGroupName(),
-sameKeytab.getGroupName());
+if(differentOwners) {
+  LOG.error(warnTemplate,
+  keytabFilePath, hostname, "groups", 
sameKeytab.getGroupName(),
+  serviceName, componentName, 
resolvedKeytab.getGroupName(),
+  sameKeytab.getGroupName());
+} else {
+  LOG.warn(warnTemplate,
+  keytabFilePath, hostname, "groups", 
sameKeytab.getGroupName(),
+  serviceName, componentName, 
resolvedKeytab.getGroupName(),
+  sameKeytab.getGroupName());
+}
   }
   if 
(!resolvedKeytab.getGroupAccess().equals(sameKeytab.getGroupAccess())) {
-LOG.warn(warnTemplate,
-keytabFilePath, hostname, "group access", 
sameKeytab.getGroupAccess(),
-serviceName, componentName, 
resolvedKeytab.getGroupAccess(),
-sameKeytab.getGroupAccess());
+

[47/50] [abbrv] ambari git commit: AMBARI-22339. Metrics for OneFS mpack (amagyar)

2017-11-22 Thread amagyar
AMBARI-22339. Metrics for OneFS mpack (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 43840c594b03c9216ff983e0e11c407a9341f58f
Parents: 6f35493
Author: Attila Magyar 
Authored: Mon Nov 6 10:48:44 2017 +0100
Committer: Attila Magyar 
Committed: Wed Nov 22 10:55:11 2017 +0100

--
 .../internal/OverriddenMetricsHostProvider.java | 101 +++
 .../internal/StackDefinedPropertyProvider.java  |   9 +-
 .../controller/metrics/MetricHostProvider.java  |   9 ++
 .../timeline/AMSComponentPropertyProvider.java  |   4 +-
 .../ambari/server/state/ConfigHelper.java   |   5 +
 .../server/state/stack/MetricDefinition.java|   9 +-
 .../OverriddenMetricsHostProviderTest.java  |  95 +
 .../addon-services/ONEFS/1.0.0/metrics.json |  13 ++-
 .../addon-services/ONEFS/1.0.0/widgets.json |  65 +++-
 9 files changed, 254 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/43840c59/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
new file mode 100644
index 000..cb59b2f
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
@@ -0,0 +1,101 @@
+/*
+ * 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.controller.internal;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.metrics.MetricHostProvider;
+import org.apache.ambari.server.controller.metrics.MetricsServiceProvider;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.state.ConfigHelper;
+import org.apache.ambari.server.state.kerberos.VariableReplacementHelper;
+
+/**
+ * I'm a special {@link MetricHostProvider} that can override default 
component host names.
+ */
+public class OverriddenMetricsHostProvider implements MetricHostProvider {
+  private final Map overriddenHosts;
+  private final MetricHostProvider metricHostProvider;
+  private final ConfigHelper configHelper;
+  private final VariableReplacementHelper variableReplacer = new 
VariableReplacementHelper();
+
+  public OverriddenMetricsHostProvider(Map overriddenHosts, 
MetricHostProvider metricHostProvider, ConfigHelper configHelper) {
+this.overriddenHosts = overriddenHosts;
+this.metricHostProvider = metricHostProvider;
+this.configHelper = configHelper;
+  }
+
+  @Override
+  public Optional getExternalHostName(String clusterName, String 
componentName) {
+return getOverriddenHost(componentName).map(host -> 
replaceVariables(clusterName, host));
+  }
+
+  private Optional getOverriddenHost(String componentName) {
+return Optional.ofNullable(overriddenHosts.get(componentName));
+  }
+
+  private String replaceVariables(String clusterName, String hostName) {
+try {
+  return hostName(variableReplacer.replaceVariables(hostName, 
config(clusterName)));
+} catch (AmbariException e) {
+  throw new RuntimeException(e);
+}
+  }
+
+  private Map> config(String clusterName) throws 
AmbariException {
+return configHelper.getEffectiveConfigProperties(clusterName, null);
+  }
+
+  private String hostName(String resolvedHost) throws AmbariException {
+return hasScheme(resolvedHost)
+  ? 

ambari git commit: AMBARI-22454. ambari-server upgrade to 2.6.1 should surface the GPL agreement (aonishuk)

2017-11-22 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk f331f86d1 -> 930c7d500


AMBARI-22454. ambari-server upgrade to 2.6.1 should surface the GPL agreement 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: 930c7d5004cb03e28de4cd24b15c2aaabb66b1ce
Parents: f331f86
Author: Andrew Onishuk 
Authored: Wed Nov 22 13:15:29 2017 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 22 13:15:29 2017 +0200

--
 .../server/upgrade/AbstractUpgradeCatalog.java  |   8 ++
 .../server/upgrade/SchemaUpgradeHelper.java |  27 +
 .../ambari/server/upgrade/UpgradeCatalog.java   |   7 ++
 .../server/upgrade/UpgradeCatalog261.java   | 118 +++
 .../main/python/ambari_server/serverSetup.py|  20 +---
 .../main/python/ambari_server/serverUpgrade.py  |  18 ++-
 .../src/test/python/TestAmbariServer.py |   2 +-
 7 files changed, 181 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/930c7d50/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index a2e2f6f..2ef0591 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -143,6 +143,7 @@ public abstract class AbstractUpgradeCatalog implements 
UpgradeCatalog {
 new HashMap<>();
 
   protected String ambariUpgradeConfigUpdatesFileName;
+  private Map upgradeJsonOutput = new HashMap<>();
 
   @Inject
   public AbstractUpgradeCatalog(Injector injector) {
@@ -261,6 +262,13 @@ public abstract class AbstractUpgradeCatalog implements 
UpgradeCatalog {
   }
 
   /**
+   * {@inheritDoc}
+   */
+  public Map getUpgradeJsonOutput() {
+return upgradeJsonOutput;
+  }
+
+  /**
* Update metainfo to new version.
*/
   @Transactional

http://git-wip-us.apache.org/repos/asf/ambari/blob/930c7d50/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 9c77129..2d0e4ce 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
@@ -29,7 +29,11 @@ import java.util.Date;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
 
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.audit.AuditLoggerModule;
 import org.apache.ambari.server.configuration.Configuration;
@@ -57,6 +61,7 @@ public class SchemaUpgradeHelper {
   private DBAccessor dbAccessor;
   private Configuration configuration;
   private static final String[] rcaTableNames = {"workflow", "job", "task", 
"taskAttempt", "hdfsEvent", "mapreduceEvent", "clusterEvent"};
+  static final Gson gson = new GsonBuilder().create();
 
   @Inject
   public SchemaUpgradeHelper(Set allUpgradeCatalogs,
@@ -180,6 +185,7 @@ public class SchemaUpgradeHelper {
   catalogBinder.addBinding().to(UpgradeCatalog251.class);
   catalogBinder.addBinding().to(UpgradeCatalog252.class);
   catalogBinder.addBinding().to(UpgradeCatalog260.class);
+  catalogBinder.addBinding().to(UpgradeCatalog261.class);
   catalogBinder.addBinding().to(UpgradeCatalog300.class);
   catalogBinder.addBinding().to(FinalUpgradeCatalog.class);
 
@@ -250,6 +256,26 @@ public class SchemaUpgradeHelper {
 }
   }
 
+  public void outputUpgradeJsonOutput(List upgradeCatalogs)
+  throws AmbariException {
+LOG.info("Combining upgrade json output.");
+Map combinedUpgradeJsonOutput = new HashMap<>();
+
+if (upgradeCatalogs != null && !upgradeCatalogs.isEmpty()) {
+  for (UpgradeCatalog upgradeCatalog : upgradeCatalogs) {
+try {
+  
combinedUpgradeJsonOutput.putAll(upgradeCatalog.getUpgradeJsonOutput());
+
+} catch (Exception e) {
+   

[30/50] [abbrv] ambari git commit: AMBARI-22450. Log Search: reference Log Feeder IDE/maven dev setup in README.md (oleewere)

2017-11-22 Thread amagyar
AMBARI-22450. Log Search: reference Log Feeder IDE/maven dev setup in README.md 
(oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 1a99da4470d3ce1d928ab56f1a4c2845f940ef53
Parents: a4e7bf3
Author: Oliver Szabo 
Authored: Wed Nov 15 12:54:25 2017 +0100
Committer: Oliver Szabo 
Committed: Wed Nov 15 16:13:53 2017 +0100

--
 ambari-logsearch/README.md | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1a99da44/ambari-logsearch/README.md
--
diff --git a/ambari-logsearch/README.md b/ambari-logsearch/README.md
index 33952a2..2a124d1 100644
--- a/ambari-logsearch/README.md
+++ b/ambari-logsearch/README.md
@@ -34,6 +34,7 @@ In case if you started the containers separately and if you 
would like to access
 ### Run applications from IDE / maven
 
 - [Start Log Search locally](ambari-logsearch-server/README.md)
+- [Start Log Feeder locally](ambari-logsearch-logfeeder/README.md)
 
 ## Package build process
 



[35/50] [abbrv] ambari git commit: AMBARI-22448. Oozie Jobs on Hive Fail With Missing Tarball (ncole)

2017-11-22 Thread amagyar
AMBARI-22448. Oozie Jobs on Hive Fail With Missing Tarball (ncole)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 99152d3257a0eb4180283fa882f8283a3eaba196
Parents: 3f2743b
Author: Nate Cole 
Authored: Wed Nov 15 12:52:50 2017 -0500
Committer: Nate Cole 
Committed: Wed Nov 15 12:52:50 2017 -0500

--
 .../resources/stacks/HDP/2.0.6/properties/stack_packages.json  | 3 ++-
 .../resources/stacks/HDP/3.0/properties/stack_packages.json| 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/99152d32/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
index 68e6bf8..245449c 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
@@ -1278,7 +1278,8 @@
 },
 "upgrade-dependencies" : {
   "HIVE": ["TEZ"],
-  "MAHOUT": ["MAPREDUCE2"]
+  "MAHOUT": ["MAPREDUCE2"],
+  "OOZIE": ["MAPREDUCE2"]
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/99152d32/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
 
b/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
index d8cd015..5603c0c 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/3.0/properties/stack_packages.json
@@ -1154,9 +1154,9 @@
   }
 },
 "upgrade-dependencies" : {
-  "YARN": ["TEZ"],
-  "TEZ": ["YARN"],
-  "MAHOUT": ["MAPREDUCE2"]
+  "HIVE": ["TEZ"],
+  "MAHOUT": ["MAPREDUCE2"],
+  "OOZIE": ["MAPREDUCE2"]
 }
   }
 }



[28/50] [abbrv] ambari git commit: AMBARI-22443. Log Feeder: do not try to connect AMS, when it is disabled (oleewere)

2017-11-22 Thread amagyar
AMBARI-22443. Log Feeder: do not try to connect AMS, when it is disabled 
(oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 2b917f491f5577a85ec88380d7f3f93397cececf
Parents: ba00ed9
Author: Oliver Szabo 
Authored: Tue Nov 14 19:15:57 2017 +0100
Committer: Oliver Szabo 
Committed: Wed Nov 15 11:43:00 2017 +0100

--
 .../ambari/logfeeder/metrics/LogFeederAMSClient.java  |  3 +++
 .../apache/ambari/logfeeder/metrics/MetricsManager.java   |  8 +++-
 .../ambari/logfeeder/metrics/MetricsManagerTest.java  | 10 ++
 3 files changed, 16 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2b917f49/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
--
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
index f446446..c832358 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/LogFeederAMSClient.java
@@ -64,6 +64,9 @@ public class LogFeederAMSClient extends 
AbstractTimelineMetricsSink {
 
   @Override
   public String getCollectorUri(String host) {
+if (collectorProtocol == null || host == null || collectorPort == null || 
collectorPath == null) {
+  return null;
+}
 return String.format("%s://%s:%s%s", collectorProtocol, host, 
collectorPort, collectorPath);
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2b917f49/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
--
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
index 1094852..6e8ac04 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/metrics/MetricsManager.java
@@ -45,7 +45,9 @@ public class MetricsManager {
 
   public void init() {
 LOG.info("Initializing MetricsManager()");
-amsClient = new LogFeederAMSClient();
+if (amsClient == null) {
+  amsClient = new LogFeederAMSClient();
+}
 
 if (amsClient.getCollectorUri(null) != null) {
   if (LogFeederUtil.hostName == null) {
@@ -144,4 +146,8 @@ public class MetricsManager {
   (currMS - lastPublishTimeMS) / 1000 + " seconds ago, 
intervalConfigured=" + publishIntervalMS / 1000);
 }
   }
+
+  public void setAmsClient(LogFeederAMSClient amsClient) {
+this.amsClient = amsClient;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2b917f49/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
--
diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
index 24042a7..f74a80e 100644
--- 
a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
+++ 
b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/metrics/MetricsManagerTest.java
@@ -50,18 +50,20 @@ public class MetricsManagerTest {
   @Before
   public void init() throws Exception {
 manager = new MetricsManager();
-manager.init();
-
+
 mockClient = strictMock(LogFeederAMSClient.class);
 Field f = MetricsManager.class.getDeclaredField("amsClient");
 f.setAccessible(true);
 f.set(manager, mockClient);
-
+
+
EasyMock.expect(mockClient.getCollectorUri(null)).andReturn("null://null:null/null").anyTimes();
 capture = EasyMock.newCapture(CaptureType.FIRST);
 mockClient.emitMetrics(EasyMock.capture(capture));
 

[01/50] [abbrv] ambari git commit: AMBARI-22389. Exclude test scope jars from Log Search / Log Feeder rpm/deb packages (oleewere)

2017-11-22 Thread amagyar
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22008 8f2ccf949 -> bd5320232


AMBARI-22389. Exclude test scope jars from Log Search / Log Feeder rpm/deb 
packages (oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 444718a10479c02dc6251ab8dc56eae70723f7bb
Parents: 38476f7
Author: Oliver Szabo 
Authored: Thu Nov 9 14:18:46 2017 +0100
Committer: Oliver Szabo 
Committed: Thu Nov 9 14:19:17 2017 +0100

--
 ambari-logsearch/ambari-logsearch-logfeeder/pom.xml | 2 +-
 ambari-logsearch/ambari-logsearch-server/pom.xml| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/444718a1/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
--
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml 
b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
index 6b7d94f..01710bf 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
@@ -240,12 +240,12 @@
 
 
 
-  *
   
true
   ${basedir}/target/libs
   false
   false
   true
+  compile
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/444718a1/ambari-logsearch/ambari-logsearch-server/pom.xml
--
diff --git a/ambari-logsearch/ambari-logsearch-server/pom.xml 
b/ambari-logsearch/ambari-logsearch-server/pom.xml
index 2ad35f5..5444b00 100755
--- a/ambari-logsearch/ambari-logsearch-server/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-server/pom.xml
@@ -118,13 +118,13 @@
   copy-dependencies
 
 
-  *
   ambari-logsearch-web
   
true
   ${basedir}/target/libs
   false
   false
   true
+  compile
 
   
 



ambari git commit: AMBARI-22454. ambari-server upgrade to 2.6.1 should surface the GPL agreement (aonishuk)

2017-11-22 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 930c7d500 -> 135d88bc1


AMBARI-22454. ambari-server upgrade to 2.6.1 should surface the GPL agreement 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: 135d88bc1c9e650a6ff969bb1468cdd3a386a011
Parents: 930c7d5
Author: Andrew Onishuk 
Authored: Wed Nov 22 13:31:36 2017 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 22 13:31:36 2017 +0200

--
 .../python/ambari_server/serverConfiguration.py | 1532 ++
 .../main/python/ambari_server/serverSetup.py|5 +-
 2 files changed, 1535 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/135d88bc/ambari-server/src/main/python/ambari_server/serverConfiguration.py
--
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py 
b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
new file mode 100644
index 000..5eb12e1
--- /dev/null
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -0,0 +1,1532 @@
+#!/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 datetime
+import glob
+import os
+import re
+import shutil
+import stat
+import string
+import sys
+import tempfile
+import getpass
+import ambari_server.serverClassPath
+
+from ambari_commons.exceptions import FatalException
+from ambari_commons.os_check import OSCheck, OSConst
+from ambari_commons.os_family_impl import OsFamilyImpl
+from ambari_commons.os_utils import run_os_command, search_file, 
set_file_permissions, parse_log4j_file
+from ambari_commons.logging_utils import get_debug_mode, print_info_msg, 
print_warning_msg, print_error_msg, \
+  set_debug_mode
+from ambari_server.properties import Properties
+from ambari_server.userInput import get_validated_string_input
+from ambari_server.utils import compare_versions, locate_file, on_powerpc
+from ambari_server.ambariPath import AmbariPath
+
+
+OS_VERSION = OSCheck().get_os_major_version()
+OS_TYPE = OSCheck.get_os_type()
+OS_FAMILY = OSCheck.get_os_family()
+
+PID_NAME = "ambari-server.pid"
+
+# Non-root user setup commands
+NR_USER_PROPERTY = "ambari-server.user"
+
+BLIND_PASSWORD = "*"
+
+# Common messages
+PRESS_ENTER_MSG = "Press  to continue."
+
+OS_FAMILY_PROPERTY = "server.os_family"
+OS_TYPE_PROPERTY = "server.os_type"
+
+BOOTSTRAP_DIR_PROPERTY = "bootstrap.dir"
+RECOMMENDATIONS_DIR_PROPERTY = 'recommendations.dir'
+
+AMBARI_CONF_VAR = "AMBARI_CONF_DIR"
+AMBARI_PROPERTIES_FILE = "ambari.properties"
+AMBARI_ENV_FILE = "ambari-env.sh"
+AMBARI_KRB_JAAS_LOGIN_FILE = "krb5JAASLogin.conf"
+GET_FQDN_SERVICE_URL = "server.fqdn.service.url"
+
+SERVER_OUT_FILE_KEY = "ambari.output.file.path"
+VERBOSE_OUTPUT_KEY = "ambari.output.verbose"
+
+DEBUG_MODE_KEY = "ambari.server.debug"
+SUSPEND_START_MODE_KEY = "ambari.server.debug.suspend.start"
+
+# Environment variables
+AMBARI_SERVER_LIB = "AMBARI_SERVER_LIB"
+JAVA_HOME = "JAVA_HOME"
+
+AMBARI_VERSION_VAR = "AMBARI_VERSION_VAR"
+
+# JDK
+JAVA_HOME_PROPERTY = "java.home"
+JDK_NAME_PROPERTY = "jdk.name"
+JCE_NAME_PROPERTY = "jce.name"
+JDK_DOWNLOAD_SUPPORTED_PROPERTY = "jdk.download.supported"
+JCE_DOWNLOAD_SUPPORTED_PROPERTY = "jce.download.supported"
+
+# Stack JDK
+STACK_JAVA_HOME_PROPERTY = "stack.java.home"
+STACK_JDK_NAME_PROPERTY = "stack.jdk.name"
+STACK_JCE_NAME_PROPERTY = "stack.jce.name"
+STACK_JAVA_VERSION = "stack.java.version"
+
+
+#TODO property used incorrectly in local case, it was meant to be dbms name, 
not postgres database name,
+# has workaround for now, as we don't need dbms name if persistence_type=local
+JDBC_DATABASE_PROPERTY = "server.jdbc.database" # E.g., 
embedded|oracle|mysql|mssql|postgres
+JDBC_DATABASE_NAME_PROPERTY = 

ambari git commit: AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install LZO (aonishuk)

2017-11-22 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 135d88bc1 -> 7eb14a0a5


AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install 
LZO (aonishuk)


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

Branch: refs/heads/trunk
Commit: 7eb14a0a563eb478d3e47d910c4dbf66b05fdfdf
Parents: 135d88b
Author: Andrew Onishuk 
Authored: Wed Nov 22 13:45:30 2017 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 22 13:45:30 2017 +0200

--
 .../libraries/functions/__init__.py |  2 +-
 .../libraries/functions/get_lzo_packages.py | 50 ---
 .../libraries/functions/lzo_utils.py| 93 
 .../libraries/functions/package_conditions.py   |  8 +-
 .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 30 ---
 .../HDFS/2.1.0.2.0/package/scripts/hdfs.py  |  7 +-
 .../2.1.0.2.0/package/scripts/install_params.py |  4 -
 .../2.1.0.2.0/package/scripts/params_linux.py   |  5 --
 .../common-services/HDFS/3.0.0.3.0/metainfo.xml | 30 ---
 .../HDFS/3.0.0.3.0/package/scripts/hdfs.py  |  7 +-
 .../3.0.0.3.0/package/scripts/install_params.py |  4 -
 .../3.0.0.3.0/package/scripts/params_linux.py   |  4 -
 .../HIVE/0.12.0.2.0/package/scripts/hive.py |  3 +
 .../HIVE/2.1.0.3.0/package/scripts/hive.py  |  3 +
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py| 38 
 .../4.0.0.2.0/package/scripts/params_linux.py   |  5 +-
 .../OOZIE/4.2.0.3.0/package/scripts/oozie.py| 16 ++--
 .../4.2.0.3.0/package/scripts/params_linux.py   |  5 +-
 .../YARN/2.1.0.2.0/package/scripts/yarn.py  |  3 +
 .../YARN/3.0.0.3.0/package/scripts/yarn.py  |  3 +
 .../stacks/HDP/2.2/services/HDFS/metainfo.xml   | 35 
 .../stacks/HDP/2.3/services/HDFS/metainfo.xml   | 30 ---
 .../stacks/HDP/3.0/services/HDFS/metainfo.xml   | 30 ---
 .../stacks/2.2/configs/oozie-upgrade.json   |  3 +-
 24 files changed, 142 insertions(+), 276 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7eb14a0a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
index f144b2d..b907844 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
@@ -39,7 +39,7 @@ from resource_management.libraries.functions.version import *
 from resource_management.libraries.functions.format_jvm_option import *
 from resource_management.libraries.functions.constants import *
 from resource_management.libraries.functions.get_stack_version import *
-from resource_management.libraries.functions.get_lzo_packages import *
+from resource_management.libraries.functions.lzo_utils import *
 from resource_management.libraries.functions.setup_ranger_plugin import *
 from resource_management.libraries.functions.curl_krb_request import *
 from resource_management.libraries.functions.get_bare_principal import *

http://git-wip-us.apache.org/repos/asf/ambari/blob/7eb14a0a/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
deleted file mode 100644
index cfbb7d8..000
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
+++ /dev/null
@@ -1,50 +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.
-
-Ambari 

[39/50] [abbrv] ambari git commit: AMBARI-22260. Update Spark2 log4j default settings to latest. (sai.sai.shao via sshridhar).

2017-11-22 Thread amagyar
AMBARI-22260. Update Spark2 log4j default settings to latest. (sai.sai.shao via 
sshridhar).


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 4042f9fde14548be77a5ed5daf45364df307c08a
Parents: 0936f46
Author: Swapan Shridhar 
Authored: Wed Nov 15 16:21:31 2017 -0800
Committer: Swapan Shridhar 
Committed: Wed Nov 15 16:21:31 2017 -0800

--
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml  | 23 
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 23 +---
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml | 45 +---
 .../configuration/spark2-log4j-properties.xml   | 56 
 4 files changed, 122 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4042f9fd/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 b1e5f91..8c2c860 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
@@ -104,14 +104,37 @@
 
 
 
+  
+
+  
+spark2-log4j-properties
+
+
+  
+
+  
   
 
+  
+spark2-log4j-properties
+
+
+  
   
 spark2-defaults
 
   
 
   
+  
+
+  
+spark2-log4j-properties
+
+
+  
+
+  
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4042f9fd/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 ace9542..9caa850 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
@@ -77,7 +77,7 @@
   
 FLUME_HANDLER
   
-  
+
   
 ACCUMULO_TRACER
 ACCUMULO_GC
@@ -355,7 +355,7 @@
 
   Validate Root Queue Ordering Policy
 
-   
+  
 
   
   
@@ -679,6 +679,15 @@
   Add queue customization property
 
   
+  
+
+  
+  
+
+  
+  
+
+  
 
 
 
 
   false
@@ -1083,7 +1092,7 @@
 FLUME_HANDLER
   
 
-
+
 
   false
   true
@@ -1112,7 +1121,7 @@
 
 
   UPGRADE
-  
+
   
 
   
@@ -1192,7 +1201,7 @@
 setup_ranger_java_patches
   
 
-
+
 
 
 
@@ -1215,7 +1224,7 @@
 configure_atlas_user_for_tagsync
   
 
-
+
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4042f9fd/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 df11ae1..4fc9b42 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
@@ -183,7 +183,7 @@
 HBASE_MASTER
   
 
-
+
 
   UPGRADE
   true
@@ -199,7 +199,7 @@
 LOGSEARCH
   
 
-
+
 
   false
   true
@@ -207,7 +207,7 @@
 DATANODE
 NFS_GATEWAY
   
-  
+
   
 HBASE_REGIONSERVER
 PHOENIX_QUERY_SERVER
@@ -223,7 +223,7 @@
 The initial batch of {{components}} hosts have been 
{{direction.past}}. You are advised to check the hosts and perform 
cluster/workload-specific tests against your cluster to ensure proper operation 
before proceeding with {{direction.text}} of the remaining services.
   
 
-
+
 
   UPGRADE
   true
@@ -458,7 +458,7 @@
 
 
   UPGRADE
-  
+
   
 
   
@@ -467,7 

[07/50] [abbrv] ambari git commit: AMBARI-22303. Spark history server is stopped (with umask 027 and custom spark log/pid dir) (aonishuk)

2017-11-22 Thread amagyar
AMBARI-22303. Spark history server is stopped (with umask 027 and custom spark 
log/pid dir) (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 46ad6c6878b00f7791845ecf7c2b3fef7244faad
Parents: feccebc
Author: Andrew Onishuk 
Authored: Fri Nov 10 12:53:06 2017 +0200
Committer: Andrew Onishuk 
Committed: Fri Nov 10 12:53:06 2017 +0200

--
 .../SPARK/1.2.1/package/scripts/setup_spark.py  |  3 ++-
 .../SPARK2/2.0.0/package/scripts/setup_spark.py |  3 ++-
 .../python/stacks/2.2/SPARK/test_job_history_server.py  | 12 
 .../test/python/stacks/2.2/SPARK/test_spark_client.py   | 12 
 .../python/stacks/2.3/SPARK/test_spark_thrift_server.py |  6 --
 5 files changed, 24 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/46ad6c68/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
index 53c8f9e..6a29efb 100644
--- 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
+++ 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/setup_spark.py
@@ -52,7 +52,8 @@ def setup_spark(env, type, upgrade_type=None, action=None, 
config_dir=None):
 owner=params.spark_user,
 group=params.user_group,
 mode=0775,
-create_parents = True
+create_parents = True,
+cd_access = 'a',
   )
   if type == 'server' and action == 'config':
 params.HdfsResource(params.spark_hdfs_user_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/46ad6c68/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
 
b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
index a7b8459..792b2a1 100755
--- 
a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
+++ 
b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/setup_spark.py
@@ -42,7 +42,8 @@ def setup_spark(env, type, upgrade_type = None, action = 
None):
 owner=params.spark_user,
 group=params.user_group,
 mode=0775,
-create_parents = True
+create_parents = True,
+cd_access = 'a',
   )
   if type == 'server' and action == 'config':
 params.HdfsResource(params.spark_hdfs_user_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/46ad6c68/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py 
b/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
index 922ace2..8801746 100644
--- a/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
+++ b/ambari-server/src/test/python/stacks/2.2/SPARK/test_job_history_server.py
@@ -165,13 +165,15 @@ class TestJobHistoryServer(RMFTestCase):
 owner = 'spark',
 group = 'hadoop',
 create_parents = True,
-mode = 0775
+mode = 0775,
+cd_access = 'a',
 )
 self.assertResourceCalled('Directory', '/var/log/spark',
 owner = 'spark',
 group = 'hadoop',
 create_parents = True,
-mode = 0775
+mode = 0775,
+cd_access = 'a',
 )
 self.assertResourceCalled('HdfsResource', '/user/spark',
 immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
@@ -246,13 +248,15 @@ class TestJobHistoryServer(RMFTestCase):
 owner = 'spark',
 group = 'hadoop',
 create_parents = True,
-mode = 0775
+mode = 0775,
+cd_access = 'a',
 )
 self.assertResourceCalled('Directory', '/var/log/spark',
 owner = 'spark',
 group = 'hadoop',
 create_parents = True,
-mode = 0775
+mode = 0775,
+cd_access = 'a',
 )
 self.assertResourceCalled('HdfsResource', '/user/spark',
 immutable_paths = 

[29/50] [abbrv] ambari git commit: AMBARI-22398. Upstart is not able to stop the ambari-agent - fix unit test

2017-11-22 Thread amagyar
AMBARI-22398. Upstart is not able to stop the ambari-agent - fix unit test


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: a4e7bf379dc2392253bd9bad3ab42ab9c2d9552e
Parents: 2b917f4
Author: Attila Doroszlai 
Authored: Wed Nov 15 12:56:23 2017 +0100
Committer: Attila Doroszlai 
Committed: Wed Nov 15 12:56:23 2017 +0100

--
 ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a4e7bf37/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py 
b/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py
index 8ff192a..56a73fc 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestAmbariAgent.py
@@ -35,8 +35,7 @@ class TestAmbariAgent(unittest.TestCase):
   @patch("os.path.isfile")
   @patch("os.remove")
   @patch("os.killpg")
-  @patch("os.setpgrp")
-  def test_main(self, os_setpgrp_mock, os_killpg_mock, os_remove_mock,
+  def test_main(self, os_killpg_mock, os_remove_mock,
 os_path_isfile_mock, subprocess_popen_mock):
 facter1 = MagicMock()
 facter2 = MagicMock()
@@ -49,7 +48,6 @@ class TestAmbariAgent(unittest.TestCase):
 sys.argv[0] = "test data"
 AmbariAgent.main()
 
-self.assertTrue(os_setpgrp_mock.called)
 self.assertTrue(subprocess_popen_mock.called)
 self.assertTrue(subprocess_popen_mock.call_count == 2)
 self.assertTrue(facter1.communicate.called)



[26/50] [abbrv] ambari git commit: AMBARI-22321 : Changed ambari version from 2.6.0.0 to 2.6.3.0. Addendum patch (mradhakrishnan on behalf of ydavis)

2017-11-22 Thread amagyar
AMBARI-22321 : Changed ambari version from 2.6.0.0 to 2.6.3.0. Addendum patch 
(mradhakrishnan on behalf of ydavis)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 869e1aaeaaf8a03a374bfe8d7fd992e1a048aaad
Parents: 3297dfa
Author: Madhuvanthi Radhakrishnan 
Authored: Tue Nov 14 11:57:05 2017 -0800
Committer: Madhuvanthi Radhakrishnan 
Committed: Tue Nov 14 11:57:05 2017 -0800

--
 .../HDP/2.0.6/properties/stack_features.json   | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/869e1aae/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
index 702fb13..f79cfe0 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_features.json
@@ -429,9 +429,24 @@
 "min_version": "2.6.0.0"
   },
   {
+"name": "registry_remove_rootpath",
+"description": "Registry remove root path setting",
+"min_version": "2.6.3.0"
+  },
+  {
+"name": "registry_allowed_resources_support",
+"description": "Registry allowed resources",
+"min_version": "2.6.3.0"
+  },
+  {
+"name": "registry_rewriteuri_filter_support",
+"description": "Registry RewriteUri servlet filter",
+"min_version": "2.6.3.0"
+  },
+  {
 "name": "sam_storage_core_in_registry",
 "description": "Storage core module moved to registry",
-"min_version": "2.6.0.0"
+"min_version": "2.6.3.0"
   }
 ]
   }



[27/50] [abbrv] ambari git commit: Revert "AMBARI-22383. Remove Auto-Installation of LZO Libraries (ncole)"

2017-11-22 Thread amagyar
Revert "AMBARI-22383. Remove Auto-Installation of LZO Libraries (ncole)"

This reverts commit 5adcea78792cf227f15e7c08f5bb3fe2c48883d3.


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: ba00ed956706cc80deff58f22799ed54a8bcadd8
Parents: 869e1aa
Author: Nate Cole 
Authored: Tue Nov 14 18:39:14 2017 -0500
Committer: Nate Cole 
Committed: Tue Nov 14 18:39:14 2017 -0500

--
 .../libraries/functions/__init__.py |  1 +
 .../libraries/functions/get_lzo_packages.py | 50 
 .../libraries/functions/package_conditions.py   |  8 +++-
 .../DRUID/0.10.1/package/scripts/druid.py   |  3 +-
 .../DRUID/0.10.1/package/scripts/params.py  |  3 +-
 .../common-services/HDFS/2.1.0.2.0/metainfo.xml | 30 
 .../HDFS/2.1.0.2.0/package/scripts/datanode.py  |  1 +
 .../HDFS/2.1.0.2.0/package/scripts/hdfs.py  |  7 +++
 .../2.1.0.2.0/package/scripts/hdfs_client.py|  1 +
 .../2.1.0.2.0/package/scripts/install_params.py |  1 -
 .../2.1.0.2.0/package/scripts/journalnode.py|  1 +
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py  |  1 +
 .../common-services/HDFS/3.0.0.3.0/metainfo.xml | 30 
 .../HDFS/3.0.0.3.0/package/scripts/hdfs.py  |  7 +++
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py|  6 ++-
 .../package/scripts/oozie_server_upgrade.py |  7 +--
 .../4.0.0.2.0/package/scripts/params_linux.py   |  1 -
 .../OOZIE/4.2.0.3.0/package/scripts/oozie.py|  4 ++
 .../package/scripts/oozie_server_upgrade.py |  5 --
 .../TEZ/0.4.0.2.1/package/scripts/tez_client.py | 32 +
 .../TEZ/0.9.0.3.0/package/scripts/tez_client.py | 26 ++
 .../custom_actions/scripts/remove_bits.py   |  2 +-
 .../BIGTOP/0.8/services/HDFS/metainfo.xml   | 16 +++
 .../0.8/services/HDFS/package/scripts/params.py |  6 ++-
 .../stacks/HDP/2.2/services/HDFS/metainfo.xml   | 35 ++
 .../2.3.GlusterFS/services/HDFS/metainfo.xml| 10 
 .../stacks/HDP/2.3/services/HDFS/metainfo.xml   | 30 
 .../stacks/HDP/3.0/services/HDFS/metainfo.xml   | 30 
 .../python/custom_actions/TestRemoveBits.py |  5 +-
 29 files changed, 339 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
index 1e388ac..f144b2d 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/__init__.py
@@ -39,6 +39,7 @@ from resource_management.libraries.functions.version import *
 from resource_management.libraries.functions.format_jvm_option import *
 from resource_management.libraries.functions.constants import *
 from resource_management.libraries.functions.get_stack_version import *
+from resource_management.libraries.functions.get_lzo_packages import *
 from resource_management.libraries.functions.setup_ranger_plugin import *
 from resource_management.libraries.functions.curl_krb_request import *
 from resource_management.libraries.functions.get_bare_principal import *

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba00ed95/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
new file mode 100644
index 000..cfbb7d8
--- /dev/null
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py
@@ -0,0 +1,50 @@
+#!/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 

[23/50] [abbrv] ambari git commit: AMBARI-22426. Push down Logger instances (adoroszlai)

2017-11-22 Thread amagyar
http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
index ca4fe6e..0162928 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/FlumeServiceCalculatedState.java
@@ -27,6 +27,8 @@ import 
org.apache.ambari.server.controller.ServiceComponentHostRequest;
 import org.apache.ambari.server.controller.ServiceComponentHostResponse;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Determines the service status for Flume.  Generically, this means that
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class FlumeServiceCalculatedState extends 
DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = 
LoggerFactory.getLogger(FlumeServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
 try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
index eac0dce..58d1687 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HBaseServiceCalculatedState.java
@@ -32,6 +32,8 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Calculator of HBase service state.
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class HBaseServiceCalculatedState extends 
DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = 
LoggerFactory.getLogger(HBaseServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
 try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
index 7bbad2a..68cb4f1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HDFSServiceCalculatedState.java
@@ -32,6 +32,8 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Calculator of HDFS service state.
@@ -40,6 +42,8 @@ import org.apache.ambari.server.state.State;
 public final class HDFSServiceCalculatedState extends 
DefaultServiceCalculatedState
   implements ServiceCalculatedState {
 
+  private static final Logger LOG = 
LoggerFactory.getLogger(HDFSServiceCalculatedState.class);
+
   @Override
   public State getState(String clusterName, String serviceName) {
 try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ed7e121f/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HiveServiceCalculatedState.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HiveServiceCalculatedState.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/state/HiveServiceCalculatedState.java
index 77e44a5..353cf5f 100644
--- 

[08/50] [abbrv] ambari git commit: AMBARI-22346. Beeline connection hangs for longer time when connection to HS2 with metastore DB down (aonishuk)

2017-11-22 Thread amagyar
AMBARI-22346. Beeline connection hangs for longer time when connection to HS2 
with metastore DB down (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 98915a114769c7ddd590854ccf0ab33beabddcf3
Parents: 46ad6c6
Author: Andrew Onishuk 
Authored: Fri Nov 10 13:28:27 2017 +0200
Committer: Andrew Onishuk 
Committed: Fri Nov 10 13:28:27 2017 +0200

--
 .../HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py | 3 ++-
 .../1.2.1/package/scripts/alerts/alert_spark_thrift_port.py  | 8 +++-
 .../2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py | 8 +++-
 3 files changed, 16 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/98915a11/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
index 3560bf8..6db92b0 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
@@ -28,6 +28,7 @@ from resource_management.libraries.functions import format
 from resource_management.libraries.functions import get_kinit_path
 from ambari_commons.os_check import OSConst
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
+from resource_management.core.signal_utils import TerminateStrategy
 
 OK_MESSAGE = "TCP OK - {0:.3f}s response on port {1}"
 CRITICAL_MESSAGE = "Connection failed on host {0}:{1} ({2})"
@@ -271,7 +272,7 @@ def execute(configurations={}, parameters={}, 
host_name=None):
 
 start_time = time.time()
 try:
-  Execute(cmd, user=hiveuser, timeout=30)
+  Execute(cmd, user=hiveuser, timeout=30, 
timeout_kill_strategy=TerminateStrategy.KILL_PROCESS_TREE)
   total_time = time.time() - start_time
   result_code = 'OK'
   label = OK_MESSAGE.format(total_time, port)

http://git-wip-us.apache.org/repos/asf/ambari/blob/98915a11/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
index 3f80fd9..6874cb4 100644
--- 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
+++ 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/alerts/alert_spark_thrift_port.py
@@ -27,6 +27,7 @@ from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions import get_kinit_path
 from resource_management.core.resources import Execute
 from resource_management.core import global_lock
+from resource_management.core.signal_utils import TerminateStrategy
 
 stack_root = Script.get_stack_root()
 
@@ -140,7 +141,12 @@ def execute(configurations={}, parameters={}, 
host_name=None):
 
 start_time = time.time()
 try:
-Execute(cmd, user=hiveruser, path=[beeline_cmd], 
timeout=CHECK_COMMAND_TIMEOUT_DEFAULT)
+Execute(cmd,
+user=hiveruser,
+path=[beeline_cmd],
+timeout=CHECK_COMMAND_TIMEOUT_DEFAULT,
+timeout_kill_strategy=TerminateStrategy.KILL_PROCESS_TREE,
+)
 total_time = time.time() - start_time
 result_code = 'OK'
 label = OK_MESSAGE.format(total_time, port)

http://git-wip-us.apache.org/repos/asf/ambari/blob/98915a11/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
 
b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/alerts/alert_spark2_thrift_port.py
index 9e1afea..d3660de 100644
--- 

[40/50] [abbrv] ambari git commit: AMBARI-22460. NFSGateway start failed (aonishuk)

2017-11-22 Thread amagyar
AMBARI-22460. NFSGateway start failed (aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: f087874e7b0bc1e5b5a2398c7571264aaec15fa5
Parents: 4042f9f
Author: Andrew Onishuk 
Authored: Thu Nov 16 12:26:56 2017 +0200
Committer: Andrew Onishuk 
Committed: Thu Nov 16 12:26:56 2017 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/f087874e/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
index 78a31f1..3f576bf 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/role_command_order.json
@@ -14,6 +14,7 @@
 "HIVE_SERVER-RESTART": ["NODEMANAGER-RESTART", "MYSQL_SERVER-RESTART", 
"ZOOKEEPER_SERVER-RESTART"],
 "HUE_SERVER-START": ["HIVE_SERVER-START", "HCAT-START", 
"OOZIE_SERVER-START"],
 "FLUME_HANDLER-START": ["OOZIE_SERVER-START"],
+"NFS_GATEWAY-START": ["NAMENODE-START"],
 "MAPREDUCE_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START", 
"RESOURCEMANAGER-START"],
 "OOZIE_SERVICE_CHECK-SERVICE_CHECK": ["OOZIE_SERVER-START", 
"MAPREDUCE2_SERVICE_CHECK-SERVICE_CHECK"],
 "HBASE_SERVICE_CHECK-SERVICE_CHECK": ["HBASE_MASTER-START", 
"HBASE_REGIONSERVER-START"],



[36/50] [abbrv] ambari git commit: AMBARI-22444 - Add Native Libraries To Tez Tarball (jonathanhurley)

2017-11-22 Thread amagyar
AMBARI-22444 - Add Native Libraries To Tez Tarball (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: c67a3246e2121c6977094e10cdb1414f45cf1482
Parents: 99152d3
Author: Jonathan Hurley 
Authored: Tue Nov 14 16:19:30 2017 -0500
Committer: Jonathan Hurley 
Committed: Wed Nov 15 15:30:36 2017 -0500

--
 .../libraries/functions/copy_tarball.py | 82 +---
 .../libraries/functions/tar_archive.py  |  6 +-
 .../stacks/2.1/FALCON/test_falcon_server.py |  6 +-
 3 files changed, 80 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c67a3246/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
index 219430a..f62aa3d 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
@@ -23,18 +23,74 @@ __all__ = ["copy_to_hdfs", 
"get_sysprep_skip_copy_tarballs_hdfs"]
 import os
 import tempfile
 import re
+import tarfile
+from contextlib import closing
 
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 from resource_management.libraries.functions.default import default
 from resource_management.core import shell
+from resource_management.core import sudo
 from resource_management.core.logger import Logger
+from resource_management.core.exceptions import Fail
+from resource_management.core.resources.system import Execute
 from resource_management.libraries.functions import stack_tools, 
stack_features, stack_select
+from resource_management.libraries.functions import tar_archive
 
 STACK_NAME_PATTERN = "{{ stack_name }}"
 STACK_ROOT_PATTERN = "{{ stack_root }}"
 STACK_VERSION_PATTERN = "{{ stack_version }}"
 
+def _prepare_tez_tarball():
+  """
+  Prepares the Tez tarball by adding the Hadoop native libraries found in the 
mapreduce tarball.
+  :return:  the full path of the newly created tez tarball to use
+  """
+  import tempfile
+
+  Logger.info("Preparing the Tez tarball...")
+
+  # get the mapreduce tarball which matches the version of tez
+  # tez installs the mapreduce tar, so it should always be present
+  _, mapreduce_source_file, _, _ = get_tarball_paths("mapreduce")
+  _, tez_source_file, _, _ = get_tarball_paths("tez")
+
+  temp_dir = Script.get_tmp_dir()
+
+  mapreduce_temp_dir = tempfile.mkdtemp(prefix="mapreduce-tarball-", 
dir=temp_dir)
+  tez_temp_dir = tempfile.mkdtemp(prefix="tez-tarball-", dir=temp_dir)
+
+  Logger.info("Extracting {0} to {1}".format(mapreduce_source_file, 
mapreduce_temp_dir))
+  tar_archive.extract_archive(mapreduce_source_file, mapreduce_temp_dir)
+
+  Logger.info("Extracting {0} to {1}".format(tez_source_file, tez_temp_dir))
+  tar_archive.untar_archive(tez_source_file, tez_temp_dir)
+
+  hadoop_lib_native_dir = os.path.join(mapreduce_temp_dir, "hadoop", "lib", 
"native")
+  tez_lib_dir = os.path.join(tez_temp_dir, "lib")
+
+  if not os.path.exists(hadoop_lib_native_dir):
+raise Fail("Unable to seed the Tez tarball with native libraries since the 
source Hadoop native lib directory {0} does not 
exist".format(hadoop_lib_native_dir))
+
+  if not os.path.exists(tez_lib_dir):
+raise Fail("Unable to seed the Tez tarball with native libraries since the 
target Tez lib directory {0} does not exist".format(tez_lib_dir))
+
+  Execute(("cp", "-a", hadoop_lib_native_dir, tez_lib_dir), sudo = True)
+
+  tez_tarball_with_native_lib = os.path.join(os.path.dirname(tez_source_file), 
"tez-native.tar.gz")
+  Logger.info("Creating a new Tez tarball at 
{0}".format(tez_tarball_with_native_lib))
+
+  # tar up Tez, making sure to specify nothing for the arcname so that it does 
not include an absolute path
+  with closing(tarfile.open(tez_tarball_with_native_lib, "w:gz")) as 
new_tez_tarball:
+new_tez_tarball.add(tez_temp_dir, arcname=os.path.sep)
+
+  # cleanup
+  sudo.rmtree(mapreduce_temp_dir)
+  sudo.rmtree(tez_temp_dir)
+
+  return tez_tarball_with_native_lib
+
+
 # TODO, in the future, each stack can define its own mapping of tarballs
 # inside the stack definition directory in some sort of xml file.
 # PLEASE DO NOT put this in cluster-env 

[33/50] [abbrv] ambari git commit: AMBARI-22418. Make Ambari configuration API consistent with existing API. (rlevas)

2017-11-22 Thread amagyar
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f2743b5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
new file mode 100644
index 000..ea9cf4f
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RootServiceComponentConfigurationResourceProvider.java
@@ -0,0 +1,476 @@
+/*
+ * 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.controller.internal;
+
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.RootComponent;
+import org.apache.ambari.server.controller.RootService;
+import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
+import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.RequestStatus;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
+import org.apache.ambari.server.controller.utilities.PredicateHelper;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.apache.ambari.server.events.AmbariConfigurationChangedEvent;
+import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
+import org.apache.ambari.server.orm.dao.AmbariConfigurationDAO;
+import org.apache.ambari.server.orm.entities.AmbariConfigurationEntity;
+import org.apache.ambari.server.security.authorization.RoleAuthorization;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.inject.Inject;
+
+public class RootServiceComponentConfigurationResourceProvider extends 
AbstractAuthorizedResourceProvider {
+
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(RootServiceComponentConfigurationResourceProvider.class);
+
+  static final String RESOURCE_KEY = "Configuration";
+
+  static final String CONFIGURATION_CATEGORY_PROPERTY_ID = 
PropertyHelper.getPropertyId(RESOURCE_KEY, "category");
+  static final String CONFIGURATION_PROPERTIES_PROPERTY_ID = 
PropertyHelper.getPropertyId(RESOURCE_KEY, "properties");
+  static final String CONFIGURATION_COMPONENT_NAME_PROPERTY_ID = 
PropertyHelper.getPropertyId(RESOURCE_KEY, "component_name");
+  static final String CONFIGURATION_SERVICE_NAME_PROPERTY_ID = 
PropertyHelper.getPropertyId(RESOURCE_KEY, "service_name");
+
+  private static final Set PROPERTIES;
+
+  private static final Map PK_PROPERTY_MAP;
+
+  private static final Set PK_PROPERTY_IDS;
+
+  static {
+Set set = new HashSet<>();
+set.add(CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
+set.add(CONFIGURATION_COMPONENT_NAME_PROPERTY_ID);
+set.add(CONFIGURATION_CATEGORY_PROPERTY_ID);
+set.add(CONFIGURATION_PROPERTIES_PROPERTY_ID);
+
+PROPERTIES = Collections.unmodifiableSet(set);
+
+Map map = new HashMap<>();
+map.put(Resource.Type.RootService, CONFIGURATION_SERVICE_NAME_PROPERTY_ID);
+map.put(Resource.Type.RootServiceComponent, 
CONFIGURATION_COMPONENT_NAME_PROPERTY_ID);
+map.put(Resource.Type.RootServiceComponentConfiguration, 
CONFIGURATION_CATEGORY_PROPERTY_ID);
+
+PK_PROPERTY_MAP = Collections.unmodifiableMap(map);
+PK_PROPERTY_IDS = 

[13/50] [abbrv] ambari git commit: AMBARI-22416 Log Search UI: fixes for filtering form. (ababiichuk)

2017-11-22 Thread amagyar
AMBARI-22416 Log Search UI: fixes for filtering form. (ababiichuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 7c4a7e4c52e00282e5b8b901cef14c143fd3da2b
Parents: 068d82f
Author: ababiichuk 
Authored: Fri Nov 10 18:16:45 2017 +0200
Committer: ababiichuk 
Committed: Fri Nov 10 23:53:24 2017 +0200

--
 .../ambari-logsearch-web/src/app/app.module.ts  |   2 -
 .../src/app/classes/filtering.ts| 355 +-
 .../src/app/classes/models/app-state.ts |   6 +-
 .../src/app/classes/models/node-item.ts |  30 +
 .../src/app/classes/models/node.ts  |  30 -
 .../src/app/classes/models/store.ts |   6 +-
 .../src/app/classes/models/tab.ts   |  12 +-
 .../src/app/components/app.component.ts |   6 +-
 .../dropdown-button.component.html  |   4 +-
 .../dropdown-button.component.spec.ts   |   2 -
 .../dropdown-button.component.ts|  55 +-
 .../dropdown-list/dropdown-list.component.html  |   2 +-
 .../dropdown-list.component.spec.ts |   6 +-
 .../filter-button.component.spec.ts |   2 -
 .../filter-button/filter-button.component.ts|  35 +-
 .../filter-dropdown.component.spec.ts   |  14 +-
 .../filter-dropdown.component.ts|  22 +-
 .../filters-panel/filters-panel.component.html  |   6 +-
 .../filters-panel.component.spec.ts |   6 +-
 .../filters-panel/filters-panel.component.ts|  18 +-
 .../log-context/log-context.component.spec.ts   |   4 +-
 .../logs-container.component.spec.ts|   2 -
 .../logs-container/logs-container.component.ts  |  26 +-
 .../logs-list/logs-list.component.html  |   3 +-
 .../logs-list/logs-list.component.spec.ts   |  21 +-
 .../components/logs-list/logs-list.component.ts |  10 +-
 .../menu-button/menu-button.component.spec.ts   |   2 -
 .../menu-button/menu-button.component.ts|   4 +-
 .../pagination-controls.component.ts|   7 +-
 .../pagination/pagination.component.html|   2 +-
 .../pagination/pagination.component.spec.ts |   9 +-
 .../pagination/pagination.component.ts  |  10 +-
 .../search-box/search-box.component.ts  |  12 +-
 .../time-range-picker.component.html|   3 +-
 .../time-range-picker.component.spec.ts |  29 +-
 .../time-range-picker.component.ts  |  47 +-
 .../timezone-picker.component.spec.ts   |   2 -
 .../services/component-actions.service.spec.ts  |   2 -
 .../app/services/component-actions.service.ts   |  24 +-
 .../component-generator.service.spec.ts |   2 -
 .../src/app/services/filtering.service.spec.ts  |  97 ---
 .../src/app/services/filtering.service.ts   | 253 ---
 .../app/services/logs-container.service.spec.ts |  31 +-
 .../src/app/services/logs-container.service.ts  | 678 ++-
 .../src/app/services/utils.service.spec.ts  | 285 +++-
 .../src/app/services/utils.service.ts   |  65 +-
 46 files changed, 1257 insertions(+), 992 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
--
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts 
b/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
index 56562df..37f3a49 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
@@ -34,7 +34,6 @@ import {environment} from '@envs/environment';
 import {mockApiDataService} from '@app/services/mock-api-data.service'
 import {HttpClientService} from '@app/services/http-client.service';
 import {ComponentActionsService} from 
'@app/services/component-actions.service';
-import {FilteringService} from '@app/services/filtering.service';
 import {UtilsService} from '@app/services/utils.service';
 import {LogsContainerService} from '@app/services/logs-container.service';
 import {ComponentGeneratorService} from 
'@app/services/component-generator.service';
@@ -164,7 +163,6 @@ export function getXHRBackend(injector: Injector, browser: 
BrowserXhr, xsrf: XSR
   providers: [
 HttpClientService,
 ComponentActionsService,
-FilteringService,
 UtilsService,
 LogsContainerService,
 ComponentGeneratorService,

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c4a7e4c/ambari-logsearch/ambari-logsearch-web/src/app/classes/filtering.ts

[04/50] [abbrv] ambari git commit: AMBARI-22400 Ambari 3.0: Implement new design for Admin View: Cluster Information page. (atkach)

2017-11-22 Thread amagyar
AMBARI-22400 Ambari 3.0: Implement new design for Admin View: Cluster 
Information page. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 430dcbf1224996c76276a8c40fb58eb54addd10a
Parents: e968b12
Author: Andrii Tkach 
Authored: Thu Nov 9 16:13:29 2017 +0200
Committer: Andrii Tkach 
Committed: Thu Nov 9 16:53:02 2017 +0200

--
 .../main/resources/ui/admin-web/app/index.html  |   3 +-
 .../app/scripts/controllers/AppCtrl.js  |   2 +-
 .../controllers/ClusterInformationCtrl.js   |  65 +++
 .../controllers/clusters/ExportBlueprintCtrl.js |  58 --
 .../app/scripts/controllers/mainCtrl.js |  27 -
 .../ui/admin-web/app/scripts/i18n.config.js |  13 +--
 .../ui/admin-web/app/scripts/routes.js  |  59 +-
 .../app/styles/cluster-information.css  |  59 ++
 .../resources/ui/admin-web/app/styles/main.css  |  98 -
 .../admin-web/app/views/clusterInformation.html |  66 
 .../app/views/clusters/exportBlueprint.html |  40 ---
 .../ui/admin-web/app/views/groups/list.html |   3 +-
 .../resources/ui/admin-web/app/views/main.html  | 107 ---
 .../app/views/remoteClusters/list.html  |   3 +-
 .../ui/admin-web/app/views/sideNav.html |  19 ++--
 .../admin-web/app/views/stackVersions/list.html |   3 +-
 .../ui/admin-web/app/views/users/list.html  |   3 +-
 .../test/unit/services/Utility_test.js  |   2 +-
 18 files changed, 240 insertions(+), 390 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/index.html
--
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/index.html 
b/ambari-admin/src/main/resources/ui/admin-web/app/index.html
index 41cc60f..2b350f0 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/index.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/index.html
@@ -121,7 +121,7 @@
 
 
 
-
+
 
 
 
@@ -142,7 +142,6 @@
 
 
 
-
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
index 4ac5b38..eb9a9b0 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/AppCtrl.js
@@ -31,7 +31,7 @@ angular.module('ambariAdminConsole')
 return $route.current;
   }, function (value) {
 var breadcrumbs = [$t('common.admin')];
-if (value && value.$$route.label) {
+if (value && value.$$route && value.$$route.label) {
   breadcrumbs.push(value.$$route.label);
 }
 $scope.breadcrumbs = breadcrumbs;

http://git-wip-us.apache.org/repos/asf/ambari/blob/430dcbf1/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ClusterInformationCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ClusterInformationCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ClusterInformationCtrl.js
new file mode 100644
index 000..60a610c
--- /dev/null
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ClusterInformationCtrl.js
@@ -0,0 +1,65 @@
+/**
+ * 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.
+ */
+'use strict';
+
+angular.module('ambariAdminConsole')
+.controller('ClusterInformationCtrl', 

[48/50] [abbrv] ambari git commit: AMBARI-22424. Quicklinks for OneFS (amagyar)

2017-11-22 Thread amagyar
AMBARI-22424. Quicklinks for OneFS (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 6fedb9f5ee4be16d2c856f944d8b7322d348ff33
Parents: 43840c5
Author: Attila Magyar 
Authored: Mon Nov 13 16:00:50 2017 +0100
Committer: Attila Magyar 
Committed: Wed Nov 22 10:55:11 2017 +0100

--
 .../ambari/server/state/quicklinks/Host.java| 75 
 .../ambari/server/state/quicklinks/Link.java| 13 
 .../QuickLinksConfigurationModuleTest.java  |  3 +
 .../resources/child_quicklinks_to_override.json |  4 ++
 .../app/views/common/quick_view_link_view.js| 64 +
 .../test/views/common/quick_link_view_test.js   | 15 +++-
 .../addon-services/ONEFS/1.0.0/metainfo.xml |  7 ++
 .../ONEFS/1.0.0/quicklinks/quicklinks.json  | 31 
 8 files changed, 197 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Host.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Host.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Host.java
new file mode 100644
index 000..074d4e7
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinks/Host.java
@@ -0,0 +1,75 @@
+/*
+ * 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.state.quicklinks;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+/**
+ * Quick links may override host names of host components with host names that 
come from configuration.
+ */
+@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Host {
+  /**
+   * The property name that has the host name if the protocol is http
+   */
+  @JsonProperty("http_property")
+  private String httpProperty;
+
+  /**
+   * The property name that has the host name if the protocol is https
+   */
+  @JsonProperty("https_property")
+  private String httpsProperty;
+
+  /**
+   * The config type where the overridden host name comes from
+   */
+  @JsonProperty("site")
+  private String site;
+
+  public String getHttpProperty() {
+return httpProperty;
+  }
+
+  public String getHttpsProperty() {
+return httpsProperty;
+  }
+
+  public String getSite() {
+return site;
+  }
+
+  public void mergeWithParent(Host parentHost) {
+if(null == parentHost) {
+  return;
+}
+if(null == httpProperty && null != parentHost.getHttpProperty()) {
+  httpProperty = parentHost.getHttpProperty();
+}
+if(null == httpsProperty && null != parentHost.getHttpsProperty()) {
+  httpsProperty = parentHost.getHttpsProperty();
+}
+if(null == site && null != parentHost.getSite()) {
+  site = parentHost.getSite();
+}
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/6fedb9f5/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 1d2e712..4e8e8a3 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
@@ -47,6 +47,9 @@ public class Link{
   @JsonProperty("port")
   private Port port;
 
+  @JsonProperty("host")
+  private Host host;
+
   

[37/50] [abbrv] ambari git commit: AMBARI-22445. Warn the user appropriately for default MySQL server install for Hive (vsubramanian)

2017-11-22 Thread amagyar
AMBARI-22445. Warn the user appropriately for default MySQL server install for 
Hive (vsubramanian)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 8fe6ac4bd03739202a35f8862270be7dcec95421
Parents: c67a324
Author: Vivek Ratnavel Subramanian 
Authored: Wed Nov 15 14:28:22 2017 -0800
Committer: Vivek Ratnavel Subramanian 
Committed: Wed Nov 15 14:28:22 2017 -0800

--
 ambari-web/app/views/common/controls_view.js   | 9 +++--
 ambari-web/test/views/common/controls_view_test.js | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8fe6ac4b/ambari-web/app/views/common/controls_view.js
--
diff --git a/ambari-web/app/views/common/controls_view.js 
b/ambari-web/app/views/common/controls_view.js
index 530b60a..63d08ce 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -543,8 +543,8 @@ App.ServiceConfigRadioButtons = 
Ember.View.extend(App.ServiceConfigCalculateId,
 if ((App.get('isHadoopWindowsStack') && this.get('inMSSQLWithIA')) || 
this.get('serviceConfig.name') === 'DB_FLAVOR') {
   this.onOptionsChange();
 }
-this.handleDBConnectionProperty();
   }
+  this.handleDBConnectionProperty();
 }
   },
 
@@ -748,6 +748,11 @@ App.ServiceConfigRadioButtons = 
Ember.View.extend(App.ServiceConfigCalculateId,
   // check for all db types when installing Ranger - not only for existing 
ones
   checkDatabase = true;
 }
+// Hive specific
+if (this.get('serviceConfig.serviceName') === 'HIVE') {
+  // check for all db types when installing Hive - not only for existing 
ones
+  checkDatabase = true;
+}
 if (propertyAppendTo1) {
   propertyAppendTo1.set('additionalView', null);
 }
@@ -757,7 +762,7 @@ App.ServiceConfigRadioButtons = 
Ember.View.extend(App.ServiceConfigCalculateId,
 var shouldAdditionalViewsBeSet = currentDB && checkDatabase && 
handledProperties.contains(this.get('serviceConfig.name')),
   driver = this.getDefaultPropertyValue('sql_jar_connector') ? 
this.getDefaultPropertyValue('sql_jar_connector').split("/").pop() : 
'driver.jar',
   dbType = this.getDefaultPropertyValue('db_type'),
-  additionalView1 = shouldAdditionalViewsBeSet ? 
App.CheckDBConnectionView.extend({databaseName: dbType}) : null,
+  additionalView1 = shouldAdditionalViewsBeSet && !this.get('isNewDb') ? 
App.CheckDBConnectionView.extend({databaseName: dbType}) : null,
   additionalView2 = shouldAdditionalViewsBeSet ? Ember.View.extend({
 template: Ember.Handlebars.compile('{{{view.message}}}'),
 message: function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8fe6ac4b/ambari-web/test/views/common/controls_view_test.js
--
diff --git a/ambari-web/test/views/common/controls_view_test.js 
b/ambari-web/test/views/common/controls_view_test.js
index 17dd6e1..76742fa 100644
--- a/ambari-web/test/views/common/controls_view_test.js
+++ b/ambari-web/test/views/common/controls_view_test.js
@@ -59,7 +59,7 @@ describe('App.ServiceConfigRadioButtons', function () {
   propertyAppendTo1: 'javax.jdo.option.ConnectionURL',
   propertyAppendTo2: 'hive_database',
   isAdditionalView1Null: true,
-  isAdditionalView2Null: true,
+  isAdditionalView2Null: false,
   title: 'Hive, embedded database'
 },
 {



[21/50] [abbrv] ambari git commit: AMBARI-22425 Ambari 3.0: Implement new design for Admin View: fix checkboxes. (atkach)

2017-11-22 Thread amagyar
AMBARI-22425 Ambari 3.0: Implement new design for Admin View: fix checkboxes. 
(atkach)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: d11faab139761a3e32da773e190951d10d1166f1
Parents: 7428e51
Author: Andrii Tkach 
Authored: Mon Nov 13 13:55:43 2017 +0200
Committer: Andrii Tkach 
Committed: Tue Nov 14 11:21:46 2017 +0200

--
 .../resources/ui/admin-web/app/styles/main.css  | 15 
 .../ui/admin-web/app/styles/top-nav.css |  3 ++
 .../admin-web/app/views/ambariViews/create.html | 20 +--
 .../admin-web/app/views/ambariViews/edit.html   | 37 +---
 .../app/views/authentication/main.html  |  8 ++---
 .../app/views/modals/AddVersionModal.html   | 14 
 .../admin-web/app/views/stackVersions/list.html | 11 --
 .../views/stackVersions/stackVersionPage.html   | 27 +++---
 8 files changed, 65 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
--
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css 
b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index 4224f62..9838227 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -459,6 +459,11 @@ table.no-border tr td{
   vertical-align: top;
 }
 
+.table td > .checkbox {
+  margin-bottom: 0;
+  margin-top: 0;
+}
+
 .groups-pane table ul{
   list-style-type: none;
   margin: 0;
@@ -821,15 +826,6 @@ accordion .panel-group .panel{
   padding-left: 19px;
 }
 
-.repo-version-inline {
-  left: 11%;
-}
-
-.repo-version-inline .repo-version-label {
-  text-align: left;
-
-}
-
 .repo-version-inline .dot {
   padding-right: 15px;
 }
@@ -1164,6 +1160,7 @@ thead.view-permission-header > tr > th {
 }
 
 .register-version-form .details-panel .control-label {
+  line-height: 20px;
   text-align: left;
   padding: 7px 2px;
   font-weight: normal;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css 
b/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css
index f93b2e6..327dc7f 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/top-nav.css
@@ -37,6 +37,9 @@
   font-size: 16px;
 }
 
+#top-nav .container {
+  background: #fff;
+}
 
 /** Override bootstrap styles **/
 @media (min-width: 0) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
 
b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
index 25f1487..81171c1 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
@@ -80,9 +80,8 @@
   
 
   
-
-   {{'views.visible' | translate}}
-
+
+{{'views.visible' | 
translate}}
   
 
   
@@ -122,9 +121,8 @@
 
 
   
-
-   {{'views.localCluster' | translate}}
-
+
+{{'views.localCluster' | translate}}
   
 
   
@@ -143,9 +141,8 @@
 
 
   
-
-   {{'views.remoteCluster' | translate}}
-
+
+{{'views.remoteCluster' | 
translate}}
   
 
   
@@ -164,9 +161,8 @@
 
 
   
-
-   {{'views.custom' | translate}}
-
+
+{{'views.custom' | translate}}
   
   
 {{form.instanceCreateForm.generalValidationError}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d11faab1/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html 
b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
index 

[41/50] [abbrv] ambari git commit: AMBARI-22121. Create mpack for Isilon OneFS (amagyar)

2017-11-22 Thread amagyar
AMBARI-22121. Create mpack for Isilon OneFS (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 2a1c2e496c14cd5b00c8c235a00fc907d85dac90
Parents: f087874
Author: Attila Magyar 
Authored: Fri Oct 6 09:13:09 2017 +0200
Committer: Attila Magyar 
Committed: Wed Nov 22 10:50:40 2017 +0100

--
 .../isilon-onefs-mpack/.gitignore   |   1 +
 .../management-packs/isilon-onefs-mpack/pom.xml | 110 ++
 .../src/main/assemblies/isilon-onefs-mpack.xml  |  40 ++
 .../addon-services/ONEFS/1.0.0/alerts.json  |  46 +++
 .../ONEFS/1.0.0/configuration/core-site.xml | 102 +
 .../ONEFS/1.0.0/configuration/hadoop-env.xml| 386 +++
 .../ONEFS/1.0.0/configuration/hdfs-site.xml |  61 +++
 .../addon-services/ONEFS/1.0.0/metainfo.xml |  90 +
 .../addon-services/ONEFS/1.0.0/metrics.json |  59 +++
 .../ONEFS/1.0.0/package/scripts/__init__.py |  20 +
 .../ONEFS/1.0.0/package/scripts/onefs_client.py |  56 +++
 .../ONEFS/1.0.0/package/scripts/params.py   |  29 ++
 .../ONEFS/1.0.0/package/scripts/params_linux.py |  74 
 .../1.0.0/package/scripts/params_windows.py |  83 
 .../1.0.0/package/scripts/service_check.py  | 137 +++
 .../1.0.0/package/scripts/status_params.py  |  58 +++
 .../addon-services/ONEFS/1.0.0/widgets.json |  38 ++
 .../src/main/resources/mpack.json   |  28 ++
 18 files changed, 1418 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/.gitignore
--
diff --git a/contrib/management-packs/isilon-onefs-mpack/.gitignore 
b/contrib/management-packs/isilon-onefs-mpack/.gitignore
new file mode 100644
index 000..1377554
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/.gitignore
@@ -0,0 +1 @@
+*.swp

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/pom.xml
--
diff --git a/contrib/management-packs/isilon-onefs-mpack/pom.xml 
b/contrib/management-packs/isilon-onefs-mpack/pom.xml
new file mode 100644
index 000..5d8f215
--- /dev/null
+++ b/contrib/management-packs/isilon-onefs-mpack/pom.xml
@@ -0,0 +1,110 @@
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+  4.0.0
+  org.apache.ambari
+  isilon-onefs-mpack
+  pom
+  0.1.0.0-SNAPSHOT
+  Isilon OneFS Ambari Management Pack
+  http://ambari.apache.org/
+  
+3.0.0.0
+
+1.0.0
+  
+  
+org.apache.ambari.contrib.mpacks
+ambari-contrib-mpacks
+2.0.0.0-SNAPSHOT
+  
+  
+
+  
+org.codehaus.mojo
+build-helper-maven-plugin
+1.8
+
+  
+parse-version
+validate
+
+  parse-version
+
+  
+  
+regex-property
+
+  regex-property
+
+
+  mpackVersion
+  ${project.version}
+  ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*
+  $1.$2.$3.$4
+  false
+
+  
+
+  
+  
+maven-resources-plugin
+2.6
+
+  
+copy-resources
+compile
+
+  copy-resources
+
+
+  ${basedir}/target/
+  
+
+  ${basedir}/src/main/resources
+  
+mpack.json
+  
+  true
+
+  
+
+  
+
+  
+  
+maven-assembly-plugin
+
+  gnu
+  
+src/main/assemblies/isilon-onefs-mpack.xml
+  
+
+
+  
+build-tarball
+package
+
+  single
+
+  
+
+  
+
+  
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a1c2e49/contrib/management-packs/isilon-onefs-mpack/src/main/assemblies/isilon-onefs-mpack.xml
--
diff --git 
a/contrib/management-packs/isilon-onefs-mpack/src/main/assemblies/isilon-onefs-mpack.xml
 

[31/50] [abbrv] ambari git commit: AMBARI-22455 Ambari Logsearch Web unit tests are sometimes failing. (ababiichuk)

2017-11-22 Thread amagyar
AMBARI-22455 Ambari Logsearch Web unit tests are sometimes failing. (ababiichuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 2d81d49fb3cc5fefbed079e7994cea7b41c5a125
Parents: 1a99da4
Author: ababiichuk 
Authored: Wed Nov 15 17:37:19 2017 +0200
Committer: ababiichuk 
Committed: Wed Nov 15 18:16:16 2017 +0200

--
 .../src/app/services/auth.service.spec.ts   | 123 ++-
 1 file changed, 62 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2d81d49f/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
--
diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts 
b/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
index a465c10..fd5a83e 100644
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
+++ 
b/ambari-logsearch/ambari-logsearch-web/src/app/services/auth.service.spec.ts
@@ -16,9 +16,12 @@
  * limitations under the License.
  */
 
-import {TestBed, inject} from '@angular/core/testing';
+import {TestBed, inject, async} from '@angular/core/testing';
 import {HttpModule} from '@angular/http';
 import {Observable} from 'rxjs/Observable';
+import 'rxjs/add/operator/first';
+import 'rxjs/add/operator/last';
+import 'rxjs/add/operator/take';
 import {StoreModule} from '@ngrx/store';
 import {AppStateService, appState} from 
'@app/services/storage/app-state.service';
 import {AuthService} from '@app/services/auth.service';
@@ -26,49 +29,37 @@ import {HttpClientService} from 
'@app/services/http-client.service';
 
 describe('AuthService', () => {
 
-  let successResponse = {
-type: 'default',
-ok: true,
-url: '/',
-status: 200,
-statusText: 'OK',
-bytesLoaded: 100,
-totalBytes: 100,
-headers: null
-  };
-  let errorResponse = {
-type: 'error',
-ok: false,
-url: '/',
-status: 401,
-statusText: 'ERROR',
-bytesLoaded: 100,
-totalBytes: 100,
-headers: null
+  const successResponse = {
+  type: 'default',
+  ok: true,
+  url: '/',
+  status: 200,
+  statusText: 'OK',
+  bytesLoaded: 100,
+  totalBytes: 100,
+  headers: null
+},
+errorResponse = {
+  type: 'error',
+  ok: false,
+  url: '/',
+  status: 401,
+  statusText: 'ERROR',
+  bytesLoaded: 100,
+  totalBytes: 100,
+  headers: null
+};
+
+  // Note: We add delay to help the isLoginInProgress test case.
+  let httpServiceStub = {
+isError: false,
+postFormData: function () {
+  const isError = this.isError;
+  return Observable.create(observer => observer.next(isError ? 
errorResponse : successResponse)).delay(1000);
+}
   };
-  let currentResponse = successResponse;
-  let httpServiceStub;
-  let authService: AuthService;
 
   beforeEach(() => {
-// Note: We add delay to help the isLoginInProgress test case.
-httpServiceStub = {
-  postFormData: function () {
-return Observable.create(observer => {
-  observer.next(currentResponse);
-}).delay(1000);
-  },
-  post: function () {
-return Observable.create(observer => {
-  observer.next(currentResponse);
-}).delay(1000);
-  },
-  get: function () {
-return Observable.create(observer => {
-  observer.next(currentResponse);
-}).delay(1000);
-  }
-};
 TestBed.configureTestingModule({
   imports: [
 HttpModule,
@@ -82,51 +73,61 @@ describe('AuthService', () => {
 {provide: HttpClientService, useValue: httpServiceStub}
   ]
 });
-authService = TestBed.get(AuthService);
   });
 
   it('should create service', inject([AuthService], (service: AuthService) => {
 expect(service).toBeTruthy();
   }));
 
-  it('should set the isAuthorized state to true in appState when the login is 
success', inject(
-[AppStateService],
-(appStateService: AppStateService) => {
-  currentResponse = successResponse;
+  it('should set the isAuthorized state to true in appState when the login is 
success', async(inject(
+[AuthService, AppStateService, HttpClientService],
+(authService: AuthService, appStateService: AppStateService, 
httpClientService) => {
+  httpClientService.isError = false;
   authService.login('test', 'test')
 .subscribe(() => {
-  appStateService.getParameter('isAuthorized').subscribe((value) 

[14/50] [abbrv] ambari git commit: AMBARI-22417. Ambari checks fail with FIPS mode is activated on the OS (rlevas)

2017-11-22 Thread amagyar
AMBARI-22417. Ambari checks fail with FIPS mode is activated on the OS (rlevas)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 5122671d0076612f4b39f4ae51c2ad627544d768
Parents: 7c4a7e4
Author: Robert Levas 
Authored: Mon Nov 13 05:20:25 2017 -0500
Committer: Robert Levas 
Committed: Mon Nov 13 05:20:25 2017 -0500

--
 .../libraries/functions/curl_krb_request.py | 22 +++-
 1 file changed, 7 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5122671d/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
index 95e8625..55395ce 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/curl_krb_request.py
@@ -21,28 +21,20 @@ Ambari Agent
 """
 
 __all__ = ["curl_krb_request"]
+import hashlib
 import logging
 import os
+
 import time
 
+from get_kinit_path import get_kinit_path
+from get_klist_path import get_klist_path
 from resource_management.core import global_lock
 from resource_management.core import shell
 from resource_management.core.exceptions import Fail
-from get_kinit_path import get_kinit_path
-from get_klist_path import get_klist_path
 from resource_management.libraries.functions.get_user_call_output import 
get_user_call_output
 
-# hashlib is supplied as of Python 2.5 as the replacement interface for md5
-# and other secure hashes.  In 2.6, md5 is deprecated.  Import hashlib if
-# available, avoiding a deprecation warning under 2.6.  Import md5 otherwise,
-# preserving 2.4 compatibility.
-try:
-  import hashlib
-  _md5 = hashlib.md5
-except ImportError:
-  import md5
-  _md5 = md5.new
-
+HASH_ALGORITHM = hashlib.sha224
 CONNECTION_TIMEOUT_DEFAULT = 10
 MAX_TIMEOUT_DEFAULT = CONNECTION_TIMEOUT_DEFAULT + 2
 
@@ -103,10 +95,10 @@ def curl_krb_request(tmp_dir, keytab, principal, url, 
cache_file_prefix,
   is_kinit_required = False
 
   # Create the kerberos credentials cache (ccache) file and set it in the 
environment to use
-  # when executing curl. Use the md5 hash of the combination of the principal 
and keytab file
+  # when executing curl. Use a hash of the combination of the principal and 
keytab file
   # to generate a (relatively) unique cache filename so that we can use it as 
needed. Scope
   # this file by user in order to prevent sharing of cache files by multiple 
users.
-  ccache_file_name = _md5("{0}|{1}".format(principal, keytab)).hexdigest()
+  ccache_file_name = HASH_ALGORITHM("{0}|{1}".format(principal, 
keytab)).hexdigest()
 
   curl_krb_cache_path = os.path.join(tmp_dir, "curl_krb_cache")
   if not os.path.exists(curl_krb_cache_path):



[19/50] [abbrv] ambari git commit: AMBARI-22347. Simplify Ambari configuration tables from AMBARI-21307 (rlevas)

2017-11-22 Thread amagyar
AMBARI-22347.  Simplify Ambari configuration tables from AMBARI-21307 (rlevas)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 4fa9ac5505d6604f1d74def8fc1ea6eeb3ea3fda
Parents: 18e5490
Author: Robert Levas 
Authored: Mon Nov 13 13:11:42 2017 -0500
Committer: Robert Levas 
Committed: Mon Nov 13 13:12:11 2017 -0500

--
 .../AmbariConfigurationRequestSwagger.java  |  14 +-
 .../services/AmbariConfigurationService.java|  46 +-
 .../api/services/ldap/AmbariConfiguration.java  |  51 +--
 .../services/ldap/LdapConfigurationService.java |   4 +-
 .../AmbariConfigurationResourceProvider.java| 370 +++-
 .../events/AmbariConfigurationChangedEvent.java |  36 ++
 .../ambari/server/events/AmbariEvent.java   |   4 +-
 .../events/AmbariLdapConfigChangedEvent.java|  37 --
 .../ldap/domain/AmbariLdapConfiguration.java|  20 +-
 .../AmbariLdapConfigurationProvider.java|  57 ++-
 .../ads/LdapConnectionTemplateFactory.java  |   4 +-
 .../server/orm/dao/AmbariConfigurationDAO.java  | 146 --
 .../orm/entities/AmbariConfigurationEntity.java |  94 ++--
 .../entities/AmbariConfigurationEntityPK.java   |  88 
 .../orm/entities/ConfigurationBaseEntity.java   | 159 ---
 .../server/upgrade/SchemaUpgradeHelper.java |   3 +-
 .../server/upgrade/UpgradeCatalog300.java   |  21 +-
 .../main/resources/Ambari-DDL-Derby-CREATE.sql  |  21 +-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  20 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  20 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|  19 +-
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |  20 +-
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |  19 +-
 .../src/main/resources/META-INF/persistence.xml |   1 -
 ...AmbariConfigurationResourceProviderTest.java | 444 ---
 .../orm/dao/AmbariConfigurationDAOTest.java | 298 +
 .../server/upgrade/UpgradeCatalog300Test.java   |  43 ++
 27 files changed, 1223 insertions(+), 836 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
index 5e8094e..2dca9f5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationRequestSwagger.java
@@ -29,19 +29,9 @@ public interface AmbariConfigurationRequestSwagger extends 
ApiModel {
 
   interface AmbariConfigurationRequestInfo {
 @ApiModelProperty
-Long getId();
+String getCategoryName();
 
 @ApiModelProperty
-Map getData();
-
-@ApiModelProperty
-String getType();
-
-@ApiModelProperty
-Long getVersion();
-
-@ApiModelProperty(name = "version_tag")
-String getVersionTag();
+Map getProperties();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/4fa9ac55/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
index 38ae766..86ed666 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariConfigurationService.java
@@ -46,21 +46,21 @@ import io.swagger.annotations.ApiResponses;
  * Ambari configuration resources may be shared with components and services 
in the cluster
  * (by recommending them as default values)
  *
- * Eg. LDAP configuration is stored as ambariconfiguration.
+ * Eg. LDAP configuration is stored as AmbariConfiguration.
  * The request payload has the form:
  *
  * 
  *  {
  *"AmbariConfiguration": {
- *"type": "ldap-configuration",
- *"data": [
- *{
- * "authentication.ldap.primaryUrl": "localhost:33389"
- * "authentication.ldap.secondaryUrl": 

[20/50] [abbrv] ambari git commit: AMBARI-22429 Log Search UI: implement logout. (Istvan Tobias via ababiichuk)

2017-11-22 Thread amagyar
AMBARI-22429 Log Search UI: implement logout. (Istvan Tobias via ababiichuk)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 7428e51d8e3759edf5248762f0a257a46cc053a5
Parents: 4fa9ac5
Author: Istvan Tobias 
Authored: Tue Nov 14 00:31:01 2017 +0200
Committer: ababiichuk 
Committed: Tue Nov 14 00:31:01 2017 +0200

--
 .../ambari-logsearch-web/src/app/app.module.ts  |   4 +-
 .../src/app/components/app.component.spec.ts|   4 +-
 .../dropdown-button.component.spec.ts   |   4 +-
 .../dropdown-list.component.spec.ts |   4 +-
 .../filter-button.component.spec.ts |   4 +-
 .../filter-dropdown.component.spec.ts   |   4 +-
 .../login-form/login-form.component.spec.ts |   7 +-
 .../login-form/login-form.component.ts  |  34 +++--
 .../menu-button/menu-button.component.spec.ts   |   4 +-
 .../timezone-picker.component.spec.ts   |   4 +-
 .../components/top-menu/top-menu.component.ts   |   3 +-
 .../ambari-logsearch-web/src/app/mock-data.ts   |   3 +-
 .../src/app/services/auth.service.spec.ts   | 132 +++
 .../src/app/services/auth.service.ts| 123 +
 .../services/component-actions.service.spec.ts  |   4 +-
 .../app/services/component-actions.service.ts   |  20 ++-
 .../src/assets/i18n/en.json |   1 +
 17 files changed, 328 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
--
diff --git a/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts 
b/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
index 37f3a49..805f8e2 100644
--- a/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
+++ b/ambari-logsearch/ambari-logsearch-web/src/app/app.module.ts
@@ -53,6 +53,7 @@ import {ComponentsService} from 
'@app/services/storage/components.service';
 import {ServiceLogsFieldsService} from 
'@app/services/storage/service-logs-fields.service';
 import {AuditLogsFieldsService} from 
'@app/services/storage/audit-logs-fields.service';
 import {TabsService} from '@app/services/storage/tabs.service';
+import {AuthService} from '@app/services/auth.service';
 import {reducer} from '@app/services/storage/reducers.service';
 
 import {AppComponent} from '@app/components/app.component';
@@ -185,7 +186,8 @@ export function getXHRBackend(injector: Injector, browser: 
BrowserXhr, xsrf: XSR
   provide: XHRBackend,
   useFactory: getXHRBackend,
   deps: [Injector, BrowserXhr, XSRFStrategy, ResponseOptions]
-}
+},
+AuthService
   ],
   bootstrap: [AppComponent],
   entryComponents: [NodeBarComponent],

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
--
diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
 
b/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
index 490e058..bae05ce 100644
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
+++ 
b/ambari-logsearch/ambari-logsearch-web/src/app/components/app.component.spec.ts
@@ -53,9 +53,9 @@ describe('AppComponent', () => {
 }).compileComponents();
   }));
 
-  it('should create the app', async(() => {
+  it('should create the app', () => {
 const fixture = TestBed.createComponent(AppComponent);
 const app = fixture.debugElement.componentInstance;
 expect(app).toBeTruthy();
-  }));
+  });
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/7428e51d/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
--
diff --git 
a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
 
b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
index bd41c04..fc42e3c 100644
--- 
a/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
+++ 
b/ambari-logsearch/ambari-logsearch-web/src/app/components/dropdown-button/dropdown-button.component.spec.ts
@@ -36,6 +36,7 @@ import {UtilsService} from '@app/services/utils.service';
 import {ComponentActionsService} from 

[38/50] [abbrv] ambari git commit: AMBARI-22444 - Add Native Libraries To Tez Tarball (part2) (jonathanhurley)

2017-11-22 Thread amagyar
AMBARI-22444 - Add Native Libraries To Tez Tarball (part2) (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 0936f463042cf5ba195b0461479d8c29c88330dd
Parents: 8fe6ac4
Author: Jonathan Hurley 
Authored: Wed Nov 15 17:37:57 2017 -0500
Committer: Jonathan Hurley 
Committed: Wed Nov 15 17:40:29 2017 -0500

--
 .../libraries/functions/copy_tarball.py   | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0936f463/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
index f62aa3d..7bca967 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
@@ -33,6 +33,7 @@ from resource_management.core import shell
 from resource_management.core import sudo
 from resource_management.core.logger import Logger
 from resource_management.core.exceptions import Fail
+from resource_management.core.resources.system import Directory
 from resource_management.core.resources.system import Execute
 from resource_management.libraries.functions import stack_tools, 
stack_features, stack_select
 from resource_management.libraries.functions import tar_archive
@@ -77,7 +78,14 @@ def _prepare_tez_tarball():
 
   Execute(("cp", "-a", hadoop_lib_native_dir, tez_lib_dir), sudo = True)
 
-  tez_tarball_with_native_lib = os.path.join(os.path.dirname(tez_source_file), 
"tez-native.tar.gz")
+  tez_native_tarball_staging_dir = os.path.join(temp_dir, 
"tez-native-tarball-staging")
+  if not os.path.exists(tez_native_tarball_staging_dir):
+Directory(tez_native_tarball_staging_dir,
+  cd_access='a',
+  create_parents = True,
+  recursive_ownership = True)
+
+  tez_tarball_with_native_lib = os.path.join(tez_native_tarball_staging_dir, 
"tez-native.tar.gz")
   Logger.info("Creating a new Tez tarball at 
{0}".format(tez_tarball_with_native_lib))
 
   # tar up Tez, making sure to specify nothing for the arcname so that it does 
not include an absolute path



[11/50] [abbrv] ambari git commit: AMBARI-22411. Restart all required services failed when running cluster with several patch upgrades applied (ncole)

2017-11-22 Thread amagyar
AMBARI-22411. Restart all required services failed when running cluster with 
several patch upgrades applied (ncole)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 068d82f700432cf5cfa75d20924443e998d8fe87
Parents: ec02a14
Author: Nate Cole 
Authored: Fri Nov 10 11:23:13 2017 -0500
Committer: Nate Cole 
Committed: Fri Nov 10 12:00:14 2017 -0500

--
 .../AmbariCustomCommandExecutionHelper.java | 23 
 .../AmbariManagementControllerImpl.java | 60 +++-
 .../internal/UpgradeResourceProvider.java   |  8 +--
 .../HDP/2.0.6/properties/stack_packages.json|  3 +-
 .../AmbariManagementControllerImplTest.java |  2 +-
 5 files changed, 25 insertions(+), 71 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/068d82f7/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index e8febbb..dc6bbb7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -1425,27 +1425,23 @@ public class AmbariCustomCommandExecutionHelper {
*
* @param actionExecContext  the context
* @param clusterthe cluster for the command
+   * @param stackIdthe stack id used to load service metainfo.
*
* @return a wrapper of the important JSON structures to add to a stage
*/
   public ExecuteCommandJson getCommandJson(ActionExecutionContext 
actionExecContext,
-  Cluster cluster, RepositoryVersionEntity repositoryVersion, String 
requestContext) throws AmbariException {
+  Cluster cluster, StackId stackId, String requestContext) throws 
AmbariException {
 
 Map commandParamsStage = 
StageUtils.getCommandParamsStage(actionExecContext, requestContext);
 Map hostParamsStage = new HashMap<>();
 Map clusterHostInfo;
 String clusterHostInfoJson = "{}";
 
-StackId stackId = null;
-if (null != repositoryVersion) {
-  stackId = repositoryVersion.getStackId();
-}
-
 if (null != cluster) {
   clusterHostInfo = StageUtils.getClusterHostInfo(cluster);
 
   // Important, because this runs during Stack Uprade, it needs to use the 
effective Stack Id.
-  hostParamsStage = createDefaultHostParams(cluster, repositoryVersion);
+  hostParamsStage = createDefaultHostParams(cluster, stackId);
 
   String componentName = null;
   String serviceName = null;
@@ -1454,7 +1450,7 @@ public class AmbariCustomCommandExecutionHelper {
 serviceName = actionExecContext.getOperationLevel().getServiceName();
   }
 
-  if (serviceName != null && componentName != null && null != stackId) {
+  if (serviceName != null && componentName != null) {
 Service service = cluster.getService(serviceName);
 ServiceComponent component = 
service.getServiceComponent(componentName);
 stackId = component.getDesiredStackId();
@@ -1473,6 +1469,10 @@ public class AmbariCustomCommandExecutionHelper {
 
   clusterHostInfoJson = StageUtils.getGson().toJson(clusterHostInfo);
 
+  if (null == stackId && null != cluster) {
+stackId = cluster.getDesiredStackVersion();
+  }
+
   //Propogate HCFS service type info to command params
   if (null != stackId) {
 Map serviceInfos = 
ambariMetaInfo.getServices(stackId.getStackName(),
@@ -1497,11 +1497,10 @@ public class AmbariCustomCommandExecutionHelper {
 hostParamsStageJson);
   }
 
-  Map createDefaultHostParams(Cluster cluster, 
RepositoryVersionEntity repositoryVersion) throws AmbariException {
-return createDefaultHostParams(cluster, repositoryVersion.getStackId());
-  }
-
   Map createDefaultHostParams(Cluster cluster, StackId 
stackId) throws AmbariException {
+if (null == stackId) {
+  stackId = cluster.getDesiredStackVersion();
+}
 
 TreeMap hostLevelParams = new TreeMap<>();
 StageUtils.useStackJdkIfExists(hostLevelParams, configs);


[43/50] [abbrv] ambari git commit: AMBARI-22236. Expression parser support for JMXServerSide alerts (amagyar)

2017-11-22 Thread amagyar
AMBARI-22236. Expression parser support for JMXServerSide alerts (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: ae45a551f2b1029285e891772a3580ae741f1efb
Parents: 362b4f0
Author: Attila Magyar 
Authored: Tue Oct 17 16:15:15 2017 +0200
Committer: Attila Magyar 
Committed: Wed Nov 22 10:50:40 2017 +0100

--
 .../server/alerts/JmxServerSideAlert.java   | 42 ++--
 .../server/state/alert/AlertDefinition.java | 13 
 .../ambari/server/state/alert/MetricSource.java | 59 -
 .../ambari/server/state/alert/Reporting.java| 16 ++---
 .../AlertDefinitionResourceProviderTest.java|  4 +-
 .../ambari/server/state/alert/JmxInfoTest.java  | 68 
 6 files changed, 162 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ae45a551/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
index a4b86f8..09eb0a4 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
@@ -23,6 +23,7 @@ import static java.util.Collections.singletonList;
 import java.net.URI;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
@@ -35,7 +36,6 @@ import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.alert.AlertDefinition;
 import org.apache.ambari.server.state.alert.AlertDefinitionFactory;
 import org.apache.ambari.server.state.alert.MetricSource;
-import org.apache.ambari.server.state.alert.Reporting;
 import org.apache.ambari.server.state.alert.ServerSource;
 import org.apache.ambari.server.state.services.MetricsRetrievalService;
 import org.slf4j.Logger;
@@ -64,41 +64,35 @@ public class JmxServerSideAlert extends AlertRunnable {
   List execute(Cluster cluster, AlertDefinitionEntity entity) throws 
AmbariException {
 AlertDefinition alertDef = definitionFactory.coerce(entity);
 ServerSource serverSource = (ServerSource) alertDef.getSource();
-URI jmxUrl = jmxUrl(cluster, serverSource);
-JMXMetricHolder metricHolder = jmxMetric(serverSource, jmxUrl);
-return metricHolder == null
-  ? emptyList()
-  : alerts(alertDef, serverSource.getJmxInfo(), metricHolder, 
serverSource.getReporting());
+return buildAlert(jmxMetric(serverSource, cluster), 
serverSource.getJmxInfo(), alertDef)
+  .map(alert -> singletonList(alert))
+  .orElse(emptyList());
   }
 
-  private URI jmxUrl(Cluster cluster, ServerSource serverSource) throws 
AmbariException {
-return 
serverSource.getUri().resolve(config(cluster)).resolve(serverSource.getJmxInfo().getUrlSuffix());
+  public Optional buildAlert(Optional metricHolder, 
MetricSource.JmxInfo jmxInfo, AlertDefinition alertDef) {
+return metricHolder.flatMap(metric -> buildAlert(metric, jmxInfo, 
alertDef));
   }
 
-  private Map> config(Cluster cluster) throws 
AmbariException {
-return configHelper.getEffectiveConfigProperties(cluster, 
configHelper.getEffectiveDesiredTags(cluster, null));
+  private Optional buildAlert(JMXMetricHolder metricHolder, 
MetricSource.JmxInfo jmxInfo, AlertDefinition alertDef) {
+List allMetrics = metricHolder.findAll(jmxInfo.getPropertyList());
+return jmxInfo.eval(metricHolder).map(val -> 
alertDef.buildAlert(val.doubleValue(), allMetrics));
   }
 
-  private JMXMetricHolder jmxMetric(ServerSource serverSource, URI jmxUri) {
+  private Optional jmxMetric(ServerSource serverSource, 
Cluster cluster) throws AmbariException {
+URI jmxUri = jmxUrl(cluster, serverSource);
 URLStreamProvider streamProvider = new URLStreamProvider(
   serverSource.getUri().getConnectionTimeoutMsec(),
   serverSource.getUri().getReadTimeoutMsec(),
   ComponentSSLConfiguration.instance());
 
metricsRetrievalService.submitRequest(MetricsRetrievalService.MetricSourceType.JMX,
 streamProvider, jmxUri.toString());
-return metricsRetrievalService.getCachedJMXMetric(jmxUri.toString());
+return 

[16/50] [abbrv] ambari git commit: AMBARI-22387. Create a Pre-Upgrade Check Warning About LZO. Fix import (dlysnichenko)

2017-11-22 Thread amagyar
AMBARI-22387. Create a Pre-Upgrade Check Warning About LZO. Fix import 
(dlysnichenko)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 6e706d427f1f9bcfc61f986ea1a1d5f5a28d500f
Parents: 76349ac
Author: Lisnichenko Dmitro 
Authored: Mon Nov 13 16:35:23 2017 +0200
Committer: Lisnichenko Dmitro 
Committed: Mon Nov 13 16:35:23 2017 +0200

--
 .../src/main/java/org/apache/ambari/server/checks/LZOCheck.java | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6e706d42/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
index 3000b79..9c0286b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
@@ -19,7 +19,6 @@ package org.apache.ambari.server.checks;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.PrereqCheckRequest;



[45/50] [abbrv] ambari git commit: AMBARI-22319. Allow the same config type to belong to multiple services (amagyar)

2017-11-22 Thread amagyar
AMBARI-22319. Allow the same config type to belong to multiple services 
(amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 6f354930ddd05795019694518a342f1d30090d11
Parents: b8f75de
Author: Attila Magyar 
Authored: Mon Oct 30 11:34:27 2017 +0100
Committer: Attila Magyar 
Committed: Wed Nov 22 10:55:11 2017 +0100

--
 .../AmbariManagementControllerImpl.java |  8 +-
 .../server/controller/internal/Stack.java   | 14 
 .../ambari/server/state/ConfigHelper.java   |  2 +-
 .../server/state/cluster/ClusterImpl.java   | 79 +++-
 .../ambari/server/topology/AmbariContext.java   |  7 +-
 .../server/state/cluster/ClusterTest.java   |  4 +
 .../server/topology/AmbariContextTest.java  |  5 +-
 7 files changed, 58 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 4c00f1f..1fd410f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -797,14 +797,8 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 
 // If the config type is for a service, then allow a user with 
SERVICE_MODIFY_CONFIGS to
 // update, else ensure the user has CLUSTER_MODIFY_CONFIGS
-String service = null;
+String service = cluster.getServiceByConfigType(configType);
 
-try {
-  service = 
cluster.getServiceForConfigTypes(Collections.singleton(configType));
-} catch (IllegalArgumentException e) {
-  // Ignore this since we may have hit a config type that spans multiple 
services. This may
-  // happen in unit test cases but should not happen with later versions 
of stacks.
-}
 
 // Get the changes so that the user's intention can be determined. For 
example, maybe
 // the user wants to change the run-as user for a service or maybe the the 
cluster-wide

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
index f8feef2..912d9be 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
@@ -18,10 +18,12 @@
 
 package org.apache.ambari.server.controller.internal;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -494,6 +496,18 @@ public class Stack {
 "Specified configuration type is not associated with any service: " + 
config);
   }
 
+  public List getServicesForConfigType(String config) {
+List serviceNames = new ArrayList<>();
+for (Map.Entry>> entry : 
serviceConfigurations.entrySet()) {
+  Map> typeMap = entry.getValue();
+  String serviceName = entry.getKey();
+  if (typeMap.containsKey(config) && 
!getExcludedConfigurationTypes(serviceName).contains(config)) {
+serviceNames.add(serviceName);
+  }
+}
+return serviceNames;
+  }
+
   /**
* Return the dependencies specified for the given component.
*

http://git-wip-us.apache.org/repos/asf/ambari/blob/6f354930/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index eade914..edeb4b7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ 

[10/50] [abbrv] ambari git commit: AMBARI-22415. Blueprint deploys failing with missing smoke user keytab file (echekanskiy)

2017-11-22 Thread amagyar
AMBARI-22415. Blueprint deploys failing with missing smoke user keytab file 
(echekanskiy)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: ec02a14c02529ec7fec647e6fed7c8c401f10e6d
Parents: 22b2d55
Author: Eugene Chekanskiy 
Authored: Fri Nov 10 17:17:34 2017 +0200
Committer: Eugene Chekanskiy 
Committed: Fri Nov 10 18:29:43 2017 +0200

--
 .../kerberos/CreateKeytabFilesServerAction.java | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ec02a14c/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
index aa65e61..5ec4c10 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/CreateKeytabFilesServerAction.java
@@ -218,17 +218,18 @@ public class CreateKeytabFilesServerAction extends 
KerberosServerAction {
 }
 
 boolean regenerateKeytabs = 
getOperationType(getCommandParameters()) == OperationType.RECREATE_ALL;
+
+KerberosPrincipalEntity principalEntity = 
kerberosPrincipalDAO.find(evaluatedPrincipal);
+String cachedKeytabPath = (principalEntity == null) ? null : 
principalEntity.getCachedKeytabPath();
+
 if (password == null) {
   if (!regenerateKeytabs && 
(hostName.equalsIgnoreCase(KerberosHelper.AMBARI_SERVER_HOST_NAME) || 
kerberosPrincipalHostDAO
-  .exists(evaluatedPrincipal, hostEntity.getHostId(), 
keytabFilePath))) {
+  .exists(evaluatedPrincipal, hostEntity.getHostId(), 
keytabFilePath)) && cachedKeytabPath == null) {
 // There is nothing to do for this since it must already 
exist and we don't want to
 // regenerate the keytab
 message = String.format("Skipping keytab file for %s, 
missing password indicates nothing to do", evaluatedPrincipal);
 LOG.debug(message);
   } else {
-KerberosPrincipalEntity principalEntity = 
kerberosPrincipalDAO.find(evaluatedPrincipal);
-String cachedKeytabPath = (principalEntity == null) ? null 
: principalEntity.getCachedKeytabPath();
-
 if (cachedKeytabPath == null) {
   message = String.format("Failed to create keytab for %s, 
missing cached file", evaluatedPrincipal);
   actionLog.writeStdErr(message);



[02/50] [abbrv] ambari git commit: AMBARI-22370 - Remove HADOOP_HOME From Environment For Daemons (jonathanhurley)

2017-11-22 Thread amagyar
AMBARI-22370 - Remove HADOOP_HOME From Environment For Daemons (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 780e91e6124f39fcd67e58369ed2a42da2a6f247
Parents: 444718a
Author: Jonathan Hurley 
Authored: Mon Nov 6 16:05:56 2017 -0500
Committer: Jonathan Hurley 
Committed: Thu Nov 9 08:23:15 2017 -0500

--
 .../libraries/functions/stack_select.py  |  3 ++-
 .../ATLAS/0.1.0.2.3/package/scripts/params.py|  2 +-
 .../ATLAS/0.7.0.3.0/package/scripts/params.py|  2 +-
 .../FALCON/0.5.0.2.1/package/scripts/falcon.py   | 11 +--
 .../package/scripts/hive_service_interactive.py  |  5 ++---
 .../package/scripts/webhcat_service.py   | 19 ---
 .../package/scripts/hive_service_interactive.py  |  5 ++---
 .../2.1.0.3.0/package/scripts/params_linux.py|  7 +++
 .../2.1.0.3.0/package/scripts/webhcat_service.py | 19 ---
 .../1.0.0.2.3/package/scripts/service_check.py   |  3 +--
 .../1.4.4.2.0/package/scripts/params_linux.py|  4 ++--
 .../1.4.4.3.0/package/scripts/params_linux.py|  4 ++--
 .../0.4.0.2.1/package/scripts/params_linux.py|  2 +-
 .../0.9.0.3.0/package/scripts/params_linux.py|  2 +-
 .../2.1.0.2.0/package/scripts/params_linux.py|  2 +-
 .../3.0.0.3.0/package/scripts/params_linux.py|  2 +-
 .../stacks/2.0.6/HIVE/test_webhcat_server.py |  4 
 .../stacks/2.1/FALCON/test_falcon_server.py  | 10 ++
 .../python/stacks/2.1/TEZ/test_tez_client.py |  2 +-
 .../2.3/MAHOUT/test_mahout_service_check.py  |  4 +---
 .../stacks/2.5/HIVE/test_hive_server_int.py  | 15 +--
 21 files changed, 38 insertions(+), 89 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
index 9b7d0eb..b741a33 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py
@@ -71,7 +71,8 @@ HADOOP_DIR_DEFAULTS = {
   "libexec": "/usr/lib/hadoop/libexec",
   "sbin": "/usr/lib/hadoop/sbin",
   "bin": "/usr/bin",
-  "lib": "/usr/lib/hadoop/lib"
+  "lib": "/usr/lib/hadoop/lib",
+  "conf": "/etc/hadoop/conf"
 }
 
 PACKAGE_SCOPE_INSTALL = "INSTALL"

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
index 968ceed..31a866e 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/params.py
@@ -118,7 +118,7 @@ metadata_stop_script = 
format("{metadata_bin}/atlas_stop.py")
 log_dir = config['configurations']['atlas-env']['metadata_log_dir']
 
 # service locations
-hadoop_conf_dir = os.path.join(os.environ["HADOOP_HOME"], "conf") if 
'HADOOP_HOME' in os.environ else '/etc/hadoop/conf'
+hadoop_conf_dir = os.path.join(os.environ["HADOOP_HOME"], "conf") if 
'HADOOP_HOME' in os.environ else 
format('{stack_root}/current/hadoop-client/conf')
 
 # some commands may need to supply the JAAS location when running as atlas
 atlas_jaas_file = format("{conf_dir}/atlas_jaas.conf")

http://git-wip-us.apache.org/repos/asf/ambari/blob/780e91e6/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
index b01884c..7c1249a 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.7.0.3.0/package/scripts/params.py
@@ -116,7 +116,7 @@ metadata_stop_script = 

[06/50] [abbrv] ambari git commit: AMBARI-22386 - Patch Upgrades Broken For Clients Due To Versioned LD Library (jonathanhurley)

2017-11-22 Thread amagyar
AMBARI-22386 - Patch Upgrades Broken For Clients Due To Versioned LD Library 
(jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: feccebcb9b4cf56d8ea0cc021d5250a711f37596
Parents: c693de3
Author: Jonathan Hurley 
Authored: Wed Nov 8 16:20:30 2017 -0500
Committer: Jonathan Hurley 
Committed: Thu Nov 9 16:36:49 2017 -0500

--
 .../TEZ/0.9.0.3.0/configuration/tez-site.xml|  2 +-
 .../configuration-mapred/mapred-site.xml|  2 +-
 .../configuration-mapred/mapred-site.xml|  2 +-
 .../2.2/services/TEZ/configuration/tez-site.xml |  4 ++--
 .../YARN/configuration-mapred/mapred-site.xml   |  2 +-
 .../resources/stacks/HDP/2.6/repos/repoinfo.xml |  2 +-
 .../stacks/HDP/2.6/upgrades/config-upgrade.xml  | 23 
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |  9 
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml |  4 
 .../YARN/configuration-mapred/mapred-site.xml   |  2 +-
 10 files changed, 44 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
 
b/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
index 5c17044..58558af 100644
--- 
a/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/TEZ/0.9.0.3.0/configuration/tez-site.xml
@@ -78,7 +78,7 @@
   
   
 tez.am.launch.env
-
LD_LIBRARY_PATH=/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64
+
LD_LIBRARY_PATH=./tezlib/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native:/usr/hdp/${hdp.version}/hadoop/lib/native/Linux-{{architecture}}-64
 
 Additional execution environment entries for tez. This is not an 
additive property. You must preserve the original value if
 you want to have access to native libraries.

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
index a7d8cd6..3438c45 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml
@@ -438,7 +438,7 @@
   
   
 mapreduce.admin.user.env
-
LD_LIBRARY_PATH={{hadoop_lib_home}}/native/Linux-{{architecture}}-64
+
LD_LIBRARY_PATH=./mr-framework/hadoop/lib/native:{{hadoop_lib_home}}/native/Linux-{{architecture}}-64
 
   Additional execution environment entries for map and reduce task 
processes.
   This is not an additive property. You must preserve the original value if

http://git-wip-us.apache.org/repos/asf/ambari/blob/feccebcb/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
 
b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
index 705763f..882cf83 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/configuration-mapred/mapred-site.xml
@@ -438,7 +438,7 @@
   
   
 mapreduce.admin.user.env
-
LD_LIBRARY_PATH=/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native/Linux-amd64-64
+
LD_LIBRARY_PATH=./mr-framework/hadoop/lib/native:/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native/Linux-amd64-64
 
   Additional execution environment entries for map and reduce task 
processes.
   This is not an additive property. You must preserve the original value if


ambari git commit: AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install LZO (aonishuk)

2017-11-22 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 8dd9acc64 -> b902c1330


AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install 
LZO (aonishuk)


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

Branch: refs/heads/trunk
Commit: b902c133035cc952a9081f5c0ffc8e967c2e6f44
Parents: 8dd9acc
Author: Andrew Onishuk 
Authored: Wed Nov 22 14:50:33 2017 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 22 14:52:43 2017 +0200

--
 .../main/python/ambari_server/serverConfiguration.py| 12 
 .../HDFS/2.1.0.2.0/package/scripts/hdfs.py  |  1 -
 .../HDFS/3.0.0.3.0/package/scripts/hdfs.py  |  1 -
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py|  1 -
 4 files changed, 12 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b902c133/ambari-server/src/main/python/ambari_server/serverConfiguration.py
--
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py 
b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index 5eb12e1..f744fa0 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -40,6 +40,7 @@ from ambari_server.properties import Properties
 from ambari_server.userInput import get_validated_string_input
 from ambari_server.utils import compare_versions, locate_file, on_powerpc
 from ambari_server.ambariPath import AmbariPath
+from ambari_server.userInput import get_YN_input
 
 
 OS_VERSION = OSCheck().get_os_major_version()
@@ -195,6 +196,15 @@ SETUP_OR_UPGRADE_MSG = "- If this is a new setup, then run 
the \"ambari-server s
"- If this is an upgrade of an existing setup, run the 
\"ambari-server upgrade\" command.\n" \
"Refer to the Ambari documentation for more information 
on setup and upgrade."
 
+GPL_LICENSE_PROMPT_TEXT = """To download GPL licensed products like lzo you 
must accept the license terms below:
+LICENSE_LINE_1
+LICENSE_LINE_2
+LICENSE_LINE_3
+LICENSE_LINE_4
+LICENSE_LINE_5
+LICENSE_LINE_6
+Do you accept the GPL License Agreement [y/n] (y)?"""
+
 DEFAULT_DB_NAME = "ambari"
 
 SECURITY_KEYS_DIR = "security.server.keys_dir"
@@ -209,6 +219,8 @@ BOOTSTRAP_SETUP_AGENT_SCRIPT = 
'bootstrap.setup_agent.script'
 STACKADVISOR_SCRIPT = 'stackadvisor.script'
 PID_DIR_PROPERTY = 'pid.dir'
 SERVER_TMP_DIR_PROPERTY = "server.tmp.dir"
+GPL_LICENSE_ACCEPTED_PROPERTY = 'gpl.license.accepted'
+
 REQUIRED_PROPERTIES = [OS_FAMILY_PROPERTY, OS_TYPE_PROPERTY, 
COMMON_SERVICES_PATH_PROPERTY, SERVER_VERSION_FILE_PATH,
WEBAPP_DIR_PROPERTY, STACK_LOCATION_KEY, 
SECURITY_KEYS_DIR, JDBC_DATABASE_NAME_PROPERTY,
NR_USER_PROPERTY, JAVA_HOME_PROPERTY, 
JDBC_PASSWORD_PROPERTY, SHARED_RESOURCES_DIR,

http://git-wip-us.apache.org/repos/asf/ambari/blob/b902c133/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
index bc80ba6..d3d0cf8 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs.py
@@ -26,7 +26,6 @@ from resource_management.core.source import Template
 from resource_management.core.resources.service import ServiceConfig
 from resource_management.libraries.resources.xml_config import XmlConfig
 
-from resource_management.libraries.functions.get_lzo_packages import 
get_lzo_packages
 from resource_management.core.exceptions import Fail
 from resource_management.core.logger import Logger
 from resource_management.libraries.functions.format import format

http://git-wip-us.apache.org/repos/asf/ambari/blob/b902c133/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py
 
b/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py
index bc80ba6..d3d0cf8 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/3.0.0.3.0/package/scripts/hdfs.py
+++ 

ambari git commit: AMBARI-22494 Unable to install the cluster. (atkach)

2017-11-22 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk 7eb14a0a5 -> 8dd9acc64


AMBARI-22494 Unable to install the cluster. (atkach)


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

Branch: refs/heads/trunk
Commit: 8dd9acc64f4411db96ed0582433e0d44f012c916
Parents: 7eb14a0
Author: Andrii Tkach 
Authored: Wed Nov 22 12:27:11 2017 +0200
Committer: Andrii Tkach 
Committed: Wed Nov 22 14:18:39 2017 +0200

--
 ambari-web/app/mixins/main/host/details/actions/check_host.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8dd9acc6/ambari-web/app/mixins/main/host/details/actions/check_host.js
--
diff --git a/ambari-web/app/mixins/main/host/details/actions/check_host.js 
b/ambari-web/app/mixins/main/host/details/actions/check_host.js
index 66baf5a..5eff19f 100644
--- a/ambari-web/app/mixins/main/host/details/actions/check_host.js
+++ b/ambari-web/app/mixins/main/host/details/actions/check_host.js
@@ -216,7 +216,7 @@ App.CheckHostMixin = Em.Mixin.create({
   return {
 hostName: Em.get(task, 'Tasks.host_name'),
 transparentHugePage: Em.get(task, 
'Tasks.structured_out.transparentHugePage.message'),
-installedPackages: installed_packages ? installed_packages : []
+installedPackages: installed_packages && 
Array.isArray(installed_packages) ? installed_packages : []
   };
 }));
 



ambari git commit: AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install LZO (aonishuk)

2017-11-22 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 9572882fd -> 5dd334c51


AMBARI-22467. YARN, MapReduce2, Hive, and Oozie Should Conditionally Install 
LZO (aonishuk)


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

Branch: refs/heads/trunk
Commit: 5dd334c513435717a7264f2092f5b281f5d2ce8f
Parents: 9572882
Author: Andrew Onishuk 
Authored: Wed Nov 22 16:36:51 2017 +0200
Committer: Andrew Onishuk 
Committed: Wed Nov 22 16:37:06 2017 +0200

--
 .../common-services/DRUID/0.10.1/package/scripts/druid.py   | 3 +--
 .../common-services/DRUID/0.10.1/package/scripts/params.py  | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5dd334c5/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
 
b/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
index ec98c3c..bb872b9 100644
--- 
a/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
+++ 
b/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/druid.py
@@ -115,8 +115,7 @@ def druid(upgrade_type=None, nodeType=None):
  )
 Logger.info(format("Created druid-{node_type_lowercase} jvm.config"))
 # Handling hadoop Lzo jars if enable and node type is hadoop related eg 
Overlords and MMs
-if ['middleManager', 'overlord'].__contains__(node_type_lowercase) and 
params.lzo_enabled and len(
-params.lzo_packages) > 0:
+if ['middleManager', 'overlord'].__contains__(node_type_lowercase) and 
params.lzo_enabled:
 try:
 Logger.info(
 format(

http://git-wip-us.apache.org/repos/asf/ambari/blob/5dd334c5/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
index fd1cde6..519dfbf 100644
--- 
a/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/DRUID/0.10.1/package/scripts/params.py
@@ -18,7 +18,6 @@ limitations under the License.
 
 """
 from ambari_commons import OSCheck
-from resource_management.libraries.functions.get_lzo_packages import 
get_lzo_packages
 from resource_management.libraries.functions import conf_select
 from resource_management.libraries.functions import stack_select
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
@@ -27,6 +26,7 @@ from resource_management.libraries.script.script import Script
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions.get_not_managed_resources import 
get_not_managed_resources
 from resource_management.libraries.functions.default import default
+from resource_management.libraries.functions.lzo_utils import 
should_install_lzo
 from ambari_commons.constants import AMBARI_SUDO_BINARY
 
 import status_params
@@ -195,6 +195,5 @@ if has_metric_collector:
 # Create current Hadoop Clients  Libs
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
 io_compression_codecs = 
default("/configurations/core-site/io.compression.codecs", None)
-lzo_enabled = io_compression_codecs is not None and 
"com.hadoop.compression.lzo" in io_compression_codecs.lower()
-lzo_packages = get_lzo_packages(stack_version_unformatted)
+lzo_enabled = should_install_lzo()
 hadoop_lib_home = stack_root + '/' + stack_version + '/hadoop/lib'



[2/2] ambari git commit: AMBARI-22497 Disk usage is not updated (dgrinenko)

2017-11-22 Thread hapylestat
AMBARI-22497 Disk usage is not updated (dgrinenko)


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

Branch: refs/heads/trunk
Commit: 9572882fdd345ac35a2b509d7e616579734d4fde
Parents: b902c13
Author: Dmytro Grinenko 
Authored: Wed Nov 22 15:55:56 2017 +0200
Committer: Dmytro Grinenko 
Committed: Wed Nov 22 15:55:56 2017 +0200

--
 .../src/main/python/ambari_agent/Hardware.py| 130 +++
 .../src/main/python/ambari_agent/Heartbeat.py   |   8 +-
 .../src/main/python/ambari_agent/HostInfo.py|  83 ++--
 .../test/python/ambari_agent/TestHardware.py|  56 ++--
 .../python/ambari_agent/TestRegistration.py |   5 +-
 5 files changed, 165 insertions(+), 117 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9572882f/ambari-agent/src/main/python/ambari_agent/Hardware.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 696438e..56ce872 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -44,55 +44,72 @@ class Hardware:
   IGNORE_DEVICES = ["proc", "tmpfs", "cgroup", "mqueue", "shm"]
   LINUX_PATH_SEP = "/"
 
-  def __init__(self, config):
+  def __init__(self, config=None, cache_info=True):
+"""
+Initialize hardware object with available metrics. Metrics cache could be
+ disabled by setting cache_info to False
+
+:param config Ambari Agent Configuration
+:param cache_info initialize hardware dictionary with available metrics
+
+:type config AmbariConfig
+:type cache_info bool
+"""
+self.config = config
+self._hardware = None
+
+if cache_info:
+  self._cache_hardware_info()
+
+  def _cache_hardware_info(self):
+"""
+Creating cache with hardware information
+"""
 logger.info("Initializing host system information.")
-self.hardware = {
-  'mounts': Hardware.osdisks()
+self._hardware = {
+  'mounts': self.osdisks()
 }
-self.config = config
-self.hardware.update(Facter(self.config).facterInfo())
-logger.info("Host system information: %s", self.hardware)
+self._hardware.update(Facter(self.config).facterInfo())
+logger.info("Host system information: %s", self._hardware)
 
-  @classmethod
-  def _parse_df_line(cls, line):
+  def _parse_df(self, lines):
 """
-  Initialize data-structure from string in specific 'df' command output 
format
+  Generator, which parses df command output and yields parsed entities
 
   Expected string format:
device fs_type disk_size used_size available_size 
capacity_used_percents mount_point
 
-:type line str
+:type lines list[str]
+:rtype collections.Iterable
 """
+titles = ["device", "type", "size", "used", "available", "percent", 
"mountpoint"]
 
-line_split = line.split()
-if len(line_split) != 7:
-  return None
+for line in lines:
+  line_split = line.split()
+  if len(line_split) != 7:
+continue
 
-titles = ["device", "type", "size", "used", "available", "percent", 
"mountpoint"]
-return dict(zip(titles, line_split))
+  yield dict(zip(titles, line_split))
 
-  @classmethod
-  def _get_mount_check_timeout(cls, config=None):
+  def _get_mount_check_timeout(self):
 """Return timeout for df call command"""
-if config and config.has_option(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY) \
-  and config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY) != "0":
+if self.config and 
self.config.has_option(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY) \
+  and self.config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY) != "0":
 
-  return config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY)
+  return self.config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY)
 
 return Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_DEFAULT
 
-  @classmethod
-  def _check_remote_mounts(cls, config=None):
+  def _check_remote_mounts(self):
 """Verify if remote mount allowed to be processed or not"""
-if config and config.has_option(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_KEY) and \
-   config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 

[1/2] ambari git commit: AMBARI-22497 Disk usage is not updated. (dgrinenko)

2017-11-22 Thread hapylestat
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 b7ed9aaa5 -> f76930957
  refs/heads/trunk b902c1330 -> 9572882fd


AMBARI-22497 Disk usage is not updated. (dgrinenko)


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

Branch: refs/heads/branch-2.6
Commit: f76930957f070fe9e6126ed26de97093229cfd05
Parents: b7ed9aa
Author: Dmytro Grinenko 
Authored: Wed Nov 22 15:54:21 2017 +0200
Committer: Dmytro Grinenko 
Committed: Wed Nov 22 15:54:21 2017 +0200

--
 .../src/main/python/ambari_agent/Hardware.py| 130 +++
 .../src/main/python/ambari_agent/Heartbeat.py   |   8 +-
 .../src/main/python/ambari_agent/HostInfo.py|  83 ++--
 .../test/python/ambari_agent/TestHardware.py|  56 ++--
 .../python/ambari_agent/TestRegistration.py |   5 +-
 5 files changed, 165 insertions(+), 117 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f7693095/ambari-agent/src/main/python/ambari_agent/Hardware.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 696438e..56ce872 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -44,55 +44,72 @@ class Hardware:
   IGNORE_DEVICES = ["proc", "tmpfs", "cgroup", "mqueue", "shm"]
   LINUX_PATH_SEP = "/"
 
-  def __init__(self, config):
+  def __init__(self, config=None, cache_info=True):
+"""
+Initialize hardware object with available metrics. Metrics cache could be
+ disabled by setting cache_info to False
+
+:param config Ambari Agent Configuration
+:param cache_info initialize hardware dictionary with available metrics
+
+:type config AmbariConfig
+:type cache_info bool
+"""
+self.config = config
+self._hardware = None
+
+if cache_info:
+  self._cache_hardware_info()
+
+  def _cache_hardware_info(self):
+"""
+Creating cache with hardware information
+"""
 logger.info("Initializing host system information.")
-self.hardware = {
-  'mounts': Hardware.osdisks()
+self._hardware = {
+  'mounts': self.osdisks()
 }
-self.config = config
-self.hardware.update(Facter(self.config).facterInfo())
-logger.info("Host system information: %s", self.hardware)
+self._hardware.update(Facter(self.config).facterInfo())
+logger.info("Host system information: %s", self._hardware)
 
-  @classmethod
-  def _parse_df_line(cls, line):
+  def _parse_df(self, lines):
 """
-  Initialize data-structure from string in specific 'df' command output 
format
+  Generator, which parses df command output and yields parsed entities
 
   Expected string format:
device fs_type disk_size used_size available_size 
capacity_used_percents mount_point
 
-:type line str
+:type lines list[str]
+:rtype collections.Iterable
 """
+titles = ["device", "type", "size", "used", "available", "percent", 
"mountpoint"]
 
-line_split = line.split()
-if len(line_split) != 7:
-  return None
+for line in lines:
+  line_split = line.split()
+  if len(line_split) != 7:
+continue
 
-titles = ["device", "type", "size", "used", "available", "percent", 
"mountpoint"]
-return dict(zip(titles, line_split))
+  yield dict(zip(titles, line_split))
 
-  @classmethod
-  def _get_mount_check_timeout(cls, config=None):
+  def _get_mount_check_timeout(self):
 """Return timeout for df call command"""
-if config and config.has_option(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY) \
-  and config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY) != "0":
+if self.config and 
self.config.has_option(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY) \
+  and self.config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY) != "0":
 
-  return config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY)
+  return self.config.get(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, 
Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY)
 
 return Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_DEFAULT
 
-  @classmethod
-  def _check_remote_mounts(cls, config=None):
+  def _check_remote_mounts(self):
 """Verify if remote mount allowed to be processed or not"""
-if config and 

[1/2] ambari git commit: AMBARI-22469. Ambari upgrade failed (dlysnichenko)

2017-11-22 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 f76930957 -> 92e362b71
  refs/heads/trunk 5dd334c51 -> b1acd1dfe


AMBARI-22469. Ambari upgrade failed (dlysnichenko)


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

Branch: refs/heads/branch-2.6
Commit: 92e362b718c0b8511ec95beb7268368f24fe92b0
Parents: f769309
Author: Lisnichenko Dmitro 
Authored: Wed Nov 22 17:04:42 2017 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Nov 22 17:04:42 2017 +0200

--
 .../server/upgrade/UpgradeCatalog260.java   | 28 ++--
 1 file changed, 20 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/92e362b7/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
index 96ce807..25635b6 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
@@ -191,7 +191,7 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
*/
   @Override
   protected void executeDDLUpdates() throws AmbariException, SQLException {
-int currentVersionID = getCurrentVersionID();
+Integer currentVersionID = getCurrentVersionID();
 dropBrokenFK();
 updateServiceComponentDesiredStateTable(currentVersionID);
 updateServiceDesiredStateTable(currentVersionID);
@@ -358,10 +358,13 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
* Removes {@value #FK_SDS_DESIRED_STACK_ID} foreign key.
* adds {@value #FK_REPO_VERSION_ID} foreign key.
*
+   * @param currentRepoID id of current repo_version. Can be null if there are 
no cluster repo versions
+   *  (in this case {@value #SERVICE_DESIRED_STATE_TABLE} 
table must be empty)
+   *
* @throws java.sql.SQLException
*/
-  private void updateServiceDesiredStateTable(int currentRepoID) throws 
SQLException {
-
+  private void updateServiceDesiredStateTable(Integer currentRepoID) throws 
SQLException {
+//in case if currentRepoID is null {@value #SERVICE_DESIRED_STATE_TABLE} 
table must be empty and null defaultValue is ok for non-nullable column
 dbAccessor.addColumn(SERVICE_DESIRED_STATE_TABLE,
 new DBAccessor.DBColumnInfo(DESIRED_REPO_VERSION_ID_COLUMN, 
Long.class, null, currentRepoID, false));
 dbAccessor.alterColumn(SERVICE_DESIRED_STATE_TABLE,
@@ -411,9 +414,13 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
* Removes {@value #FK_SCDS_DESIRED_STACK_ID} foreign key.
* adds {@value #FK_SCDS_DESIRED_REPO_ID} foreign key.
*
+   * @param currentRepoID id of current repo_version. Can be null if there are 
no cluster repo versions
+   *  (in this case {@value #SERVICE_DESIRED_STATE_TABLE} 
table must be empty)
+   *
* @throws java.sql.SQLException
*/
-  private void updateServiceComponentDesiredStateTable(int currentRepoID) 
throws SQLException {
+  private void updateServiceComponentDesiredStateTable(Integer currentRepoID) 
throws SQLException {
+//in case if currentRepoID is null {@value #SERVICE_DESIRED_STATE_TABLE} 
table must be empty and null defaultValue is ok for non-nullable column
 dbAccessor.addColumn(SERVICE_COMPONENT_DESIRED_STATE_TABLE,
 new DBAccessor.DBColumnInfo(DESIRED_REPO_VERSION_ID_COLUMN, 
Long.class, null, currentRepoID, false));
 dbAccessor.alterColumn(SERVICE_COMPONENT_DESIRED_STATE_TABLE,
@@ -499,15 +506,20 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
* where {@value #STATE_COLUMN} = {@value #CURRENT}
* and validate it
*
-   * @return current version ID
-   * @throws AmbariException
+   * @return current version ID or null if no cluster versions do exist
+   * @throws AmbariException if cluster versions are present, but current is 
not selected
* @throws SQLException
*/
-  public int getCurrentVersionID() throws AmbariException, SQLException {
+  public Integer getCurrentVersionID() throws AmbariException, SQLException {
 List currentVersionList = 
dbAccessor.getIntColumnValues(CLUSTER_VERSION_TABLE, REPO_VERSION_ID_COLUMN,
 new String[]{STATE_COLUMN}, new String[]{CURRENT}, false);
 if (currentVersionList.isEmpty()) {
-  throw new AmbariException("Unable to find any 

[2/2] ambari git commit: AMBARI-22469. Ambari upgrade failed (dlysnichenko)

2017-11-22 Thread dmitriusan
AMBARI-22469. Ambari upgrade failed (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: b1acd1dfe214f1d381af6cdb54300daa78cbd37f
Parents: 5dd334c
Author: Lisnichenko Dmitro 
Authored: Wed Nov 22 17:04:42 2017 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Nov 22 17:06:30 2017 +0200

--
 .../server/upgrade/UpgradeCatalog260.java   | 41 +++-
 1 file changed, 31 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b1acd1df/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
index 11f79fe..25635b6 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
@@ -17,8 +17,6 @@
  */
 package org.apache.ambari.server.upgrade;
 
-import static org.apache.ambari.server.view.ViewContextImpl.CORE_SITE;
-
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -134,9 +132,9 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
   public static final String HOST_COMPONENT_DESIRED_STATE = 
"hostcomponentdesiredstate";
   public static final String HOST_COMPONENT_STATE = "hostcomponentstate";
 
+  private static final String CORE_SITE = "core-site";
   public static final String AMS_SSL_CLIENT = "ams-ssl-client";
   public static final String METRIC_TRUSTSTORE_ALIAS = 
"ssl.client.truststore.alias";
-
   /**
* Logger.
*/
@@ -193,7 +191,7 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
*/
   @Override
   protected void executeDDLUpdates() throws AmbariException, SQLException {
-int currentVersionID = getCurrentVersionID();
+Integer currentVersionID = getCurrentVersionID();
 dropBrokenFK();
 updateServiceComponentDesiredStateTable(currentVersionID);
 updateServiceDesiredStateTable(currentVersionID);
@@ -360,10 +358,13 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
* Removes {@value #FK_SDS_DESIRED_STACK_ID} foreign key.
* adds {@value #FK_REPO_VERSION_ID} foreign key.
*
+   * @param currentRepoID id of current repo_version. Can be null if there are 
no cluster repo versions
+   *  (in this case {@value #SERVICE_DESIRED_STATE_TABLE} 
table must be empty)
+   *
* @throws java.sql.SQLException
*/
-  private void updateServiceDesiredStateTable(int currentRepoID) throws 
SQLException {
-
+  private void updateServiceDesiredStateTable(Integer currentRepoID) throws 
SQLException {
+//in case if currentRepoID is null {@value #SERVICE_DESIRED_STATE_TABLE} 
table must be empty and null defaultValue is ok for non-nullable column
 dbAccessor.addColumn(SERVICE_DESIRED_STATE_TABLE,
 new DBAccessor.DBColumnInfo(DESIRED_REPO_VERSION_ID_COLUMN, 
Long.class, null, currentRepoID, false));
 dbAccessor.alterColumn(SERVICE_DESIRED_STATE_TABLE,
@@ -413,9 +414,13 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
* Removes {@value #FK_SCDS_DESIRED_STACK_ID} foreign key.
* adds {@value #FK_SCDS_DESIRED_REPO_ID} foreign key.
*
+   * @param currentRepoID id of current repo_version. Can be null if there are 
no cluster repo versions
+   *  (in this case {@value #SERVICE_DESIRED_STATE_TABLE} 
table must be empty)
+   *
* @throws java.sql.SQLException
*/
-  private void updateServiceComponentDesiredStateTable(int currentRepoID) 
throws SQLException {
+  private void updateServiceComponentDesiredStateTable(Integer currentRepoID) 
throws SQLException {
+//in case if currentRepoID is null {@value #SERVICE_DESIRED_STATE_TABLE} 
table must be empty and null defaultValue is ok for non-nullable column
 dbAccessor.addColumn(SERVICE_COMPONENT_DESIRED_STATE_TABLE,
 new DBAccessor.DBColumnInfo(DESIRED_REPO_VERSION_ID_COLUMN, 
Long.class, null, currentRepoID, false));
 dbAccessor.alterColumn(SERVICE_COMPONENT_DESIRED_STATE_TABLE,
@@ -496,11 +501,27 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
 updateExistingRepositoriesToBeResolved();
   }
 
-  public int getCurrentVersionID() throws AmbariException, SQLException {
+  /**
+   * get {@value #REPO_VERSION_ID_COLUMN} value 

[1/2] ambari git commit: AMBARI-22500. Modify AMBARI-22387 to Check for LZO + No Opt-in (dlysnichenko)

2017-11-22 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22457 aea1a3c48 -> c0fbb86a4
  refs/heads/trunk b1acd1dfe -> cadbf3542


AMBARI-22500. Modify AMBARI-22387 to Check for LZO + No Opt-in (dlysnichenko)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: c0fbb86a4c34190be01ff287586959b5320ea98d
Parents: aea1a3c
Author: Lisnichenko Dmitro 
Authored: Wed Nov 22 17:44:07 2017 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Nov 22 17:44:07 2017 +0200

--
 .../java/org/apache/ambari/server/checks/LZOCheck.java |  6 +-
 .../org/apache/ambari/server/checks/LZOCheckTest.java  | 13 ++---
 2 files changed, 15 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c0fbb86a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
index 9c0286b..1eaacea 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
@@ -52,6 +52,9 @@ public class LZOCheck extends AbstractCheckDescriptor {
*/
   @Override
   public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest 
request) throws AmbariException {
+if (config.getGplLicenseAccepted()){
+  return;
+}
 List errorMessages = new ArrayList<>();
 PrereqCheckStatus checkStatus = PrereqCheckStatus.WARNING;
 
@@ -66,7 +69,8 @@ public class LZOCheck extends AbstractCheckDescriptor {
 }
 
 if (!errorMessages.isEmpty()) {
-  prerequisiteCheck.setFailReason(StringUtils.join(errorMessages, "You 
have LZO codec enabled in the core-site config of your cluster. LZO is no 
longer installed automatically. " +
+  prerequisiteCheck.setFailReason(StringUtils.join(errorMessages, "You 
have LZO codec enabled in the core-site config of your cluster. " +
+  "You have to accept GPL license during ambari-server setup to have 
LZO installed automatically. " +
   "If any hosts require LZO, it should be installed before starting 
the upgrade. " +
   "Consult Ambari documentation for instructions on how to do this."));
   prerequisiteCheck.getFailedOn().add("LZO");

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0fbb86a/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
index e50e936..13f52a5 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
@@ -60,6 +60,9 @@ public class LZOCheckTest {
   @Mock
   private RepositoryVersionEntity m_repositoryVersion;
 
+  @Mock
+  private Configuration configuration;
+
   final Map m_services = new HashMap<>();
 
   @Before
@@ -70,8 +73,7 @@ public class LZOCheckTest {
 return clusters;
   }
 };
-Configuration config = Mockito.mock(Configuration.class);
-lZOCheck.config = config;
+lZOCheck.config = configuration;
 
 m_services.clear();
 
@@ -99,7 +101,6 @@ public class LZOCheckTest {
   public void testPerform() throws Exception {
 final Cluster cluster = Mockito.mock(Cluster.class);
 final Map services = new HashMap<>();
-final Service service = Mockito.mock(Service.class);
 
 Mockito.when(cluster.getServices()).thenReturn(services);
 Mockito.when(cluster.getClusterId()).thenReturn(1L);
@@ -115,6 +116,7 @@ public class LZOCheckTest {
 Mockito.when(cluster.getConfig(Mockito.anyString(), 
Mockito.anyString())).thenReturn(config);
 final Map properties = new HashMap<>();
 Mockito.when(config.getProperties()).thenReturn(properties);
+Mockito.when(configuration.getGplLicenseAccepted()).thenReturn(false);
 
 PrerequisiteCheck check = new PrerequisiteCheck(null, null);
 lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
@@ -141,5 +143,10 @@ public class LZOCheckTest {
 check = new PrerequisiteCheck(null, null);
 lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
 

[2/2] ambari git commit: AMBARI-22500. Modify AMBARI-22387 to Check for LZO + No Opt-in (dlysnichenko)

2017-11-22 Thread dmitriusan
AMBARI-22500. Modify AMBARI-22387 to Check for LZO + No Opt-in (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: cadbf3542ce9e8ffad2aa32668518cb07464234d
Parents: b1acd1d
Author: Lisnichenko Dmitro 
Authored: Wed Nov 22 17:44:07 2017 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Nov 22 17:44:36 2017 +0200

--
 .../java/org/apache/ambari/server/checks/LZOCheck.java |  6 +-
 .../org/apache/ambari/server/checks/LZOCheckTest.java  | 13 ++---
 2 files changed, 15 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/cadbf354/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
index 9c0286b..1eaacea 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/LZOCheck.java
@@ -52,6 +52,9 @@ public class LZOCheck extends AbstractCheckDescriptor {
*/
   @Override
   public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest 
request) throws AmbariException {
+if (config.getGplLicenseAccepted()){
+  return;
+}
 List errorMessages = new ArrayList<>();
 PrereqCheckStatus checkStatus = PrereqCheckStatus.WARNING;
 
@@ -66,7 +69,8 @@ public class LZOCheck extends AbstractCheckDescriptor {
 }
 
 if (!errorMessages.isEmpty()) {
-  prerequisiteCheck.setFailReason(StringUtils.join(errorMessages, "You 
have LZO codec enabled in the core-site config of your cluster. LZO is no 
longer installed automatically. " +
+  prerequisiteCheck.setFailReason(StringUtils.join(errorMessages, "You 
have LZO codec enabled in the core-site config of your cluster. " +
+  "You have to accept GPL license during ambari-server setup to have 
LZO installed automatically. " +
   "If any hosts require LZO, it should be installed before starting 
the upgrade. " +
   "Consult Ambari documentation for instructions on how to do this."));
   prerequisiteCheck.getFailedOn().add("LZO");

http://git-wip-us.apache.org/repos/asf/ambari/blob/cadbf354/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
index e50e936..13f52a5 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/checks/LZOCheckTest.java
@@ -60,6 +60,9 @@ public class LZOCheckTest {
   @Mock
   private RepositoryVersionEntity m_repositoryVersion;
 
+  @Mock
+  private Configuration configuration;
+
   final Map m_services = new HashMap<>();
 
   @Before
@@ -70,8 +73,7 @@ public class LZOCheckTest {
 return clusters;
   }
 };
-Configuration config = Mockito.mock(Configuration.class);
-lZOCheck.config = config;
+lZOCheck.config = configuration;
 
 m_services.clear();
 
@@ -99,7 +101,6 @@ public class LZOCheckTest {
   public void testPerform() throws Exception {
 final Cluster cluster = Mockito.mock(Cluster.class);
 final Map services = new HashMap<>();
-final Service service = Mockito.mock(Service.class);
 
 Mockito.when(cluster.getServices()).thenReturn(services);
 Mockito.when(cluster.getClusterId()).thenReturn(1L);
@@ -115,6 +116,7 @@ public class LZOCheckTest {
 Mockito.when(cluster.getConfig(Mockito.anyString(), 
Mockito.anyString())).thenReturn(config);
 final Map properties = new HashMap<>();
 Mockito.when(config.getProperties()).thenReturn(properties);
+Mockito.when(configuration.getGplLicenseAccepted()).thenReturn(false);
 
 PrerequisiteCheck check = new PrerequisiteCheck(null, null);
 lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
@@ -141,5 +143,10 @@ public class LZOCheckTest {
 check = new PrerequisiteCheck(null, null);
 lZOCheck.perform(check, new PrereqCheckRequest("cluster"));
 Assert.assertEquals(PrereqCheckStatus.WARNING, check.getStatus());
+
+Mockito.when(configuration.getGplLicenseAccepted()).thenReturn(true);
+check = new 

ambari git commit: AMBARI-22472. Ambari Upgrade 2.5 -> 2.6 : Update NodeManager's HSI identity 'llap_zk_hive' and 'llap_task_hive' to use '/HIVE/HIVE_SERVER/hive_server_hive' reference instead of crea

2017-11-22 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/trunk f343e8c0f -> 65ca08455


AMBARI-22472. Ambari Upgrade 2.5 -> 2.6 : Update NodeManager's HSI identity 
'llap_zk_hive' and 'llap_task_hive' to use '/HIVE/HIVE_SERVER/hive_server_hive' 
reference instead of creating the same identity again.


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

Branch: refs/heads/trunk
Commit: 65ca08455f05b7c7e9352723f2bea21e86bc43e8
Parents: f343e8c
Author: Swapan Shridhar 
Authored: Tue Nov 21 15:57:44 2017 -0800
Committer: Swapan Shridhar 
Committed: Wed Nov 22 10:20:02 2017 -0800

--
 .../server/upgrade/UpgradeCatalog260.java   | 142 +
 .../stacks/HDP/2.5/services/YARN/kerberos.json  |  12 +-
 .../stacks/HDP/2.6/services/YARN/kerberos.json  |  24 +-
 .../server/upgrade/UpgradeCatalog260Test.java   | 136 -
 .../test_kerberos_descriptor_ranger_kms.json| 286 +++
 5 files changed, 564 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/65ca0845/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
index 25635b6..a7e0654 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
@@ -45,7 +45,9 @@ import 
org.apache.ambari.server.state.kerberos.KerberosComponentDescriptor;
 import org.apache.ambari.server.state.kerberos.KerberosDescriptor;
 import org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory;
 import org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor;
+import org.apache.ambari.server.state.kerberos.KerberosKeytabDescriptor;
 import org.apache.ambari.server.state.kerberos.KerberosPrincipalDescriptor;
+import org.apache.ambari.server.state.kerberos.KerberosPrincipalType;
 import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
@@ -135,6 +137,20 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
   private static final String CORE_SITE = "core-site";
   public static final String AMS_SSL_CLIENT = "ams-ssl-client";
   public static final String METRIC_TRUSTSTORE_ALIAS = 
"ssl.client.truststore.alias";
+
+  private static final String HIVE_INTERACTIVE_SITE = "hive-interactive-site";
+  public static final String HIVE_LLAP_DAEMON_KEYTAB_FILE = 
"hive.llap.daemon.keytab.file";
+  public static final String HIVE_LLAP_ZK_SM_KEYTAB_FILE = 
"hive.llap.zk.sm.keytab.file";
+  public static final String HIVE_LLAP_TASK_KEYTAB_FILE = 
"hive.llap.task.keytab.file";
+  public static final String HIVE_SERVER_KERBEROS_PREFIX = 
"/HIVE/HIVE_SERVER/";
+  public static final String YARN_LLAP_ZK_HIVE_KERBEROS_IDENTITY = 
"llap_zk_hive";
+  public static final String YARN_LLAP_TASK_HIVE_KERBEROS_IDENTITY = 
"llap_task_hive";
+  public static final String HIVE_SERVER_HIVE_KERBEROS_IDENTITY = 
"hive_server_hive";
+
+  // Used to track whether YARN -> NODEMANAGER -> 'llap_zk_hive' kerberos 
descriptor was updated or not.
+  private List yarnKerberosDescUpdatedList = new ArrayList<>();
+
+
   /**
* Logger.
*/
@@ -497,6 +513,7 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
 ensureZeppelinProxyUserConfigs();
 updateKerberosDescriptorArtifacts();
 updateAmsConfigs();
+updateHiveConfigs();
 updateHDFSWidgetDefinition();
 updateExistingRepositoriesToBeResolved();
   }
@@ -636,6 +653,7 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
 if (kerberosDescriptor != null) {
   fixRangerKMSKerberosDescriptor(kerberosDescriptor);
   fixIdentityReferences(getCluster(artifactEntity), 
kerberosDescriptor);
+  
fixYarnHsiKerberosDescriptorAndSiteConfig(getCluster(artifactEntity), 
kerberosDescriptor);
 
   artifactEntity.setArtifactData(kerberosDescriptor.toMap());
   artifactDAO.merge(artifactEntity);
@@ -662,6 +680,130 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
 }
   }
 
+  /**
+   * Updates YARN's NM 'llap_zk_hive' kerberos descriptor as reference and the 
associated config
+   * hive-interactive-site/hive.llap.zk.sm.keytab.file
+   */
+  protected void fixYarnHsiKerberosDescriptorAndSiteConfig(Cluster 

ambari git commit: AMBARI-22501. stack advisor error while adding Druid service (alexantonenko)

2017-11-22 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk cadbf3542 -> f343e8c0f


AMBARI-22501. stack advisor error while adding Druid service (alexantonenko)


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

Branch: refs/heads/trunk
Commit: f343e8c0f596d9bd3610c23b387c370dbf6f6028
Parents: cadbf35
Author: Alex Antonenko 
Authored: Wed Nov 22 21:19:23 2017 +0300
Committer: Alex Antonenko 
Committed: Wed Nov 22 21:19:23 2017 +0300

--
 ambari-web/app/mixins/wizard/addSecurityConfigs.js | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f343e8c0/ambari-web/app/mixins/wizard/addSecurityConfigs.js
--
diff --git a/ambari-web/app/mixins/wizard/addSecurityConfigs.js 
b/ambari-web/app/mixins/wizard/addSecurityConfigs.js
index 89d3cf7..bd6fa89 100644
--- a/ambari-web/app/mixins/wizard/addSecurityConfigs.js
+++ b/ambari-web/app/mixins/wizard/addSecurityConfigs.js
@@ -657,6 +657,13 @@ App.AddSecurityConfigs = Em.Mixin.create({
   return p;
 }, {});
 
+if (this.get('isWithinAddService')) {
+  this.get('content.masterComponentHosts').filterProperty('isInstalled', 
false).forEach(function(item) {
+var hostGroupName = blueprintUtils.getHostGroupByFqdn(recommendations, 
item.hostName);
+blueprintUtils.addComponentToHostGroup(recommendations, 
item.component, hostGroupName);
+  }, this);
+}
+
 return recommendations;
   },
 



ambari git commit: AMBARI-22472. Ambari Upgrade 2.5 -> 2.6 : Update NodeManager's HSI identity 'llap_zk_hive' and 'llap_task_hive' to use '/HIVE/HIVE_SERVER/hive_server_hive' reference instead of crea

2017-11-22 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 92e362b71 -> 7f5b7d7ce


AMBARI-22472. Ambari Upgrade 2.5 -> 2.6 : Update NodeManager's HSI identity 
'llap_zk_hive' and 'llap_task_hive' to use '/HIVE/HIVE_SERVER/hive_server_hive' 
reference instead of creating the same identity again.


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

Branch: refs/heads/branch-2.6
Commit: 7f5b7d7cef41162686e4ff9e3b620de990a6bd3f
Parents: 92e362b
Author: Swapan Shridhar 
Authored: Mon Nov 20 12:26:48 2017 -0800
Committer: Swapan Shridhar 
Committed: Wed Nov 22 10:10:49 2017 -0800

--
 .../server/upgrade/UpgradeCatalog260.java   | 141 +
 .../stacks/HDP/2.5/services/YARN/kerberos.json  |  12 +-
 .../stacks/HDP/2.6/services/YARN/kerberos.json  |  24 +-
 .../server/upgrade/UpgradeCatalog260Test.java   | 129 -
 .../test_kerberos_descriptor_ranger_kms.json| 286 +++
 5 files changed, 556 insertions(+), 36 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7f5b7d7c/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
index 25635b6..5831565 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
@@ -45,7 +45,9 @@ import 
org.apache.ambari.server.state.kerberos.KerberosComponentDescriptor;
 import org.apache.ambari.server.state.kerberos.KerberosDescriptor;
 import org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory;
 import org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor;
+import org.apache.ambari.server.state.kerberos.KerberosKeytabDescriptor;
 import org.apache.ambari.server.state.kerberos.KerberosPrincipalDescriptor;
+import org.apache.ambari.server.state.kerberos.KerberosPrincipalType;
 import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
@@ -135,6 +137,19 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
   private static final String CORE_SITE = "core-site";
   public static final String AMS_SSL_CLIENT = "ams-ssl-client";
   public static final String METRIC_TRUSTSTORE_ALIAS = 
"ssl.client.truststore.alias";
+
+  private static final String HIVE_INTERACTIVE_SITE = "hive-interactive-site";
+  public static final String HIVE_LLAP_DAEMON_KEYTAB_FILE = 
"hive.llap.daemon.keytab.file";
+  public static final String HIVE_LLAP_ZK_SM_KEYTAB_FILE = 
"hive.llap.zk.sm.keytab.file";
+  public static final String HIVE_LLAP_TASK_KEYTAB_FILE = 
"hive.llap.task.keytab.file";
+  public static final String HIVE_SERVER_KERBEROS_PREFIX = 
"/HIVE/HIVE_SERVER/";
+  public static final String YARN_LLAP_ZK_HIVE_KERBEROS_IDENTITY = 
"llap_zk_hive";
+  public static final String YARN_LLAP_TASK_HIVE_KERBEROS_IDENTITY = 
"llap_task_hive";
+  public static final String HIVE_SERVER_HIVE_KERBEROS_IDENTITY = 
"hive_server_hive";
+
+  // Used to track whether YARN -> NODEMANAGER -> 'llap_zk_hive' kerberos 
descriptor was updated or not.
+  private List yarnKerberosDescUpdatedList = new ArrayList<>();
+
   /**
* Logger.
*/
@@ -497,6 +512,7 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
 ensureZeppelinProxyUserConfigs();
 updateKerberosDescriptorArtifacts();
 updateAmsConfigs();
+updateHiveConfigs();
 updateHDFSWidgetDefinition();
 updateExistingRepositoriesToBeResolved();
   }
@@ -636,6 +652,7 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
 if (kerberosDescriptor != null) {
   fixRangerKMSKerberosDescriptor(kerberosDescriptor);
   fixIdentityReferences(getCluster(artifactEntity), 
kerberosDescriptor);
+  
fixYarnHsiKerberosDescriptorAndSiteConfig(getCluster(artifactEntity), 
kerberosDescriptor);
 
   artifactEntity.setArtifactData(kerberosDescriptor.toMap());
   artifactDAO.merge(artifactEntity);
@@ -662,6 +679,130 @@ public class UpgradeCatalog260 extends 
AbstractUpgradeCatalog {
 }
   }
 
+  /**
+   * Updates YARN's NM 'llap_zk_hive' kerberos descriptor as reference and the 
associated config
+   * hive-interactive-site/hive.llap.zk.sm.keytab.file
+   */
+  protected void 

ambari git commit: AMBARI-22484. Stack advisor should disallow lzo enable without accepting license agreement. Additional fixes. (mpapirkovskyy)

2017-11-22 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22457 c0fbb86a4 -> d301d3451


AMBARI-22484. Stack advisor should disallow lzo enable without accepting 
license agreement. Additional fixes. (mpapirkovskyy)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: d301d34517d5f48b824b95e9aab01176ec4c4a10
Parents: c0fbb86
Author: Myroslav Papirkovskyi 
Authored: Wed Nov 22 20:37:22 2017 +0200
Committer: Myroslav Papirkovskyi 
Committed: Wed Nov 22 20:40:06 2017 +0200

--
 .../stackadvisor/StackAdvisorRequest.java   |  8 +
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 36 +++-
 .../src/main/resources/stacks/stack_advisor.py  |  9 +
 .../stacks/2.0.6/common/test_stack_advisor.py   | 14 ++--
 4 files changed, 55 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d301d345/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java
index bc1e079..d750a6c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorRequest.java
@@ -118,6 +118,9 @@ public class StackAdvisorRequest {
 this.configGroups = configGroups;
   }
 
+  /**
+   * @return true if GPL license is accepted, false otherwise
+   */
   public Boolean getGplLicenseAccepted() {
 return gplLicenseAccepted;
   }
@@ -194,6 +197,11 @@ public class StackAdvisorRequest {
   return this;
 }
 
+/**
+ * Set GPL license acceptance parameter to request.
+ * @param gplLicenseAccepted is GPL license accepted.
+ * @return stack advisor request builder.
+ */
 public StackAdvisorRequestBuilder withGPLLicenseAccepted(
 Boolean gplLicenseAccepted) {
   this.instance.gplLicenseAccepted = gplLicenseAccepted;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d301d345/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 6d80f1a..3f8a772 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -517,20 +517,38 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 self.recommendHadoopProxyUsers(configurations, services, hosts)
 
   def getLZOSupportValidationItems(self, properties, services):
+'''
+Checks GPL license is accepted when GPL software is used.
+:param properties: dict of properties' name and value pairs
+:param services: list of services
+:return: NOT_APPLICABLE messages in case GPL license is not accepted
+'''
 services_list = self.get_services_list(services)
 
+validations = []
 if "HDFS" in services_list:
   lzo_allowed = services["gpl-license-accepted"]
-  property_name = "io.compression.codec.lzo.class"
-  if property_name in properties:
-property_value = properties.get(property_name)
-if not lzo_allowed and "com.hadoop.compression.lzo.LzoCodec" in 
property_value:
-  return [{"config-name": property_name, "item": self.getErrorItem(
-"Your Ambari Server has not been configured to download LZO and 
install it. "
-"LZO is GPL software and requires you to accept a license prior to 
use. "
-"Please refer to this documentation to configure Ambari before 
proceeding.")}]
 
-return []
+  self.validatePropertyToLZOCodec("io.compression.codecs", properties, 
lzo_allowed, validations)
+  self.validatePropertyToLZOCodec("io.compression.codec.lzo.class", 
properties, lzo_allowed, validations)
+return validations
+
+  def validatePropertyToLZOCodec(self, property_name, properties, lzo_allowed, 
validations):
+'''
+Checks specified property contains LZO codec class and requires GPL 
license acceptance.
+:param property_name: property name
+:param properties: dict of 

ambari git commit: AMBARI-22501. stack advisor error while adding Druid service (alexantonenko)

2017-11-22 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 7f5b7d7ce -> 416570dbd


AMBARI-22501. stack advisor error while adding Druid service (alexantonenko)


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

Branch: refs/heads/branch-2.6
Commit: 416570dbd947c5bd366abf8aebaa9b44ac9cfecf
Parents: 7f5b7d7
Author: Alex Antonenko 
Authored: Wed Nov 22 21:20:46 2017 +0300
Committer: Alex Antonenko 
Committed: Wed Nov 22 21:20:46 2017 +0300

--
 .../app/controllers/main/admin/kerberos/step4_controller.js| 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/416570db/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index f23814c..ba66d87 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -502,6 +502,12 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
   return p;
 }, {});
 
+if (this.get('isWithinAddService')) {
+  this.get('content.masterComponentHosts').filterProperty('isInstalled', 
false).forEach(function(item) {
+var hostGroupName = blueprintUtils.getHostGroupByFqdn(recommendations, 
item.hostName);
+blueprintUtils.addComponentToHostGroup(recommendations, 
item.component, hostGroupName);
+  }, this);
+}
 return recommendations;
   },
 



ambari git commit: AMBARI-22498. Remove trailing lines (if any) from llapstatus command before converting the o/p to JSON.

2017-11-22 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/trunk 65ca08455 -> 9d3eeaaa9


AMBARI-22498. Remove trailing lines (if any) from llapstatus command before 
converting the o/p to JSON.


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

Branch: refs/heads/trunk
Commit: 9d3eeaaa9eca4cda1b3c675da9341516d9d19706
Parents: 65ca084
Author: Swapan Shridhar 
Authored: Wed Nov 22 10:24:38 2017 -0800
Committer: Swapan Shridhar 
Committed: Wed Nov 22 10:24:38 2017 -0800

--
 .../package/scripts/hive_server_interactive.py  | 20 +++--
 .../HIVE/running_withMOTDmsg_andTrailingMsg.txt | 46 
 .../stacks/2.5/HIVE/test_hive_server_int.py | 21 +
 3 files changed, 84 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9d3eeaaa/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 c0b152e..caa3e9b 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
@@ -415,13 +415,14 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
 
 
 """
-Remove extra lines from 'llapstatus' status output (eg: because of MOTD 
logging) so as to have a valid JSON data to be passed in
-to JSON converter.
+Remove extra lines (begginning/end) from 'llapstatus' status output (eg: 
because of MOTD logging) so as to have 
+a valid JSON data to be passed in to JSON converter.
 """
 def _make_valid_json(self, output):
   '''
 
-  Note: It is assumed right now that extra lines will be only at the start 
and not at the end.
+  Note: Extra lines (eg: because of MOTD) may be at the start or the end 
(some other logging getting appended)
+  of the passed-in data.
 
   Sample expected JSON to be passed for 'loads' is either of the form :
 
@@ -457,6 +458,19 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
   if (len_splits < 3):
 raise Fail ("Malformed JSON data received from 'llapstatus' command. 
Exiting ")
 
+  # Firstly, remove extra lines from the END.
+  updated_splits = []
+  for itr, line in enumerate(reversed(splits)):
+if line == "}": # Our assumption of end of JSON data.
+  updated_splits = splits[:-itr]
+  break
+
+  if len(updated_splits) > 0:
+splits = updated_splits
+len_splits = len(splits)
+
+
+  # Secondly, remove extra lines from the BEGGINNING.
   marker_idx = None # To detect where from to start reading for JSON data
   for idx, split in enumerate(splits):
 curr_elem = split.strip()

http://git-wip-us.apache.org/repos/asf/ambari/blob/9d3eeaaa/ambari-server/src/test/python/stacks/2.5/HIVE/running_withMOTDmsg_andTrailingMsg.txt
--
diff --git 
a/ambari-server/src/test/python/stacks/2.5/HIVE/running_withMOTDmsg_andTrailingMsg.txt
 
b/ambari-server/src/test/python/stacks/2.5/HIVE/running_withMOTDmsg_andTrailingMsg.txt
new file mode 100644
index 000..394faef
--- /dev/null
+++ 
b/ambari-server/src/test/python/stacks/2.5/HIVE/running_withMOTDmsg_andTrailingMsg.txt
@@ -0,0 +1,46 @@
+ Hortonworks #
+This is MOTD message, added for testing in qe infra
+{
+  "amInfo" : {
+"appName" : "llap",
+"appType" : "org-apache-slider",
+"appId" : "application_1455662455106_10882",
+"containerId" : "container_e14_1455662455106_10882_01_01",
+"hostname" : "HOST_REPLACED",
+"amWebUrl" : "http://HOST_REPLACED:1025/;
+  },
+  "state" : "RUNNING_ALL",
+  "originalConfigurationPath" : 
"hdfs://HOST_REPLACED:8020/user/USER_REPLACED/.slider/cluster/llap/snapshot",
+  "generatedConfigurationPath" : 
"hdfs://HOST_REPLACED:8020/user/USER_REPLACED/.slider/cluster/llap/generated",
+  "desiredInstances" : 3,
+  "liveInstances" : 3,
+  "appStartTime" : 1459625802169,
+  "llapInstances" : [ {
+"hostname" : "HOST_REPLACED",
+"containerId" : "container_e14_1455662455106_10882_01_03",
+"statusUrl" : "http://HOST_REPLACED:15002/status;,
+"webUrl" : "http://HOST_REPLACED:15002;,
+

ambari git commit: AMBARI-22498. Remove trailing lines (if any) from llapstatus command before converting the o/p to JSON.

2017-11-22 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 416570dbd -> 677e27e65


AMBARI-22498. Remove trailing lines (if any) from llapstatus command before 
converting the o/p to JSON.


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

Branch: refs/heads/branch-2.6
Commit: 677e27e658b1fe6e272789ce97ecfbaa5ad0d0ca
Parents: 416570d
Author: Swapan Shridhar 
Authored: Wed Nov 22 10:24:38 2017 -0800
Committer: Swapan Shridhar 
Committed: Wed Nov 22 10:26:53 2017 -0800

--
 .../package/scripts/hive_server_interactive.py  | 20 +++--
 .../HIVE/running_withMOTDmsg_andTrailingMsg.txt | 46 
 .../stacks/2.5/HIVE/test_hive_server_int.py | 21 +
 3 files changed, 84 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/677e27e6/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 57cbcd0..32322cd 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
@@ -416,13 +416,14 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
 
 
 """
-Remove extra lines from 'llapstatus' status output (eg: because of MOTD 
logging) so as to have a valid JSON data to be passed in
-to JSON converter.
+Remove extra lines (begginning/end) from 'llapstatus' status output (eg: 
because of MOTD logging) so as to have 
+a valid JSON data to be passed in to JSON converter.
 """
 def _make_valid_json(self, output):
   '''
 
-  Note: It is assumed right now that extra lines will be only at the start 
and not at the end.
+  Note: Extra lines (eg: because of MOTD) may be at the start or the end 
(some other logging getting appended)
+  of the passed-in data.
 
   Sample expected JSON to be passed for 'loads' is either of the form :
 
@@ -458,6 +459,19 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
   if (len_splits < 3):
 raise Fail ("Malformed JSON data received from 'llapstatus' command. 
Exiting ")
 
+  # Firstly, remove extra lines from the END.
+  updated_splits = []
+  for itr, line in enumerate(reversed(splits)):
+if line == "}": # Our assumption of end of JSON data.
+  updated_splits = splits[:-itr]
+  break
+
+  if len(updated_splits) > 0:
+splits = updated_splits
+len_splits = len(splits)
+
+
+  # Secondly, remove extra lines from the BEGGINNING.
   marker_idx = None # To detect where from to start reading for JSON data
   for idx, split in enumerate(splits):
 curr_elem = split.strip()

http://git-wip-us.apache.org/repos/asf/ambari/blob/677e27e6/ambari-server/src/test/python/stacks/2.5/HIVE/running_withMOTDmsg_andTrailingMsg.txt
--
diff --git 
a/ambari-server/src/test/python/stacks/2.5/HIVE/running_withMOTDmsg_andTrailingMsg.txt
 
b/ambari-server/src/test/python/stacks/2.5/HIVE/running_withMOTDmsg_andTrailingMsg.txt
new file mode 100644
index 000..394faef
--- /dev/null
+++ 
b/ambari-server/src/test/python/stacks/2.5/HIVE/running_withMOTDmsg_andTrailingMsg.txt
@@ -0,0 +1,46 @@
+ Hortonworks #
+This is MOTD message, added for testing in qe infra
+{
+  "amInfo" : {
+"appName" : "llap",
+"appType" : "org-apache-slider",
+"appId" : "application_1455662455106_10882",
+"containerId" : "container_e14_1455662455106_10882_01_01",
+"hostname" : "HOST_REPLACED",
+"amWebUrl" : "http://HOST_REPLACED:1025/;
+  },
+  "state" : "RUNNING_ALL",
+  "originalConfigurationPath" : 
"hdfs://HOST_REPLACED:8020/user/USER_REPLACED/.slider/cluster/llap/snapshot",
+  "generatedConfigurationPath" : 
"hdfs://HOST_REPLACED:8020/user/USER_REPLACED/.slider/cluster/llap/generated",
+  "desiredInstances" : 3,
+  "liveInstances" : 3,
+  "appStartTime" : 1459625802169,
+  "llapInstances" : [ {
+"hostname" : "HOST_REPLACED",
+"containerId" : "container_e14_1455662455106_10882_01_03",
+"statusUrl" : "http://HOST_REPLACED:15002/status;,
+"webUrl" : "http://HOST_REPLACED:15002;,
+ 

ambari git commit: AMBARI-22486 - Conditionally Rebuild MapReduce and Tez Tarballs with LZO if Enabled (jonathanhurley)

2017-11-22 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 9d3eeaaa9 -> 2c46bb3ea


AMBARI-22486 - Conditionally Rebuild MapReduce and Tez Tarballs with LZO if 
Enabled (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: 2c46bb3ea9b7868ddc087acc320e624cfa601436
Parents: 9d3eeaa
Author: Jonathan Hurley 
Authored: Mon Nov 20 14:23:20 2017 -0500
Committer: Jonathan Hurley 
Committed: Wed Nov 22 14:31:38 2017 -0500

--
 .../libraries/functions/copy_tarball.py | 99 +++-
 .../TEZ/0.4.0.2.1/package/scripts/tez.py|  5 +-
 .../TEZ/0.9.0.3.0/configuration/tez-site.xml|  4 +-
 .../TEZ/0.9.0.3.0/package/scripts/tez.py|  4 +
 .../configuration-mapred/mapred-site.xml|  2 +-
 .../configuration-mapred/mapred-site.xml|  2 +-
 .../2.2/services/TEZ/configuration/tez-site.xml |  4 +-
 .../YARN/configuration-mapred/mapred-site.xml   |  2 +-
 .../stacks/HDP/2.6/upgrades/config-upgrade.xml  |  6 +-
 9 files changed, 113 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2c46bb3e/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
index dda1a18..c15fbd1 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/copy_tarball.py
@@ -28,6 +28,8 @@ from contextlib import closing
 
 from resource_management.libraries.script.script import Script
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
+from resource_management.libraries.functions import component_version
+from resource_management.libraries.functions import lzo_utils
 from resource_management.libraries.functions.default import default
 from resource_management.core import shell
 from resource_management.core import sudo
@@ -45,6 +47,9 @@ STACK_VERSION_PATTERN = "{{ stack_version }}"
 def _prepare_tez_tarball():
   """
   Prepares the Tez tarball by adding the Hadoop native libraries found in the 
mapreduce tarball.
+  It's very important to use the version of mapreduce which matches tez here.
+  Additionally, this will also copy native LZO to the tez tarball if LZO is 
enabled and the
+  GPL license has been accepted.
   :return:  the full path of the newly created tez tarball to use
   """
   import tempfile
@@ -79,12 +84,31 @@ def _prepare_tez_tarball():
   if not os.path.exists(tez_lib_dir):
 raise Fail("Unable to seed the Tez tarball with native libraries since the 
target Tez lib directory {0} does not exist".format(tez_lib_dir))
 
-  # ensure that the tez/lib directory is readable by non-root (which it 
typically is not)
-  sudo.chmod(tez_lib_dir, 0755)
-
   # copy native libraries from hadoop to tez
   Execute(("cp", "-a", hadoop_lib_native_dir, tez_lib_dir), sudo = True)
 
+  # if enabled, LZO GPL libraries must be copied as well
+  if lzo_utils.should_install_lzo():
+stack_root = Script.get_stack_root()
+tez_version = component_version.get_component_repository_version("TEZ")
+hadoop_lib_native_lzo_dir = os.path.join(stack_root, tez_version, 
"hadoop", "lib", "native")
+
+if not sudo.path_isdir(hadoop_lib_native_lzo_dir):
+  Logger.warning("Unable to located native LZO libraries at {0}, falling 
back to hadoop home".format(hadoop_lib_native_lzo_dir))
+  hadoop_lib_native_lzo_dir = os.path.join(stack_root, "current", 
"hadoop-client", "lib", "native")
+
+if not sudo.path_isdir(hadoop_lib_native_lzo_dir):
+  raise Fail("Unable to seed the Tez tarball with native libraries since 
LZO is enabled but the native LZO libraries could not be found at 
{0}".format(hadoop_lib_native_lzo_dir))
+
+Execute(("cp", "-a", hadoop_lib_native_lzo_dir, tez_lib_dir), sudo = True)
+
+
+  # ensure that the tez/lib directory is readable by non-root (which it 
typically is not)
+  Directory(tez_lib_dir,
+mode = 0755,
+cd_access = 'a',
+recursive_ownership = True)
+
   # create the staging directory so that non-root agents can write to it
   tez_native_tarball_staging_dir = os.path.join(temp_dir, 
"tez-native-tarball-staging")
   if not os.path.exists(tez_native_tarball_staging_dir):
@@ -111,6 +135,72 @@ def _prepare_tez_tarball():
   return tez_tarball_with_native_lib
 
 
+def 

ambari git commit: AMBARI-22454. ambari-server upgrade to 2.6.1 should surface the GPL agreement. Fix checkstyle. (Attila Doroszlai via mpapyrkovskyy)

2017-11-22 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/trunk 2c46bb3ea -> 5d421b7ab


AMBARI-22454. ambari-server upgrade to 2.6.1 should surface the GPL agreement. 
Fix checkstyle. (Attila Doroszlai via mpapyrkovskyy)


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

Branch: refs/heads/trunk
Commit: 5d421b7abd557a0ab915e03cee8df59cd4760178
Parents: 2c46bb3
Author: Myroslav Papirkovskyi 
Authored: Wed Nov 22 21:57:15 2017 +0200
Committer: Myroslav Papirkovskyi 
Committed: Wed Nov 22 22:14:39 2017 +0200

--
 .../controller/AmbariCustomCommandExecutionHelper.java   |  2 +-
 .../internal/ClientConfigResourceProvider.java   |  2 +-
 .../ambari/server/upgrade/SchemaUpgradeHelper.java   |  8 
 .../org/apache/ambari/server/upgrade/UpgradeCatalog.java |  1 -
 .../apache/ambari/server/upgrade/UpgradeCatalog260.java  |  1 -
 .../apache/ambari/server/upgrade/UpgradeCatalog261.java  | 11 ++-
 6 files changed, 12 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5d421b7a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 7c52877..c4df0b1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -26,9 +26,9 @@ import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.COMPONENT
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.CUSTOM_COMMAND;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_DRIVER_FILENAME;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_NAME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GPL_LICENSE_ACCEPTED;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GROUP_LIST;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOST_SYS_PREPPED;
-import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GPL_LICENSE_ACCEPTED;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCATION;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.MYSQL_JDBC_URL;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.NOT_MANAGED_HDFS_PATH_LIST;

http://git-wip-us.apache.org/repos/asf/ambari/blob/5d421b7a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index 993da1b..f0ede5d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -21,6 +21,7 @@ package org.apache.ambari.server.controller.internal;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AGENT_STACK_RETRY_COUNT;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AGENT_STACK_RETRY_ON_UNAVAILABILITY;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_NAME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GPL_LICENSE_ACCEPTED;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GROUP_LIST;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOST_SYS_PREPPED;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCATION;
@@ -33,7 +34,6 @@ import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_NAM
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_VERSION;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.USER_GROUPS;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.USER_LIST;
-import static 

ambari git commit: AMBARI-22454. ambari-server upgrade to 2.6.1 should surface the GPL agreement. Fix checkstyle. (Attila Doroszlai via mpapyrkovskyy)

2017-11-22 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22457 d301d3451 -> ba957a869


AMBARI-22454. ambari-server upgrade to 2.6.1 should surface the GPL agreement. 
Fix checkstyle. (Attila Doroszlai via mpapyrkovskyy)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: ba957a86990f533387f4a788452a6aae9fb758cc
Parents: d301d34
Author: Myroslav Papirkovskyi 
Authored: Wed Nov 22 21:57:15 2017 +0200
Committer: Myroslav Papirkovskyi 
Committed: Wed Nov 22 22:23:53 2017 +0200

--
 .../AmbariCustomCommandExecutionHelper.java   | 14 +-
 .../internal/ClientConfigResourceProvider.java|  2 +-
 .../ambari/server/upgrade/SchemaUpgradeHelper.java|  8 
 .../apache/ambari/server/upgrade/UpgradeCatalog.java  |  1 -
 .../ambari/server/upgrade/UpgradeCatalog261.java  | 11 ++-
 5 files changed, 12 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ba957a86/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index f75e315..06c3b04 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -26,10 +26,10 @@ import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.COMPONENT
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.CUSTOM_COMMAND;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_DRIVER_FILENAME;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_NAME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GPL_LICENSE_ACCEPTED;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GROUP_LIST;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOST_SYS_PREPPED;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JAVA_HOME;
-import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GPL_LICENSE_ACCEPTED;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JAVA_VERSION;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JCE_NAME;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCATION;
@@ -58,8 +58,6 @@ import java.util.Random;
 import java.util.Set;
 import java.util.TreeMap;
 
-import org.apache.ambari.annotations.Experimental;
-import org.apache.ambari.annotations.ExperimentalFeature;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.Role;
 import org.apache.ambari.server.RoleCommand;
@@ -67,7 +65,6 @@ import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.actionmanager.Stage;
 import org.apache.ambari.server.agent.AgentCommand.AgentCommandType;
-import org.apache.ambari.server.agent.CommandRepository;
 import org.apache.ambari.server.agent.ExecutionCommand;
 import org.apache.ambari.server.agent.ExecutionCommand.KeyNames;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
@@ -78,9 +75,6 @@ import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.metadata.ActionMetadata;
 import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
-import org.apache.ambari.server.orm.entities.OperatingSystemEntity;
-import org.apache.ambari.server.orm.entities.RepositoryEntity;
-import org.apache.ambari.server.orm.entities.RepositoryVersionEntity;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.CommandScriptDefinition;
@@ -95,7 +89,6 @@ import org.apache.ambari.server.state.HostState;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.PropertyInfo;
 import org.apache.ambari.server.state.PropertyInfo.PropertyType;
-import org.apache.ambari.server.state.RepositoryInfo;
 import org.apache.ambari.server.state.Service;
 import