ambari git commit: AMBARI-20782. Add config changes from AMBARI-20537 to hive component upgrade path. (Swapan Shridhar via Prasanth Jayachandran).

2017-04-18 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/trunk 323da5089 -> f516b6c5a


AMBARI-20782. Add config changes from AMBARI-20537 to hive component upgrade 
path. (Swapan Shridhar via Prasanth Jayachandran).


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

Branch: refs/heads/trunk
Commit: f516b6c5ad384ceb52181bee6b1553089563182e
Parents: 323da50
Author: Swapan Shridhar 
Authored: Tue Apr 18 18:01:35 2017 -0700
Committer: Swapan Shridhar 
Committed: Tue Apr 18 18:01:35 2017 -0700

--
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml  | 10 ++
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 37 +---
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml |  2 ++
 3 files changed, 36 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f516b6c5/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 b70b9df..ad936c2 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
@@ -487,6 +487,16 @@
 
   
 
+  
+hive-interactive-env
+
+  
+
+  
+hive-interactive-site
+
+  
+
 
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/f516b6c5/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 a6bc4fc..d46353e 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
@@ -540,6 +540,30 @@
 
   
 
+  
+
+  Updating headroom for LLAP
+
+  
+
+  
+
+  Updating Hash Aggregation settings for LLAP
+
+  
+
+  
+
+  Updating JVM stack size for LLAP
+
+  
+
+  
+
+  Updating tez shuffle parallel copies for LLAP
+
+  
+
   
 
   
@@ -696,19 +720,6 @@
   wait_for_safemode_off
 
   
-
-  
-
-  Updating the Hive Log4J2 properties to include 
parameterizations
-
-  
-
-  
-
-  Updating Hash Aggregation settings for LLAP
-
-  
-
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f516b6c5/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 53d4579..94aab48 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
@@ -842,6 +842,8 @@
   
   
   
+  
+  
 
 
 



ambari git commit: AMBARI-20782. Add config changes from AMBARI-20537 to hive component upgrade path. (Swapan Shridhar via Prasanth Jayachandran).

2017-04-18 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 71399b7f7 -> 8be765f1d


AMBARI-20782. Add config changes from AMBARI-20537 to hive component upgrade 
path. (Swapan Shridhar via Prasanth Jayachandran).


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

Branch: refs/heads/branch-2.5
Commit: 8be765f1d08b8b28c5170a11a97ea7da4ec67671
Parents: 71399b7
Author: Swapan Shridhar 
Authored: Tue Apr 18 17:58:27 2017 -0700
Committer: Swapan Shridhar 
Committed: Tue Apr 18 17:58:35 2017 -0700

--
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml  | 10 ++
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 37 +---
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml |  2 ++
 3 files changed, 36 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8be765f1/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 1762d15..99107ef 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
@@ -481,6 +481,16 @@
 
   
 
+  
+hive-interactive-env
+
+  
+
+  
+hive-interactive-site
+
+  
+
 
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/8be765f1/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 f1b26d6..e347a02 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
@@ -536,6 +536,30 @@
 
   
 
+  
+
+  Updating headroom for LLAP
+
+  
+
+  
+
+  Updating Hash Aggregation settings for LLAP
+
+  
+
+  
+
+  Updating JVM stack size for LLAP
+
+  
+
+  
+
+  Updating tez shuffle parallel copies for LLAP
+
+  
+
   
 
   
@@ -692,19 +716,6 @@
   wait_for_safemode_off
 
   
-
-  
-
-  Updating the Hive Log4J2 properties to include 
parameterizations
-
-  
-
-  
-
-  Updating Hash Aggregation settings for LLAP
-
-  
-
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8be765f1/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 53d4579..94aab48 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
@@ -842,6 +842,8 @@
   
   
   
+  
+  
 
 
 



ambari git commit: AMBARI-15754. configs.sh expands ***** in config values to a local file list, causing broken config files (Asger Askov Blekinge via smohanty)

2017-04-18 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 f613941aa -> 14c6114f4


AMBARI-15754. configs.sh expands * in config values to a local file list, 
causing broken config files (Asger Askov Blekinge via smohanty)


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

Branch: refs/heads/branch-2.4
Commit: 14c6114f4d50323f51cc4ebeb08782cec4f698a9
Parents: f613941
Author: Sumit Mohanty 
Authored: Thu Feb 23 14:01:35 2017 -0800
Committer: Sumit Mohanty 
Committed: Tue Apr 18 14:34:02 2017 -0700

--
 ambari-server/src/main/resources/scripts/configs.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/14c6114f/ambari-server/src/main/resources/scripts/configs.sh
--
diff --git a/ambari-server/src/main/resources/scripts/configs.sh 
b/ambari-server/src/main/resources/scripts/configs.sh
index ba02d2d..3b57d2e 100755
--- a/ambari-server/src/main/resources/scripts/configs.sh
+++ b/ambari-server/src/main/resources/scripts/configs.sh
@@ -168,7 +168,7 @@ doConfigUpdate () {
   finalJson="{ \"Clusters\": { \"desired_config\": {\"type\": 
\"$SITE\", \"tag\":\"$newTag\", $newProperties}}}"
   newFile="doSet_$newTag.json"
   echo "## PUTting json into: $newFile"
-  echo $finalJson > $newFile
+  echo "$finalJson" > $newFile
   curl -k -u $USERID:$PASSWD -X PUT -H "X-Requested-By: ambari" 
"$AMBARIURL/api/v1/clusters/$CLUSTER" --data @$newFile
   currentSiteTag
   echo "## NEW Site:$SITE, Tag:$SITETAG";
@@ -193,7 +193,7 @@ doConfigFileUpdate () {
   newProperties=`cat $FILENAME`;
   finalJson="{ \"Clusters\": { \"desired_config\": {\"type\": \"$SITE\", 
\"tag\":\"$newTag\", $newProperties}}}"
   newFile="doSet_$newTag.json"
-  echo $finalJson>$newFile
+  echo "$finalJson" > $newFile
   echo "## PUTting file:\"$FILENAME\" into config(type:\"$SITE\", 
tag:$newTag) via $newFile"
   curl -k -u $USERID:$PASSWD -X PUT -H "X-Requested-By: ambari" 
"$AMBARIURL/api/v1/clusters/$CLUSTER" --data @$newFile
   currentSiteTag
@@ -240,9 +240,9 @@ doGet () {
 fi
 if [ "$propertiesStarted" -gt "0" ]; then
   if [ -z $FILENAME ]; then
-echo $line
+echo "$line"
   else
-echo $line >> $FILENAME
+echo "$line" >> $FILENAME
   fi
 fi
 if [ "`echo $line | grep -E "{$"`" ]; then



ambari git commit: AMBARI-20777 : AMS changes to use instanceId for cluster based segregation of data. (avijayan)

2017-04-18 Thread avijayan
Repository: ambari
Updated Branches:
  refs/heads/trunk 8e2abf97b -> 323da5089


AMBARI-20777 : AMS changes to use instanceId for cluster based segregation of 
data. (avijayan)


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

Branch: refs/heads/trunk
Commit: 323da508944626c8ee82118ce67a000b8e5a511c
Parents: 8e2abf9
Author: Aravindan Vijayan 
Authored: Tue Apr 18 13:16:09 2017 -0700
Committer: Aravindan Vijayan 
Committed: Tue Apr 18 13:16:09 2017 -0700

--
 .../timeline/HadoopTimelineMetricsSink.java |   4 +
 .../timeline/HBaseTimelineMetricStore.java  |   5 +
 .../metrics/timeline/PhoenixHBaseAccessor.java  | 106 +++
 .../metrics/timeline/TimelineMetricStore.java   |   8 ++
 .../TimelineMetricClusterAggregatorSecond.java  |   1 +
 .../TimelineMetricMetadataManager.java  |  38 +++
 .../discovery/TimelineMetricMetadataSync.java   |  57 ++
 .../timeline/query/PhoenixTransactSQL.java  |  12 +++
 .../webapp/TimelineWebServices.java |  16 +++
 .../timeline/TestTimelineMetricStore.java   |   5 +
 .../timeline/discovery/TestMetadataManager.java |   8 ++
 .../timeline/discovery/TestMetadataSync.java|  12 +++
 12 files changed, 272 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/323da508/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
--
diff --git 
a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
 
b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
index a112ef2..8e0de03 100644
--- 
a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
+++ 
b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
@@ -51,6 +51,7 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
   private Map useTagsMap = new HashMap();
   private TimelineMetricsCache metricsCache;
   private String hostName = "UNKNOWN.example.com";
+  private String instanceId = null;
   private String serviceName = "";
   private Collection collectorHosts;
   private String collectorUri;
@@ -94,6 +95,8 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
 }
 
 serviceName = getServiceName(conf);
+String inst = conf.getString("instanceId", "");
+instanceId = StringUtils.isEmpty(inst) ? null : inst;
 
 LOG.info("Identified hostname = " + hostName + ", serviceName = " + 
serviceName);
 // Initialize the collector write strategy
@@ -318,6 +321,7 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
 timelineMetric.setMetricName(name);
 timelineMetric.setHostName(hostName);
 timelineMetric.setAppId(serviceName);
+timelineMetric.setInstanceId(instanceId);
 timelineMetric.setStartTime(startTime);
 timelineMetric.setType(metric.type() != null ? metric.type().name() : 
null);
 timelineMetric.getMetricValues().put(startTime, value.doubleValue());

http://git-wip-us.apache.org/repos/asf/ambari/blob/323da508/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
index 17c58f0..fa095a0 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
@@ -388,6 +388,11 @@ public class HBaseTimelineMetricStore extends 
AbstractService implements Timelin
   }
 
   @Override
+  public Map getInstanceHostsMetadata() throws 
SQLException, 

ambari git commit: AMBARI-19632. Ldap sync fails when there are special characters in distinguished names (rlevas)

2017-04-18 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 36226da09 -> f613941aa


AMBARI-19632. Ldap sync fails when there are special characters in 
distinguished names (rlevas)


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

Branch: refs/heads/branch-2.4
Commit: f613941aabb78b600ea627f89bb78aa014bf1e79
Parents: 36226da
Author: Robert Levas 
Authored: Tue Apr 18 16:08:55 2017 -0400
Committer: Robert Levas 
Committed: Tue Apr 18 16:08:55 2017 -0400

--
 ambari-project/pom.xml  |   4 +-
 .../security/authorization/AmbariLdapUtils.java |  71 +--
 .../security/ldap/AmbariLdapDataPopulator.java  | 100 
 .../server/security/AmbariLdapUtilsTest.java| 118 ++-
 .../ldap/AmbariLdapDataPopulatorTest.java   |   9 +-
 5 files changed, 200 insertions(+), 102 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f613941a/ambari-project/pom.xml
--
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 8825032..be00c9f 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -140,12 +140,12 @@
   
 org.springframework.security
 spring-security-ldap
-3.1.2.RELEASE
+4.0.4.RELEASE
   
   
 org.springframework.ldap
 spring-ldap-core
-1.3.1.RELEASE
+2.0.4.RELEASE
   
   
 org.apache.directory.server

http://git-wip-us.apache.org/repos/asf/ambari/blob/f613941a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapUtils.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapUtils.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapUtils.java
index 6d20de3..a1c7009 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapUtils.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapUtils.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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
@@ -7,7 +7,7 @@
  * "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
+ * 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,
@@ -19,13 +19,17 @@
 package org.apache.ambari.server.security.authorization;
 
 import com.google.common.base.Preconditions;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.ldap.core.DirContextAdapter;
-import org.springframework.ldap.core.DistinguishedName;
-import org.springframework.security.ldap.LdapUtils;
+import org.springframework.ldap.support.LdapUtils;
 
+import javax.naming.Context;
+import javax.naming.InvalidNameException;
 import javax.naming.Name;
+import javax.naming.NamingException;
+
 import java.util.regex.Pattern;
 
 /**
@@ -42,8 +46,9 @@ public class AmbariLdapUtils {
 
   /**
* Returns true if the given user name contains domain name as well (e.g. 
username@domain)
+   *
* @param loginName the login name to verify if it contains domain 
information.
-   * @return
+   * @return true if the given user name contains domain name as well; false 
otherwise
*/
   public static boolean isUserPrincipalNameFormat(String loginName) {
 return UPN_FORMAT.matcher(loginName).matches();
@@ -52,9 +57,10 @@ public class AmbariLdapUtils {
 
   /**
* Determine that the full DN of an LDAP object is in/out of the base DN 
scope.
+   *
* @param adapter used for get the full dn from the ldap query response
-   * @param baseDn
-   * @return
+   * @param baseDn the base distinguished name
+   * @return true if the object is out of scope; false otherwise
*/
   public static boolean isLdapObjectOutOfScopeFromBaseDn(DirContextAdapter 
adapter, String baseDn) {
 boolean isOutOfScope = true;
@@ -62,9 +68,9 @@ public class AmbariLdapUtils {
   Name dn = adapter.getDn();
   Preconditions.checkArgument(dn != null, "DN cannot be null in LDAP 
response object");
 
-  DistinguishedName full = LdapUtils.getFullDn((DistinguishedName) dn, 

ambari git commit: AMBARI-20777 : AMS changes to use instanceId for cluster based segregation of data. (avijayan)

2017-04-18 Thread avijayan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 c7e5331e4 -> 71399b7f7


AMBARI-20777 : AMS changes to use instanceId for cluster based segregation of 
data. (avijayan)


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

Branch: refs/heads/branch-2.5
Commit: 71399b7f7f02813e20813719816a1e82710ff3d3
Parents: c7e5331
Author: Aravindan Vijayan 
Authored: Tue Apr 18 13:06:53 2017 -0700
Committer: Aravindan Vijayan 
Committed: Tue Apr 18 13:07:04 2017 -0700

--
 .../timeline/HadoopTimelineMetricsSink.java |   4 +
 .../timeline/HBaseTimelineMetricStore.java  |   5 +
 .../metrics/timeline/PhoenixHBaseAccessor.java  | 106 +++
 .../metrics/timeline/TimelineMetricStore.java   |   8 ++
 .../TimelineMetricClusterAggregatorSecond.java  |   1 +
 .../TimelineMetricMetadataManager.java  |  38 +++
 .../discovery/TimelineMetricMetadataSync.java   |  57 ++
 .../timeline/query/PhoenixTransactSQL.java  |  12 +++
 .../webapp/TimelineWebServices.java |  16 +++
 .../timeline/TestTimelineMetricStore.java   |   5 +
 .../timeline/discovery/TestMetadataManager.java |   8 ++
 .../timeline/discovery/TestMetadataSync.java|  12 +++
 12 files changed, 272 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/71399b7f/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
--
diff --git 
a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
 
b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
index 1f0adc0..85cc794 100644
--- 
a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
+++ 
b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
@@ -51,6 +51,7 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
   private Map useTagsMap = new HashMap();
   private TimelineMetricsCache metricsCache;
   private String hostName = "UNKNOWN.example.com";
+  private String instanceId = null;
   private String serviceName = "";
   private Collection collectorHosts;
   private String collectorUri;
@@ -94,6 +95,8 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
 }
 
 serviceName = getServiceName(conf);
+String inst = conf.getString("instanceId", "");
+instanceId = StringUtils.isEmpty(inst) ? null : inst;
 
 LOG.info("Identified hostname = " + hostName + ", serviceName = " + 
serviceName);
 // Initialize the collector write strategy
@@ -319,6 +322,7 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
 timelineMetric.setMetricName(name);
 timelineMetric.setHostName(hostName);
 timelineMetric.setAppId(serviceName);
+timelineMetric.setInstanceId(instanceId);
 timelineMetric.setStartTime(startTime);
 timelineMetric.setType(metric.type() != null ? metric.type().name() : 
null);
 timelineMetric.getMetricValues().put(startTime, value.doubleValue());

http://git-wip-us.apache.org/repos/asf/ambari/blob/71399b7f/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
index 72ae4ac..8509b68 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
@@ -390,6 +390,11 @@ public class HBaseTimelineMetricStore extends 
AbstractService implements Timelin
   }
 
   @Override
+  public Map getInstanceHostsMetadata() throws 

ambari git commit: AMBARI-18576. When multiple requests are running, aborting any will incorrectly abort all requests instead the desired one (alejandro)

2017-04-18 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 f4d7a3fdb -> 36226da09


AMBARI-18576. When multiple requests are running, aborting any will incorrectly 
abort all requests instead the desired one (alejandro)


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

Branch: refs/heads/branch-2.4
Commit: 36226da099b1e6311595fcc732d0d06681ce105b
Parents: f4d7a3f
Author: Alejandro Fernandez 
Authored: Tue Apr 18 11:30:16 2017 -0700
Committer: Alejandro Fernandez 
Committed: Tue Apr 18 11:30:28 2017 -0700

--
 .../ambari/server/actionmanager/ActionDBAccessor.java | 13 +
 .../server/actionmanager/ActionDBAccessorImpl.java| 14 ++
 .../ambari/server/actionmanager/ActionScheduler.java  |  4 ++--
 .../org/apache/ambari/server/orm/dao/StageDAO.java| 10 ++
 .../ambari/server/orm/entities/StageEntity.java   |  5 -
 .../server/actionmanager/TestActionScheduler.java | 12 ++--
 6 files changed, 49 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/36226da0/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
index 0e78cbc..8aef70d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
@@ -86,6 +86,19 @@ public interface ActionDBAccessor {
   public List getStagesInProgress();
 
   /**
+   * Returns all the pending stages in a request, including queued and 
not-queued. A stage is
+   * considered in progress if it is in progress for any host.
+   * 
+   * The results will be sorted by stage ID making this call
+   * expensive in some scenarios. Use {@link #getCommandsInProgressCount()} in
+   * order to determine if there are stages that are in progress before getting
+   * the stages from this method.
+   *
+   * @see HostRoleStatus#IN_PROGRESS_STATUSES
+   */
+  public List getStagesInProgressForRequest(Long requestId);
+
+  /**
* Gets the number of commands in progress.
*
* @return the number of commands in progress.

http://git-wip-us.apache.org/repos/asf/ambari/blob/36226da0/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
index c31ca7e..2c87583 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
@@ -270,10 +270,24 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
*/
   @Override
   @Experimental(feature = ExperimentalFeature.PARALLEL_PROCESSING)
+  public List getStagesInProgressForRequest(Long requestId) {
+List stageEntities = 
stageDAO.findByRequestIdAndCommandStatuses(requestId, 
HostRoleStatus.IN_PROGRESS_STATUSES);
+return getStagesForEntities(stageEntities);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  @Experimental(feature = ExperimentalFeature.PARALLEL_PROCESSING)
   public List getStagesInProgress() {
 List stageEntities = stageDAO.findByCommandStatuses(
   HostRoleStatus.IN_PROGRESS_STATUSES);
+return getStagesForEntities(stageEntities);
+  }
 
+  @Experimental(feature = ExperimentalFeature.PARALLEL_PROCESSING)
+  private List getStagesForEntities(List stageEntities) {
 // experimentally enable parallel stage processing
 @Experimental(feature = ExperimentalFeature.PARALLEL_PROCESSING)
 boolean useConcurrentStageProcessing = 
configuration.isExperimentalConcurrentStageProcessingEnabled();

http://git-wip-us.apache.org/repos/asf/ambari/blob/36226da0/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
index e380ae4..8cbfb1e 100644
--- 

ambari git commit: AMBARI-20774 - Service Upgrade VDF Creates Host Version Entries For All Hosts With INSTALLING (jonathanhurley)

2017-04-18 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-12556 b013be0b9 -> 56f838b5b


AMBARI-20774 - Service Upgrade VDF Creates Host Version Entries For All Hosts 
With INSTALLING (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 56f838b5b0a5681dffb703f503fcf443cb3b6dbd
Parents: b013be0
Author: Jonathan Hurley 
Authored: Mon Apr 17 17:19:45 2017 -0400
Committer: Jonathan Hurley 
Committed: Tue Apr 18 14:13:21 2017 -0400

--
 .../ClusterStackVersionResourceProvider.java| 136 -
 .../org/apache/ambari/server/state/Cluster.java |  40 ++-
 .../server/state/cluster/ClusterImpl.java   | 169 +++-
 .../server/upgrade/UpgradeCatalog300.java   |   8 +-
 .../ServicesNamenodeTruncateCheckTest.java  |   2 +-
 .../AmbariManagementControllerImplTest.java |   6 +-
 ...ClusterStackVersionResourceProviderTest.java | 273 +++
 .../HostVersionOutOfSyncListenerTest.java   |  42 ++-
 .../server/state/cluster/ClusterTest.java   |  62 +++--
 9 files changed, 413 insertions(+), 325 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/56f838b5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
index 9c54a9d..e39588e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
@@ -20,7 +20,6 @@ package org.apache.ambari.server.controller.internal;
 import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCATION;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumSet;
 import java.util.HashMap;
@@ -77,7 +76,6 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Host;
-import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.RepositoryType;
 import org.apache.ambari.server.state.RepositoryVersionState;
 import org.apache.ambari.server.state.ServiceComponentHost;
@@ -89,6 +87,7 @@ import org.apache.ambari.server.utils.StageUtils;
 import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.math.NumberUtils;
+import org.apache.hadoop.metrics2.sink.relocated.google.common.collect.Lists;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Sets;
@@ -350,10 +349,10 @@ public class ClusterStackVersionResourceProvider extends 
AbstractControllerResou
   stackId = currentStackVersion;
 }
 
-RepositoryVersionEntity repoVersionEnt = 
repositoryVersionDAO.findByStackAndVersion(
+RepositoryVersionEntity repoVersionEntity = 
repositoryVersionDAO.findByStackAndVersion(
 stackId, desiredRepoVersion);
 
-if (repoVersionEnt == null) {
+if (repoVersionEntity == null) {
   throw new IllegalArgumentException(String.format(
   "Repo version %s is not available for stack %s",
   desiredRepoVersion, stackId));
@@ -361,14 +360,40 @@ public class ClusterStackVersionResourceProvider extends 
AbstractControllerResou
 
 VersionDefinitionXml desiredVersionDefinition = null;
 try {
-  desiredVersionDefinition = repoVersionEnt.getRepositoryXml();
+  desiredVersionDefinition = repoVersionEntity.getRepositoryXml();
 } catch (Exception e) {
   throw new IllegalArgumentException(
   String.format("Version %s is backed by a version definition, but it 
could not be parsed", desiredRepoVersion), e);
 }
 
-// get all of the host eligible for stack distribution
-List hosts = getHostsForStackDistribution(cluster);
+// if true, then we need to force all new host versions into the INSTALLED 
state
+boolean forceInstalled = Boolean.parseBoolean((String)propertyMap.get(
+CLUSTER_STACK_VERSION_FORCE));
+
+try {
+  // either create the necessary host version entries, or set them to 

ambari git commit: AMBARI-18938. NPE when authenticating via a Centrify LDAP proxy (rlevas)

2017-04-18 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 2db62f4be -> f4d7a3fdb


AMBARI-18938. NPE when authenticating via a Centrify LDAP proxy (rlevas)


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

Branch: refs/heads/branch-2.4
Commit: f4d7a3fdbf26ef1900647a31121f2b7ceb5b1a2b
Parents: 2db62f4
Author: Robert Levas 
Authored: Tue Apr 18 13:34:17 2017 -0400
Committer: Robert Levas 
Committed: Tue Apr 18 13:34:22 2017 -0400

--
 .../AmbariLdapAuthenticationProvider.java   |  23 +-
 .../AmbariLdapBindAuthenticator.java| 228 +--
 .../AmbariLdapBindAuthenticatorTest.java| 209 ++---
 3 files changed, 340 insertions(+), 120 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f4d7a3fd/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
index 6905757..b5776a3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProvider.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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
@@ -24,7 +24,6 @@ import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.dao.UserDAO;
 import org.apache.ambari.server.orm.entities.UserEntity;
 import org.apache.ambari.server.security.ClientSecurityType;
-import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.dao.IncorrectResultSizeDataAccessException;
@@ -72,17 +71,21 @@ public class AmbariLdapAuthenticationProvider implements 
AuthenticationProvider
 
 return new AmbariAuthentication(auth, userId);
   } catch (AuthenticationException e) {
-LOG.debug("Got exception during LDAP authentification attempt", e);
+LOG.debug("Got exception during LDAP authentication attempt", e);
 // Try to help in troubleshooting
 Throwable cause = e.getCause();
-if (cause != null) {
-  // Below we check the cause of an AuthenticationException . If it is
-  // caused by another AuthenticationException, than probably
-  // the problem is with LDAP ManagerDN/password
-  if ((cause != e) && (cause instanceof
-  org.springframework.ldap.AuthenticationException)) {
+if ((cause != null) && (cause != e)) {
+  // Below we check the cause of an AuthenticationException to see 
what the actual cause is
+  // and then send an appropriate message to the caller.
+  if (cause instanceof 
org.springframework.ldap.CommunicationException) {
+if (LOG.isDebugEnabled()) {
+  LOG.warn("Failed to communicate with the LDAP server: " + 
cause.getMessage(), e);
+} else {
+  LOG.warn("Failed to communicate with the LDAP server: " + 
cause.getMessage());
+}
+  } else if (cause instanceof 
org.springframework.ldap.AuthenticationException) {
 LOG.warn("Looks like LDAP manager credentials (that are used for " 
+
-"connecting to LDAP server) are invalid.", e);
+"connecting to LDAP server) are invalid.", e);
   }
 }
 throw new InvalidUsernamePasswordCombinationException(e);

http://git-wip-us.apache.org/repos/asf/ambari/blob/f4d7a3fd/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
index 9e534a6..e2bcd2d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
+++ 

ambari git commit: AMBARI-19345 Storm REST metrics are not available when Storm UI is running in HTTPS (dsen)

2017-04-18 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 34f0103f6 -> 2db62f4be


AMBARI-19345 Storm REST metrics are not available when Storm UI is running in 
HTTPS (dsen)


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

Branch: refs/heads/branch-2.4
Commit: 2db62f4be4e2f726ec36df031bbdfc3324bcb4d4
Parents: 34f0103
Author: Dmytro Sen 
Authored: Thu Feb 9 18:44:15 2017 +0200
Committer: Dmytro Sen 
Committed: Tue Apr 18 19:13:19 2017 +0300

--
 .../HDP/2.1.1/services/STORM/metrics.json   |  10 +-
 .../metrics/RestMetricsPropertyProvider.java| 106 ---
 .../common-services/STORM/0.10.0/metrics.json   |   8 +-
 .../common-services/STORM/0.9.1/alerts.json |  30 +-
 .../common-services/STORM/0.9.1/metrics.json|   8 +-
 .../STORM/0.9.1/quicklinks/quicklinks.json  |  25 -
 .../common-services/STORM/0.9.3/metrics.json|   8 +-
 .../RestMetricsPropertyProviderTest.java|   4 +-
 .../HDP/2.1.1/services/STORM/metrics.json   |  10 +-
 9 files changed, 125 insertions(+), 84 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2db62f4b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
--
diff --git 
a/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
 
b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
index 7c149bb..247e59e 100644
--- 
a/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
+++ 
b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/STORM/metrics.json
@@ -7,7 +7,9 @@
   "default_port": "8745",
   "port_config_type": "storm-site",
   "port_property_name": "storm.port",
-  "protocol": "http"
+  "protocol": "http",
+  "https_port_property_name" : "ui.https.port",
+  "https_property_name" : "ui.https.keystore.type"
 },
 "metrics": {
   "default": {
@@ -62,7 +64,9 @@
   "default_port": "8745",
   "port_config_type": "storm-site",
   "port_property_name": "storm.port",
-  "protocol": "http"
+  "protocol": "http",
+  "https_port_property_name" : "ui.https.port",
+  "https_property_name" : "ui.https.keystore.type"
 },
 "metrics": {
   "default": {
@@ -111,4 +115,4 @@
   }
 ]
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2db62f4b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
index cbe827a..4fdf2db 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java
@@ -101,16 +101,17 @@ public class RestMetricsPropertyProvider extends 
ThreadPoolEnabledPropertyProvid
   private static final String DEFAULT_PORT_PROPERTY = "default_port";
   private static final String PORT_CONFIG_TYPE_PROPERTY = "port_config_type";
   private static final String PORT_PROPERTY_NAME_PROPERTY = 
"port_property_name";
+  private static final String HTTPS_PORT_PROPERTY_NAME_PROPERTY = 
"https_port_property_name";
 
   /**
* Protocol to use when connecting
*/
   private static final String PROTOCOL_OVERRIDE_PROPERTY = "protocol";
+  private static final String HTTPS_PROTOCOL_PROPERTY = "https_property_name";
   private static final String HTTP_PROTOCOL = "http";
   private static final String HTTPS_PROTOCOL = "https";
   private static final String DEFAULT_PROTOCOL = HTTP_PROTOCOL;
 
-
   /**
* String that separates JSON URL from path inside JSON in metrics path
*/
@@ -207,7 +208,7 @@ public class RestMetricsPropertyProvider extends 
ThreadPoolEnabledPropertyProvid
   // If there are no metrics defined for the given component then there is 
nothing to do.
   return resource;
 }
-String protocol = resolveProtocol();
+String protocol = null;
 String port = "-1";
 String hostname = null;
 try {
@@ -220,7 +221,8 @@ public class RestMetricsPropertyProvider extends 
ThreadPoolEnabledPropertyProvid
 LOG.warn(msg);
 

ambari git commit: AMBARI-18813. Optionally force username from LDAP authentication data to be lowercase in Ambari (rlevas)

2017-04-18 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 943fac128 -> 34f0103f6


AMBARI-18813. Optionally force username from LDAP authentication data to be 
lowercase in Ambari (rlevas)


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

Branch: refs/heads/branch-2.4
Commit: 34f0103f6d50d27fbeb1482e86a03daee7cff795
Parents: 943fac1
Author: Robert Levas 
Authored: Tue Apr 18 09:52:46 2017 -0400
Committer: Robert Levas 
Committed: Tue Apr 18 09:52:46 2017 -0400

--
 .../server/configuration/Configuration.java |  4 +++
 .../AmbariLdapBindAuthenticator.java| 15 +--
 .../authorization/LdapServerProperties.java | 26 
 .../AmbariLdapBindAuthenticatorTest.java| 17 +++--
 4 files changed, 58 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/34f0103f/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 a91eada..a55dbbe 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
@@ -189,6 +189,7 @@ public class Configuration {
   public static final String LDAP_MANAGER_PASSWORD_KEY = 
"authentication.ldap.managerPassword";
   public static final String LDAP_DN_ATTRIBUTE_KEY = 
"authentication.ldap.dnAttribute";
   public static final String LDAP_USERNAME_ATTRIBUTE_KEY = 
"authentication.ldap.usernameAttribute";
+  public static final String LDAP_USERNAME_FORCE_LOWERCASE_KEY = 
"authentication.ldap.username.forceLowercase";
   public static final String LDAP_USER_BASE_KEY = 
"authentication.ldap.userBase";
   public static final String LDAP_USER_OBJECT_CLASS_KEY = 
"authentication.ldap.userObjectClass";
   public static final String LDAP_GROUP_BASE_KEY = 
"authentication.ldap.groupBase";
@@ -517,6 +518,7 @@ public class Configuration {
   private static final String LDAP_PRIMARY_URL_DEFAULT = "localhost:33389";
   private static final String LDAP_BASE_DN_DEFAULT = 
"dc=ambari,dc=apache,dc=org";
   private static final String LDAP_USERNAME_ATTRIBUTE_DEFAULT = "uid";
+  private static final String LDAP_USERNAME_FORCE_LOWERCASE_DEFAULT = "false";
   private static final String LDAP_DN_ATTRIBUTE_DEFAULT = "dn";
   private static final String LDAP_USER_BASE_DEFAULT = 
"ou=people,dc=ambari,dc=apache,dc=org";
   private static final String LDAP_USER_OBJECT_CLASS_DEFAULT = "person";
@@ -1889,6 +1891,8 @@ public class Configuration {
   (LDAP_BASE_DN_KEY, LDAP_BASE_DN_DEFAULT));
 ldapServerProperties.setUsernameAttribute(properties.
   getProperty(LDAP_USERNAME_ATTRIBUTE_KEY, 
LDAP_USERNAME_ATTRIBUTE_DEFAULT));
+
ldapServerProperties.setForceUsernameToLowercase("true".equalsIgnoreCase(properties.
+  getProperty(LDAP_USERNAME_FORCE_LOWERCASE_KEY, 
LDAP_USERNAME_FORCE_LOWERCASE_DEFAULT)));
 
 ldapServerProperties.setUserBase(properties.getProperty(
   LDAP_USER_BASE_KEY, LDAP_USER_BASE_DEFAULT));

http://git-wip-us.apache.org/repos/asf/ambari/blob/34f0103f/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
index 917471b..9e534a6 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapBindAuthenticator.java
@@ -71,9 +71,20 @@ public class AmbariLdapBindAuthenticator extends 
BindAuthenticator {
   // if authenticated user name is different from ldap user name than user 
has logged in
   // with a login name that is different (e.g. user principal name) from 
the ambari user name stored in
   // ambari db. In this case add the user login name  as login alias for 
ambari user name.
-  LOG.info("User with {}='{}' logged in with login alias '{}'", 
ldapUserName, loginName);
+  LOG.info("User with {}='{}' logged in with login alias '{}'", 

ambari git commit: AMBARI-19149. Code cleanup: unresolved references in javadoc

2017-04-18 Thread adoroszlai
Repository: ambari
Updated Branches:
  refs/heads/trunk 7bb94a010 -> 8e2abf97b


AMBARI-19149. Code cleanup: unresolved references in javadoc


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

Branch: refs/heads/trunk
Commit: 8e2abf97bd2f10bad978d176a53bffd0ad2c7b67
Parents: 7bb94a0
Author: Attila Doroszlai 
Authored: Wed Apr 12 15:22:06 2017 +0200
Committer: Attila Doroszlai 
Committed: Tue Apr 18 14:45:38 2017 +0200

--
 .../ambari/server/actionmanager/Stage.java  |  2 +-
 .../ambari/server/agent/HeartBeatResponse.java  |  3 --
 .../ambari/server/api/query/JpaSortBuilder.java |  2 +-
 .../RequestScheduleResourceDefinition.java  |  6 +--
 .../server/api/rest/BootStrapResource.java  |  2 +-
 .../api/services/AlertDefinitionService.java|  3 --
 .../ambari/server/checks/ServicesUpCheck.java   |  2 -
 .../server/configuration/Configuration.java | 52 +++-
 .../internal/AbstractProviderModule.java|  2 +-
 .../internal/UpgradeResourceProvider.java   |  5 +-
 .../VersionDefinitionResourceProvider.java  |  1 -
 .../events/AlertDefinitionDisabledEvent.java|  2 +-
 .../EntityManagerCacheInvalidationEvent.java|  5 --
 .../listeners/alerts/AlertReceivedListener.java |  2 +-
 .../apache/ambari/server/orm/DBAccessor.java|  3 +-
 .../ambari/server/orm/dao/ExtensionDAO.java |  2 +-
 .../ambari/server/orm/dao/ExtensionLinkDAO.java |  3 +-
 .../ambari/server/orm/dao/RequestDAO.java   |  4 +-
 .../orm/entities/AlertDefinitionEntity.java |  2 +-
 .../server/orm/entities/UpgradeEntity.java  |  3 --
 .../server/orm/entities/UpgradeGroupEntity.java |  2 +-
 .../server/orm/entities/ViewURLEntity.java  |  1 -
 .../server/orm/helpers/dbms/DbmsHelper.java |  1 -
 .../authorization/LdapServerProperties.java |  4 +-
 .../apache/ambari/server/stack/StackModule.java |  2 +-
 .../org/apache/ambari/server/state/Cluster.java |  3 +-
 .../apache/ambari/server/state/ConfigImpl.java  |  2 +-
 .../server/state/alert/AlertDefinitionHash.java |  2 -
 .../server/state/cluster/ClusterImpl.java   |  2 +-
 .../state/configgroup/ConfigGroupFactory.java   | 15 +-
 .../state/configgroup/ConfigGroupImpl.java  |  8 ---
 .../server/state/fsm/StateMachineFactory.java   |  4 +-
 .../state/repository/VersionDefinitionXml.java  |  1 -
 .../state/services/MetricsRetrievalService.java |  6 +--
 .../state/stack/upgrade/HostOrderGrouping.java  |  1 -
 .../server/state/stack/upgrade/TaskWrapper.java |  8 +--
 .../server/upgrade/UpgradeCatalog300.java   |  2 +-
 .../server/api/query/JpaSortBuilderTest.java|  4 --
 .../apache/ambari/server/events/EventsTest.java |  4 --
 .../apache/ambari/server/orm/OrmTestHelper.java |  8 ---
 .../server/orm/dao/HostRoleCommandDAOTest.java  |  2 -
 .../state/alerts/AlertDefinitionHashTest.java   |  2 +-
 .../state/alerts/AlertEventPublisherTest.java   |  3 --
 .../state/alerts/InitialAlertEventTest.java |  3 --
 .../server/state/cluster/ClusterTest.java   |  2 +-
 ...omponentHostConcurrentWriteDeadlockTest.java |  4 --
 46 files changed, 43 insertions(+), 159 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8e2abf97/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 a46e6a2..574afa1 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
@@ -811,7 +811,7 @@ public class Stage {
   /**
* This method should be used only in stage planner. To add
* a new execution command use
-   * {@link #addHostRoleExecutionCommand(String, 
org.apache.ambari.server.Role, org.apache.ambari.server.RoleCommand, 
org.apache.ambari.server.state.ServiceComponentHostEvent, String, String, 
boolean)}
+   * {@link #addHostRoleExecutionCommand(String, Role, RoleCommand, 
ServiceComponentHostEvent, String, String, boolean, boolean)}
* @param origStage the stage
* @param hostname  the hostname; {@code null} for a server-side stage
* @param r the role

http://git-wip-us.apache.org/repos/asf/ambari/blob/8e2abf97/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatResponse.java
--
diff --git 

ambari git commit: AMBARI-20044. NullPointerException after server restart in case not all hosts were joined (magyari_sandor)

2017-04-18 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 327db732e -> 943fac128


AMBARI-20044. NullPointerException after server restart in case not all hosts 
were joined (magyari_sandor)


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

Branch: refs/heads/branch-2.4
Commit: 943fac128e208ebe5c7aeec1569a81bbbe79c01b
Parents: 327db73
Author: Sandor Magyari 
Authored: Thu Feb 16 16:22:59 2017 +0100
Committer: Toader, Sebastian 
Committed: Tue Apr 18 08:30:38 2017 +0200

--
 .../main/java/org/apache/ambari/server/topology/HostRequest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/943fac12/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
index 2136b68..e5f5e05 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java
@@ -299,7 +299,7 @@ public class HostRequest implements Comparable 
{
 for (HostRoleCommand logicalTask : logicalTasks.values()) {
   // set host on command detail if it is set to null
   String commandDetail = logicalTask.getCommandDetail();
-  if (commandDetail != null && commandDetail.contains("null")) {
+  if (commandDetail != null && commandDetail.contains("null") && hostname 
!= null) {
 logicalTask.setCommandDetail(commandDetail.replace("null", hostname));
   }
   Long physicalTaskId = physicalTasks.get(logicalTask.getTaskId());