ambari git commit: AMBARI-18393. Hive Server Interactive (HSI) fails to start with 'Permission denied' for User Hive, if HSI starts before HS2.

2016-09-14 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d21f1f6e7 -> 7594857e4


AMBARI-18393. Hive Server Interactive (HSI) fails to start with 'Permission 
denied' for User Hive, if HSI starts before HS2.


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

Branch: refs/heads/branch-2.5
Commit: 7594857e40da29baa3ff80832b04b57e4ffcf90d
Parents: d21f1f6
Author: Swapan Shridhar 
Authored: Wed Sep 14 15:37:51 2016 -0700
Committer: Swapan Shridhar 
Committed: Wed Sep 14 15:39:39 2016 -0700

--
 .../0.12.0.2.0/package/scripts/hive_interactive.py |  8 
 .../python/stacks/2.5/HIVE/test_hive_server_int.py | 17 -
 2 files changed, 24 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7594857e/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
index 74c67fc..0739c93 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
@@ -59,6 +59,14 @@ Sets up the configs, jdbc connection and tarball copy to 
HDFS for Hive Server In
 def hive_interactive(name=None):
   import params
 
+  # Create Hive User Dir
+  params.HdfsResource(params.hive_hdfs_user_dir,
+  type="directory",
+  action="create_on_execute",
+  owner=params.hive_user,
+  mode=params.hive_hdfs_user_mode
+  )
+
   # list of properties that should be excluded from the config
   # this approach is a compromise against adding a dedicated config
   # type for hive_server_interactive or needed config groups on a

http://git-wip-us.apache.org/repos/asf/ambari/blob/7594857e/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py 
b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index b97c377..7477457 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -224,7 +224,22 @@ class TestHiveServerInteractive(RMFTestCase):
 self.assertNoMoreResources()
 
 
-  def assert_configure_default(self, no_tmp=False, 
default_fs_default='hdfs://c6401.ambari.apache.org:8020'):
+  def assert_configure_default(self, no_tmp=False, 
default_fs_default=u'hdfs://c6401.ambari.apache.org:8020'):
+
+self.assertResourceCalled('HdfsResource', '/user/hive',
+  immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+  security_enabled = False,
+  hadoop_bin_dir = 
'/usr/hdp/current/hadoop-client/bin',
+  keytab = UnknownConfigurationMock(),
+  kinit_path_local = '/usr/bin/kinit',
+  user = 'hdfs',
+  dfs_type = '',
+  owner = 'hive',
+  hadoop_conf_dir = 
'/usr/hdp/current/hadoop-client/conf',
+  type = 'directory',
+  action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name='missing_principal', default_fs=default_fs_default,
+  mode = 0755,
+  )
 
 self.assertResourceCalled('Directory', '/etc/hive2',
   mode=0755,



ambari git commit: AMBARI-18393. Hive Server Interactive (HSI) fails to start with 'Permission denied' for User Hive, if HSI starts before HS2.

2016-09-14 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/trunk f5ad1de86 -> 565685d32


AMBARI-18393. Hive Server Interactive (HSI) fails to start with 'Permission 
denied' for User Hive, if HSI starts before HS2.


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

Branch: refs/heads/trunk
Commit: 565685d326e5a877f8e4479736e75f59f728c9ec
Parents: f5ad1de
Author: Swapan Shridhar 
Authored: Wed Sep 14 15:37:51 2016 -0700
Committer: Swapan Shridhar 
Committed: Wed Sep 14 15:37:51 2016 -0700

--
 .../0.12.0.2.0/package/scripts/hive_interactive.py |  8 
 .../python/stacks/2.5/HIVE/test_hive_server_int.py | 17 -
 2 files changed, 24 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/565685d3/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
index 1bcb954..6511d0e 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
@@ -58,6 +58,14 @@ Sets up the configs, jdbc connection and tarball copy to 
HDFS for Hive Server In
 def hive_interactive(name=None):
   import params
 
+  # Create Hive User Dir
+  params.HdfsResource(params.hive_hdfs_user_dir,
+  type="directory",
+  action="create_on_execute",
+  owner=params.hive_user,
+  mode=params.hive_hdfs_user_mode
+  )
+
   # list of properties that should be excluded from the config
   # this approach is a compromise against adding a dedicated config
   # type for hive_server_interactive or needed config groups on a

http://git-wip-us.apache.org/repos/asf/ambari/blob/565685d3/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py 
b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index b97c377..7477457 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -224,7 +224,22 @@ class TestHiveServerInteractive(RMFTestCase):
 self.assertNoMoreResources()
 
 
-  def assert_configure_default(self, no_tmp=False, 
default_fs_default='hdfs://c6401.ambari.apache.org:8020'):
+  def assert_configure_default(self, no_tmp=False, 
default_fs_default=u'hdfs://c6401.ambari.apache.org:8020'):
+
+self.assertResourceCalled('HdfsResource', '/user/hive',
+  immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+  security_enabled = False,
+  hadoop_bin_dir = 
'/usr/hdp/current/hadoop-client/bin',
+  keytab = UnknownConfigurationMock(),
+  kinit_path_local = '/usr/bin/kinit',
+  user = 'hdfs',
+  dfs_type = '',
+  owner = 'hive',
+  hadoop_conf_dir = 
'/usr/hdp/current/hadoop-client/conf',
+  type = 'directory',
+  action = ['create_on_execute'], 
hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', 
hdfs_site=self.getConfig()['configurations']['hdfs-site'], 
principal_name='missing_principal', default_fs=default_fs_default,
+  mode = 0755,
+  )
 
 self.assertResourceCalled('Directory', '/etc/hive2',
   mode=0755,



[5/5] ambari git commit: AMBARI-18125 : Allow for certain metrics to skip aggregation determined by client. (avijayan)

2016-09-14 Thread avijayan
 AMBARI-18125 : Allow for certain metrics to skip aggregation determined by 
client. (avijayan)


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

Branch: refs/heads/branch-2.5
Commit: d21f1f6e791b4bf5a18b0a76dc7bf95e3961c2f1
Parents: 1086185
Author: Aravindan Vijayan 
Authored: Wed Sep 14 15:03:23 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:13:21 2016 -0700

--
 .../metrics2/sink/timeline/TimelineMetric.java  |  11 ++
 .../timeline/HadoopTimelineMetricsSink.java |  35 --
 .../timeline/HadoopTimelineMetricsSinkTest.java |   4 +-
 .../src/main/python/core/host_info.py   |   4 +-
 .../src/test/python/core/TestHostInfo.py|  43 +++
 .../timeline/TimelineMetricConfiguration.java   |   3 +
 .../TimelineMetricClusterAggregatorSecond.java  |  33 +-
 .../TimelineMetricMetadataManager.java  |   9 +-
 .../metrics/timeline/query/Condition.java   |   1 +
 .../timeline/query/DefaultCondition.java|  84 +++---
 .../metrics/timeline/query/EmptyCondition.java  |   6 +
 .../query/SplitByMetricNamesCondition.java  |   6 +
 .../timeline/TestPhoenixTransactSQL.java|  50 
 ...melineMetricClusterAggregatorSecondTest.java |   5 +
 .../timeline/query/DefaultConditionTest.java| 116 +++
 .../0.1.0/configuration/ams-site.xml|  21 
 16 files changed, 348 insertions(+), 83 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d21f1f6e/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
--
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
index 98f4978..44c9d4a 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
@@ -17,6 +17,7 @@
  */
 package org.apache.hadoop.metrics2.sink.timeline;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.TreeMap;
 
@@ -44,6 +45,7 @@ public class TimelineMetric implements 
Comparable {
   private String type;
   private String units;
   private TreeMap metricValues = new TreeMap();
+  private Map metadata = new HashMap<>();
 
   // default
   public TimelineMetric() {
@@ -148,6 +150,15 @@ public class TimelineMetric implements 
Comparable {
 this.metricValues.putAll(metricValues);
   }
 
+  @XmlElement(name = "metadata")
+  public Map getMetadata () {
+return metadata;
+  }
+
+  public void setMetadata (Map metadata) {
+this.metadata = metadata;
+  }
+
   @Override
   public boolean equals(Object o) {
 if (this == o) return true;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d21f1f6e/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 ebbf342..7eb242e 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
@@ -39,6 +39,7 @@ import java.net.SocketAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -205,6 +206,7 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
   String contextName = record.context();
 
   StringBuilder sb = new StringBuilder();
+  boolean skipAggregation = false;
 
   // Transform ipc.8020 -> ipc.client,  ipc.8040 -> ipc.datanode, etc.
   if (contextName.startsWith("ipc.")) {
@@ -216,17 +218,19 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink 

[1/5] ambari git commit: AMBARI-18185 : Selecting one host when topN is set, throws an error. (avijayan)

2016-09-14 Thread avijayan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 2c3caa776 -> d21f1f6e7


AMBARI-18185 : Selecting one host when topN is set, throws an error. (avijayan)


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

Branch: refs/heads/branch-2.5
Commit: cd7788621d22750156e8df52a6ac94faba49d07a
Parents: 2c3caa7
Author: Aravindan Vijayan 
Authored: Tue Sep 13 20:16:03 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:05:18 2016 -0700

--
 .../metrics/timeline/HBaseTimelineMetricStore.java| 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/cd778862/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 0b82506..686533b 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
@@ -201,7 +201,8 @@ public class HBaseTimelineMetricStore extends 
AbstractService implements Timelin
   .grouped(groupedByHosts);
 
 if (topNConfig != null) {
-  if (TopNCondition.isTopNHostCondition(metricNames, hostnames) || 
TopNCondition.isTopNMetricCondition(metricNames, hostnames)) {
+  if (TopNCondition.isTopNHostCondition(metricNames, hostnames) ^ //Only 1 
condition should be true.
+TopNCondition.isTopNMetricCondition(metricNames, hostnames)) {
 conditionBuilder.topN(topNConfig.getTopN());
 conditionBuilder.isBottomN(topNConfig.getIsBottomN());
 Function.ReadFunction readFunction = 
Function.ReadFunction.getFunction(topNConfig.getTopNFunction());



[3/5] ambari git commit: AMBARI-18289 : Invalid negative values for some AMS metrics. (avijayan)

2016-09-14 Thread avijayan
AMBARI-18289 : Invalid negative values for some AMS metrics. (avijayan)


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

Branch: refs/heads/branch-2.5
Commit: 7adb5cfff607bf7914988fc3f99096d850cc0a33
Parents: 9b08b70
Author: Aravindan Vijayan 
Authored: Wed Sep 14 15:08:40 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:08:40 2016 -0700

--
 .../conf/unix/metric_monitor.ini|  1 +
 .../src/main/python/core/config_reader.py   |  5 ++-
 .../src/main/python/core/host_info.py   | 39 
 .../0.1.0/configuration/ams-env.xml | 20 ++
 .../0.1.0/package/scripts/params.py |  1 +
 .../package/templates/metric_monitor.ini.j2 |  1 +
 6 files changed, 58 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7adb5cff/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini 
b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini
index 3e5d861..fc896b8 100644
--- a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini
+++ b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini
@@ -21,6 +21,7 @@ debug_level = INFO
 hostname = localhost
 enable_time_threshold = false
 enable_value_threshold = false
+skip_disk_patterns =
 
 [emitter]
 send_interval = 60

http://git-wip-us.apache.org/repos/asf/ambari/blob/7adb5cff/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
index 02f0ce3..e2ed83f 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
@@ -232,4 +232,7 @@ class Configuration:
   return 6188
 
   def get_ca_certs(self):
-return self._ca_cert_file_path
\ No newline at end of file
+return self._ca_cert_file_path
+
+  def get_disk_metrics_skip_pattern(self):
+return self.get("default", "skip_disk_patterns")

http://git-wip-us.apache.org/repos/asf/ambari/blob/7adb5cff/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
index 845b270..f79cacd 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
@@ -26,6 +26,8 @@ import time
 import threading
 import socket
 import operator
+import re
+from collections import namedtuple
 
 logger = logging.getLogger()
 cached_hostname = None
@@ -244,16 +246,37 @@ class HostInfo():
 if delta <= 0:
   delta = float("inf")
 
-io_counters = psutil.disk_io_counters()
+skip_disk_patterns = self.__config.get_disk_metrics_skip_pattern()
+logger.debug('skip_disk_patterns: %s' % skip_disk_patterns)
+if not skip_disk_patterns or skip_disk_patterns == 'None':
+  io_counters = psutil.disk_io_counters()
+else:
+  sdiskio = namedtuple('sdiskio', ['read_count', 'write_count',
+   'read_bytes', 'write_bytes',
+   'read_time', 'write_time'])
+  skip_disk_pattern_list = skip_disk_patterns.split(',')
+  rawdict = psutil.disk_io_counters(True)
+  if not rawdict:
+raise RuntimeError("Couldn't find any physical disk")
+  trimmed_dict = {}
+  for disk, fields in rawdict.items():
+ignore_disk = False
+for p in skip_disk_pattern_list:
+  if re.match(p, disk):
+ignore_disk = True
+if not ignore_disk:
+  trimmed_dict[disk] = sdiskio(*fields)
+  io_counters = sdiskio(*[sum(x) for x in zip(*trimmed_dict.values())])
 
 new_disk_stats = {
-  'read_count' : io_counters.read_count if hasattr(io_counters, 
'read_count') else 0,
-  'write_count' : io_counters.write_count if hasattr(io_counters, 
'write_count') else 0,
-  'read_bytes' : 

[4/5] ambari git commit: AMBARI-18132 : Remove FIFO and Normalizer in ams-env config. (avijayan)

2016-09-14 Thread avijayan
AMBARI-18132 : Remove FIFO and Normalizer in ams-env config. (avijayan)


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

Branch: refs/heads/branch-2.5
Commit: 10861855360904d047533b072f3b5bbb731538de
Parents: 7adb5cf
Author: Aravindan Vijayan 
Authored: Tue Sep 13 20:32:07 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:08:54 2016 -0700

--
 .../server/upgrade/UpgradeCatalog250.java   |  62 ++-
 .../0.1.0/configuration/ams-env.xml |   6 -
 .../0.1.0/package/scripts/params.py |   2 -
 .../server/upgrade/UpgradeCatalog250Test.java   | 110 +++
 4 files changed, 171 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/10861855/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 43f489b..35c773a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -18,9 +18,18 @@
 package org.apache.ambari.server.upgrade;
 
 import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.dao.DaoUtils;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -33,7 +42,7 @@ import com.google.inject.Injector;
 public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
 
   protected static final String HOST_VERSION_TABLE = "host_version";
-
+  private static final String AMS_ENV = "ams-env";
   /**
* Logger.
*/
@@ -97,6 +106,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
*/
   @Override
   protected void executeDMLUpdates() throws AmbariException, SQLException {
+updateAMSConfigs();
   }
 
   protected void updateHostVersionTable() throws SQLException {
@@ -106,6 +116,56 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 dbAccessor.addUniqueConstraint(HOST_VERSION_TABLE, "UQ_host_repo", 
"repo_version_id", "host_id");
   }
 
+  protected void updateAMSConfigs() throws AmbariException {
+AmbariManagementController ambariManagementController = 
injector.getInstance(AmbariManagementController.class);
+Clusters clusters = ambariManagementController.getClusters();
+
+if (clusters != null) {
+  Map clusterMap = clusters.getClusters();
+
+  if (clusterMap != null && !clusterMap.isEmpty()) {
+for (final Cluster cluster : clusterMap.values()) {
+
+  Config amsEnv = cluster.getDesiredConfigByType(AMS_ENV);
+  if (amsEnv != null) {
+Map amsEnvProperties = amsEnv.getProperties();
+String content = amsEnvProperties.get("content");
+Map newProperties = new HashMap<>();
+newProperties.put("content", updateAmsEnvContent(content));
+updateConfigurationPropertiesForCluster(cluster, AMS_ENV, 
newProperties, true, true);
+  }
+
+}
+  }
+}
+  }
+
+
+  protected String updateAmsEnvContent(String content) {
+if (content == null) {
+  return null;
+}
+
+List toReplaceList = new ArrayList<>();
+toReplaceList.add("\n# HBase normalizer enabled\n");
+toReplaceList.add("\n# HBase compaction policy enabled\n");
+toReplaceList.add("export 
AMS_HBASE_NORMALIZER_ENABLED={{ams_hbase_normalizer_enabled}}\n");
+toReplaceList.add("export 
AMS_HBASE_FIFO_COMPACTION_ENABLED={{ams_hbase_fifo_compaction_enabled}}\n");
+
+//Because of AMBARI-15331 : AMS HBase FIFO compaction policy and 
Normalizer settings are not handled correctly
+toReplaceList.add("export 
HBASE_NORMALIZATION_ENABLED={{ams_hbase_normalizer_enabled}}\n");
+toReplaceList.add("export 
HBASE_FIFO_COMPACTION_POLICY_ENABLED={{ams_hbase_fifo_compaction_policy_enabled}}\n");
+
+
+for (String toReplace : toReplaceList) {
+  if (content.contains(toReplace)) {
+content = 

[2/5] ambari git commit: AMBARI-18154 : Ambari Dashboard, Cluster load widget - Incorrect value in Nodes._avg metric. (avijayan)

2016-09-14 Thread avijayan
AMBARI-18154 : Ambari Dashboard, Cluster load widget - Incorrect value in 
Nodes._avg metric. (avijayan)


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

Branch: refs/heads/branch-2.5
Commit: 9b08b7042da5e6985b3cd5e9734891fced552f67
Parents: cd77886
Author: Aravindan Vijayan 
Authored: Tue Sep 13 20:17:40 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:05:37 2016 -0700

--
 .../TimelineMetricClusterAggregatorSecond.java  | 34 ++--
 ...melineMetricClusterAggregatorSecondTest.java |  6 ++--
 .../src/main/resources/ganglia_properties.json  |  2 +-
 3 files changed, 36 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b08b704/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
index 1676867..19652f0 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
@@ -31,11 +31,15 @@ import java.io.IOException;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_APP_ID;
 import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.SERVER_SIDE_TIMESIFT_ADJUSTMENT;
 import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRICS_CLUSTER_AGGREGATOR_INTERPOLATION_ENABLED;
 import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.GET_METRIC_SQL;
@@ -127,6 +131,7 @@ public class TimelineMetricClusterAggregatorSecond extends 
AbstractTimelineAggre
 throws SQLException, IOException {
 Map aggregateClusterMetrics 
=
   new HashMap();
+int numLiveHosts = 0;
 
 TimelineMetric metric = null;
 if (rs.next()) {
@@ -142,18 +147,25 @@ public class TimelineMetricClusterAggregatorSecond 
extends AbstractTimelineAggre
   metric.addMetricValues(nextMetric.getMetricValues());
 } else {
   // Process the current metric
-  processAggregateClusterMetrics(aggregateClusterMetrics, metric, 
timeSlices);
+  int numHosts = 
processAggregateClusterMetrics(aggregateClusterMetrics, metric, timeSlices);
+  numLiveHosts = Math.max(numHosts, numLiveHosts);
   metric = nextMetric;
 }
   }
 }
 // Process last metric
 if (metric != null) {
-  processAggregateClusterMetrics(aggregateClusterMetrics, metric, 
timeSlices);
+  int numHosts = processAggregateClusterMetrics(aggregateClusterMetrics, 
metric, timeSlices);
+  numLiveHosts = Math.max(numHosts, numLiveHosts);
 }
 
 // Add app level aggregates to save
 aggregateClusterMetrics.putAll(appAggregator.getAggregateClusterMetrics());
+
+// Add liveHosts metric.
+long timestamp = timeSlices.get(timeSlices.size() - 1)[1];
+processLiveHostsMetric(aggregateClusterMetrics, numLiveHosts, timestamp);
+
 return aggregateClusterMetrics;
   }
 
@@ -162,10 +174,11 @@ public class TimelineMetricClusterAggregatorSecond 
extends AbstractTimelineAggre
* timeline.metrics.cluster.aggregator.minute.timeslice.interval
* Normalize value by averaging them within the interval
*/
-  protected void processAggregateClusterMetrics(Map 

[3/5] ambari git commit: AMBARI-18132 : Remove FIFO and Normalizer in ams-env config. (avijayan)

2016-09-14 Thread avijayan
AMBARI-18132 : Remove FIFO and Normalizer in ams-env config. (avijayan)


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

Branch: refs/heads/trunk
Commit: 0e3435856a2aee7951f765e90e55e027b6455c1a
Parents: 9455b52
Author: Aravindan Vijayan 
Authored: Tue Sep 13 20:32:07 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:03:34 2016 -0700

--
 .../server/upgrade/UpgradeCatalog250.java   |  62 ++-
 .../0.1.0/configuration/ams-env.xml |   6 -
 .../0.1.0/package/scripts/params.py |   2 -
 .../server/upgrade/UpgradeCatalog250Test.java   | 110 +++
 4 files changed, 171 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0e343585/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 43f489b..35c773a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -18,9 +18,18 @@
 package org.apache.ambari.server.upgrade;
 
 import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.dao.DaoUtils;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -33,7 +42,7 @@ import com.google.inject.Injector;
 public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
 
   protected static final String HOST_VERSION_TABLE = "host_version";
-
+  private static final String AMS_ENV = "ams-env";
   /**
* Logger.
*/
@@ -97,6 +106,7 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
*/
   @Override
   protected void executeDMLUpdates() throws AmbariException, SQLException {
+updateAMSConfigs();
   }
 
   protected void updateHostVersionTable() throws SQLException {
@@ -106,6 +116,56 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 dbAccessor.addUniqueConstraint(HOST_VERSION_TABLE, "UQ_host_repo", 
"repo_version_id", "host_id");
   }
 
+  protected void updateAMSConfigs() throws AmbariException {
+AmbariManagementController ambariManagementController = 
injector.getInstance(AmbariManagementController.class);
+Clusters clusters = ambariManagementController.getClusters();
+
+if (clusters != null) {
+  Map clusterMap = clusters.getClusters();
+
+  if (clusterMap != null && !clusterMap.isEmpty()) {
+for (final Cluster cluster : clusterMap.values()) {
+
+  Config amsEnv = cluster.getDesiredConfigByType(AMS_ENV);
+  if (amsEnv != null) {
+Map amsEnvProperties = amsEnv.getProperties();
+String content = amsEnvProperties.get("content");
+Map newProperties = new HashMap<>();
+newProperties.put("content", updateAmsEnvContent(content));
+updateConfigurationPropertiesForCluster(cluster, AMS_ENV, 
newProperties, true, true);
+  }
+
+}
+  }
+}
+  }
+
+
+  protected String updateAmsEnvContent(String content) {
+if (content == null) {
+  return null;
+}
+
+List toReplaceList = new ArrayList<>();
+toReplaceList.add("\n# HBase normalizer enabled\n");
+toReplaceList.add("\n# HBase compaction policy enabled\n");
+toReplaceList.add("export 
AMS_HBASE_NORMALIZER_ENABLED={{ams_hbase_normalizer_enabled}}\n");
+toReplaceList.add("export 
AMS_HBASE_FIFO_COMPACTION_ENABLED={{ams_hbase_fifo_compaction_enabled}}\n");
+
+//Because of AMBARI-15331 : AMS HBase FIFO compaction policy and 
Normalizer settings are not handled correctly
+toReplaceList.add("export 
HBASE_NORMALIZATION_ENABLED={{ams_hbase_normalizer_enabled}}\n");
+toReplaceList.add("export 
HBASE_FIFO_COMPACTION_POLICY_ENABLED={{ams_hbase_fifo_compaction_policy_enabled}}\n");
+
+
+for (String toReplace : toReplaceList) {
+  if (content.contains(toReplace)) {
+content = 

[2/5] ambari git commit: AMBARI-18289 : Invalid negative values for some AMS metrics. (avijayan)

2016-09-14 Thread avijayan
AMBARI-18289 : Invalid negative values for some AMS metrics. (avijayan)


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

Branch: refs/heads/trunk
Commit: 9455b52dd3126248ccea0d077d5da4512f4e2f21
Parents: aa0528e
Author: Aravindan Vijayan 
Authored: Tue Sep 13 20:22:56 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:03:34 2016 -0700

--
 .../conf/unix/metric_monitor.ini|  1 +
 .../src/main/python/core/config_reader.py   |  3 ++
 .../src/main/python/core/host_info.py   | 39 
 .../0.1.0/configuration/ams-env.xml |  9 +
 .../0.1.0/package/scripts/params.py |  1 +
 .../package/templates/metric_monitor.ini.j2 |  1 +
 6 files changed, 46 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9455b52d/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini 
b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini
index 59ca5d7..e98c65c 100644
--- a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini
+++ b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/metric_monitor.ini
@@ -21,6 +21,7 @@ debug_level = INFO
 metrics_servers = localhost
 enable_time_threshold = false
 enable_value_threshold = false
+skip_disk_patterns =
 
 [emitter]
 send_interval = 60

http://git-wip-us.apache.org/repos/asf/ambari/blob/9455b52d/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
index 44692f6..2e8a170 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/config_reader.py
@@ -245,3 +245,6 @@ class Configuration:
 
   def get_ca_certs(self):
 return self._ca_cert_file_path
+
+  def get_disk_metrics_skip_pattern(self):
+return self.get("default", "skip_disk_patterns")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/9455b52d/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
--
diff --git 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
index 845b270..f79cacd 100644
--- 
a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
+++ 
b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
@@ -26,6 +26,8 @@ import time
 import threading
 import socket
 import operator
+import re
+from collections import namedtuple
 
 logger = logging.getLogger()
 cached_hostname = None
@@ -244,16 +246,37 @@ class HostInfo():
 if delta <= 0:
   delta = float("inf")
 
-io_counters = psutil.disk_io_counters()
+skip_disk_patterns = self.__config.get_disk_metrics_skip_pattern()
+logger.debug('skip_disk_patterns: %s' % skip_disk_patterns)
+if not skip_disk_patterns or skip_disk_patterns == 'None':
+  io_counters = psutil.disk_io_counters()
+else:
+  sdiskio = namedtuple('sdiskio', ['read_count', 'write_count',
+   'read_bytes', 'write_bytes',
+   'read_time', 'write_time'])
+  skip_disk_pattern_list = skip_disk_patterns.split(',')
+  rawdict = psutil.disk_io_counters(True)
+  if not rawdict:
+raise RuntimeError("Couldn't find any physical disk")
+  trimmed_dict = {}
+  for disk, fields in rawdict.items():
+ignore_disk = False
+for p in skip_disk_pattern_list:
+  if re.match(p, disk):
+ignore_disk = True
+if not ignore_disk:
+  trimmed_dict[disk] = sdiskio(*fields)
+  io_counters = sdiskio(*[sum(x) for x in zip(*trimmed_dict.values())])
 
 new_disk_stats = {
-  'read_count' : io_counters.read_count if hasattr(io_counters, 
'read_count') else 0,
-  'write_count' : io_counters.write_count if hasattr(io_counters, 
'write_count') else 0,
-  'read_bytes' : io_counters.read_bytes if hasattr(io_counters, 

[5/5] ambari git commit: AMBARI-18154 : Ambari Dashboard, Cluster load widget - Incorrect value in Nodes._avg metric. (avijayan)

2016-09-14 Thread avijayan
AMBARI-18154 : Ambari Dashboard, Cluster load widget - Incorrect value in 
Nodes._avg metric. (avijayan)


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

Branch: refs/heads/trunk
Commit: aa0528ecab47850f44dd5575ab7861083e67c6ea
Parents: 4a09934
Author: Aravindan Vijayan 
Authored: Tue Sep 13 20:17:40 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:03:34 2016 -0700

--
 .../TimelineMetricClusterAggregatorSecond.java  | 34 ++--
 ...melineMetricClusterAggregatorSecondTest.java |  6 ++--
 .../src/main/resources/ganglia_properties.json  |  2 +-
 3 files changed, 36 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/aa0528ec/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
index 6731eb3..5f40d21 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
@@ -34,11 +34,15 @@ import java.io.IOException;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
+import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_APP_ID;
 import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.SERVER_SIDE_TIMESIFT_ADJUSTMENT;
 import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRICS_CLUSTER_AGGREGATOR_INTERPOLATION_ENABLED;
 import static 
org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.GET_METRIC_SQL;
@@ -130,6 +134,7 @@ public class TimelineMetricClusterAggregatorSecond extends 
AbstractTimelineAggre
 throws SQLException, IOException {
 Map aggregateClusterMetrics 
=
   new HashMap();
+int numLiveHosts = 0;
 
 TimelineMetric metric = null;
 if (rs.next()) {
@@ -145,18 +150,25 @@ public class TimelineMetricClusterAggregatorSecond 
extends AbstractTimelineAggre
   metric.addMetricValues(nextMetric.getMetricValues());
 } else {
   // Process the current metric
-  processAggregateClusterMetrics(aggregateClusterMetrics, metric, 
timeSlices);
+  int numHosts = 
processAggregateClusterMetrics(aggregateClusterMetrics, metric, timeSlices);
+  numLiveHosts = Math.max(numHosts, numLiveHosts);
   metric = nextMetric;
 }
   }
 }
 // Process last metric
 if (metric != null) {
-  processAggregateClusterMetrics(aggregateClusterMetrics, metric, 
timeSlices);
+  int numHosts = processAggregateClusterMetrics(aggregateClusterMetrics, 
metric, timeSlices);
+  numLiveHosts = Math.max(numHosts, numLiveHosts);
 }
 
 // Add app level aggregates to save
 aggregateClusterMetrics.putAll(appAggregator.getAggregateClusterMetrics());
+
+// Add liveHosts metric.
+long timestamp = timeSlices.get(timeSlices.size() - 1)[1];
+processLiveHostsMetric(aggregateClusterMetrics, numLiveHosts, timestamp);
+
 return aggregateClusterMetrics;
   }
 
@@ -165,10 +177,11 @@ public class TimelineMetricClusterAggregatorSecond 
extends AbstractTimelineAggre
* timeline.metrics.cluster.aggregator.minute.timeslice.interval
* Normalize value by averaging them within the interval
*/
-  protected void processAggregateClusterMetrics(Map 

[1/5] ambari git commit: AMBARI-18185 : Selecting one host when topN is set, throws an error. (avijayan)

2016-09-14 Thread avijayan
Repository: ambari
Updated Branches:
  refs/heads/trunk 1b89d6866 -> f5ad1de86


AMBARI-18185 : Selecting one host when topN is set, throws an error. (avijayan)


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

Branch: refs/heads/trunk
Commit: 4a099342c1b5a8c1b7dbf77fda3ef0f24bfd26cd
Parents: 1b89d68
Author: Aravindan Vijayan 
Authored: Tue Sep 13 20:16:03 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:03:33 2016 -0700

--
 .../metrics/timeline/HBaseTimelineMetricStore.java| 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4a099342/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 60ebdcf..a6f8e2f 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
@@ -228,7 +228,8 @@ public class HBaseTimelineMetricStore extends 
AbstractService implements Timelin
   .grouped(groupedByHosts);
 
 if (topNConfig != null) {
-  if (TopNCondition.isTopNHostCondition(metricNames, hostnames) || 
TopNCondition.isTopNMetricCondition(metricNames, hostnames)) {
+  if (TopNCondition.isTopNHostCondition(metricNames, hostnames) ^ //Only 1 
condition should be true.
+TopNCondition.isTopNMetricCondition(metricNames, hostnames)) {
 conditionBuilder.topN(topNConfig.getTopN());
 conditionBuilder.isBottomN(topNConfig.getIsBottomN());
 Function.ReadFunction readFunction = 
Function.ReadFunction.getFunction(topNConfig.getTopNFunction());



[4/5] ambari git commit: AMBARI-18125 : Allow for certain metrics to skip aggregation determined by client. (avijayan)

2016-09-14 Thread avijayan
AMBARI-18125 : Allow for certain metrics to skip aggregation determined by 
client. (avijayan)


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

Branch: refs/heads/trunk
Commit: f5ad1de8689fc45980e5439d873a9331ea6f4723
Parents: 0e34358
Author: Aravindan Vijayan 
Authored: Wed Sep 14 15:03:23 2016 -0700
Committer: Aravindan Vijayan 
Committed: Wed Sep 14 15:03:34 2016 -0700

--
 .../metrics2/sink/timeline/TimelineMetric.java  |  11 ++
 .../timeline/HadoopTimelineMetricsSink.java |  35 --
 .../timeline/HadoopTimelineMetricsSinkTest.java |   4 +-
 .../src/main/python/core/host_info.py   |   4 +-
 .../src/test/python/core/TestHostInfo.py|  43 +++
 .../timeline/TimelineMetricConfiguration.java   |   3 +
 .../TimelineMetricClusterAggregatorSecond.java  |  30 -
 .../TimelineMetricMetadataManager.java  |   9 +-
 .../metrics/timeline/query/Condition.java   |   1 +
 .../timeline/query/DefaultCondition.java|  84 +++---
 .../metrics/timeline/query/EmptyCondition.java  |   6 +
 .../query/SplitByMetricNamesCondition.java  |   6 +
 .../timeline/TestPhoenixTransactSQL.java|  50 
 ...melineMetricClusterAggregatorSecondTest.java |   5 +
 .../timeline/query/DefaultConditionTest.java| 116 +++
 .../0.1.0/configuration/ams-site.xml|  12 ++
 16 files changed, 340 insertions(+), 79 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f5ad1de8/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
--
diff --git 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
index 98f4978..44c9d4a 100644
--- 
a/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
+++ 
b/ambari-metrics/ambari-metrics-common/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
@@ -17,6 +17,7 @@
  */
 package org.apache.hadoop.metrics2.sink.timeline;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.TreeMap;
 
@@ -44,6 +45,7 @@ public class TimelineMetric implements 
Comparable {
   private String type;
   private String units;
   private TreeMap metricValues = new TreeMap();
+  private Map metadata = new HashMap<>();
 
   // default
   public TimelineMetric() {
@@ -148,6 +150,15 @@ public class TimelineMetric implements 
Comparable {
 this.metricValues.putAll(metricValues);
   }
 
+  @XmlElement(name = "metadata")
+  public Map getMetadata () {
+return metadata;
+  }
+
+  public void setMetadata (Map metadata) {
+this.metadata = metadata;
+  }
+
   @Override
   public boolean equals(Object o) {
 if (this == o) return true;

http://git-wip-us.apache.org/repos/asf/ambari/blob/f5ad1de8/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 c534121..b720ba9 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
@@ -34,6 +34,7 @@ import java.io.IOException;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -228,6 +229,7 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
   String contextName = record.context();
 
   StringBuilder sb = new StringBuilder();
+  boolean skipAggregation = false;
 
   // Transform ipc.8020 -> ipc.client,  ipc.8040 -> ipc.datanode, etc.
   if (contextName.startsWith("ipc.")) {
@@ -239,17 +241,19 @@ public class HadoopTimelineMetricsSink extends 
AbstractTimelineMetricsSink imple
 
  

ambari git commit: AMBARI-18389 - Config compare shows incorrect value after enabling kerberos (rzang)

2016-09-14 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 45067817c -> 2c3caa776


AMBARI-18389 - Config compare shows incorrect value after enabling kerberos 
(rzang)


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

Branch: refs/heads/branch-2.5
Commit: 2c3caa77687eb39eda8f4218973b344abbff3ca8
Parents: 4506781
Author: Richard Zang 
Authored: Wed Sep 14 13:50:08 2016 -0700
Committer: Richard Zang 
Committed: Wed Sep 14 14:48:14 2016 -0700

--
 .../app/models/configs/objects/service_config_property.js   | 9 +++--
 .../models/configs/objects/service_config_property_test.js  | 2 --
 2 files changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2c3caa77/ambari-web/app/models/configs/objects/service_config_property.js
--
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js 
b/ambari-web/app/models/configs/objects/service_config_property.js
index 265dd52..e7a2f52 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -111,8 +111,13 @@ App.ServiceConfigProperty = Em.Object.extend({
   /**
* Placeholder used for configs with input type text
*/
-  placeholder: Em.computed.firstNotBlank('placeholderText', 'savedValue'),
-
+  placeholder: function() {
+if (this.isEditable) {
+  return this.get('placeholderText') || this.get('savedValue');
+}
+return null;
+  }.property('isEditable', 'placeholderText', 'savedValue'),
+  
   retypedPassword: '',
   description: '',
   displayType: 'string', // string, digits, number, directories, custom

http://git-wip-us.apache.org/repos/asf/ambari/blob/2c3caa77/ambari-web/test/models/configs/objects/service_config_property_test.js
--
diff --git 
a/ambari-web/test/models/configs/objects/service_config_property_test.js 
b/ambari-web/test/models/configs/objects/service_config_property_test.js
index a6772d3..d462025 100644
--- a/ambari-web/test/models/configs/objects/service_config_property_test.js
+++ b/ambari-web/test/models/configs/objects/service_config_property_test.js
@@ -186,8 +186,6 @@ describe('App.ServiceConfigProperty', function () {
 serviceConfigProperty = getProperty();
   });
 
-  App.TestAliases.testAsComputedFirstNotBlank(getProperty(), 'placeholder', 
['placeholderText', 'savedValue']);
-
   App.TestAliases.testAsComputedAnd(getProperty(), 'hideFinalIcon', 
['!isFinal', 'isNotEditable']);
 
   describe('#isPropertyOverridable', function () {



ambari git commit: AMBARI-18332: Blueprints: API should make available "setting" property from blueprint

2016-09-14 Thread smnaha
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 170b29340 -> 45067817c


AMBARI-18332: Blueprints: API should make available "setting" property from 
blueprint


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

Branch: refs/heads/branch-2.5
Commit: 45067817cea3800c04dfc40adec7557e1a27fb69
Parents: 170b293
Author: Nahappan Somasundaram 
Authored: Tue Sep 13 11:06:32 2016 -0700
Committer: Nahappan Somasundaram 
Committed: Wed Sep 14 14:43:01 2016 -0700

--
 .../internal/BlueprintResourceProvider.java |  31 ++
 .../internal/BlueprintResourceProviderTest.java | 104 +++
 2 files changed, 135 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/45067817/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
index 775827b..1c127c0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
@@ -21,6 +21,7 @@ package org.apache.ambari.server.controller.internal;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import com.google.gson.Gson;
+import org.apache.ambari.server.orm.entities.BlueprintSettingEntity;
 import org.apache.ambari.server.utils.SecretReference;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.DuplicateResourceException;
@@ -96,6 +97,10 @@ public class BlueprintResourceProvider extends 
AbstractControllerResourceProvide
 
   // Configurations
   public static final String CONFIGURATION_PROPERTY_ID = "configurations";
+
+  // Setting
+  public static final String SETTING_PROPERTY_ID = "settings";
+
   public static final String PROPERTIES_PROPERTY_ID = "properties";
   public static final String PROPERTIES_ATTRIBUTES_PROPERTY_ID = 
"properties_attributes";
   public static final String SCHEMA_IS_NOT_SUPPORTED_MESSAGE =
@@ -320,6 +325,8 @@ public class BlueprintResourceProvider extends 
AbstractControllerResourceProvide
 setResourceProperty(resource, HOST_GROUP_PROPERTY_ID, listGroupProps, 
requestedIds);
 setResourceProperty(resource, CONFIGURATION_PROPERTY_ID,
   populateConfigurationList(entity.getConfigurations()), requestedIds);
+setResourceProperty(resource, SETTING_PROPERTY_ID,
+  populateSettingList(entity.getSettings()), requestedIds);
 
 if (entity.getSecurityType() != null) {
   Map securityConfigMap = new LinkedHashMap<>();
@@ -387,6 +394,30 @@ public class BlueprintResourceProvider extends 
AbstractControllerResourceProvide
   }
 
   /**
+   * Populate a list of setting property maps from a collection of setting 
entities.
+   *
+   * @param settings  collection of setting entities
+   *
+   * @return list of setting property maps
+   */
+  public static List> populateSettingList(
+  Collection settings) throws 
NoSuchResourceException {
+List> listSettings = new ArrayList>();
+
+if (settings != null) {
+  for (BlueprintSettingEntity setting : settings) {
+List> propertiesList = 
jsonSerializer.>>fromJson(
+setting.getSettingData(), List.class);
+Map settingMap = new HashMap<>();
+settingMap.put(setting.getSettingName(), propertiesList);
+listSettings.add(settingMap);
+  }
+}
+
+return listSettings;
+  }
+
+  /**
* Populate blueprint configurations.
*
* @param propertyMaps  collection of configuration property maps

http://git-wip-us.apache.org/repos/asf/ambari/blob/45067817/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
index 75eff7e..0943bc9 100644
--- 

ambari git commit: AMBARI-18332: Blueprints: API should make available "setting" property from blueprint

2016-09-14 Thread smnaha
Repository: ambari
Updated Branches:
  refs/heads/trunk 9496772d9 -> 1b89d6866


AMBARI-18332: Blueprints: API should make available "setting" property from 
blueprint


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

Branch: refs/heads/trunk
Commit: 1b89d6866e369906902f759a7a5d2ba865e8cbe0
Parents: 9496772
Author: Nahappan Somasundaram 
Authored: Tue Sep 13 11:06:32 2016 -0700
Committer: Nahappan Somasundaram 
Committed: Wed Sep 14 14:42:16 2016 -0700

--
 .../internal/BlueprintResourceProvider.java |  31 ++
 .../internal/BlueprintResourceProviderTest.java | 104 +++
 2 files changed, 135 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1b89d686/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
index 775827b..1c127c0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
@@ -21,6 +21,7 @@ package org.apache.ambari.server.controller.internal;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import com.google.gson.Gson;
+import org.apache.ambari.server.orm.entities.BlueprintSettingEntity;
 import org.apache.ambari.server.utils.SecretReference;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.DuplicateResourceException;
@@ -96,6 +97,10 @@ public class BlueprintResourceProvider extends 
AbstractControllerResourceProvide
 
   // Configurations
   public static final String CONFIGURATION_PROPERTY_ID = "configurations";
+
+  // Setting
+  public static final String SETTING_PROPERTY_ID = "settings";
+
   public static final String PROPERTIES_PROPERTY_ID = "properties";
   public static final String PROPERTIES_ATTRIBUTES_PROPERTY_ID = 
"properties_attributes";
   public static final String SCHEMA_IS_NOT_SUPPORTED_MESSAGE =
@@ -320,6 +325,8 @@ public class BlueprintResourceProvider extends 
AbstractControllerResourceProvide
 setResourceProperty(resource, HOST_GROUP_PROPERTY_ID, listGroupProps, 
requestedIds);
 setResourceProperty(resource, CONFIGURATION_PROPERTY_ID,
   populateConfigurationList(entity.getConfigurations()), requestedIds);
+setResourceProperty(resource, SETTING_PROPERTY_ID,
+  populateSettingList(entity.getSettings()), requestedIds);
 
 if (entity.getSecurityType() != null) {
   Map securityConfigMap = new LinkedHashMap<>();
@@ -387,6 +394,30 @@ public class BlueprintResourceProvider extends 
AbstractControllerResourceProvide
   }
 
   /**
+   * Populate a list of setting property maps from a collection of setting 
entities.
+   *
+   * @param settings  collection of setting entities
+   *
+   * @return list of setting property maps
+   */
+  public static List> populateSettingList(
+  Collection settings) throws 
NoSuchResourceException {
+List> listSettings = new ArrayList>();
+
+if (settings != null) {
+  for (BlueprintSettingEntity setting : settings) {
+List> propertiesList = 
jsonSerializer.>>fromJson(
+setting.getSettingData(), List.class);
+Map settingMap = new HashMap<>();
+settingMap.put(setting.getSettingName(), propertiesList);
+listSettings.add(settingMap);
+  }
+}
+
+return listSettings;
+  }
+
+  /**
* Populate blueprint configurations.
*
* @param propertyMaps  collection of configuration property maps

http://git-wip-us.apache.org/repos/asf/ambari/blob/1b89d686/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintResourceProviderTest.java
index 75eff7e..0943bc9 100644
--- 

ambari git commit: AMBARI-18389 - Config compare shows incorrect value after enabling kerberos (rzang)

2016-09-14 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 86be23374 -> 05ecaae27


AMBARI-18389 - Config compare shows incorrect value after enabling kerberos 
(rzang)


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

Branch: refs/heads/branch-2.4
Commit: 05ecaae2773a2e8cdf1c5f740a7e0d9de23b0f36
Parents: 86be233
Author: Richard Zang 
Authored: Wed Sep 14 13:50:08 2016 -0700
Committer: Richard Zang 
Committed: Wed Sep 14 14:01:05 2016 -0700

--
 .../app/models/configs/objects/service_config_property.js   | 9 +++--
 .../models/configs/objects/service_config_property_test.js  | 2 --
 2 files changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/05ecaae2/ambari-web/app/models/configs/objects/service_config_property.js
--
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js 
b/ambari-web/app/models/configs/objects/service_config_property.js
index 2757804..8d4cef1 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -111,8 +111,13 @@ App.ServiceConfigProperty = Em.Object.extend({
   /**
* Placeholder used for configs with input type text
*/
-  placeholder: Em.computed.firstNotBlank('placeholderText', 'savedValue'),
-
+  placeholder: function() {
+if (this.isEditable) {
+  return this.get('placeholderText') || this.get('savedValue');
+}
+return null;
+  }.property('isEditable', 'placeholderText', 'savedValue'),
+  
   retypedPassword: '',
   description: '',
   displayType: 'string', // string, digits, number, directories, custom

http://git-wip-us.apache.org/repos/asf/ambari/blob/05ecaae2/ambari-web/test/models/configs/objects/service_config_property_test.js
--
diff --git 
a/ambari-web/test/models/configs/objects/service_config_property_test.js 
b/ambari-web/test/models/configs/objects/service_config_property_test.js
index a6772d3..d462025 100644
--- a/ambari-web/test/models/configs/objects/service_config_property_test.js
+++ b/ambari-web/test/models/configs/objects/service_config_property_test.js
@@ -186,8 +186,6 @@ describe('App.ServiceConfigProperty', function () {
 serviceConfigProperty = getProperty();
   });
 
-  App.TestAliases.testAsComputedFirstNotBlank(getProperty(), 'placeholder', 
['placeholderText', 'savedValue']);
-
   App.TestAliases.testAsComputedAnd(getProperty(), 'hideFinalIcon', 
['!isFinal', 'isNotEditable']);
 
   describe('#isPropertyOverridable', function () {



ambari git commit: AMBARI-18389 - Config compare shows incorrect value after enabling kerberos (rzang)

2016-09-14 Thread rzang
Repository: ambari
Updated Branches:
  refs/heads/trunk 08e426ac7 -> 9496772d9


AMBARI-18389 - Config compare shows incorrect value after enabling kerberos 
(rzang)


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

Branch: refs/heads/trunk
Commit: 9496772d9f662daefcb78f971a201df0172c2430
Parents: 08e426a
Author: Richard Zang 
Authored: Wed Sep 14 13:50:08 2016 -0700
Committer: Richard Zang 
Committed: Wed Sep 14 13:50:08 2016 -0700

--
 .../app/models/configs/objects/service_config_property.js   | 9 +++--
 .../models/configs/objects/service_config_property_test.js  | 2 --
 2 files changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9496772d/ambari-web/app/models/configs/objects/service_config_property.js
--
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js 
b/ambari-web/app/models/configs/objects/service_config_property.js
index 0c7673d..5d85ae0 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -118,8 +118,13 @@ App.ServiceConfigProperty = Em.Object.extend({
   /**
* Placeholder used for configs with input type text
*/
-  placeholder: Em.computed.firstNotBlank('placeholderText', 'savedValue'),
-
+  placeholder: function() {
+if (this.isEditable) {
+  return this.get('placeholderText') || this.get('savedValue');
+}
+return null;
+  }.property('isEditable', 'placeholderText', 'savedValue'),
+  
   retypedPassword: '',
   description: '',
   displayType: 'string', // string, digits, number, directories, custom

http://git-wip-us.apache.org/repos/asf/ambari/blob/9496772d/ambari-web/test/models/configs/objects/service_config_property_test.js
--
diff --git 
a/ambari-web/test/models/configs/objects/service_config_property_test.js 
b/ambari-web/test/models/configs/objects/service_config_property_test.js
index a6772d3..d462025 100644
--- a/ambari-web/test/models/configs/objects/service_config_property_test.js
+++ b/ambari-web/test/models/configs/objects/service_config_property_test.js
@@ -186,8 +186,6 @@ describe('App.ServiceConfigProperty', function () {
 serviceConfigProperty = getProperty();
   });
 
-  App.TestAliases.testAsComputedFirstNotBlank(getProperty(), 'placeholder', 
['placeholderText', 'savedValue']);
-
   App.TestAliases.testAsComputedAnd(getProperty(), 'hideFinalIcon', 
['!isFinal', 'isNotEditable']);
 
   describe('#isPropertyOverridable', function () {



ambari git commit: AMBARI-18388. Link UI: add missing unit tests for models/configs/* and models/stack_version/* files (alexantonenko)

2016-09-14 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 752e7c463 -> 08e426ac7


AMBARI-18388. Link UI: add missing unit tests for models/configs/* and 
models/stack_version/* files
 (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 08e426ac790957e3fab3edeef128a331fd5860bc
Parents: 752e7c4
Author: Alex Antonenko 
Authored: Wed Sep 14 18:32:11 2016 +0300
Committer: Alex Antonenko 
Committed: Wed Sep 14 21:40:26 2016 +0300

--
 ambari-web/app/assets/test/tests.js |   7 +-
 .../app/models/stack_version/service_simple.js  |   2 +-
 ambari-web/app/models/stack_version/version.js  |   2 +-
 ambari-web/test/aliases/computed/concat.js  |  92 ++
 ambari-web/test/aliases/computed/empty.js   | 125 ++
 ambari-web/test/aliases/computed/equal.js   |   6 +-
 ambari-web/test/init_computed_aliases.js|  23 ++-
 ambari-web/test/models/configs/section_test.js  |  55 --
 .../test/models/configs/sub_section_test.js | 103 ---
 .../test/models/configs/theme/section_test.js   |  55 ++
 .../configs/theme/sub_section_tab_test.js   | 169 +++
 .../models/configs/theme/sub_section_test.js| 103 +++
 .../models/stack_version/service_simple_test.js | 119 +
 .../test/models/stack_version/version_test.js   |  38 +
 14 files changed, 734 insertions(+), 165 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/08e426ac/ambari-web/app/assets/test/tests.js
--
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index d918900..78c6196 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -401,16 +401,19 @@ var files = [
   'test/models/host_stack_version_test',
   'test/models/upgrade_entity_test',
   'test/models/finished_upgrade_entity_test',
-  'test/models/configs/sub_section_test',
-  'test/models/configs/section_test',
   'test/models/configs/service_config_version_test',
   'test/models/configs/config_group_test',
   'test/models/configs/stack_config_property_test',
   'test/models/configs/objects/service_config_test',
   'test/models/configs/objects/service_config_category_test',
   'test/models/configs/objects/service_config_property_test',
+  'test/models/configs/theme/section_test',
+  'test/models/configs/theme/sub_section_test',
+  'test/models/configs/theme/sub_section_tab_test',
   'test/models/configs/theme/tab_test',
   'test/models/stack_version/repository_version_test',
+  'test/models/stack_version/service_simple_test',
+  'test/models/stack_version/version_test',
   'test/routes/views_test',
   //contains test with fake timers that affect Date
   'test/utils/lazy_loading_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/08e426ac/ambari-web/app/models/stack_version/service_simple.js
--
diff --git a/ambari-web/app/models/stack_version/service_simple.js 
b/ambari-web/app/models/stack_version/service_simple.js
index f693cc8..c7d94e5 100644
--- a/ambari-web/app/models/stack_version/service_simple.js
+++ b/ambari-web/app/models/stack_version/service_simple.js
@@ -30,7 +30,7 @@ App.ServiceSimple = DS.Model.extend({
 
   doNotShowAndInstall: function () {
 var skipServices = ['KERBEROS'];
-if(!App.supports.installGanglia) {
+if(!App.get('supports.installGanglia')) {
   skipServices.push('GANGLIA');
 }
 return skipServices.contains(this.get('name'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/08e426ac/ambari-web/app/models/stack_version/version.js
--
diff --git a/ambari-web/app/models/stack_version/version.js 
b/ambari-web/app/models/stack_version/version.js
index 3f2fe37..4e18ca4 100644
--- a/ambari-web/app/models/stack_version/version.js
+++ b/ambari-web/app/models/stack_version/version.js
@@ -35,7 +35,7 @@ App.StackVersion = DS.Model.extend({
   upgradeFailedHosts: DS.attr('array'),
   currentHosts: DS.attr('array'),
 
-  noInstalledHosts:  Em.computed.empty('installedHosts'),
+  noInstalledHosts: Em.computed.empty('installedHosts'),
 
   noCurrentHosts: Em.computed.empty('currentHosts'),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/08e426ac/ambari-web/test/aliases/computed/concat.js
--
diff --git a/ambari-web/test/aliases/computed/concat.js 

[10/35] ambari git commit: AMBARI-17957. Remove Falcon UI Quick Link. Additional patch (alexantonenko)

2016-09-14 Thread ncole
AMBARI-17957. Remove Falcon UI Quick Link. Additional patch (alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 3d99106ac3b75508d4b645241ab9d32657adf0ac
Parents: 2181d73
Author: Alex Antonenko 
Authored: Tue Sep 13 17:46:52 2016 +0300
Committer: Alex Antonenko 
Committed: Tue Sep 13 17:50:03 2016 +0300

--
 .../resources/common-services/FALCON/0.5.0.2.1/metainfo.xml   | 7 ---
 1 file changed, 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3d99106a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/metainfo.xml
 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/metainfo.xml
index 2cda70a..7dab615 100644
--- 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/metainfo.xml
@@ -131,13 +131,6 @@
   
 oozie-site
   
-
-  
-
-  quicklinks.json
-  true
-
-  
 
   
 



[30/35] ambari git commit: AMBARI-18370. Do not execute stack-selector-tool after HDP component install on sysprepped hosts. (stoader)

2016-09-14 Thread ncole
AMBARI-18370. Do not execute stack-selector-tool after HDP component install on 
sysprepped hosts. (stoader)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: a54d60918b9df11cd0046d2d96203f60b1ecd546
Parents: 02256c3
Author: Toader, Sebastian 
Authored: Wed Sep 14 13:52:52 2016 +0200
Committer: Toader, Sebastian 
Committed: Wed Sep 14 13:52:52 2016 +0200

--
 .../main/resources/scripts/Ambaripreupload.py   | 11 +-
 .../2.0.6/hooks/after-INSTALL/scripts/params.py |  1 +
 .../scripts/shared_initialization.py|  3 ++
 .../hooks/after-INSTALL/test_after_install.py   | 35 
 4 files changed, 49 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a54d6091/ambari-server/src/main/resources/scripts/Ambaripreupload.py
--
diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 9492e17..09dcd7e 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -417,4 +417,13 @@ with Environment() as env:
   except:
 os.remove("/var/lib/ambari-agent/data/.hdfs_resource_ignore")
 raise
-  print "Completed tarball copy. Ambari preupload script completed."
+  print "Completed tarball copy."
+
+  if not options.upgrade:
+print "Executing stack-selector-tool for stack {0} 
...".format(stack_version)
+Execute(
+  ('/usr/bin/hdp-select', 'set', 'all', stack_version),
+  sudo = True
+)
+
+  print "Ambari preupload script completed."
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a54d6091/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
index 819d8f7..ed34217 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
@@ -33,6 +33,7 @@ tmp_dir = Script.get_tmp_dir()
 dfs_type = default("/commandParams/dfs_type", "")
 
 is_parallel_execution_enabled = 
int(default("/agentConfigParams/agent/parallel_execution", 0)) == 1
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 sudo = AMBARI_SUDO_BINARY
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a54d6091/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
index 9982dc6..e9f2283 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
@@ -44,6 +44,9 @@ def setup_stack_symlinks():
 version = params.current_version if params.current_version is not None 
else params.stack_version_unformatted
 
 if not params.upgrade_suspended:
+  if params.host_sys_prepped:
+Logger.warning("Skipping running stack-selector-tool for stack {0} as 
its a sys_prepped host. This may cause symlink pointers not to be created for 
HDP componets installed later on top of an already sys_prepped 
host.".format(version))
+return
   # On parallel command execution this should be executed by a single 
process at a time.
   with FcntlBasedProcessLock(params.stack_select_lock_file, enabled = 
params.is_parallel_execution_enabled, skip_fcntl_failures = True):
 stack_select.select_all(version)

http://git-wip-us.apache.org/repos/asf/ambari/blob/a54d6091/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
 
b/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
index 06a366e..434ef51 

[34/35] ambari git commit: AMBARI-15538. Support service-specific repo for add-on services. (Balazs Bence Sari via stoader).

2016-09-14 Thread ncole
AMBARI-15538. Support service-specific repo for add-on services. (Balazs Bence 
Sari via stoader).


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0e4515c42ba950ee73bd6511b43cc8eec7481348
Parents: 2ad4207
Author: Balazs Bence Sari 
Authored: Wed Sep 14 16:17:21 2016 +0200
Committer: Toader, Sebastian 
Committed: Wed Sep 14 16:17:47 2016 +0200

--
 .../checks/DatabaseConsistencyCheckHelper.java  |   1 +
 .../AmbariManagementControllerImpl.java |  13 +-
 .../ambari/server/controller/AmbariServer.java  |   2 +
 .../VersionDefinitionResourceProvider.java  |  18 +-
 .../apache/ambari/server/stack/RepoUtil.java| 207 +++
 .../ambari/server/stack/ServiceModule.java  |   7 +
 .../ambari/server/stack/StackDirectory.java |  28 +--
 .../apache/ambari/server/stack/StackModule.java | 133 ++--
 .../server/stack/StackServiceDirectory.java |  70 ++-
 .../stack/UpdateActiveRepoVersionOnStartup.java | 118 +++
 .../ambari/server/state/RepositoryInfo.java |  76 ++-
 .../apache/ambari/server/state/StackInfo.java   |  13 +-
 .../stack/upgrade/RepositoryVersionHelper.java  |  28 ++-
 .../src/main/resources/version_definition.xsd   |  24 +--
 .../ambari/server/stack/RepoUtilTest.java   | 166 +++
 .../stack/StackManagerCommonServicesTest.java   |  20 ++
 .../ambari/server/stack/StackModuleTest.java| 188 +
 .../UpdateActiveRepoVersionOnStartupTest.java   | 143 +
 .../ADDON/1.0/configuration/addon-env.xml   |  35 
 .../common-services/ADDON/1.0/metainfo.xml  |  35 
 ...veRepoVersionOnStartupTest_initialRepos.json |  32 +++
 .../HDP/0.2/services/ADDON/metainfo.xml |  28 +++
 .../HDP/0.2/services/ADDON/repos/repoinfo.xml   |  26 +++
 .../8.0.0/configuration/microsoft-r-env.xml |  35 
 .../8.0.0/package/scripts/microsoft_r.py|  22 +-
 .../MICROSOFT_R/8.0.0/repos/repoinfo.xml|  33 +++
 26 files changed, 1412 insertions(+), 89 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
index 7403dba..cee6c47 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
@@ -563,6 +563,7 @@ public class DatabaseConsistencyCheckHelper {
 String stackVersion = stackInfo.get(stackName);
 Map serviceInfoMap = 
ambariMetaInfo.getServices(stackName, stackVersion);
 for (String serviceName : serviceNames) {
+  LOG.info("Processing {}-{} / {}", stackName, stackVersion, 
serviceName);
   ServiceInfo serviceInfo = serviceInfoMap.get(serviceName);
   if (serviceInfo != null) {
 Set configTypes = 
serviceInfo.getConfigTypeAttributes().keySet();

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/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 90d2162..1fc9dbf 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
@@ -142,6 +142,7 @@ import org.apache.ambari.server.security.ldap.LdapSyncDto;
 import 
org.apache.ambari.server.serveraction.kerberos.KerberosInvalidConfigurationException;
 import 
org.apache.ambari.server.serveraction.kerberos.KerberosOperationException;
 import org.apache.ambari.server.stack.ExtensionHelper;
+import org.apache.ambari.server.stack.RepoUtil;
 import org.apache.ambari.server.stageplanner.RoleGraph;
 import org.apache.ambari.server.stageplanner.RoleGraphFactory;
 import org.apache.ambari.server.state.Cluster;
@@ -208,6 +209,7 @@ import com.google.inject.Inject;
 import 

[31/35] ambari git commit: AMBARI-18365. Add Ambari configuration options to support Kerberos token authentication (rlevas)

2016-09-14 Thread ncole
AMBARI-18365. Add Ambari configuration options to support Kerberos token 
authentication (rlevas)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 5beed88e1a7ab422d619a445f8f8e892844d5fa4
Parents: a54d609
Author: Robert Levas 
Authored: Wed Sep 14 09:21:14 2016 -0400
Committer: Robert Levas 
Committed: Wed Sep 14 09:21:18 2016 -0400

--
 .../server/configuration/Configuration.java | 181 +++
 .../AmbariKerberosAuthenticationProperties.java | 161 +
 .../server/configuration/ConfigurationTest.java | 136 +-
 ...ariKerberosAuthenticationPropertiesTest.java |  84 +
 4 files changed, 561 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5beed88e/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 0690ca8..b2fa4c0 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
@@ -58,7 +58,9 @@ import org.apache.ambari.server.orm.PersistenceType;
 import org.apache.ambari.server.orm.dao.HostRoleCommandStatusSummaryDTO;
 import org.apache.ambari.server.orm.entities.StageEntity;
 import org.apache.ambari.server.security.ClientSecurityType;
+import 
org.apache.ambari.server.security.authentication.kerberos.AmbariKerberosAuthenticationProperties;
 import org.apache.ambari.server.security.authorization.LdapServerProperties;
+import org.apache.ambari.server.security.authorization.UserType;
 import 
org.apache.ambari.server.security.authorization.jwt.JwtAuthenticationProperties;
 import org.apache.ambari.server.security.encryption.CertificateUtils;
 import org.apache.ambari.server.security.encryption.CredentialProvider;
@@ -71,6 +73,7 @@ import org.apache.ambari.server.utils.DateUtils;
 import org.apache.ambari.server.utils.HostUtils;
 import org.apache.ambari.server.utils.Parallel;
 import org.apache.ambari.server.utils.ShellCommandUtil;
+import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.DefaultParser;
@@ -1322,6 +1325,49 @@ public class Configuration {
   public static final ConfigurationProperty 
JWT_ORIGINAL_URL_QUERY_PARAM = new ConfigurationProperty<>(
   "authentication.jwt.originalUrlParamName", "originalUrl");
 
+  /* 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+   * Kerberos authentication-specific properties
+   * 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 */
+  /**
+   * Determines whether to use Kerberos (SPNEGO) authentication when 
connecting Ambari.
+   */
+  @Markdown(description = "Determines whether to use Kerberos (SPNEGO) 
authentication when connecting Ambari.")
+  public static final ConfigurationProperty KERBEROS_AUTH_ENABLED = 
new ConfigurationProperty<>(
+  "authentication.kerberos.enabled", Boolean.FALSE);
+
+  /**
+   * The Kerberos principal name to use when verifying user-supplied Kerberos 
tokens for authentication via SPNEGO.
+   */
+  @Markdown(description = "The Kerberos principal name to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
+  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_PRINCIPAL = new ConfigurationProperty<>(
+  "authentication.kerberos.spnego.principal", "HTTP/_HOST");
+
+  /**
+   * The Kerberos identity to use when verifying user-supplied Kerberos tokens 
for authentication via SPNEGO.
+   */
+  @Markdown(description = "The Kerberos keytab file to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
+  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_KEYTAB_FILE = new ConfigurationProperty<>(
+  "authentication.kerberos.spnego.keytab.file", 
"/etc/security/keytabs/spnego.service.keytab");
+
+  /**
+   * A comma-delimited (ordered) list of preferred user types to use when 
finding the Ambari user
+   * account for the user-supplied Kerberos identity during authentication via 
SPNEGO.
+   */
+  @Markdown(description = "A comma-delimited (ordered) list of preferred user 
types to use 

[16/35] ambari git commit: AMBARI-18383 : Oozie spark failed due to incomplete spark share-lib directory. (avijayan)

2016-09-14 Thread ncole
AMBARI-18383 : Oozie spark failed due to incomplete spark share-lib directory. 
(avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1e21842e3ac9e2b6a4552cb0d58294a22d3c2e40
Parents: 0855174
Author: Aravindan Vijayan 
Authored: Tue Sep 13 16:21:33 2016 -0700
Committer: Aravindan Vijayan 
Committed: Tue Sep 13 16:21:33 2016 -0700

--
 .../4.0.0.2.0/package/scripts/oozie_service.py  | 11 
 .../main/resources/scripts/Ambaripreupload.py   | 54 ++--
 2 files changed, 62 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1e21842e/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
index 8d80638..4740131 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie_service.py
@@ -122,6 +122,17 @@ def oozie_service(action = 'start', upgrade_type=None):
   
   if params.host_sys_prepped:
 print "Skipping creation of oozie sharelib as host is sys prepped"
+# Copy current hive-site to hdfs:/user/oozie/share/lib/spark/
+params.HdfsResource(format("{hdfs_share_dir}/lib/spark/hive-site.xml"),
+action="create_on_execute",
+type = 'file',
+mode=0444,
+owner=params.oozie_user,
+group=params.user_group,
+source=format("{hive_conf_dir}/hive-site.xml"),
+)
+params.HdfsResource(None, action="execute")
+
 hdfs_share_dir_exists = True # skip time-expensive hadoop fs -ls check
   elif WebHDFSUtil.is_webhdfs_available(params.is_webhdfs_enabled, 
params.default_fs):
 # check with webhdfs is much faster than executing hadoop fs -ls. 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e21842e/ambari-server/src/main/resources/scripts/Ambaripreupload.py
--
diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 7c8c601..9492e17 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -37,7 +37,7 @@ from resource_management.core import shell
 from resource_management.core.base import Resource, ForcedListArgument, 
ResourceArgument, BooleanArgument
 from resource_management.core.exceptions import Fail
 from resource_management.core.logger import Logger
-from resource_management.core.resources.system import Execute
+from resource_management.core.resources.system import Execute, Directory
 from resource_management.libraries.functions.default import default
 from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions.oozie_prepare_war import 
prepare_war
@@ -327,7 +327,55 @@ with Environment() as env:
   action="delete_on_execute",
   type = 'directory'
 )
-
+
+spark_client_dir = format("/usr/hdp/{stack_version}/spark")
+
+if os.path.exists(spark_client_dir):
+  # Rename /usr/hdp/{stack_version}/oozie/share/lib/spark to spark-orig
+  Execute(("mv",
+   format("{oozie_shared_lib}/lib/spark"),
+   format("{oozie_shared_lib}/lib/spark-orig")),
+   sudo=True)
+
+  # Create /usr/hdp/{stack_version}/oozie/share/lib/spark
+  Directory(format("{oozie_shared_lib}/lib/spark"),
+owner = oozie_user,
+create_parents = True
+)
+
+  # Copy oozie-sharelib-spark from 
/usr/hdp/{stack_version}/oozie/share/lib/spark-orig to spark
+  Execute(format("cp -f 
{oozie_shared_lib}/lib/spark-orig/oozie-sharelib-spark*.jar 
{oozie_shared_lib}/lib/spark"),
+  user=oozie_user)
+
+  # Copy /usr/hdp/{stack_version}/spark-client/*.jar except 
spark-examples*.jar
+  Execute(format("cp -P {spark_client_dir}/lib/*.jar 
{oozie_shared_lib}/lib/spark"),
+  user=oozie_user)
+  Execute(format("find 

[07/35] ambari git commit: AMBARI-18284. Ambari PigView stores the script in HDFS in non UTF-8 format (Jay SenSharma via pallavkul)

2016-09-14 Thread ncole
AMBARI-18284. Ambari PigView stores the script in HDFS in non UTF-8 format (Jay 
SenSharma via pallavkul)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e82d03c8a66100ec9c2ceb91d4c5a9cc6e427847
Parents: 3638a5b
Author: Pallav Kulshreshtha 
Authored: Tue Sep 13 14:14:57 2016 +0530
Committer: Pallav Kulshreshtha 
Committed: Tue Sep 13 14:14:57 2016 +0530

--
 .../org/apache/ambari/view/pig/resources/files/FileService.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e82d03c8/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
--
diff --git 
a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
 
b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
index 9dea2a2..509b20e 100644
--- 
a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
+++ 
b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
@@ -164,7 +164,7 @@ public class FileService extends BaseService {
   filePath = sanitizeFilePath(filePath);
   LOG.info("Rewriting file {}", filePath);
   FSDataOutputStream output = getHdfsApi().create(filePath, true);
-  output.writeBytes(request.file.getFileContent());
+  output.write(request.file.getFileContent().getBytes("UTF-8"));
   output.close();
   return Response.status(204).build();
 } catch (WebApplicationException ex) {
@@ -189,7 +189,7 @@ public class FileService extends BaseService {
   try {
 FSDataOutputStream output = 
getHdfsApi().create(request.file.getFilePath(), false);
 if (request.file.getFileContent() != null) {
-  output.writeBytes(request.file.getFileContent());
+  output.write(request.file.getFileContent().getBytes("UTF-8"));
 }
 output.close();
   } catch (FileAlreadyExistsException ex) {



[12/35] ambari git commit: Ambari-18281 Expose Disabling of Alert Targets in Web Client (Vivek Ratnavel Subramanian via zhewang)

2016-09-14 Thread ncole
Ambari-18281 Expose Disabling of Alert Targets in Web Client (Vivek Ratnavel 
Subramanian via zhewang)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9595706527b924cb273723fd1906c6a4b5d3d686
Parents: 0d84a7b
Author: Zhe (Joe) Wang 
Authored: Tue Sep 13 13:31:41 2016 -0700
Committer: Zhe (Joe) Wang 
Committed: Tue Sep 13 13:31:41 2016 -0700

--
 .../main/alerts/alert_definitions_actions_controller.js   | 2 +-
 ambari-web/app/styles/modal_popups.less   | 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/95957065/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
 
b/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
index f3f0387..6ca3e78 100644
--- 
a/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
+++ 
b/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js
@@ -196,7 +196,7 @@ App.MainAlertDefinitionActionsController = 
Em.ArrayController.extend({
 controllerBinding: 'App.router.manageAlertNotificationsController'
   }),
 
-  classNames: ['sixty-percent-width-modal', 
'manage-configuration-group-popup'],
+  classNames: ['sixty-percent-width-modal', 
'manage-configuration-group-popup', 'manage-alert-notifications-popup'],
 
   secondary: null,
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/95957065/ambari-web/app/styles/modal_popups.less
--
diff --git a/ambari-web/app/styles/modal_popups.less 
b/ambari-web/app/styles/modal_popups.less
index a2343e0..04e7dd4 100644
--- a/ambari-web/app/styles/modal_popups.less
+++ b/ambari-web/app/styles/modal_popups.less
@@ -138,6 +138,13 @@
 }
   }
 }
+
+.manage-alert-notifications-popup {
+  .modal-body {
+overflow: visible;
+  }
+}
+
 .sixty-percent-width-modal-edit-widget {
   .modal {
 width: 60%;



[18/35] ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/widgets.json
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/widgets.json
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/widgets.json
new file mode 100644
index 000..3176354
--- /dev/null
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/widgets.json
@@ -0,0 +1,95 @@
+{
+  "layouts": [
+{
+  "layout_name": "default_system_heatmap",
+  "display_name": "Heatmaps",
+  "section_name": "SYSTEM_HEATMAPS",
+  "widgetLayoutInfo": [
+{
+  "widget_name": "Host Disk Space Used %",
+  "description": "",
+  "widget_type": "HEATMAP",
+  "is_visible": true,
+  "metrics": [
+{
+  "name": "disk_free",
+  "metric_path": "metrics/disk/disk_free",
+  "service_name": "STACK"
+},
+{
+  "name": "disk_total",
+  "metric_path": "metrics/disk/disk_total",
+  "service_name": "STACK"
+}
+  ],
+  "values": [
+{
+  "name": "Host Disk Space Used %",
+  "value": "${((disk_total-disk_free)/disk_total)*100}"
+}
+  ],
+  "properties": {
+"display_unit": "%",
+"max_limit": "100"
+  }
+},
+{
+  "widget_name": "Host Memory Used %",
+  "description": "",
+  "widget_type": "HEATMAP",
+  "is_visible": false,
+  "metrics": [
+{
+  "name": "mem_total",
+  "metric_path": "metrics/memory/mem_total",
+  "service_name": "STACK"
+},
+{
+  "name": "mem_free",
+  "metric_path": "metrics/memory/mem_free",
+  "service_name": "STACK"
+},
+{
+  "name": "mem_cached",
+  "metric_path": "metrics/memory/mem_cached",
+  "service_name": "STACK"
+}
+  ],
+  "values": [
+{
+  "name": "Host Memory Used %",
+  "value": "${((mem_total-mem_free-mem_cached)/mem_total)*100}"
+}
+  ],
+  "properties": {
+"display_unit": "%",
+"max_limit": "100"
+  }
+},
+{
+  "widget_name": "Host CPU Wait IO %",
+  "description": "",
+  "widget_type": "HEATMAP",
+  "is_visible": false,
+  "metrics": [
+{
+  "name": "cpu_wio",
+  "metric_path": "metrics/cpu/cpu_wio",
+  "service_name": "STACK"
+}
+  ],
+  "values": [
+{
+  "name": "Host Memory Used %",
+  "value": "${cpu_wio*100}"
+}
+  ],
+  "properties": {
+"display_unit": "%",
+"max_limit": "100"
+  }
+}
+  ]
+}
+  ]
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/pom.xml
--
diff --git a/contrib/management-packs/pom.xml b/contrib/management-packs/pom.xml
index c8acf6b..f5ec2bb 100644
--- a/contrib/management-packs/pom.xml
+++ b/contrib/management-packs/pom.xml
@@ -35,6 +35,7 @@
   
   
 microsoft-r_mpack
+hdf-ambari-mpack
   
   
 
@@ -72,6 +73,7 @@
 **/.tmp/**
 **/tmp/**
 **/*.json
+**/fast-hdfs-resource.jar
 **/*.svg
 **/vendor/**
 **/bin
@@ -150,6 +152,7 @@
   
   
 microsoft-r_mpack
+hdf-ambari-mpack
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/pom.xml
--
diff --git a/pom.xml b/pom.xml
index fc6a2ccc..7ca4ba4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -301,6 +301,7 @@
 ambari-web/node_modules/**
 
 
+
contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/files/fast-hdfs-resource.jar
 contrib/ambari-scom/management-pack/Hadoop_MP/**
 
contrib/addons/test/dataServices/jmx/data/cluster_configuration.json.nohbase
 contrib/ambari-scom/msi/src/GUI_Ambari.sln



[20/35] ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/services/RANGER/themes/theme_version_4.json
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/services/RANGER/themes/theme_version_4.json
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/services/RANGER/themes/theme_version_4.json
new file mode 100644
index 000..379e980
--- /dev/null
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/services/RANGER/themes/theme_version_4.json
@@ -0,0 +1,480 @@
+{
+  "name": "default",
+  "description": "Default theme for Ranger service",
+  "configuration": {
+"layouts": [
+  {
+"name": "default",
+"tabs": [
+  {
+"name": "ranger_tagsync",
+"display-name": "Ranger Tagsync",
+"layout": {
+  "tab-columns": "1",
+  "tab-rows": "1",
+  "sections": [
+{
+  "name": "section-tagsync-file",
+  "display-name": "File Tag Source",
+  "row-index": "0",
+  "column-index": "0",
+  "row-span": "1",
+  "column-span": "1",
+  "section-columns": "1",
+  "section-rows": "1",
+  "subsections": [
+{
+  "name": "subsection-ranger-tagsync-row1-col1",
+  "row-index": "0",
+  "column-index": "0",
+  "row-span": "1",
+  "column-span": "1"
+}
+  ]
+}
+  ]
+}
+  },
+  {
+"name": "ranger_plugin",
+"display-name": "Ranger Plugin",
+"layout": {
+  "tab-columns": "1",
+  "tab-rows": "1",
+  "sections": [
+{
+  "name": "section-ranger-plugin",
+  "display-name": "Ranger Plugin",
+  "row-index": "0",
+  "column-index": "0",
+  "row-span": "1",
+  "column-span": "3",
+  "section-columns": "3",
+  "section-rows": "1",
+  "subsections": [
+{
+  "name": "section-ranger-plugin-row1-col1",
+  "row-index": "0",
+  "column-index": "0",
+  "row-span": "1",
+  "column-span": "1"
+},
+{
+  "name": "section-ranger-plugin-row1-col2",
+  "row-index": "0",
+  "column-index": "1",
+  "row-span": "1",
+  "column-span": "1"
+},
+{
+  "name": "section-ranger-plugin-row1-col3",
+  "row-index": "0",
+  "column-index": "2",
+  "row-span": "1",
+  "column-span": "1"
+}
+  ]
+}
+  ]
+}
+  },
+  {
+"name" : "ranger_audit_settings",
+"display-name" : "Ranger Audit",
+"layout" : {
+  "sections" : [
+{
+  "subsections" : [
+{
+  "name" : "subsection-ranger-solr-row1-col1",
+  "removed" : false,
+  "row-index" : "0",
+  "column-span" : "1",
+  "row-span" : "1",
+  "column-index" : "0"
+}
+  ],
+  "name" : "section-ranger-audit-solr",
+  "removed" : false,
+  "display-name" : "Audit to Solr",
+  "row-index" : "0",
+  "section-rows" : "1",
+  "column-span" : "1",
+  "section-columns" : "1",
+  "column-index" : "0",
+  "row-span" : "1"
+}
+  ],
+  "tab-rows" : "2",
+  "tab-columns" : "2"
+}
+  }
+]
+  }
+],
+"placement": {
+  "configuration-layout": "default",
+  "configs": [
+{
+  "config": "ranger-tagsync-site/ranger.tagsync.source.file",
+  "subsection-name": "subsection-ranger-tagsync-row1-col1"
+},
+{
+  "config": 
"ranger-tagsync-site/ranger.tagsync.source.file.check.interval.millis",
+  "subsection-name": "subsection-ranger-tagsync-row1-col1",
+  "depends-on": [
+{
+  

[03/35] ambari git commit: Ambari-2.4.1 website updates

2016-09-14 Thread ncole
Ambari-2.4.1 website updates


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 2dd5ba37b74d98c6b0bd3a8fe3ea2725c06faee2
Parents: b44078c
Author: Jayush Luniya 
Authored: Mon Sep 12 20:33:09 2016 -0700
Committer: Jayush Luniya 
Committed: Mon Sep 12 20:33:09 2016 -0700

--
 docs/pom.xml| 2 +-
 docs/src/site/apt/index.apt | 2 +-
 docs/src/site/apt/whats-new.apt | 4 ++--
 docs/src/site/site.xml  | 6 --
 4 files changed, 8 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2dd5ba37/docs/pom.xml
--
diff --git a/docs/pom.xml b/docs/pom.xml
index 934515c..0b8c5ef 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -28,7 +28,7 @@
 4.0.0
 
 org.apache.ambari
-2.4.0
+2.4.1
 ambari
 pom
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2dd5ba37/docs/src/site/apt/index.apt
--
diff --git a/docs/src/site/apt/index.apt b/docs/src/site/apt/index.apt
index e76f900..78b6d90 100644
--- a/docs/src/site/apt/index.apt
+++ b/docs/src/site/apt/index.apt
@@ -52,7 +52,7 @@ Introduction
 
 Getting Started with Ambari
 
-  Follow the 
{{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.0}
 installation guide for Ambari 2.4.0}}.
+  Follow the 
{{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.1}
 installation guide for Ambari 2.4.1}}.
 
   Note: Ambari currently supports the 64-bit version of the following 
Operating Systems:
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2dd5ba37/docs/src/site/apt/whats-new.apt
--
diff --git a/docs/src/site/apt/whats-new.apt b/docs/src/site/apt/whats-new.apt
index df6140e..ba8aadc 100644
--- a/docs/src/site/apt/whats-new.apt
+++ b/docs/src/site/apt/whats-new.apt
@@ -16,7 +16,7 @@
 
 What's New with Ambari?
 
-  * The latest release of Ambari is Ambari 2.4.0
+  * The latest release of Ambari is Ambari 2.4.1. This is a maintainenance 
release of Ambari 2.4.0.
 
   * Ambari 2.4.0 added the following features:
 
@@ -51,7 +51,7 @@ JIRA
 
 User Guide
 
-  Take a look at 
{{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.0}
 how to install a Hadoop cluster using Ambari 2.4.0}}.
+  Take a look at 
{{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.1}
 how to install a Hadoop cluster using Ambari 2.4.1}}.
 
 Stay Tuned
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2dd5ba37/docs/src/site/site.xml
--
diff --git a/docs/src/site/site.xml b/docs/src/site/site.xml
index 13ba51d..e0bad19 100644
--- a/docs/src/site/site.xml
+++ b/docs/src/site/site.xml
@@ -107,6 +107,7 @@
   https://cwiki.apache.org/confluence/display/AMBARI/Quick+Start+Guide"/>
   https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=30755705"/>
   https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md"/>
+  https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.1"/>
   https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.0"/>
   https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.2.2"/>
   https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.2.1"/>
@@ -136,8 +137,9 @@
 
 
 
-  http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.4.0"/>
-  http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.2.2"/>
+  http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.4.1"/>
+  http://archive.apache.org/dist/ambari/ambari-2.4.0"/>
+  http://archive.apache.org/dist/ambari/ambari-2.2.2"/>
   http://archive.apache.org/dist/ambari/ambari-2.2.1"/>
   http://archive.apache.org/dist/ambari/ambari-2.2.0"/>
   http://archive.apache.org/dist/ambari/ambari-2.1.2"/>



[22/35] ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/configuration/cluster-env.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/configuration/cluster-env.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/configuration/cluster-env.xml
new file mode 100644
index 000..9114222
--- /dev/null
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/configuration/cluster-env.xml
@@ -0,0 +1,210 @@
+
+
+
+
+
+
+recovery_enabled
+true
+Auto start enabled or not for this cluster.
+
+
+
+recovery_type
+AUTO_START
+Auto start type.
+
+
+
+recovery_lifetime_max_count
+1024
+Auto start lifetime maximum count of recovery attempt 
allowed per host component. This is reset when agent is restarted.
+
+
+
+recovery_max_count
+6
+Auto start maximum count of recovery attempt allowed per 
host component in a window. This is reset when agent is restarted.
+
+
+
+recovery_window_in_minutes
+60
+Auto start recovery window size in minutes.
+
+
+
+recovery_retry_interval
+5
+Auto start recovery retry gap between tries per host 
component.
+
+
+
+security_enabled
+false
+Hadoop Security
+
+
+
+kerberos_domain
+EXAMPLE.COM
+Kerberos realm.
+
+
+
+ignore_groupsusers_create
+Skip group modifications during install
+false
+ADDITIONAL_USER_PROPERTY
+Whether to ignore failures on users and group 
creation
+
+false
+boolean
+
+
+
+
+smokeuser
+Smoke User
+ambari-qa
+USER
+User executing service checks
+
+user
+false
+
+
+
+
+smokeuser_keytab
+/etc/security/keytabs/smokeuser.headless.keytab
+Path to smoke test user keytab file
+
+
+
+user_group
+Hadoop Group
+hadoop
+GROUP
+Hadoop user group.
+
+user
+false
+
+
+
+
+repo_suse_rhel_template
+[{{repo_id}}]
+name={{repo_id}}
+{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% 
endif %}
+
+path=/
+enabled=1
+gpgcheck=0
+Template of repositories for rhel and suse.
+
+
+
+repo_ubuntu_template
+{{package_type}} {{base_url}} {{components}}
+Template of repositories for ubuntu.
+
+
+
+
+override_uid
+true
+ADDITIONAL_USER_PROPERTY
+Have Ambari manage UIDs
+Have Ambari manage UIDs
+
+false
+boolean
+
+
+
+
+
+fetch_nonlocal_groups
+true
+Ambari fetch nonlocal groups
+Ambari requires fetching all the groups. This can be slow
+on envs with enabled ldap. Setting this option to false will enable 
Ambari,
+to skip user/group management connected with ldap groups.
+
+false
+boolean
+
+
+
+
+
+managed_hdfs_resource_property_names
+
+Comma separated list of property names with HDFS resource 
paths.
+Resource from this list will be managed even if it is marked as not 
managed in the stack
+
+false
+true
+
+
+
+
+
+stack_tools
+
+Stack specific tools
+VALUE_FROM_PROPERTY_FILE
+
+stack_tools.json
+json
+
+
+
+
+
+stack_features
+
+List of features supported by the stack
+VALUE_FROM_PROPERTY_FILE
+
+stack_features.json
+json
+
+
+
+
+
+stack_root
+/usr/hdf
+Stack root folder
+
+
+
+
+alerts_repeat_tolerance
+1
+The number of consecutive alerts required to transition 
an alert from the SOFT to the HARD state.
+
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/after-INSTALL/scripts/hook.py
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/after-INSTALL/scripts/hook.py
 

[24/35] ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-properties.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-properties.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-properties.xml
new file mode 100644
index 000..94055b1
--- /dev/null
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-properties.xml
@@ -0,0 +1,848 @@
+
+
+
+  
+  
+nifi.version
+1.0.0.{{stack_version_buildnum}}
+
+The version number of the current release.
+  
+
+  
+nifi.flow.configuration.file
+{{nifi_flow_config_dir}}/flow.xml.gz
+
+The location of the flow configuration file (i.e., the file 
that contains what is currently displayed on the NiFi graph).
+  
+  
+nifi.flow.configuration.archive.dir
+{{nifi_internal_dir}}/archive/
+
+The location of the archive directory where backup copies of 
the flow.xml are saved.
+  
+  
+nifi.flowcontroller.graceful.shutdown.period
+10 sec
+
+Indicates the shutdown period. The default value is 10 
sec.
+  
+  
+nifi.flowcontroller.autoResumeState
+true
+
+Indicates whether -upon restart- the components on the NiFi 
graph should return to their last state. The default value is 
true.
+
+  boolean
+
+  
+  
+nifi.flowservice.writedelay.interval
+500 ms
+
+When many changes are made to the flow.xml, this property 
specifies how long to wait before writing out the changes, so as to batch the 
changes into a single write. The default value is 500 ms.
+  
+  
+nifi.administrative.yield.duration
+30 sec
+
+If a component allows an unexpected exception to escape, it 
is considered a bug. As a result, the framework will pause (or administratively 
yield) the component for this amount of time. This is done so that the 
component does not use up massive amounts of system resources, since it is 
known to have problems in the existing state. The default value is 30 
sec.
+  
+  
+nifi.bored.yield.duration
+10 millis
+
+When a component has no work to do (i.e., is "bored"), this 
is the amount of time it will wait before checking to see if it has new data to 
work on. This way, it does not use up CPU resources by checking for new work 
too often. When setting this property, be aware that it could add extra latency 
for components that do not constantly have work to do, as once they go into 
this "bored" state, they will wait this amount of time before checking for more 
work. The default value is 10 millis.
+  
+
+  
+nifi.authorizer.configuration.file
+{{nifi_config_dir}}/authorizers.xml
+
+This is the location of the file that specifies how user 
access is authorized. 
+  
+  
+nifi.login.identity.provider.configuration.file
+{{nifi_config_dir}}/login-identity-providers.xml
+
+This is the location of the file that specifies how 
username/password authentication is performed. This file is only consider if 
nifi.security.user.login.identity.provider configured with a provider 
identifier
+  
+  
+nifi.templates.directory
+{{nifi_internal_dir}}/templates
+
+This is the location of the directory where flow templates 
are saved.
+  
+  
+nifi.ui.banner.text
+
+
+  true
+
+
+This is banner text that may be configured to display at the 
top of the User Interface. It is blank by default.
+  
+  
+nifi.ui.autorefresh.interval
+30 sec
+
+The interval at which the User Interface auto-refreshes. The 
default value is 30 sec.
+  
+  
+nifi.nar.library.directory
+{{nifi_install_dir}}/lib
+
+The location of the nar library. The default probably should 
be left as is but additional library directories can be specified by using the 
nifi.nar.library.directory. prefix with unique suffixes and separate paths as 
values e.g. nifi.nar.library.directory.lib1=/nars/lib1
+  
+  
+nifi.nar.working.directory
+{{nifi_internal_dir}}/work/nar
+
+The location of the nar working directory. The default value 
should probably should be left as is.
+  
+  
+nifi.documentation.working.directory
+{{nifi_internal_dir}}/work/docs/components
+
+The documentation working directory. The default value should 
probably should be left as is.
+  
+
+  
+  
+nifi.state.management.configuration.file
+{{nifi_config_dir}}/state-management.xml
+
+The XML file that contains configuration for the local and 
cluster-wide State Providers.
+  
+  
+nifi.state.management.provider.cluster
+zk-provider
+
+The ID of the Cluster State Provider to use. 

[08/35] ambari git commit: AMBARI-18373. After updating HDFS config, Ambari does not show restart required for hive. (alexantonenko)

2016-09-14 Thread ncole
AMBARI-18373. After updating HDFS config, Ambari does not show restart required 
for hive.  (alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: d722e38114ae607d0d94d22c96330ae7fd4c1a4d
Parents: e82d03c
Author: Alex Antonenko 
Authored: Tue Sep 13 15:19:22 2016 +0300
Committer: Alex Antonenko 
Committed: Tue Sep 13 15:42:12 2016 +0300

--
 .../src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d722e381/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml
index 5d8295a..1a3e2e3 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/metainfo.xml
@@ -333,6 +333,7 @@
   
 
   
+core-site
 hive-log4j
 hive-exec-log4j
 hive-env



[09/35] ambari git commit: AMBARI-18366 - YAML Maps For Storm Are Not Being Escaped Correctly (jonathanhurley)

2016-09-14 Thread ncole
AMBARI-18366 - YAML Maps For Storm Are Not Being Escaped Correctly 
(jonathanhurley)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 2181d73c4a2dadd198597e03215ea5fc14151d13
Parents: d722e38
Author: Jonathan Hurley 
Authored: Mon Sep 12 15:10:15 2016 -0400
Committer: Jonathan Hurley 
Committed: Tue Sep 13 09:56:37 2016 -0400

--
 .../main/python/ambari_commons/yaml_utils.py| 45 +++-
 ambari-server/src/test/python/TestYAMLUtils.py  | 40 -
 2 files changed, 73 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2181d73c/ambari-common/src/main/python/ambari_commons/yaml_utils.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/yaml_utils.py 
b/ambari-common/src/main/python/ambari_commons/yaml_utils.py
index bb05c8a..9753177 100644
--- a/ambari-common/src/main/python/ambari_commons/yaml_utils.py
+++ b/ambari-common/src/main/python/ambari_commons/yaml_utils.py
@@ -19,37 +19,60 @@ limitations under the License.
 """
 import re
 
+# [a,b,c]
+REGEX_LIST = '^\w*\[.+\]\w*$'
+
+# {a: v, b: v2, c: v3}
+REGEX_DICTIONARY = '^\w*\{.+\}\w*$'
+
+"""
+storm:
+  hosts:
+[c6401.ambari.apache.org, c6402.ambari.apache.org]
+  groups:
+[hadoop, foo]
+"""
+REGEX_NESTED_MAPS = '^[\w+\s*:\s*\n\s*]+\[(.*?)\]+'
+
 def escape_yaml_property(value):
-  unquouted = False
   unquouted_values = ["null", "Null", "NULL", "true", "True", "TRUE", "false",
 "False", "FALSE", "YES", "Yes", "yes", "NO", "No", "no", "ON", "On", "on",
 "OFF", "Off", "off"]
 
+  # known list of boolean/null types
   if value in unquouted_values:
-unquouted = True
-
-  # if is list [a,b,c] or dictionary {a: v, b: v2, c: v3}
-  if re.match('^\w*\[.+\]\w*$', value) or re.match('^\w*\{.+\}\w*$', value):
-unquouted = True
+return value
 
+  # quick pythonic check for integer
   try:
 int(value)
-unquouted = True
+return value
   except ValueError:
 pass
 
+  # quick pythonic check for float
   try:
 float(value)
-unquouted = True
+return value
   except ValueError:
 pass
 
-  if not unquouted:
-value = value.replace("'", "''")
-value = "'" + value + "'"
+  # if is list [a,b,c] or dictionary {a: v, b: v2, c: v3}
+  if re.match(REGEX_LIST, value) or re.match(REGEX_DICTIONARY, value):
+return value
 
+  # check for a nested map
+  if re.match(REGEX_NESTED_MAPS, value):
+# nested maps must begin on a newline and not have whitespace on the first 
line
+value = value.lstrip()
+return "\n" + value
+
+  # no more checks, so assume it's a string a quote it
+  value = value.replace("'", "''")
+  value = "'" + value + "'"
   return value
 
+
 def get_values_from_yaml_array(yaml_array):
   """
   Converts a YAML array into a normal array of values. For example, this

http://git-wip-us.apache.org/repos/asf/ambari/blob/2181d73c/ambari-server/src/test/python/TestYAMLUtils.py
--
diff --git a/ambari-server/src/test/python/TestYAMLUtils.py 
b/ambari-server/src/test/python/TestYAMLUtils.py
index bdbb11f..c6ee343 100644
--- a/ambari-server/src/test/python/TestYAMLUtils.py
+++ b/ambari-server/src/test/python/TestYAMLUtils.py
@@ -41,4 +41,42 @@ class TestYAMLUtils(TestCase):
 self.assertEquals(expected_values, values)
 
 values = 
yaml_utils.get_values_from_yaml_array('[\'c6401.ambari.apache.org\', 
"c6402.ambari.apache.org"]')
-self.assertEquals(expected_values, values)
\ No newline at end of file
+self.assertEquals(expected_values, values)
+
+
+  def test_yaml_property_escaping(self):
+"""
+Tests that YAML values are escaped with quotes properly when needed
+"""
+self.assertEquals("True", yaml_utils.escape_yaml_property("True"))
+self.assertEquals("FALSE", yaml_utils.escape_yaml_property("FALSE"))
+self.assertEquals("yes", yaml_utils.escape_yaml_property("yes"))
+self.assertEquals("NO", yaml_utils.escape_yaml_property("NO"))
+self.assertEquals("28", yaml_utils.escape_yaml_property("28"))
+self.assertEquals("28.0", yaml_utils.escape_yaml_property("28.0"))
+self.assertEquals("[a,b,c]", yaml_utils.escape_yaml_property("[a,b,c]"))
+self.assertEquals("{ foo : bar }", yaml_utils.escape_yaml_property("{ foo 
: bar }"))
+
+# some strings which should be escaped
+self.assertEquals("'5f'", yaml_utils.escape_yaml_property("5f"))
+self.assertEquals("'28.O'", 

[05/35] ambari git commit: AMBARI-18359. Get LDAP tests to run in concurrent forked JVMs. (Attila Doroszlai via stoader)

2016-09-14 Thread ncole
AMBARI-18359. Get LDAP tests to run in concurrent forked JVMs. (Attila 
Doroszlai via stoader)

Change-Id: I89cd272d14c45a8078cba9a020e0148af63d0559


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e16d916b1318d456b96cde658b5911853bfec32d
Parents: d8f3cf8
Author: Attila Doroszlai 
Authored: Tue Sep 13 10:15:58 2016 +0200
Committer: Toader, Sebastian 
Committed: Tue Sep 13 10:16:44 2016 +0200

--
 .../AmbariLdapAuthenticationProviderForDNWithSpaceTest.java| 5 +++--
 .../AmbariLdapAuthenticationProviderForDuplicateUserTest.java  | 5 +++--
 .../authorization/AmbariLdapAuthenticationProviderTest.java| 5 +++--
 .../authorization/AmbariLdapBindAuthenticatorTest.java | 6 +++---
 4 files changed, 12 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e16d916b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
index 1a18ff2..95b1860 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDNWithSpaceTest.java
@@ -43,7 +43,7 @@ import static org.junit.Assert.*;
 
 @RunWith(FrameworkRunner.class)
 @CreateDS(allowAnonAccess = true,
-name = "Test",
+name = "AmbariLdapAuthenticationProviderForDNWithSpaceTest",
 partitions = {
 @CreatePartition(name = "Root",
 suffix = "dc=the apache,dc=org",
@@ -59,7 +59,7 @@ import static org.junit.Assert.*;
 "objectClass: domain\n\n"))
 })
 @CreateLdapServer(allowAnonymousAccess = true,
-transports = {@CreateTransport(protocol = "LDAP", port = 33389)})
+transports = {@CreateTransport(protocol = "LDAP")})
 @ApplyLdifFiles("users_for_dn_with_space.ldif")
 public class AmbariLdapAuthenticationProviderForDNWithSpaceTest extends 
AmbariLdapAuthenticationProviderBaseTest {
 
@@ -80,6 +80,7 @@ public class 
AmbariLdapAuthenticationProviderForDNWithSpaceTest extends AmbariLd
 injector.injectMembers(this);
 injector.getInstance(GuiceJpaInitializer.class);
 configuration.setClientSecurityType(ClientSecurityType.LDAP);
+configuration.setProperty(Configuration.LDAP_PRIMARY_URL, "localhost:" + 
getLdapServer().getPort());
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/ambari/blob/e16d916b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
index c0086d6..03bf83d 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthenticationProviderForDuplicateUserTest.java
@@ -41,7 +41,7 @@ import org.springframework.security.core.Authentication;
 
 @RunWith(FrameworkRunner.class)
 @CreateDS(allowAnonAccess = true,
-  name = "Test",
+  name = "AmbariLdapAuthenticationProviderForDuplicateUserTest",
   partitions = {
 @CreatePartition(name = "Root",
   suffix = "dc=apache,dc=org",
@@ -57,7 +57,7 @@ import org.springframework.security.core.Authentication;
 "objectClass: domain\n\n"))
   })
 @CreateLdapServer(allowAnonymousAccess = true,
-  transports = {@CreateTransport(protocol = "LDAP", port = 33389)})
+  transports = {@CreateTransport(protocol = "LDAP")})
 @ApplyLdifFiles("users_with_duplicate_uid.ldif")
 public class AmbariLdapAuthenticationProviderForDuplicateUserTest extends 
AmbariLdapAuthenticationProviderBaseTest {
 
@@ -85,6 +85,7 @@ public class 
AmbariLdapAuthenticationProviderForDuplicateUserTest extends Ambari
 

[23/35] ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/package/scripts/nifi.py
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/package/scripts/nifi.py
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/package/scripts/nifi.py
new file mode 100644
index 000..362a40b
--- /dev/null
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/package/scripts/nifi.py
@@ -0,0 +1,231 @@
+#!/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 sys, nifi_ca_util, os, pwd, grp, signal, time, glob, socket, json
+from resource_management.core import sudo
+from resource_management import *
+from subprocess import call
+from setup_ranger_nifi import setup_ranger_nifi
+
+reload(sys)
+sys.setdefaultencoding('utf8')
+
+class Master(Script):
+  def install(self, env):
+
+import params
+import status_params
+
+self.install_packages(env)
+
+Directory([params.nifi_node_dir],
+owner=params.nifi_user,
+group=params.nifi_group,
+create_parents=True,
+recursive_ownership=True
+)
+
+#update the configs specified by user
+self.configure(env, True)
+
+Execute('touch ' +  params.nifi_node_log_file, user=params.nifi_user)
+
+  def configure(self, env, isInstall=False, is_starting = False):
+import params
+import status_params
+env.set_params(params)
+env.set_params(status_params)
+
+#create the log, pid, conf dirs if not already present
+Directory([status_params.nifi_pid_dir, params.nifi_node_log_dir, 
params.nifi_internal_dir, params.nifi_database_dir, 
params.nifi_flowfile_repo_dir, params.nifi_content_repo_dir_default, 
params.nifi_provenance_repo_dir_default, params.nifi_config_dir, 
params.nifi_flow_config_dir, params.nifi_state_dir, params.lib_dir],
+owner=params.nifi_user,
+group=params.nifi_group,
+create_parents=True,
+recursive_ownership=True
+)
+
+# On some OS this folder may not exist, so we will create it before 
pushing files there
+Directory(params.limits_conf_dir,
+  create_parents = True,
+  owner='root',
+  group='root'
+)
+
+File(os.path.join(params.limits_conf_dir, 'nifi.conf'),
+ owner='root',
+ group='root',
+ mode=0644,
+ content=Template("nifi.conf.j2")
+)
+
+
+ca_client_script = nifi_ca_util.get_toolkit_script('tls-toolkit.sh')
+File(ca_client_script, mode=0755)
+
+
+if params.nifi_ca_host and params.nifi_ssl_enabled:
+  ca_client_json = os.path.realpath(os.path.join(params.nifi_config_dir, 
'nifi-certificate-authority-client.json'))
+  File(ca_client_json,
+   owner = params.nifi_user,
+   group = params.nifi_group,
+   mode = 0600)
+  ca_client_dict = nifi_ca_util.load(ca_client_json)
+  if is_starting:
+if params.nifi_toolkit_tls_regenerate:
+  nifi_ca_util.move_keystore_truststore(ca_client_dict)
+  ca_client_dict = {}
+else:
+  nifi_ca_util.move_keystore_truststore_if_necessary(ca_client_dict, 
params.nifi_ca_client_config)
+  nifi_ca_util.overlay(ca_client_dict, params.nifi_ca_client_config)
+  nifi_ca_util.dump(ca_client_json, ca_client_dict)
+  if is_starting:
+Execute('JAVA_HOME='+params.jdk64_home+' '+ca_client_script+' client 
-F -f '+ca_client_json, user=params.nifi_user)
+  nifi_ca_util.update_nifi_properties(nifi_ca_util.load(ca_client_json), 
params.nifi_properties)
+
+#write out nifi.properties
+PropertiesFile(params.nifi_config_dir + '/nifi.properties',
+   properties = params.nifi_properties,
+   mode = 0400,
+   owner = params.nifi_user,
+   group = params.nifi_group)
+
+#write out boostrap.conf
+bootstrap_content=InlineTemplate(params.nifi_boostrap_content)
+File(format("{params.nifi_config_dir}/bootstrap.conf"), 

[28/35] ambari git commit: AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)

2016-09-14 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/main/resources/stacks/HDPWIN/2.1/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/repos/repoinfo.xml 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/repos/repoinfo.xml
index 7f9e075..c1f610a 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/repos/repoinfo.xml
@@ -21,6 +21,7 @@
   http://dummy_repo
   HDPWIN-2.1
   HDPWIN
+  true
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
index e429adb..d996dfc 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
@@ -21,6 +21,7 @@
   http://dummy_repo
   HDPWIN-2.2
   HDPWIN
+  true
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
index 54a0bf0..5aeb7cf 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
@@ -21,6 +21,7 @@
   http://dummy_repo
   HDPWIN-2.3
   HDPWIN
+  true
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/main/resources/version_definition.xsd
--
diff --git a/ambari-server/src/main/resources/version_definition.xsd 
b/ambari-server/src/main/resources/version_definition.xsd
index bd49028..35deb6e 100644
--- a/ambari-server/src/main/resources/version_definition.xsd
+++ b/ambari-server/src/main/resources/version_definition.xsd
@@ -122,6 +122,7 @@
   
   
   
+  
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
index 8ba141b..a43a1dc 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
@@ -258,7 +258,7 @@ public class RepositoryVersionResourceProviderTest {
 final Set> propertySet = new LinkedHashSet>();
 final Map properties = new LinkedHashMap();
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_DISPLAY_NAME_PROPERTY_ID,
 "name");
-
properties.put(RepositoryVersionResourceProvider.SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID,
 new 
Gson().fromJson("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"1\"}]}]",
 Object.class));
+
properties.put(RepositoryVersionResourceProvider.SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID,
 new 
Gson().fromJson("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"1\",\"Repositories/unique\":\"true\"}]}]",
 Object.class));
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_STACK_NAME_PROPERTY_ID,
 "HDP");
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_STACK_VERSION_PROPERTY_ID,
 "1.1");
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_REPOSITORY_VERSION_PROPERTY_ID,
 "1.1.1.1");
@@ -325,7 +325,7 @@ public class RepositoryVersionResourceProviderTest {
 entity.setDisplayName("name");
 entity.setStack(stackEntity);
 entity.setVersion("1.1");
-

[29/35] ambari git commit: AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)

2016-09-14 Thread ncole
AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 02256c3ff80a40440f06247732fbad70afe8e2eb
Parents: 962e06a
Author: Lisnichenko Dmitro 
Authored: Wed Sep 14 12:54:10 2016 +0300
Committer: Lisnichenko Dmitro 
Committed: Wed Sep 14 12:54:10 2016 +0300

--
 .../resources/stacks/HDP/0.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/0.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/1.2.0/repos/repoinfo.xml | 16 ++
 .../stacks/HDP/1.3.0/repos/repoinfo.xml | 14 +
 .../stacks/HDP/1.3.1/repos/repoinfo.xml | 12 +++
 .../stacks/HDP/2.0.1/repos/repoinfo.xml |  8 +++
 .../stacks/HDP/2.0.5/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.6.1/repos/repoinfo.xml   |  6 ++
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.7/repos/repoinfo.xml |  6 ++
 .../HDP/2.0.7/services/HBASE/metainfo.xml   |  1 +
 .../stacks/HDP/2.0.8/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.1.1/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0.ECS/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/1.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/2.0/repos/repoinfo.xml |  6 ++
 .../server/controller/RepositoryResponse.java   |  8 +++
 .../internal/RepositoryResourceProvider.java|  3 +++
 .../RepositoryVersionResourceProvider.java  |  3 +--
 .../server/orm/entities/RepositoryEntity.java   |  9 
 .../ambari/server/state/RepositoryInfo.java | 17 +++
 .../server/state/stack/RepositoryXml.java   | 14 +
 .../stack/upgrade/RepositoryVersionHelper.java  |  4 
 .../stacks/BIGTOP/0.8/repos/repoinfo.xml|  2 ++
 .../HDP/2.0.6.GlusterFS/repos/repoinfo.xml  | 10 +
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  4 
 .../resources/stacks/HDP/2.0/repos/repoinfo.xml |  4 
 .../stacks/HDP/2.1.GlusterFS/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/2.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.3.ECS/repos/repoinfo.xml   | 18 
 .../stacks/HDP/2.3.GlusterFS/repos/repoinfo.xml | 10 +
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml | 12 +++
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml | 12 +++
 .../resources/stacks/HDP/2.5/repos/repoinfo.xml | 16 ++
 .../stacks/HDPWIN/2.1/repos/repoinfo.xml|  1 +
 .../stacks/HDPWIN/2.2/repos/repoinfo.xml|  1 +
 .../stacks/HDPWIN/2.3/repos/repoinfo.xml|  1 +
 .../src/main/resources/version_definition.xsd   |  1 +
 .../RepositoryVersionResourceProviderTest.java  | 22 ++--
 .../upgrade/RepositoryVersionHelperTest.java|  3 ++-
 .../bad-stacks/HDP/0.1/repos/repoinfo.xml   |  1 +
 .../src/test/resources/hbase_version_test.xml   |  2 ++
 .../resources/stacks/HDP/0.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/0.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/1.2.0/repos/repoinfo.xml | 16 ++
 .../stacks/HDP/1.3.0/repos/repoinfo.xml | 14 +
 .../stacks/HDP/1.3.1/repos/repoinfo.xml | 12 +++
 .../stacks/HDP/2.0.1/repos/repoinfo.xml |  8 +++
 .../stacks/HDP/2.0.5/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.6.1/repos/repoinfo.xml   |  6 ++
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.7/repos/repoinfo.xml |  6 ++
 .../HDP/2.0.7/services/HBASE/metainfo.xml   |  1 +
 .../stacks/HDP/2.0.8/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.1.1/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0.ECS/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0/repos/repoinfo.xml |  2 ++
 .../HDP/2.2.0/repos/version-2.2.0.4-123.xml |  2 ++
 .../2.2.0/repos/version-2.2.0.4-124-suse11.xml  |  2 ++
 .../stacks/OTHER/1.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/2.0/repos/repoinfo.xml |  6 ++
 .../HDP/0.1/repos/repoinfo.xml  |  6 ++
 .../HDP/0.2/repos/repoinfo.xml  |  6 ++
 .../OTHER/1.0/repos/repoinfo.xml|  6 ++
 .../OTHER/2.0/repos/repoinfo.xml|  6 ++
 .../stack1/1.0/repos/repoinfo.xml   |  6 ++
 .../stack2/1.0/repos/repoinfo.xml   |  6 ++
 

[27/35] ambari git commit: Revert "AMBARI-18324: Externalize skip repo url check to ambari.properties instead of hardcoding it in Ambari Java code (dili)"

2016-09-14 Thread ncole
Revert "AMBARI-18324: Externalize skip repo url check to ambari.properties 
instead of hardcoding it in Ambari Java code (dili)"

This reverts commit 623c36d2e0832d9a0bc60bc9ff19b302d5e3cefa.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 962e06aca097ec02ee52f2284fb804c0c60425ad
Parents: 580a351
Author: Lisnichenko Dmitro 
Authored: Wed Sep 14 12:53:59 2016 +0300
Committer: Lisnichenko Dmitro 
Committed: Wed Sep 14 12:53:59 2016 +0300

--
 .../server/configuration/Configuration.java | 25 +---
 .../RepositoryVersionResourceProvider.java  | 15 +---
 .../server/configuration/ConfigurationTest.java | 20 
 3 files changed, 2 insertions(+), 58 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/962e06ac/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 ee73b8d..0690ca8 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
@@ -2300,14 +2300,6 @@ public class Configuration {
   public static final ConfigurationProperty TASK_ID_LIST_LIMIT = new 
ConfigurationProperty<>(
   "task.query.parameterlist.size", 999);
 
-  /**
-   * A comma separated list of repo ids to skip the repo url check when 
registering a repo for the stack
-   * @return
-   */
-  @Markdown(description = "The list of repo ids to skip the repo url check 
when registering a repo for the stack.")
-  public static final ConfigurationProperty 
SKIP_REPO_URL_EXISTENCE_VALIDATION_LIST = new ConfigurationProperty<>(
-  "no.repo.existence.validation.list", "HDP-UTILS");
-
   private static final Logger LOG = LoggerFactory.getLogger(
 Configuration.class);
 
@@ -4833,22 +4825,6 @@ public class Configuration {
   }
 
   /**
-   * Default to HDP-UTILS
-   * */
-  public List getSkipRepoUrlExistenceValidationList(){
-List list = new ArrayList();
-String propValue = getProperty(SKIP_REPO_URL_EXISTENCE_VALIDATION_LIST);
-for (String repo: propValue.split(",")) {
-  repo = repo.trim();
-  if (!repo.isEmpty()) {
-list.add(repo);
-  }
-}
-LOG.debug("Skip Repo URL Existence Validation on :" + list);
-return list;
-  }
-
-  /**
* Generates a markdown table which includes:
* 
* Property key name
@@ -5211,4 +5187,5 @@ public class Configuration {
 ClusterSizeType clusterSize();
 String value();
   }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/962e06ac/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
index cd440f3..e440460 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
@@ -32,7 +32,6 @@ import org.apache.ambari.server.ObjectNotFoundException;
 import 
org.apache.ambari.server.api.resources.OperatingSystemResourceDefinition;
 import org.apache.ambari.server.api.resources.RepositoryResourceDefinition;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
-import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.NoSuchResourceException;
 import org.apache.ambari.server.controller.spi.Predicate;
@@ -458,14 +457,11 @@ public class RepositoryVersionResourceProvider extends 
AbstractAuthorizedResourc
 
 // List of all repo urls that are already added at stack
 Set existingRepoUrls = new HashSet();
-Configuration configuration = new Configuration();
-List skipRepos = 
configuration.getSkipRepoUrlExistenceValidationList();
 List existingRepoVersions = 
dao.findByStack(requiredStack);
 for (RepositoryVersionEntity 

[25/35] ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread ncole
AMBARI-18385: Add HDF management pack (jluniya)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 37e71db741cacb5acc4113131a27d2c1b7ac5791
Parents: 532b689
Author: Jayush Luniya 
Authored: Tue Sep 13 22:26:38 2016 -0700
Committer: Jayush Luniya 
Committed: Tue Sep 13 22:26:38 2016 -0700

--
 .../hdf-ambari-mpack/.gitignore |1 +
 .../management-packs/hdf-ambari-mpack/pom.xml   |  150 ++
 .../src/main/assemblies/hdf-ambari-mpack.xml|   79 +
 .../common-services/NIFI/1.0.0/alerts.json  |   18 +
 .../1.0.0/configuration/nifi-ambari-config.xml  |  189 ++
 .../configuration/nifi-ambari-ssl-config.xml|  226 +++
 .../configuration/nifi-authorizers-env.xml  |  103 +
 .../1.0.0/configuration/nifi-bootstrap-env.xml  |  116 ++
 ...nifi-bootstrap-notification-services-env.xml |   80 +
 .../NIFI/1.0.0/configuration/nifi-env.xml   |  116 ++
 .../NIFI/1.0.0/configuration/nifi-flow-env.xml  |   69 +
 .../nifi-login-identity-providers-env.xml   |  147 ++
 .../configuration/nifi-node-logback-env.xml |  201 ++
 .../1.0.0/configuration/nifi-properties.xml |  848 
 .../configuration/nifi-state-management-env.xml |   96 +
 .../1.0.0/configuration/ranger-nifi-audit.xml   |   91 +
 .../ranger-nifi-plugin-properties.xml   |  170 ++
 .../configuration/ranger-nifi-policymgr-ssl.xml |   84 +
 .../configuration/ranger-nifi-security.xml  |   90 +
 .../common-services/NIFI/1.0.0/kerberos.json|   72 +
 .../common-services/NIFI/1.0.0/metainfo.xml |  149 ++
 .../common-services/NIFI/1.0.0/metrics.json |  131 ++
 .../1.0.0/package/scripts/alert_check_nifi.py   |   49 +
 .../NIFI/1.0.0/package/scripts/nifi.py  |  231 +++
 .../NIFI/1.0.0/package/scripts/nifi_ca.py   |  114 ++
 .../NIFI/1.0.0/package/scripts/nifi_ca_util.py  |  110 ++
 .../1.0.0/package/scripts/nifi_constants.py |   25 +
 .../NIFI/1.0.0/package/scripts/params.py|  445 +
 .../NIFI/1.0.0/package/scripts/run_ca.sh|   63 +
 .../NIFI/1.0.0/package/scripts/service_check.py |   75 +
 .../1.0.0/package/scripts/setup_ranger_nifi.py  |   68 +
 .../NIFI/1.0.0/package/scripts/status_params.py |   29 +
 .../NIFI/1.0.0/package/templates/nifi.conf.j2   |   36 +
 .../NIFI/1.0.0/quicklinks/quicklinks.json   |   35 +
 .../common-services/NIFI/1.0.0/widgets.json |  463 +
 .../src/main/resources/hooks/after_install.py   |   49 +
 .../src/main/resources/mpack.json   |   30 +
 .../HDF/2.0/configuration/cluster-env.xml   |  210 ++
 .../HDF/2.0/hooks/after-INSTALL/scripts/hook.py |   37 +
 .../2.0/hooks/after-INSTALL/scripts/params.py   |  101 +
 .../scripts/shared_initialization.py|  108 ++
 .../hooks/before-ANY/files/changeToSecureUid.sh |   53 +
 .../HDF/2.0/hooks/before-ANY/scripts/hook.py|   36 +
 .../HDF/2.0/hooks/before-ANY/scripts/params.py  |  235 +++
 .../before-ANY/scripts/shared_initialization.py |  224 +++
 .../2.0/hooks/before-INSTALL/scripts/hook.py|   37 +
 .../2.0/hooks/before-INSTALL/scripts/params.py  |  113 ++
 .../scripts/repo_initialization.py  |   68 +
 .../scripts/shared_initialization.py|   37 +
 .../2.0/hooks/before-RESTART/scripts/hook.py|   29 +
 .../hooks/before-START/files/checkForFormat.sh  |   65 +
 .../before-START/files/fast-hdfs-resource.jar   |  Bin 0 -> 19285850 bytes
 .../before-START/files/task-log4j.properties|  134 ++
 .../hooks/before-START/files/topology_script.py |   66 +
 .../HDF/2.0/hooks/before-START/scripts/hook.py  |   39 +
 .../2.0/hooks/before-START/scripts/params.py|  318 +++
 .../before-START/scripts/rack_awareness.py  |   47 +
 .../scripts/shared_initialization.py|  175 ++
 .../templates/commons-logging.properties.j2 |   43 +
 .../templates/exclude_hosts_list.j2 |   21 +
 .../templates/hadoop-metrics2.properties.j2 |  104 +
 .../before-START/templates/health_check.j2  |   81 +
 .../templates/include_hosts_list.j2 |   21 +
 .../templates/topology_mappings.data.j2 |   24 +
 .../main/resources/stacks/HDF/2.0/kerberos.json |   64 +
 .../main/resources/stacks/HDF/2.0/metainfo.xml  |   23 +
 .../HDF/2.0/properties/stack_features.json  |  281 +++
 .../stacks/HDF/2.0/properties/stack_tools.json  |4 +
 .../resources/stacks/HDF/2.0/repos/repoinfo.xml |  104 +
 .../stacks/HDF/2.0/role_command_order.json  |   55 +
 .../HDF/2.0/services/AMBARI_INFRA/metainfo.xml  |   26 +
 .../AMBARI_INFRA/role_command_order.json|7 +
 .../2.0/services/AMBARI_METRICS/metainfo.xml|   26 +
 

[33/35] ambari git commit: AMBARI-15538. Support service-specific repo for add-on services. (Balazs Bence Sari via stoader).

2016-09-14 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/ambari-server/src/test/resources/stacks_with_common_services/HDP/0.2/services/ADDON/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/test/resources/stacks_with_common_services/HDP/0.2/services/ADDON/repos/repoinfo.xml
 
b/ambari-server/src/test/resources/stacks_with_common_services/HDP/0.2/services/ADDON/repos/repoinfo.xml
new file mode 100644
index 000..8d7c255
--- /dev/null
+++ 
b/ambari-server/src/test/resources/stacks_with_common_services/HDP/0.2/services/ADDON/repos/repoinfo.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+http:add.on/repo
+ADDON_REPO-1.0
+ADDON_REPO
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/configuration/microsoft-r-env.xml
--
diff --git 
a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/configuration/microsoft-r-env.xml
 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/configuration/microsoft-r-env.xml
new file mode 100644
index 000..5bc4a31
--- /dev/null
+++ 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/configuration/microsoft-r-env.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+R Open Version
+Version of R Open
+Version of R Open
+3.2.2
+
+string
+false
+
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
--
diff --git 
a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
index 61ea96b..382bd0f 100644
--- 
a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
+++ 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
@@ -19,30 +19,24 @@ limitations under the License.
 """
 from resource_management.libraries.script import Script
 from resource_management.core.logger import Logger
-from resource_management.core.source import DownloadSource
-from resource_management.core.resources import File, Package
+from resource_management.core.resources import Package
 
-rpm_location = 'http://104.196.87.250/msft-r/8.1/'
-rpms = ['microsoft-r-server-mro-8.0.rpm',
-'microsoft-r-server-intel-mkl-8.0.rpm',
-'microsoft-r-server-packages-8.0.rpm',
-'microsoft-r-server-hadoop-8.0.rpm']
+
+rpms = ['microsoft-r-server-mro-8.0',
+'microsoft-r-server-intel-mkl-8.0',
+'microsoft-r-server-packages-8.0',
+'microsoft-r-server-hadoop-8.0']
 
 class MicrosoftR(Script):
+
   def install(self, env):
 Logger.info('Installing R Server Client...')
 tmp_dir = Script.tmp_dir
 Logger.debug('Using temp dir: {0}'.format(tmp_dir))
-Logger.info("Will download and install the following rpm's from {0}: 
{1}".format(rpm_location, rpms))
 
 for rpm in rpms:
-  Logger.info('Downloading {0}'.format(rpm))
-  rpmFile = '{0}/{1}'.format(tmp_dir, rpm)
-  File(rpmFile, \
-   content = DownloadSource(rpm_location + rpm), \
-   mode = 0644)
   Logger.info('Installing {0}'.format(rpm))
-  Package(rpmFile)
+  Package(rpm)
 
 Logger.info('Installed R Server')
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/contrib/management-packs/microsoft-r_mpack/src/main/resources/custom-services/MICROSOFT_R/8.0.0/repos/repoinfo.xml
--
diff --git 
a/contrib/management-packs/microsoft-r_mpack/src/main/resources/custom-services/MICROSOFT_R/8.0.0/repos/repoinfo.xml
 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/custom-services/MICROSOFT_R/8.0.0/repos/repoinfo.xml
new file mode 100644
index 000..4c82514
--- /dev/null
+++ 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/custom-services/MICROSOFT_R/8.0.0/repos/repoinfo.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+http://104.196.87.250/msft-r/MICROSOFT_R-8.0/
+MSFT_R-8.1
+MSFT_R
+
+
+
+
+http://104.196.87.250/msft-r/MICROSOFT_R-8.0/
+MSFT_R-8.1
+MSFT_R
+
+
+



[17/35] ambari git commit: AMBARI-18375 Ranger Plugin configs are not generated for Hive interactive (mugdha)

2016-09-14 Thread ncole
AMBARI-18375 Ranger Plugin configs are not generated for Hive interactive 
(mugdha)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 532b689f3158f8c90b9bc69e1d62d3816f3e81b1
Parents: 1e21842
Author: Mugdha Varadkar 
Authored: Tue Sep 13 16:53:35 2016 +0530
Committer: Mugdha Varadkar 
Committed: Wed Sep 14 10:41:51 2016 +0530

--
 .../0.12.0.2.0/package/scripts/setup_ranger_hive_interactive.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/532b689f/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/setup_ranger_hive_interactive.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/setup_ranger_hive_interactive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/setup_ranger_hive_interactive.py
index 0b5d5db..2cbe952 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/setup_ranger_hive_interactive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/setup_ranger_hive_interactive.py
@@ -53,8 +53,8 @@ def setup_ranger_hive_interactive(upgrade_type = None):
   )
   params.HdfsResource(None, action="execute")
 
-  from resource_management.libraries.functions.setup_ranger_plugin_xml 
import setup_ranger_plugin
-  setup_ranger_plugin('hive-server2-hive2', 'hive', 
params.ranger_previous_jdbc_jar,
+from resource_management.libraries.functions.setup_ranger_plugin_xml 
import setup_ranger_plugin
+setup_ranger_plugin('hive-server2-hive2', 'hive', 
params.ranger_previous_jdbc_jar,
   params.ranger_downloaded_custom_connector, 
params.ranger_driver_curl_source,
   params.ranger_driver_curl_target, params.java64_home,
   params.repo_name, params.hive_ranger_plugin_repo,
@@ -73,6 +73,5 @@ def setup_ranger_hive_interactive(upgrade_type = None):
   is_stack_supports_ranger_kerberos = 
params.stack_supports_ranger_kerberos,
   component_user_principal=params.hive_principal if 
params.security_enabled else None,
   component_user_keytab=params.hive_server2_keytab if 
params.security_enabled else None)
-
   else:
 Logger.info('Ranger admin not installed')



[13/35] ambari git commit: AMBARI-18382. Enable Kerberos Wizard: Metrics collector fails to start on a cluster with Ranger installed. (jaimin)

2016-09-14 Thread ncole
AMBARI-18382. Enable Kerberos Wizard: Metrics collector fails to start on a 
cluster with Ranger installed. (jaimin)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1b4a38dde7a683c7e1b282a14bf2f39afbfafed1
Parents: 9595706
Author: Jaimin Jetly 
Authored: Tue Sep 13 13:43:57 2016 -0700
Committer: Jaimin Jetly 
Committed: Tue Sep 13 13:56:49 2016 -0700

--
 ambari-web/app/controllers/main/admin/kerberos/step4_controller.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1b4a38dd/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 91a40dd..29cbfff 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -511,7 +511,7 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
 Array.prototype.push.apply(self.getServicesConfigObject().get('configs'), 
newProperties);
 Em.keys(groupedProperties.update).forEach(function(fileName) {
   
Em.keys(groupedProperties.update[fileName]).forEach(function(propertyName) {
-var configProperty = allConfigs.findProperty('name', propertyName);
+var configProperty = allConfigs.filterProperty('filename', 
fileName).findProperty('name', propertyName);
 if (configProperty) {
   self._updateConfigByRecommendation(configProperty, 
groupedProperties.update[fileName][propertyName], true, false);
 }



[35/35] ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread ncole
AMBARI-18385: Add HDF management pack (jluniya)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 752e7c46391e1a50f99ab5e3513dfdfc813f6228
Parents: 0e4515c
Author: Jayush Luniya 
Authored: Wed Sep 14 10:03:07 2016 -0700
Committer: Jayush Luniya 
Committed: Wed Sep 14 10:03:07 2016 -0700

--
 .../NIFI/1.0.0/configuration/nifi-ambari-config.xml  | 3 +--
 .../NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml  | 3 +--
 .../NIFI/1.0.0/configuration/nifi-authorizers-env.xml| 3 +--
 .../NIFI/1.0.0/configuration/nifi-bootstrap-env.xml  | 3 +--
 .../configuration/nifi-bootstrap-notification-services-env.xml   | 4 ++--
 .../common-services/NIFI/1.0.0/configuration/nifi-env.xml| 3 +--
 .../common-services/NIFI/1.0.0/configuration/nifi-flow-env.xml   | 3 +--
 .../1.0.0/configuration/nifi-login-identity-providers-env.xml| 3 +--
 .../NIFI/1.0.0/configuration/nifi-node-logback-env.xml   | 3 +--
 .../NIFI/1.0.0/configuration/nifi-state-management-env.xml   | 3 +--
 .../NIFI/1.0.0/configuration/ranger-nifi-audit.xml   | 3 +--
 .../NIFI/1.0.0/configuration/ranger-nifi-policymgr-ssl.xml   | 3 +--
 .../NIFI/1.0.0/configuration/ranger-nifi-security.xml| 3 +--
 13 files changed, 14 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/752e7c46/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
index 743fda0..adb9b41 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
@@ -1,4 +1,5 @@
 
+
 
-
-
 
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/752e7c46/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
index 272535f..09f2b9b 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
@@ -1,4 +1,5 @@
 
+
 
-
-
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/752e7c46/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
index e6505aa..2f1d670 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
@@ -1,4 +1,5 @@
 
+
 
-
-
 
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/752e7c46/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-bootstrap-env.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-bootstrap-env.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-bootstrap-env.xml
index ea4e919..90999a6 100644
--- 

[14/35] ambari git commit: AMBARI-17458 : Add support for distributed collector to Ambari REST API. (avijayan)

2016-09-14 Thread ncole
AMBARI-17458 : Add support for distributed collector to Ambari REST API. 
(avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0855174b815987850d0022ff3c1619c3b2373921
Parents: a33e2b6
Author: Aravindan Vijayan 
Authored: Tue Sep 13 15:21:49 2016 -0700
Committer: Aravindan Vijayan 
Committed: Tue Sep 13 15:22:38 2016 -0700

--
 .../controller/AmbariManagementController.java  |   8 +
 .../AmbariManagementControllerImpl.java |   8 +
 .../internal/AbstractProviderModule.java| 120 ++-
 .../controller/internal/HostStatusHelper.java   |  88 
 .../metrics/MetricsCollectorHAClusterState.java | 211 +++
 .../metrics/MetricsCollectorHAManager.java  | 106 ++
 .../metrics/timeline/AMSPropertyProvider.java   |  62 --
 .../timeline/AMSReportPropertyProvider.java |  15 +-
 .../metrics/timeline/MetricsRequestHelper.java  |   5 +-
 .../timeline/cache/TimelineMetricCache.java |  10 +
 .../ambari/server/events/AmbariEvent.java   |   7 +-
 .../events/MetricsCollectorHostDownEvent.java   |  47 +
 .../0.1.0/package/scripts/metrics_collector.py  |   2 +-
 .../0.1.0/package/scripts/metrics_grafana.py|   2 +-
 .../0.1.0/package/scripts/metrics_monitor.py|   2 +-
 .../0.1.0/package/scripts/status.py |   4 +-
 16 files changed, 561 insertions(+), 136 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0855174b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
index 9da6fd4..746bca4 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
@@ -32,6 +32,7 @@ import 
org.apache.ambari.server.controller.internal.DeleteStatusMetaData;
 import org.apache.ambari.server.controller.internal.RequestStageContainer;
 import 
org.apache.ambari.server.controller.logging.LoggingSearchPropertyProvider;
 import 
org.apache.ambari.server.controller.metrics.MetricPropertyProviderFactory;
+import org.apache.ambari.server.controller.metrics.MetricsCollectorHAManager;
 import 
org.apache.ambari.server.controller.metrics.timeline.cache.TimelineMetricCacheProvider;
 import org.apache.ambari.server.events.AmbariEvent;
 import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
@@ -889,5 +890,12 @@ public interface AmbariManagementController {
*/
   AmbariEventPublisher getAmbariEventPublisher();
 
+  /**
+   * Gets an {@link MetricsCollectorHAManager} which can be used to get/add 
collector host for a cluster
+   *
+   * @return {@link MetricsCollectorHAManager}
+   */
+  MetricsCollectorHAManager getMetricsCollectorHAManager();
+
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0855174b/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 1d82928..90d2162 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
@@ -98,6 +98,7 @@ import 
org.apache.ambari.server.controller.internal.WidgetLayoutResourceProvider
 import org.apache.ambari.server.controller.internal.WidgetResourceProvider;
 import 
org.apache.ambari.server.controller.logging.LoggingSearchPropertyProvider;
 import 
org.apache.ambari.server.controller.metrics.MetricPropertyProviderFactory;
+import org.apache.ambari.server.controller.metrics.MetricsCollectorHAManager;
 import 
org.apache.ambari.server.controller.metrics.timeline.cache.TimelineMetricCacheProvider;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.customactions.ActionDefinition;
@@ -287,6 +288,8 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   private ClusterVersionDAO clusterVersionDAO;
   

[02/35] ambari git commit: AMBARI-18351. Preserve output while executing HSI/LLAP's run.sh command for launching LLAP.

2016-09-14 Thread ncole
AMBARI-18351. Preserve output while executing HSI/LLAP's run.sh command for 
launching LLAP.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: b44078cc30ac3c5d4fa86efbcaa9e5d68a37bc04
Parents: 181de17
Author: Swapan Shridhar 
Authored: Mon Sep 12 11:27:18 2016 -0700
Committer: Swapan Shridhar 
Committed: Mon Sep 12 11:27:18 2016 -0700

--
 .../HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py   | 2 +-
 .../src/test/python/stacks/2.5/HIVE/test_hive_server_int.py  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b44078cc/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 3d66125..da05913 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
@@ -296,7 +296,7 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
   raise Fail("Did not find run.sh file in output: " + str(output))
 
 Logger.info(format("Run file path: {run_file_path}"))
-Execute(run_file_path, user=params.hive_user)
+Execute(run_file_path, user=params.hive_user, logoutput=True)
 Logger.info("Submitted LLAP app name : {0}".format(LLAP_APP_NAME))
 
 # We need to check the status of LLAP app to figure out it got

http://git-wip-us.apache.org/repos/asf/ambari/blob/b44078cc/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py 
b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index 389e45d..b97c377 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -106,7 +106,7 @@ class TestHiveServerInteractive(RMFTestCase):
 
 self.assertResourceCalled('Execute',
   '/home/hive/llap-slider-05Apr2016/run.sh',
-  user='hive'
+  logoutput= True, user=u'hive'
 )
 self.assertResourceCalled('Execute',
   'hive --config 
/usr/hdp/current/hive-server2-hive2/conf/conf.server --service metatool 
-updateLocation hdfs://c6401.ambari.apache.org:8020 OK.',
@@ -164,7 +164,7 @@ class TestHiveServerInteractive(RMFTestCase):
 
 self.assertResourceCalled('Execute',
   '/home/hive/llap-slider-05Apr2016/run.sh',
-  user='hive'
+  logoutput= True, user=u'hive'
   )
 self.assertResourceCalled('Execute',
   'hive --config 
/usr/hdp/current/hive-server2-hive2/conf/conf.server --service metatool 
-updateLocation hdfs://c6401.ambari.apache.org:8020 OK.',



[32/35] ambari git commit: AMBARI-18379 Cover host views with unit tests. (atkach)

2016-09-14 Thread ncole
AMBARI-18379 Cover host views with unit tests. (atkach)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 2ad42074f1633c5c6f56cf979bdaa49440457566
Parents: 5beed88
Author: Andrii Tkach 
Authored: Tue Sep 13 20:28:41 2016 +0300
Committer: Andrii Tkach 
Committed: Wed Sep 14 16:22:17 2016 +0300

--
 ambari-web/app/assets/test/tests.js |   3 +
 .../app/views/main/host/combo_search_box.js | 294 --
 .../views/main/host/hosts_table_menu_view.js|  14 +-
 ambari-web/app/views/main/host/log_metrics.js   |   2 +-
 .../views/main/host/combo_search_box_test.js| 957 ++-
 .../views/main/host/host_alerts_view_test.js|  23 +-
 .../main/host/hosts_table_menu_view_test.js | 304 ++
 .../test/views/main/host/log_metrics_test.js| 116 +++
 .../test/views/main/host/logs_view_test.js  | 178 
 .../views/main/host/stack_versions_view_test.js |  66 ++
 ambari-web/test/views/main/host/summary_test.js |  91 ++
 11 files changed, 1942 insertions(+), 106 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ad42074/ambari-web/app/assets/test/tests.js
--
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index d2f3637..d918900 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -296,6 +296,9 @@ var files = [
   'test/views/main/host/combo_search_box_test',
   'test/views/main/host/config_service_test',
   'test/views/main/host/add_view_test',
+  'test/views/main/host/logs_view_test',
+  'test/views/main/host/hosts_table_menu_view_test',
+  'test/views/main/host/log_metrics_test',
   'test/views/main/host/config_service_menu_test',
   'test/views/main/host/details/host_component_view_test',
   'test/views/main/host/details/host_component_views/decommissionable_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/2ad42074/ambari-web/app/views/main/host/combo_search_box.js
--
diff --git a/ambari-web/app/views/main/host/combo_search_box.js 
b/ambari-web/app/views/main/host/combo_search_box.js
index f417cc6..2f9900a 100644
--- a/ambari-web/app/views/main/host/combo_search_box.js
+++ b/ambari-web/app/views/main/host/combo_search_box.js
@@ -60,7 +60,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 if (invalidFacet) {
   this.showErrMsg(invalidFacet);
 }
-var tableView = this.get('parentView').get('parentView');
+var tableView = this.get('parentView.parentView');
 App.db.setComboSearchQuery(tableView.get('controller.name'), query);
 var filterConditions = this.createFilterConditions(searchCollection);
 tableView.updateComboFilter(filterConditions);
@@ -87,7 +87,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 // Add host component facets only when there isn't any component filter
 // with value other than ALL yet
 var currentComponentFacets = 
this.getComponentStateFacets(hostComponentList, false);
-if (currentComponentFacets.length == 0) {
+if (currentComponentFacets.length === 0) {
   list = list.concat(hostComponentList);
 }
 list = this.filterOutOneFacetOnlyOptions(list);
@@ -105,7 +105,6 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 var controller = App.router.get('mainHostComboSearchBoxController');
 this.showHideClearButton();
 var map = App.router.get('mainHostController.labelValueMap');
-var serviceMap = this.get('serviceMap')
 var facetValue = map[facet] || facet;
 if (controller.isComponentStateFacet(facetValue)) {
   facetValue = 'componentState'
@@ -113,76 +112,153 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 switch (facetValue) {
   case 'hostName':
   case 'ip':
-controller.getPropertySuggestions(facetValue, 
searchTerm).done(function() {
-  callback(controller.get('currentSuggestion').reject(function (item) {
-return visualSearch.searchQuery.values(facet).indexOf(item) >= 0; 
// reject the ones already in search
-  }), {preserveMatches: true});
-});
+this.searchByHostname(facetValue, searchTerm, facet, callback);
 break;
   case 'rack':
-
callback(App.Host.find().toArray().mapProperty('rack').uniq().reject(function 
(item) {
-  return visualSearch.searchQuery.values(facet).indexOf(item) >= 0;
-}));
+this.searchByRack(facet, callback);
 break;
   case 

[15/35] ambari git commit: AMBARI-18368. Atlas web UI alert after performing stack upgrade to HDP 2.5 and adding Atlas Service (alejandro)

2016-09-14 Thread ncole
AMBARI-18368. Atlas web UI alert after performing stack upgrade to HDP 2.5 and 
adding Atlas Service (alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: a33e2b628f5e6f40377c0c8c8cc348dcfb6d2a6f
Parents: 1b4a38d
Author: Alejandro Fernandez 
Authored: Mon Sep 12 18:50:07 2016 -0700
Committer: Alejandro Fernandez 
Committed: Tue Sep 13 15:23:23 2016 -0700

--
 .../ATLAS/0.1.0.2.3/package/scripts/metadata.py  | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a33e2b62/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
index 0c07018..a568cb7 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/package/scripts/metadata.py
@@ -17,9 +17,11 @@ See the License for the specific language governing 
permissions and
 limitations under the License.
 
 """
+import os
+
 from resource_management import Package
 from resource_management import StackFeature
-from resource_management.core.resources.system import Directory, File
+from resource_management.core.resources.system import Directory, File, Execute
 from resource_management.core.source import StaticFile, InlineTemplate, 
Template
 from resource_management.core.exceptions import Fail
 from resource_management.libraries.functions.format import format
@@ -94,6 +96,17 @@ def metadata(type='server'):
mode=0755,
content=InlineTemplate(params.metadata_env_content)
   )
+ 
+  files_to_chown = [format("{conf_dir}/policy-store.txt"), 
format("{conf_dir}/users-credentials.properties")]
+  for file in files_to_chown:
+if os.path.exists(file):
+  Execute(('chown', format('{metadata_user}:{user_group}'), file),
+  sudo=True
+  )
+  Execute(('chmod', '644', file),
+  sudo=True
+  )
+
   if params.metadata_solrconfig_content:
 File(format("{conf_dir}/solr/solrconfig.xml"),
  mode=0644,



[26/35] ambari git commit: revert "AMBARI-18213. Storm components were stopped during RU and can not be started (Dmitry Lysnichenko via ncole)" (dlisnichenko)

2016-09-14 Thread ncole
revert "AMBARI-18213. Storm components were stopped during RU and can not be 
started (Dmitry Lysnichenko via ncole)" (dlisnichenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 580a35139ecd4ee8c47af948d1e4717533eac8f4
Parents: 37e71db
Author: Lisnichenko Dmitro 
Authored: Wed Sep 14 12:46:32 2016 +0300
Committer: Lisnichenko Dmitro 
Committed: Wed Sep 14 12:46:32 2016 +0300

--
 .../StormUpgradeKerberosDescriptorConfig.java   | 144 ---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml |   5 -
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml |   3 -
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml |   5 -
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml |   3 -
 5 files changed, 160 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/580a3513/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java
deleted file mode 100644
index 07bdaa6..000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java
+++ /dev/null
@@ -1,144 +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.
- */
-package org.apache.ambari.server.serveraction.upgrades;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
-
-import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.actionmanager.HostRoleStatus;
-import org.apache.ambari.server.agent.CommandReport;
-import org.apache.ambari.server.orm.dao.ArtifactDAO;
-import org.apache.ambari.server.orm.entities.ArtifactEntity;
-import org.apache.ambari.server.serveraction.AbstractServerAction;
-import org.apache.ambari.server.state.kerberos.KerberosConfigurationDescriptor;
-import org.apache.ambari.server.state.kerberos.KerberosDescriptor;
-import org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory;
-import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor;
-
-import com.google.inject.Inject;
-
-
-/**
- * Update Kerberos Descriptor Storm properties when upgrading to Storm 1.0
- */
-public class StormUpgradeKerberosDescriptorConfig extends AbstractServerAction 
{
-
-
-  public static final String KERBEROS_DESCRIPTOR = "kerberos_descriptor";
-  public static final String STORM = "STORM";
-  public static final String NEW_PART = "org.apache";
-  public static final String OLD_PART = "backtype";
-
-  @Inject
-  ArtifactDAO artifactDAO;
-
-  protected StormUpgradeKerberosDescriptorConfig() {
-  }
-
-  /**
-   * Lists config types and properties that may be replaced "backtype" to 
"org.apache"
-   */
-  private static final HashMap TARGET_PROPERTIES = new 
HashMap() {{
-put("storm-site", new String[]{
-"nimbus.authorizer",
-"storm.principal.tolocal",
-"drpc.authorizer"
-});
-
-  }};
-
-  /**
-   * Update Kerberos Descriptor Storm properties when upgrading to Storm 1.0
-   * 
-   * Finds the relevant artifact entities and iterates through them to process 
each independently.
-   */
-  @Override
-  public CommandReport execute(ConcurrentMap 
requestSharedDataContext)
-  throws AmbariException, InterruptedException {
-
-String msg = "";
-
-List artifactEntities = 
artifactDAO.findByName(KERBEROS_DESCRIPTOR);
-
-if (artifactEntities != null) {
-  for (ArtifactEntity 

[01/35] ambari git commit: Revert "AMBARI-18237. Certain configuration files cannot be modified through Ambari api. (aonishuk)"

2016-09-14 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade e4cb41e0a -> 752e7c463


Revert "AMBARI-18237. Certain configuration files cannot be modified through 
Ambari api. (aonishuk)"

This reverts commit 4b141dd8842fe97d9cf8565af179ea2b68191729.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 181de178b270fd111f395b951ded7ae670a7d9ce
Parents: e4cb41e
Author: Andrew Onishuk 
Authored: Mon Sep 12 21:10:19 2016 +0300
Committer: Andrew Onishuk 
Committed: Mon Sep 12 21:10:39 2016 +0300

--
 .../stacks/HDP/2.0.6/hooks/before-START/scripts/params.py | 3 +--
 .../HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/181de178/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
index 45eab2f..49a14d0 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/params.py
@@ -40,12 +40,11 @@ stack_version_formatted = 
format_stack_version(stack_version_unformatted)
 
 dfs_type = default("/commandParams/dfs_type", "")
 hadoop_conf_dir = "/etc/hadoop/conf"
+
 component_list = default("/localComponents", [])
 
 hdfs_tmp_dir = config['configurations']['hadoop-env']['hdfs_tmp_dir']
 
-hadoop_metrics2_properties_content = 
config['configurations']['hadoop-metrics2.properties']['content']
-
 # hadoop default params
 mapreduce_libs_path = "/usr/lib/hadoop-mapreduce/*"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/181de178/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
index ff52b31..ba9c8fb 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
@@ -101,7 +101,7 @@ def setup_hadoop():
   File(os.path.join(params.hadoop_conf_dir, "hadoop-metrics2.properties"),
owner=params.hdfs_user,
group=params.user_group,
-   content=InlineTemplate(params.hadoop_metrics2_properties_content)
+   content=Template("hadoop-metrics2.properties.j2")
   )
 
 if params.dfs_type == 'HCFS' and params.has_core_site and 'ECS_CLIENT' in 
params.component_list:



[06/35] ambari git commit: AMBARI-18361. All classes recompiled due to Maven bug, even if none changed. (Attila Doroszlai via stoader)

2016-09-14 Thread ncole
AMBARI-18361. All classes recompiled due to Maven bug, even if none changed. 
(Attila Doroszlai via stoader)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 3638a5b42034a0d05f2496b683dd1eec25380eed
Parents: e16d916
Author: Attila Doroszlai 
Authored: Tue Sep 13 10:38:40 2016 +0200
Committer: Toader, Sebastian 
Committed: Tue Sep 13 10:38:40 2016 +0200

--
 ambari-server/pom.xml | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3638a5b4/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 45d3ce4..323ce22 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -104,7 +104,10 @@
   
   
 maven-compiler-plugin
-3.0
+3.2
+
+  false
+
   
   
 org.apache.maven.plugins



[21/35] ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread ncole
http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/rack_awareness.py
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/rack_awareness.py
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/rack_awareness.py
new file mode 100644
index 000..548f051
--- /dev/null
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/rack_awareness.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+from resource_management.core.resources import File
+from resource_management.core.source import StaticFile, Template
+from resource_management.libraries.functions import format
+
+
+def create_topology_mapping():
+  import params
+
+  File(params.net_topology_mapping_data_file_path,
+   content=Template("topology_mappings.data.j2"),
+   owner=params.hdfs_user,
+   group=params.user_group,
+   only_if=format("test -d {net_topology_script_dir}"))
+
+def create_topology_script():
+  import params
+
+  File(params.net_topology_script_file_path,
+   content=StaticFile('topology_script.py'),
+   mode=0755,
+   only_if=format("test -d {net_topology_script_dir}"))
+
+def create_topology_script_and_mapping():
+  import params
+  if params.has_hadoop_env:
+create_topology_mapping()
+create_topology_script()

http://git-wip-us.apache.org/repos/asf/ambari/blob/37e71db7/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
new file mode 100644
index 000..ba9c8fb
--- /dev/null
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/scripts/shared_initialization.py
@@ -0,0 +1,175 @@
+"""
+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 os
+from resource_management.libraries.providers.hdfs_resource import WebHDFSUtil
+
+from resource_management import *
+
+def setup_hadoop():
+  """
+  Setup hadoop files and directories
+  """
+  import params
+
+  Execute(("setenforce","0"),
+  only_if="test -f /selinux/enforce",
+  not_if="(! which getenforce ) || (which getenforce && getenforce | 
grep -q Disabled)",
+  sudo=True,
+  )
+
+  #directories
+  if params.has_namenode or params.dfs_type == 'HCFS':
+Directory(params.hdfs_log_dir_prefix,
+  create_parents = True,
+  owner='root',
+  group=params.user_group,
+  mode=0775,
+  cd_access='a',
+)
+if params.has_namenode:
+  Directory(params.hadoop_pid_dir_prefix,
+  create_parents = True,
+  owner='root',
+  group='root',
+  cd_access='a',
+  )
+Directory(params.hadoop_tmp_dir,
+  create_parents = True,
+  owner=params.hdfs_user,
+  cd_access='a',
+  )
+  #files
+   

[11/35] ambari git commit: AMBARI-18377. Retry Installing Kerberos Clients skips hosts were it failed (if lost heartbeat) (alexantonenko)

2016-09-14 Thread ncole
AMBARI-18377. Retry Installing Kerberos Clients skips hosts were it failed (if 
lost heartbeat) (alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0d84a7bf39f9127889f216ce4c882534a5af
Parents: 3d99106
Author: Alex Antonenko 
Authored: Tue Sep 13 18:07:46 2016 +0300
Committer: Alex Antonenko 
Committed: Tue Sep 13 20:22:15 2016 +0300

--
 .../main/admin/kerberos/step3_controller.js | 54 +++-
 .../app/templates/main/admin/kerberos/step3.hbs |  6 ++
 ambari-web/app/utils/ajax/ajax.js   |  4 ++
 .../app/views/main/admin/kerberos/step3_view.js | 29 -
 .../admin/kerberos/step3_controller_test.js | 66 +++-
 5 files changed, 151 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0d84a7bf/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js
index a244348..15be4f9 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step3_controller.js
@@ -22,7 +22,7 @@ App.KerberosWizardStep3Controller = 
App.KerberosProgressPageController.extend({
   serviceName: 'KERBEROS',
   componentName: 'KERBEROS_CLIENT',
   ignore: undefined,
-
+  heartBeatLostHosts: [],
   commands: ['installKerberos', 'testKerberos'],
 
   loadStep: function () {
@@ -30,6 +30,11 @@ App.KerberosWizardStep3Controller = 
App.KerberosProgressPageController.extend({
 this.enableDisablePreviousSteps();
   },
 
+  clearStep: function() {
+this.get('heartBeatLostHosts').clear();
+this._super();
+  },
+
   installKerberos: function() {
 var self = this;
 this.getKerberosClientState().done(function(data) {
@@ -52,6 +57,21 @@ App.KerberosWizardStep3Controller = 
App.KerberosProgressPageController.extend({
 });
   },
 
+  /**
+   * Get hosts with HEARTBEAT_LOST state.
+   *
+   * @return {$.Deferred.promise} promise
+   */
+  getHeartbeatLostHosts: function() {
+return App.ajax.send({
+  name: 'hosts.heartbeat_lost',
+  sender: this,
+  data: {
+clusterName: App.get('clusterName')
+  }
+});
+  },
+
   getKerberosClientState: function() {
 return App.ajax.send({
   name: 'common.service_component.info',
@@ -116,6 +136,34 @@ App.KerberosWizardStep3Controller = 
App.KerberosProgressPageController.extend({
 if (this.get('showIgnore')) {
   this.set('isSubmitDisabled', !this.get('ignore'));
 }
-  }.observes('ignore', 'showIgnore')
-});
+  }.observes('ignore', 'showIgnore'),
+
+  retryTask: function() {
+this._super();
+// retry from the first task (installKerberos) if there is any host in 
HEARTBEAT_LOST state.
+if (this.get('heartBeatLostHosts').length) {
+  this.get('tasks').setEach('status', 'PENDING');
+  this.get('tasks').setEach('showRetry', false);
+  this.get('heartBeatLostHosts').clear();
+}
+  },
 
+  /**
+   * Check for complete status and determines:
+   *  - if there are any hosts in HEARTBEAT_LOST state. In this case warn 
about hosts and make step FAILED.
+   *
+   * @return {undefined}
+   */
+  statusDidChange: function() {
+var self = this;
+if (this.get('completedStatuses').contains(this.get('status'))) {
+  this.getHeartbeatLostHosts().then(function(data) {
+var hostNames = Em.getWithDefault(data || {}, 'items', 
[]).mapProperty('Hosts.host_name');
+if (hostNames.length) {
+  self.set('heartBeatLostHosts', hostNames.uniq());
+  self.get('tasks').objectAt(0).set('status', 'FAILED');
+}
+  });
+}
+  }.observes('status')
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/0d84a7bf/ambari-web/app/templates/main/admin/kerberos/step3.hbs
--
diff --git a/ambari-web/app/templates/main/admin/kerberos/step3.hbs 
b/ambari-web/app/templates/main/admin/kerberos/step3.hbs
index 7e576b8..c9e0446 100644
--- a/ambari-web/app/templates/main/admin/kerberos/step3.hbs
+++ b/ambari-web/app/templates/main/admin/kerberos/step3.hbs
@@ -76,6 +76,12 @@
 {{view Em.Checkbox classNames="checkbox" 
checkedBinding="ignore"}} {{t 
admin.kerberos.wizard.step3.checkbox.ignoreAndProceed.label}}
 
 {{/if}}
+{{#if view.isHostHeartbeatLost}}
+  

ambari git commit: AMBARI-18385: Add HDF management pack (jluniya)

2016-09-14 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk 0e4515c42 -> 752e7c463


AMBARI-18385: Add HDF management pack (jluniya)


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

Branch: refs/heads/trunk
Commit: 752e7c46391e1a50f99ab5e3513dfdfc813f6228
Parents: 0e4515c
Author: Jayush Luniya 
Authored: Wed Sep 14 10:03:07 2016 -0700
Committer: Jayush Luniya 
Committed: Wed Sep 14 10:03:07 2016 -0700

--
 .../NIFI/1.0.0/configuration/nifi-ambari-config.xml  | 3 +--
 .../NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml  | 3 +--
 .../NIFI/1.0.0/configuration/nifi-authorizers-env.xml| 3 +--
 .../NIFI/1.0.0/configuration/nifi-bootstrap-env.xml  | 3 +--
 .../configuration/nifi-bootstrap-notification-services-env.xml   | 4 ++--
 .../common-services/NIFI/1.0.0/configuration/nifi-env.xml| 3 +--
 .../common-services/NIFI/1.0.0/configuration/nifi-flow-env.xml   | 3 +--
 .../1.0.0/configuration/nifi-login-identity-providers-env.xml| 3 +--
 .../NIFI/1.0.0/configuration/nifi-node-logback-env.xml   | 3 +--
 .../NIFI/1.0.0/configuration/nifi-state-management-env.xml   | 3 +--
 .../NIFI/1.0.0/configuration/ranger-nifi-audit.xml   | 3 +--
 .../NIFI/1.0.0/configuration/ranger-nifi-policymgr-ssl.xml   | 3 +--
 .../NIFI/1.0.0/configuration/ranger-nifi-security.xml| 3 +--
 13 files changed, 14 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/752e7c46/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
index 743fda0..adb9b41 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-config.xml
@@ -1,4 +1,5 @@
 
+
 
-
-
 
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/752e7c46/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
index 272535f..09f2b9b 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-ambari-ssl-config.xml
@@ -1,4 +1,5 @@
 
+
 
-
-
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/752e7c46/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
index e6505aa..2f1d670 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-authorizers-env.xml
@@ -1,4 +1,5 @@
 
+
 
-
-
 
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/752e7c46/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-bootstrap-env.xml
--
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-bootstrap-env.xml
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/common-services/NIFI/1.0.0/configuration/nifi-bootstrap-env.xml
index ea4e919..90999a6 100644
--- 

[1/2] ambari git commit: AMBARI-18365. Add Ambari configuration options to support Kerberos token authentication (rlevas)

2016-09-14 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 3ebb8d496 -> 170b29340


AMBARI-18365. Add Ambari configuration options to support Kerberos token 
authentication (rlevas)


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

Branch: refs/heads/branch-2.5
Commit: 170b293403ec4fa11353b58d95c65dc5761bb989
Parents: c0e0a53
Author: Robert Levas 
Authored: Wed Sep 14 12:09:20 2016 -0400
Committer: Robert Levas 
Committed: Wed Sep 14 12:09:51 2016 -0400

--
 .../server/configuration/Configuration.java | 183 ++-
 .../AmbariKerberosAuthenticationProperties.java | 161 
 .../server/configuration/ConfigurationTest.java | 136 +-
 ...ariKerberosAuthenticationPropertiesTest.java |  85 +
 4 files changed, 563 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/170b2934/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 fa0f784..b70c5f4 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
@@ -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
@@ -56,7 +56,9 @@ import org.apache.ambari.server.orm.PersistenceType;
 import org.apache.ambari.server.orm.dao.HostRoleCommandStatusSummaryDTO;
 import org.apache.ambari.server.orm.entities.StageEntity;
 import org.apache.ambari.server.security.ClientSecurityType;
+import 
org.apache.ambari.server.security.authentication.kerberos.AmbariKerberosAuthenticationProperties;
 import org.apache.ambari.server.security.authorization.LdapServerProperties;
+import org.apache.ambari.server.security.authorization.UserType;
 import 
org.apache.ambari.server.security.authorization.jwt.JwtAuthenticationProperties;
 import org.apache.ambari.server.security.encryption.CertificateUtils;
 import org.apache.ambari.server.security.encryption.CredentialProvider;
@@ -68,6 +70,7 @@ import org.apache.ambari.server.utils.DateUtils;
 import org.apache.ambari.server.utils.HostUtils;
 import org.apache.ambari.server.utils.Parallel;
 import org.apache.ambari.server.utils.ShellCommandUtil;
+import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.DefaultParser;
@@ -1312,6 +1315,49 @@ public class Configuration {
   public static final ConfigurationProperty 
JWT_ORIGINAL_URL_QUERY_PARAM = new ConfigurationProperty<>(
   "authentication.jwt.originalUrlParamName", "originalUrl");
 
+  /* 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+   * Kerberos authentication-specific properties
+   * 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 */
+  /**
+   * Determines whether to use Kerberos (SPNEGO) authentication when 
connecting Ambari.
+   */
+  @Markdown(description = "Determines whether to use Kerberos (SPNEGO) 
authentication when connecting Ambari.")
+  public static final ConfigurationProperty KERBEROS_AUTH_ENABLED = 
new ConfigurationProperty<>(
+  "authentication.kerberos.enabled", Boolean.FALSE);
+
+  /**
+   * The Kerberos principal name to use when verifying user-supplied Kerberos 
tokens for authentication via SPNEGO.
+   */
+  @Markdown(description = "The Kerberos principal name to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
+  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_PRINCIPAL = new ConfigurationProperty<>(
+  "authentication.kerberos.spnego.principal", "HTTP/_HOST");
+
+  /**
+   * The Kerberos identity to use when verifying user-supplied Kerberos tokens 
for authentication via SPNEGO.
+   */
+  @Markdown(description = "The Kerberos keytab file to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
+  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_KEYTAB_FILE = new ConfigurationProperty<>(
+  "authentication.kerberos.spnego.keytab.file", 
"/etc/security/keytabs/spnego.service.keytab");
+
+  /**
+   * A 

[2/2] ambari git commit: Revert "AMBARI-18365. Add Ambari configuration options to support Kerberos token authentication (rlevas)"

2016-09-14 Thread rlevas
Revert "AMBARI-18365. Add Ambari configuration options to support Kerberos 
token authentication (rlevas)"

This reverts commit 70d2223a9bb39da3a9b8d7eaf05bbad3698a92c0.


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

Branch: refs/heads/branch-2.5
Commit: c0e0a5331889d4a7578d54dee15e9cd0396e
Parents: 3ebb8d4
Author: Robert Levas 
Authored: Wed Sep 14 12:08:39 2016 -0400
Committer: Robert Levas 
Committed: Wed Sep 14 12:09:51 2016 -0400

--
 .../server/configuration/Configuration.java | 183 +--
 .../server/configuration/ConfigurationTest.java | 136 +-
 2 files changed, 2 insertions(+), 317 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c0e0a533/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 b70c5f4..fa0f784 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
@@ -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
@@ -56,9 +56,7 @@ import org.apache.ambari.server.orm.PersistenceType;
 import org.apache.ambari.server.orm.dao.HostRoleCommandStatusSummaryDTO;
 import org.apache.ambari.server.orm.entities.StageEntity;
 import org.apache.ambari.server.security.ClientSecurityType;
-import 
org.apache.ambari.server.security.authentication.kerberos.AmbariKerberosAuthenticationProperties;
 import org.apache.ambari.server.security.authorization.LdapServerProperties;
-import org.apache.ambari.server.security.authorization.UserType;
 import 
org.apache.ambari.server.security.authorization.jwt.JwtAuthenticationProperties;
 import org.apache.ambari.server.security.encryption.CertificateUtils;
 import org.apache.ambari.server.security.encryption.CredentialProvider;
@@ -70,7 +68,6 @@ import org.apache.ambari.server.utils.DateUtils;
 import org.apache.ambari.server.utils.HostUtils;
 import org.apache.ambari.server.utils.Parallel;
 import org.apache.ambari.server.utils.ShellCommandUtil;
-import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.DefaultParser;
@@ -1315,49 +1312,6 @@ public class Configuration {
   public static final ConfigurationProperty 
JWT_ORIGINAL_URL_QUERY_PARAM = new ConfigurationProperty<>(
   "authentication.jwt.originalUrlParamName", "originalUrl");
 
-  /* 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-   * Kerberos authentication-specific properties
-   * 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 */
-  /**
-   * Determines whether to use Kerberos (SPNEGO) authentication when 
connecting Ambari.
-   */
-  @Markdown(description = "Determines whether to use Kerberos (SPNEGO) 
authentication when connecting Ambari.")
-  public static final ConfigurationProperty KERBEROS_AUTH_ENABLED = 
new ConfigurationProperty<>(
-  "authentication.kerberos.enabled", Boolean.FALSE);
-
-  /**
-   * The Kerberos principal name to use when verifying user-supplied Kerberos 
tokens for authentication via SPNEGO.
-   */
-  @Markdown(description = "The Kerberos principal name to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
-  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_PRINCIPAL = new ConfigurationProperty<>(
-  "authentication.kerberos.spnego.principal", "HTTP/_HOST");
-
-  /**
-   * The Kerberos identity to use when verifying user-supplied Kerberos tokens 
for authentication via SPNEGO.
-   */
-  @Markdown(description = "The Kerberos keytab file to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
-  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_KEYTAB_FILE = new ConfigurationProperty<>(
-  "authentication.kerberos.spnego.keytab.file", 
"/etc/security/keytabs/spnego.service.keytab");
-
-  /**
-   * A comma-delimited (ordered) list of preferred user types to use when 
finding the Ambari user
-   * account for the user-supplied Kerberos identity 

ambari git commit: AMBARI-18330. Add optional digital clock widget attached to page. (alexantonenko)

2016-09-14 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 092c9cf52 -> 3ebb8d496


AMBARI-18330. Add optional digital clock widget attached to page. 
(alexantonenko)


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

Branch: refs/heads/branch-2.5
Commit: 3ebb8d496c3be688bf81c2a8102372c089b9c547
Parents: 092c9cf
Author: Alex Antonenko 
Authored: Wed Sep 7 13:13:07 2016 +0300
Committer: Alex Antonenko 
Committed: Wed Sep 14 18:35:43 2016 +0300

--
 ambari-web/app/config.js  |  2 ++
 ambari-web/app/styles/application.less| 19 ---
 ambari-web/app/templates/application.hbs  |  5 +++
 ambari-web/app/views.js   |  1 +
 ambari-web/app/views/common/clock_view.js | 46 ++
 5 files changed, 69 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3ebb8d49/ambari-web/app/config.js
--
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 06faf27..4550eb8 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -61,6 +61,8 @@ App.healthStatusOrange = '#FF8E00';
 App.inactivityRemainTime = 60; // in seconds
 App.enableLogger = true;
 App.stackVersionsAvailable = true;
+App.upgradeHistoryAvailable = false;
+App.enableDigitalClock = false;
 
 // experimental features are automatically enabled if running on brunch server
 App.enableExperimental = false;

http://git-wip-us.apache.org/repos/asf/ambari/blob/3ebb8d49/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 7fb5639..b2b4dd1 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -48,6 +48,16 @@ ul.typeahead.dropdown-menu {
   overflow: visible;
   padding-bottom: @footer-height;
   min-width: 980px;
+
+   .clock-view {
+ top: 10px;
+ left: 4px;
+ position: fixed;
+ color: red;
+ font-weight: bold;
+ padding: 4px;
+ background-color: rgba(0, 0, 0, 0.6);
+  }
 }
 
 footer {
@@ -381,6 +391,7 @@ footer {
   .navbar .nav .top-nav-user > li.right {
 float: right;
   }
+
 }
 
 .nav.top-nav-menu,
@@ -6216,7 +6227,7 @@ input[type="radio"].align-checkbox, 
input[type="checkbox"].align-checkbox {
 padding: 5px 25px;
   }
   .right-stack-info {
-margin-left: 0px;
+margin-left: 0;
 .available-repos-dropdown {
   a, a.disbled{
 cursor: pointer;
@@ -6282,7 +6293,7 @@ input[type="radio"].align-checkbox, 
input[type="checkbox"].align-checkbox {
 background-color: #f0f0f0;
 font-weight: bold;
 p {
-  margin-bottom: 0px;
+  margin-bottom: 0;
   display: block;
   padding: 8px 15px;
 }
@@ -6378,7 +6389,7 @@ input[type="radio"].align-checkbox, 
input[type="checkbox"].align-checkbox {
 }
 #use-redhat, #skip-validation {
   input{
-margin: 0px 10px;
+margin: 0 10px;
   }
 }
 #use-redhat span.disabled {
@@ -6416,7 +6427,7 @@ input[type="radio"].align-checkbox, 
input[type="checkbox"].align-checkbox {
 background-image: linear-gradient(top, #fdfdfd, #e3e3e3);
   }
   &.is_selected {
-margin-left: 0px;
+margin-left: 0;
   }
 }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/3ebb8d49/ambari-web/app/templates/application.hbs
--
diff --git a/ambari-web/app/templates/application.hbs 
b/ambari-web/app/templates/application.hbs
index 6fd9a31..05c4122 100644
--- a/ambari-web/app/templates/application.hbs
+++ b/ambari-web/app/templates/application.hbs
@@ -17,6 +17,11 @@
 }}
 
 
+  {{#if App.enableDigitalClock}}
+{{view App.ClockView}}
+  {{/if}}
+
+
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/3ebb8d49/ambari-web/app/views.js
--
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index a347487..c8a8784 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -20,6 +20,7 @@
 // load all views here
 
 require('views/application');
+require('views/common/clock_view');
 require('views/common/log_search_ui_link_view');
 require('views/common/log_file_search_view');
 require('views/common/log_tail_view');

http://git-wip-us.apache.org/repos/asf/ambari/blob/3ebb8d49/ambari-web/app/views/common/clock_view.js

ambari git commit: AMBARI-18209. UI: add missing unit tests for models (alexantonenko)

2016-09-14 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 a4f749429 -> 092c9cf52


AMBARI-18209. UI: add missing unit tests for models (alexantonenko)


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

Branch: refs/heads/branch-2.5
Commit: 092c9cf52edebb84817dcb0b5302608c83b24998
Parents: a4f7494
Author: Alex Antonenko 
Authored: Fri Aug 19 14:42:46 2016 +0300
Committer: Alex Antonenko 
Committed: Wed Sep 14 18:28:33 2016 +0300

--
 ambari-web/app/assets/test/tests.js |   8 +
 ambari-web/app/models/client_component.js   |   8 +-
 ambari-web/app/models/cluster.js|   2 +-
 ambari-web/app/models/master_component.js   |   2 +-
 ambari-web/app/models/root_service.js   |   2 +-
 ambari-web/app/models/slave_component.js|   2 +-
 ambari-web/app/models/widget_property.js|  11 +-
 ambari-web/test/models/client_component_test.js | 115 +++
 ambari-web/test/models/cluster_test.js  |  89 ++
 ambari-web/test/models/master_component_test.js |  59 
 ambari-web/test/models/root_service_test.js |  78 +
 ambari-web/test/models/slave_component_test.js  |  59 
 ambari-web/test/models/stack_test.js| 226 +
 ambari-web/test/models/widget_property_test.js  | 320 +++
 ambari-web/test/models/widget_test.js   |  70 
 15 files changed, 1036 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/092c9cf5/ambari-web/app/assets/test/tests.js
--
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index 34f0db8..3e52d35 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -362,17 +362,25 @@ var files = [
   'test/models/alerts/alert_group_test',
   'test/models/alerts/alert_instance_test',
   'test/models/authentication_test',
+  'test/models/client_component_test',
   'test/models/cluster_states_test',
+  'test/models/cluster_test',
   'test/models/form_test',
   'test/models/host_test',
   'test/models/host_component_test',
   'test/models/hosts_test',
+  'test/models/master_component_test',
   'test/models/operating_system_test',
   'test/models/repository_test',
+  'test/models/root_service_test',
   'test/models/stack_service_component_test',
   'test/models/service_test',
+  'test/models/slave_component_test',
+  'test/models/stack_test',
   'test/models/stack_service_test',
   'test/models/user_test',
+  'test/models/widget_test',
+  'test/models/widget_property_test',
   'test/models/host_stack_version_test',
   'test/models/upgrade_entity_test',
   'test/models/configs/sub_section_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/092c9cf5/ambari-web/app/models/client_component.js
--
diff --git a/ambari-web/app/models/client_component.js 
b/ambari-web/app/models/client_component.js
index 19ef7ce..50a3bb6 100644
--- a/ambari-web/app/models/client_component.js
+++ b/ambari-web/app/models/client_component.js
@@ -37,19 +37,19 @@ App.ClientComponent = DS.Model.extend({
*
* @type {boolean}
*/
-  allowToDelete: function() {
+  allowToDelete: function () {
 return this.get('totalCount') === (this.get('installedCount') + 
this.get('installFailedCount') + this.get('initCount') + 
this.get('unknownCount'));
   }.property('totalCount', 'installedCount', 'installFailedCount', 
'initCount', 'unknownCount'),
 
-  summaryLabelClassName:function(){
+  summaryLabelClassName: function () {
 return 'label_for_'+this.get('componentName').toLowerCase();
   }.property('componentName'),
 
-  summaryValueClassName:function(){
+  summaryValueClassName: function () {
 return 'value_for_'+this.get('componentName').toLowerCase();
   }.property('componentName'),
 
-  displayNamePluralized: function() {
+  displayNamePluralized: function () {
 return stringUtils.pluralize(this.get('installedCount'), 
this.get('displayName'));
   }.property('installedCount')
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/092c9cf5/ambari-web/app/models/cluster.js
--
diff --git a/ambari-web/app/models/cluster.js b/ambari-web/app/models/cluster.js
index a571a28..57f91ee 100644
--- a/ambari-web/app/models/cluster.js
+++ b/ambari-web/app/models/cluster.js
@@ -35,7 +35,7 @@ App.Cluster = DS.Model.extend({
 
   isKerberosEnabled: Em.computed.equal('securityType', 'KERBEROS'),
 
-  isCredentialStorePersistent: 

ambari git commit: AMBARI-18158. Add UI unit tests for App.HttpClient (alexantonenko)

2016-09-14 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 e01fb6019 -> a4f749429


AMBARI-18158. Add UI unit tests for App.HttpClient (alexantonenko)


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

Branch: refs/heads/branch-2.5
Commit: a4f74942972908f29663de07c4b9818854b538f0
Parents: e01fb60
Author: Alex Antonenko 
Authored: Tue Aug 16 13:00:43 2016 +0300
Committer: Alex Antonenko 
Committed: Wed Sep 14 18:26:07 2016 +0300

--
 ambari-web/app/assets/test/tests.js |   1 +
 ambari-web/app/utils/http_client.js |  55 +--
 .../global/errors_handler_controller_test.js|   1 +
 ambari-web/test/utils/http_client_test.js   | 433 +++
 4 files changed, 451 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a4f74942/ambari-web/app/assets/test/tests.js
--
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index 005c97b..34f0db8 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -195,6 +195,7 @@ var files = [
   'test/utils/heatmap_test',
   'test/utils/host_progress_popup_test',
   'test/utils/hosts_test',
+  'test/utils/http_client_test',
   'test/utils/misc_test',
   'test/utils/number_utils_test',
   'test/utils/polling_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/a4f74942/ambari-web/app/utils/http_client.js
--
diff --git a/ambari-web/app/utils/http_client.js 
b/ambari-web/app/utils/http_client.js
index 6b94d81..dbfc640 100644
--- a/ambari-web/app/utils/http_client.js
+++ b/ambari-web/app/utils/http_client.js
@@ -49,32 +49,10 @@ App.HttpClient = Em.Object.create({
* @param {string} url
* @param {Object} ajaxOptions
* @param {App.ServerDataMapper} mapper - json processor
+   * @param {boolean} isGetAsPost - if true, do POST-request equal to 
GET-request but with some params put to body
* @param {callback} errorHandler
*/
-  request: function (url, ajaxOptions, mapper, errorHandler) {
-
-if (!errorHandler) {
-  errorHandler = this.defaultErrorHandler;
-}
-
-var xhr = new XMLHttpRequest();
-var curTime = App.dateTime();
-
-xhr.open('GET', url + (url.indexOf('?') >= 0 ? '&_=' : '?_=') + curTime, 
true);
-xhr.send(null);
-
-this.onReady(xhr, "", ajaxOptions, mapper, errorHandler, url);
-  },
-
-  /**
-   * Do POST-request equal to GET-request but with some params put to body
-   * @param {string} url
-   * @param {{params: string, success: callback, error: callback}} ajaxOptions
-   * @param {App.QuickDataMapper} mapper
-   * @param errorHandler
-   * @method getAsPostRequest
-   */
-  getAsPostRequest: function (url, ajaxOptions, mapper, errorHandler) {
+  request: function (url, ajaxOptions, mapper, errorHandler, isGetAsPost) {
 
 if (!errorHandler) {
   errorHandler = this.defaultErrorHandler;
@@ -82,19 +60,22 @@ App.HttpClient = Em.Object.create({
 
 var xhr = new XMLHttpRequest(),
   curTime = App.dateTime(),
-  params = JSON.stringify({
-"RequestInfo": {"query" : ajaxOptions.params }
-  });
-
-xhr.open('POST', url + (url.indexOf('?') >= 0 ? '&_=' : '?_=') + curTime, 
true);
-xhr.setRequestHeader("X-Http-Method-Override", "GET");
-xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+  method = isGetAsPost ? 'POST': 'GET',
+  params = isGetAsPost ? JSON.stringify({
+"RequestInfo": {"query" : ajaxOptions.params}
+  }) : null;
+
+xhr.open(method, url + (url.indexOf('?') >= 0 ? '&_=' : '?_=') + curTime, 
true);
+if (isGetAsPost) {
+  xhr.setRequestHeader("X-Http-Method-Override", "GET");
+  xhr.setRequestHeader("Content-type", 
"application/x-www-form-urlencoded");
+}
 xhr.send(params);
 
 this.onReady(xhr, "", ajaxOptions, mapper, errorHandler, url);
   },
 
-  /*
+  /**
This function checks if we get response from server
Not using onreadystatechange cuz of possible closure
*/
@@ -140,12 +121,8 @@ App.HttpClient = Em.Object.create({
 }
 var client = this,
   request = function () {
-if (data.doGetAsPost && !App.get('testMode')) {
-  client.getAsPostRequest(url, data, mapper, errorHandler);
-}
-else {
-  client.request(url, data, mapper, errorHandler);
-}
+var isGetAsPost = Boolean(data.doGetAsPost && !App.get('testMode'));
+client.request(url, data, mapper, errorHandler, 

ambari git commit: AMBARI-18320. Frequently getting an Ambari consistency check error when changing configuration (alexantonenko)

2016-09-14 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 70d2223a9 -> e01fb6019


AMBARI-18320. Frequently getting an Ambari consistency check error when 
changing configuration (alexantonenko)


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

Branch: refs/heads/branch-2.5
Commit: e01fb601997c126ac68dc2a656ad99420f46dc85
Parents: 70d2223
Author: Alex Antonenko 
Authored: Tue Sep 6 17:57:23 2016 +0300
Committer: Alex Antonenko 
Committed: Wed Sep 14 18:25:01 2016 +0300

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/e01fb601/ambari-web/app/controllers/main/service/info/configs.js
--
diff --git a/ambari-web/app/controllers/main/service/info/configs.js 
b/ambari-web/app/controllers/main/service/info/configs.js
index 095bdc7..31ea248 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -301,7 +301,10 @@ App.MainServiceInfoConfigsController = 
Em.Controller.extend(App.AddSecurityConfi
   loadStep: function () {
 var serviceName = this.get('content.serviceName'), self = this;
 this.clearStep();
-this.set('dependentServiceNames', 
App.StackService.find(serviceName).get('dependentServiceNames'));
+this.set('dependentServiceNames', 
(App.StackService.find(serviceName).get('dependentServiceNames') || 
[]).reduce(function(acc, i) {
+  acc.push(i);
+  return Array.prototype.concat.apply(acc, 
App.StackService.find(i).get('dependentServiceNames').toArray()).without(serviceName).uniq();
+}, []));
 this.loadConfigTheme(serviceName).always(function () {
   if (self.get('preSelectedConfigVersion')) {
 self.loadPreSelectedConfigVersion();



ambari git commit: AMBARI-18365. Add Ambari configuration options to support Kerberos token authentication (rlevas)

2016-09-14 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 468589ae7 -> 70d2223a9


AMBARI-18365. Add Ambari configuration options to support Kerberos token 
authentication (rlevas)


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

Branch: refs/heads/branch-2.5
Commit: 70d2223a9bb39da3a9b8d7eaf05bbad3698a92c0
Parents: 468589a
Author: Robert Levas 
Authored: Wed Sep 14 11:13:50 2016 -0400
Committer: Robert Levas 
Committed: Wed Sep 14 11:13:54 2016 -0400

--
 .../server/configuration/Configuration.java | 183 ++-
 .../server/configuration/ConfigurationTest.java | 136 +-
 2 files changed, 317 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/70d2223a/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 fa0f784..b70c5f4 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
@@ -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
@@ -56,7 +56,9 @@ import org.apache.ambari.server.orm.PersistenceType;
 import org.apache.ambari.server.orm.dao.HostRoleCommandStatusSummaryDTO;
 import org.apache.ambari.server.orm.entities.StageEntity;
 import org.apache.ambari.server.security.ClientSecurityType;
+import 
org.apache.ambari.server.security.authentication.kerberos.AmbariKerberosAuthenticationProperties;
 import org.apache.ambari.server.security.authorization.LdapServerProperties;
+import org.apache.ambari.server.security.authorization.UserType;
 import 
org.apache.ambari.server.security.authorization.jwt.JwtAuthenticationProperties;
 import org.apache.ambari.server.security.encryption.CertificateUtils;
 import org.apache.ambari.server.security.encryption.CredentialProvider;
@@ -68,6 +70,7 @@ import org.apache.ambari.server.utils.DateUtils;
 import org.apache.ambari.server.utils.HostUtils;
 import org.apache.ambari.server.utils.Parallel;
 import org.apache.ambari.server.utils.ShellCommandUtil;
+import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.DefaultParser;
@@ -1312,6 +1315,49 @@ public class Configuration {
   public static final ConfigurationProperty 
JWT_ORIGINAL_URL_QUERY_PARAM = new ConfigurationProperty<>(
   "authentication.jwt.originalUrlParamName", "originalUrl");
 
+  /* 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+   * Kerberos authentication-specific properties
+   * 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 */
+  /**
+   * Determines whether to use Kerberos (SPNEGO) authentication when 
connecting Ambari.
+   */
+  @Markdown(description = "Determines whether to use Kerberos (SPNEGO) 
authentication when connecting Ambari.")
+  public static final ConfigurationProperty KERBEROS_AUTH_ENABLED = 
new ConfigurationProperty<>(
+  "authentication.kerberos.enabled", Boolean.FALSE);
+
+  /**
+   * The Kerberos principal name to use when verifying user-supplied Kerberos 
tokens for authentication via SPNEGO.
+   */
+  @Markdown(description = "The Kerberos principal name to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
+  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_PRINCIPAL = new ConfigurationProperty<>(
+  "authentication.kerberos.spnego.principal", "HTTP/_HOST");
+
+  /**
+   * The Kerberos identity to use when verifying user-supplied Kerberos tokens 
for authentication via SPNEGO.
+   */
+  @Markdown(description = "The Kerberos keytab file to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
+  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_KEYTAB_FILE = new ConfigurationProperty<>(
+  "authentication.kerberos.spnego.keytab.file", 
"/etc/security/keytabs/spnego.service.keytab");
+
+  /**
+   * A comma-delimited (ordered) list of preferred user types to use when 
finding the Ambari user
+   * account for the user-supplied Kerberos 

[2/2] ambari git commit: AMBARI-15538. Support service-specific repo for add-on services. (Balazs Bence Sari via stoader).

2016-09-14 Thread stoader
AMBARI-15538. Support service-specific repo for add-on services. (Balazs Bence 
Sari via stoader).


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

Branch: refs/heads/trunk
Commit: 0e4515c42ba950ee73bd6511b43cc8eec7481348
Parents: 2ad4207
Author: Balazs Bence Sari 
Authored: Wed Sep 14 16:17:21 2016 +0200
Committer: Toader, Sebastian 
Committed: Wed Sep 14 16:17:47 2016 +0200

--
 .../checks/DatabaseConsistencyCheckHelper.java  |   1 +
 .../AmbariManagementControllerImpl.java |  13 +-
 .../ambari/server/controller/AmbariServer.java  |   2 +
 .../VersionDefinitionResourceProvider.java  |  18 +-
 .../apache/ambari/server/stack/RepoUtil.java| 207 +++
 .../ambari/server/stack/ServiceModule.java  |   7 +
 .../ambari/server/stack/StackDirectory.java |  28 +--
 .../apache/ambari/server/stack/StackModule.java | 133 ++--
 .../server/stack/StackServiceDirectory.java |  70 ++-
 .../stack/UpdateActiveRepoVersionOnStartup.java | 118 +++
 .../ambari/server/state/RepositoryInfo.java |  76 ++-
 .../apache/ambari/server/state/StackInfo.java   |  13 +-
 .../stack/upgrade/RepositoryVersionHelper.java  |  28 ++-
 .../src/main/resources/version_definition.xsd   |  24 +--
 .../ambari/server/stack/RepoUtilTest.java   | 166 +++
 .../stack/StackManagerCommonServicesTest.java   |  20 ++
 .../ambari/server/stack/StackModuleTest.java| 188 +
 .../UpdateActiveRepoVersionOnStartupTest.java   | 143 +
 .../ADDON/1.0/configuration/addon-env.xml   |  35 
 .../common-services/ADDON/1.0/metainfo.xml  |  35 
 ...veRepoVersionOnStartupTest_initialRepos.json |  32 +++
 .../HDP/0.2/services/ADDON/metainfo.xml |  28 +++
 .../HDP/0.2/services/ADDON/repos/repoinfo.xml   |  26 +++
 .../8.0.0/configuration/microsoft-r-env.xml |  35 
 .../8.0.0/package/scripts/microsoft_r.py|  22 +-
 .../MICROSOFT_R/8.0.0/repos/repoinfo.xml|  33 +++
 26 files changed, 1412 insertions(+), 89 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
index 7403dba..cee6c47 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/DatabaseConsistencyCheckHelper.java
@@ -563,6 +563,7 @@ public class DatabaseConsistencyCheckHelper {
 String stackVersion = stackInfo.get(stackName);
 Map serviceInfoMap = 
ambariMetaInfo.getServices(stackName, stackVersion);
 for (String serviceName : serviceNames) {
+  LOG.info("Processing {}-{} / {}", stackName, stackVersion, 
serviceName);
   ServiceInfo serviceInfo = serviceInfoMap.get(serviceName);
   if (serviceInfo != null) {
 Set configTypes = 
serviceInfo.getConfigTypeAttributes().keySet();

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/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 90d2162..1fc9dbf 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
@@ -142,6 +142,7 @@ import org.apache.ambari.server.security.ldap.LdapSyncDto;
 import 
org.apache.ambari.server.serveraction.kerberos.KerberosInvalidConfigurationException;
 import 
org.apache.ambari.server.serveraction.kerberos.KerberosOperationException;
 import org.apache.ambari.server.stack.ExtensionHelper;
+import org.apache.ambari.server.stack.RepoUtil;
 import org.apache.ambari.server.stageplanner.RoleGraph;
 import org.apache.ambari.server.stageplanner.RoleGraphFactory;
 import org.apache.ambari.server.state.Cluster;
@@ -208,6 +209,7 @@ import com.google.inject.Inject;
 import com.google.inject.Injector;
 import 

[1/2] ambari git commit: AMBARI-15538. Support service-specific repo for add-on services. (Balazs Bence Sari via stoader).

2016-09-14 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/trunk 2ad42074f -> 0e4515c42


http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/ambari-server/src/test/resources/stacks_with_common_services/HDP/0.2/services/ADDON/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/test/resources/stacks_with_common_services/HDP/0.2/services/ADDON/repos/repoinfo.xml
 
b/ambari-server/src/test/resources/stacks_with_common_services/HDP/0.2/services/ADDON/repos/repoinfo.xml
new file mode 100644
index 000..8d7c255
--- /dev/null
+++ 
b/ambari-server/src/test/resources/stacks_with_common_services/HDP/0.2/services/ADDON/repos/repoinfo.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+http:add.on/repo
+ADDON_REPO-1.0
+ADDON_REPO
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/configuration/microsoft-r-env.xml
--
diff --git 
a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/configuration/microsoft-r-env.xml
 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/configuration/microsoft-r-env.xml
new file mode 100644
index 000..5bc4a31
--- /dev/null
+++ 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/configuration/microsoft-r-env.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+R Open Version
+Version of R Open
+Version of R Open
+3.2.2
+
+string
+false
+
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
--
diff --git 
a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
index 61ea96b..382bd0f 100644
--- 
a/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
+++ 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/common-services/MICROSOFT_R/8.0.0/package/scripts/microsoft_r.py
@@ -19,30 +19,24 @@ limitations under the License.
 """
 from resource_management.libraries.script import Script
 from resource_management.core.logger import Logger
-from resource_management.core.source import DownloadSource
-from resource_management.core.resources import File, Package
+from resource_management.core.resources import Package
 
-rpm_location = 'http://104.196.87.250/msft-r/8.1/'
-rpms = ['microsoft-r-server-mro-8.0.rpm',
-'microsoft-r-server-intel-mkl-8.0.rpm',
-'microsoft-r-server-packages-8.0.rpm',
-'microsoft-r-server-hadoop-8.0.rpm']
+
+rpms = ['microsoft-r-server-mro-8.0',
+'microsoft-r-server-intel-mkl-8.0',
+'microsoft-r-server-packages-8.0',
+'microsoft-r-server-hadoop-8.0']
 
 class MicrosoftR(Script):
+
   def install(self, env):
 Logger.info('Installing R Server Client...')
 tmp_dir = Script.tmp_dir
 Logger.debug('Using temp dir: {0}'.format(tmp_dir))
-Logger.info("Will download and install the following rpm's from {0}: 
{1}".format(rpm_location, rpms))
 
 for rpm in rpms:
-  Logger.info('Downloading {0}'.format(rpm))
-  rpmFile = '{0}/{1}'.format(tmp_dir, rpm)
-  File(rpmFile, \
-   content = DownloadSource(rpm_location + rpm), \
-   mode = 0644)
   Logger.info('Installing {0}'.format(rpm))
-  Package(rpmFile)
+  Package(rpm)
 
 Logger.info('Installed R Server')
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0e4515c4/contrib/management-packs/microsoft-r_mpack/src/main/resources/custom-services/MICROSOFT_R/8.0.0/repos/repoinfo.xml
--
diff --git 
a/contrib/management-packs/microsoft-r_mpack/src/main/resources/custom-services/MICROSOFT_R/8.0.0/repos/repoinfo.xml
 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/custom-services/MICROSOFT_R/8.0.0/repos/repoinfo.xml
new file mode 100644
index 000..4c82514
--- /dev/null
+++ 
b/contrib/management-packs/microsoft-r_mpack/src/main/resources/custom-services/MICROSOFT_R/8.0.0/repos/repoinfo.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+http://104.196.87.250/msft-r/MICROSOFT_R-8.0/
+MSFT_R-8.1
+MSFT_R
+
+
+
+
+http://104.196.87.250/msft-r/MICROSOFT_R-8.0/
+MSFT_R-8.1
+MSFT_R
+

ambari git commit: AMBARI-18177. [UI] Atlas Zookeeper properties should be updated on zookeeper add/remove operations (onechiporenko)

2016-09-14 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 acdde3d5a -> 468589ae7


AMBARI-18177. [UI] Atlas Zookeeper properties should be updated on zookeeper 
add/remove operations (onechiporenko)


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

Branch: refs/heads/branch-2.5
Commit: 468589ae7b2854a7e5fc98790a20dc45e2c7d96c
Parents: acdde3d
Author: Oleg Nechiporenko 
Authored: Wed Aug 17 11:11:06 2016 +0300
Committer: Oleg Nechiporenko 
Committed: Wed Sep 14 16:24:54 2016 +0300

--
 ambari-web/app/controllers/main/host/details.js |  20 +-
 .../configs/add_component_config_initializer.js |  28 +-
 .../app/utils/configs/config_initializer.js |   4 +-
 .../configs/hosts_based_initializer_mixin.js|   3 +-
 .../admin/kerberos/step1_controller_test.js |  10 +-
 .../test/controllers/main/host/details_test.js  |  50 ++
 .../test/utils/configs_collection_test.js   | 136 +++--
 .../common/widget/graph_widget_view_test.js | 552 ++-
 8 files changed, 728 insertions(+), 75 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/468589ae/ambari-web/app/controllers/main/host/details.js
--
diff --git a/ambari-web/app/controllers/main/host/details.js 
b/ambari-web/app/controllers/main/host/details.js
index 1364adf..2076333 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -774,6 +774,7 @@ App.MainHostDetailsController = 
Em.Controller.extend(App.SupportClientConfigsDow
   updateZkConfigs: function (configs) {
 var portValue = configs['zoo.cfg'] && Em.get(configs['zoo.cfg'], 
'clientPort');
 var zkPort = typeof portValue === 'undefined' ? '2181' : portValue;
+var infraSolrZnode = configs['infra-solr-env'] ? 
Em.get(configs['infra-solr-env'], 'infra_solr_znode') : '/ambari-solr';
 var initializer = App.AddZooKeeperComponentsInitializer;
 var hostComponentsTopology = {
   masterComponentHosts: []
@@ -788,7 +789,8 @@ App.MainHostDetailsController = 
Em.Controller.extend(App.SupportClientConfigsDow
   }
 }
 var dependencies = {
-  zkClientPort: zkPort
+  zkClientPort: zkPort,
+  infraSolrZnode: infraSolrZnode
 };
 hostComponentsTopology.masterComponentHosts = masterComponents;
 Em.keys(configs).forEach(function(fileName) {
@@ -1337,6 +1339,10 @@ App.MainHostDetailsController = 
Em.Controller.extend(App.SupportClientConfigsDow
 if (services.someProperty('serviceName', 'KAFKA')) {
   urlParams.push('(type=kafka-broker=' + 
data.Clusters.desired_configs['kafka-broker'].tag + ')');
 }
+if (services.someProperty('serviceName', 'ATLAS')) {
+  urlParams.push('(type=application-properties=' + 
data.Clusters.desired_configs['application-properties'].tag + ')');
+  urlParams.push('(type=infra-solr-env=' + 
data.Clusters.desired_configs['infra-solr-env'].tag + ')');
+}
 return urlParams;
   },
 
@@ -1415,6 +1421,18 @@ App.MainHostDetailsController = 
Em.Controller.extend(App.SupportClientConfigsDow
 }
   );
 }
+if (installedServiceNames.contains('ATLAS')) {
+  groups.push(
+{
+  properties: {
+'application-properties': configs['application-properties']
+  },
+  properties_attributes: {
+'application-properties': attributes['application-properties']
+  }
+}
+  );
+}
 this.saveConfigsBatch(groups, 'ZOOKEEPER_SERVER');
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/468589ae/ambari-web/app/utils/configs/add_component_config_initializer.js
--
diff --git a/ambari-web/app/utils/configs/add_component_config_initializer.js 
b/ambari-web/app/utils/configs/add_component_config_initializer.js
index 6a8ab4c..7e3fedf 100644
--- a/ambari-web/app/utils/configs/add_component_config_initializer.js
+++ b/ambari-web/app/utils/configs/add_component_config_initializer.js
@@ -59,7 +59,10 @@ App.AddComponentConfigInitializer = 
App.HaConfigInitializerClass.extend(App.Host
   'nimbus.seeds': 
this.getHostsListComponentJSONStringifiedConfig('NIMBUS', true),
   'hadoop.proxyuser.{{webhcatUser}}.hosts': 
this.getComponentsHostsConfig(['HIVE_SERVER', 'WEBHCAT_SERVER', 
'HIVE_METASTORE'], false, true),
   'hadoop.proxyuser.{{hiveUser}}.hosts': 
this.getComponentsHostsConfig(['HIVE_SERVER', 'WEBHCAT_SERVER', 
'HIVE_METASTORE'], false, true),
-  'hive.metastore.uris': 

ambari git commit: AMBARI-18379 Cover host views with unit tests. (atkach)

2016-09-14 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk 5beed88e1 -> 2ad42074f


AMBARI-18379 Cover host views with unit tests. (atkach)


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

Branch: refs/heads/trunk
Commit: 2ad42074f1633c5c6f56cf979bdaa49440457566
Parents: 5beed88
Author: Andrii Tkach 
Authored: Tue Sep 13 20:28:41 2016 +0300
Committer: Andrii Tkach 
Committed: Wed Sep 14 16:22:17 2016 +0300

--
 ambari-web/app/assets/test/tests.js |   3 +
 .../app/views/main/host/combo_search_box.js | 294 --
 .../views/main/host/hosts_table_menu_view.js|  14 +-
 ambari-web/app/views/main/host/log_metrics.js   |   2 +-
 .../views/main/host/combo_search_box_test.js| 957 ++-
 .../views/main/host/host_alerts_view_test.js|  23 +-
 .../main/host/hosts_table_menu_view_test.js | 304 ++
 .../test/views/main/host/log_metrics_test.js| 116 +++
 .../test/views/main/host/logs_view_test.js  | 178 
 .../views/main/host/stack_versions_view_test.js |  66 ++
 ambari-web/test/views/main/host/summary_test.js |  91 ++
 11 files changed, 1942 insertions(+), 106 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ad42074/ambari-web/app/assets/test/tests.js
--
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index d2f3637..d918900 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -296,6 +296,9 @@ var files = [
   'test/views/main/host/combo_search_box_test',
   'test/views/main/host/config_service_test',
   'test/views/main/host/add_view_test',
+  'test/views/main/host/logs_view_test',
+  'test/views/main/host/hosts_table_menu_view_test',
+  'test/views/main/host/log_metrics_test',
   'test/views/main/host/config_service_menu_test',
   'test/views/main/host/details/host_component_view_test',
   'test/views/main/host/details/host_component_views/decommissionable_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/2ad42074/ambari-web/app/views/main/host/combo_search_box.js
--
diff --git a/ambari-web/app/views/main/host/combo_search_box.js 
b/ambari-web/app/views/main/host/combo_search_box.js
index f417cc6..2f9900a 100644
--- a/ambari-web/app/views/main/host/combo_search_box.js
+++ b/ambari-web/app/views/main/host/combo_search_box.js
@@ -60,7 +60,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 if (invalidFacet) {
   this.showErrMsg(invalidFacet);
 }
-var tableView = this.get('parentView').get('parentView');
+var tableView = this.get('parentView.parentView');
 App.db.setComboSearchQuery(tableView.get('controller.name'), query);
 var filterConditions = this.createFilterConditions(searchCollection);
 tableView.updateComboFilter(filterConditions);
@@ -87,7 +87,7 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 // Add host component facets only when there isn't any component filter
 // with value other than ALL yet
 var currentComponentFacets = 
this.getComponentStateFacets(hostComponentList, false);
-if (currentComponentFacets.length == 0) {
+if (currentComponentFacets.length === 0) {
   list = list.concat(hostComponentList);
 }
 list = this.filterOutOneFacetOnlyOptions(list);
@@ -105,7 +105,6 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 var controller = App.router.get('mainHostComboSearchBoxController');
 this.showHideClearButton();
 var map = App.router.get('mainHostController.labelValueMap');
-var serviceMap = this.get('serviceMap')
 var facetValue = map[facet] || facet;
 if (controller.isComponentStateFacet(facetValue)) {
   facetValue = 'componentState'
@@ -113,76 +112,153 @@ App.MainHostComboSearchBoxView = Em.View.extend({
 switch (facetValue) {
   case 'hostName':
   case 'ip':
-controller.getPropertySuggestions(facetValue, 
searchTerm).done(function() {
-  callback(controller.get('currentSuggestion').reject(function (item) {
-return visualSearch.searchQuery.values(facet).indexOf(item) >= 0; 
// reject the ones already in search
-  }), {preserveMatches: true});
-});
+this.searchByHostname(facetValue, searchTerm, facet, callback);
 break;
   case 'rack':
-
callback(App.Host.find().toArray().mapProperty('rack').uniq().reject(function 
(item) {
-  return visualSearch.searchQuery.values(facet).indexOf(item) >= 0;
-}));
+

ambari git commit: AMBARI-18365. Add Ambari configuration options to support Kerberos token authentication (rlevas)

2016-09-14 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk a54d60918 -> 5beed88e1


AMBARI-18365. Add Ambari configuration options to support Kerberos token 
authentication (rlevas)


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

Branch: refs/heads/trunk
Commit: 5beed88e1a7ab422d619a445f8f8e892844d5fa4
Parents: a54d609
Author: Robert Levas 
Authored: Wed Sep 14 09:21:14 2016 -0400
Committer: Robert Levas 
Committed: Wed Sep 14 09:21:18 2016 -0400

--
 .../server/configuration/Configuration.java | 181 +++
 .../AmbariKerberosAuthenticationProperties.java | 161 +
 .../server/configuration/ConfigurationTest.java | 136 +-
 ...ariKerberosAuthenticationPropertiesTest.java |  84 +
 4 files changed, 561 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5beed88e/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 0690ca8..b2fa4c0 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
@@ -58,7 +58,9 @@ import org.apache.ambari.server.orm.PersistenceType;
 import org.apache.ambari.server.orm.dao.HostRoleCommandStatusSummaryDTO;
 import org.apache.ambari.server.orm.entities.StageEntity;
 import org.apache.ambari.server.security.ClientSecurityType;
+import 
org.apache.ambari.server.security.authentication.kerberos.AmbariKerberosAuthenticationProperties;
 import org.apache.ambari.server.security.authorization.LdapServerProperties;
+import org.apache.ambari.server.security.authorization.UserType;
 import 
org.apache.ambari.server.security.authorization.jwt.JwtAuthenticationProperties;
 import org.apache.ambari.server.security.encryption.CertificateUtils;
 import org.apache.ambari.server.security.encryption.CredentialProvider;
@@ -71,6 +73,7 @@ import org.apache.ambari.server.utils.DateUtils;
 import org.apache.ambari.server.utils.HostUtils;
 import org.apache.ambari.server.utils.Parallel;
 import org.apache.ambari.server.utils.ShellCommandUtil;
+import org.apache.ambari.server.utils.StageUtils;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.DefaultParser;
@@ -1322,6 +1325,49 @@ public class Configuration {
   public static final ConfigurationProperty 
JWT_ORIGINAL_URL_QUERY_PARAM = new ConfigurationProperty<>(
   "authentication.jwt.originalUrlParamName", "originalUrl");
 
+  /* 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+   * Kerberos authentication-specific properties
+   * 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 */
+  /**
+   * Determines whether to use Kerberos (SPNEGO) authentication when 
connecting Ambari.
+   */
+  @Markdown(description = "Determines whether to use Kerberos (SPNEGO) 
authentication when connecting Ambari.")
+  public static final ConfigurationProperty KERBEROS_AUTH_ENABLED = 
new ConfigurationProperty<>(
+  "authentication.kerberos.enabled", Boolean.FALSE);
+
+  /**
+   * The Kerberos principal name to use when verifying user-supplied Kerberos 
tokens for authentication via SPNEGO.
+   */
+  @Markdown(description = "The Kerberos principal name to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
+  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_PRINCIPAL = new ConfigurationProperty<>(
+  "authentication.kerberos.spnego.principal", "HTTP/_HOST");
+
+  /**
+   * The Kerberos identity to use when verifying user-supplied Kerberos tokens 
for authentication via SPNEGO.
+   */
+  @Markdown(description = "The Kerberos keytab file to use when verifying 
user-supplied Kerberos tokens for authentication via SPNEGO")
+  public static final ConfigurationProperty 
KERBEROS_AUTH_SPNEGO_KEYTAB_FILE = new ConfigurationProperty<>(
+  "authentication.kerberos.spnego.keytab.file", 
"/etc/security/keytabs/spnego.service.keytab");
+
+  /**
+   * A comma-delimited (ordered) list of preferred user types to use when 
finding the Ambari user
+   * account for the user-supplied Kerberos identity during authentication via 
SPNEGO.
+   */
+  @Markdown(description = "A 

ambari git commit: AMBARI-18370. Do not execute stack-selector-tool after HDP component install on sysprepped hosts. (stoader)

2016-09-14 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 64873b97a -> acdde3d5a


AMBARI-18370. Do not execute stack-selector-tool after HDP component install on 
sysprepped hosts. (stoader)


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

Branch: refs/heads/branch-2.5
Commit: acdde3d5ad26ea25fbaf75667273c8adf5384da5
Parents: 64873b9
Author: Toader, Sebastian 
Authored: Wed Sep 14 13:52:52 2016 +0200
Committer: Toader, Sebastian 
Committed: Wed Sep 14 14:47:58 2016 +0200

--
 .../main/resources/scripts/Ambaripreupload.py   | 11 +-
 .../2.0.6/hooks/after-INSTALL/scripts/params.py |  1 +
 .../scripts/shared_initialization.py|  3 ++
 .../hooks/after-INSTALL/test_after_install.py   | 35 
 4 files changed, 49 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/acdde3d5/ambari-server/src/main/resources/scripts/Ambaripreupload.py
--
diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 9492e17..09dcd7e 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -417,4 +417,13 @@ with Environment() as env:
   except:
 os.remove("/var/lib/ambari-agent/data/.hdfs_resource_ignore")
 raise
-  print "Completed tarball copy. Ambari preupload script completed."
+  print "Completed tarball copy."
+
+  if not options.upgrade:
+print "Executing stack-selector-tool for stack {0} 
...".format(stack_version)
+Execute(
+  ('/usr/bin/hdp-select', 'set', 'all', stack_version),
+  sudo = True
+)
+
+  print "Ambari preupload script completed."
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/acdde3d5/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
index 819d8f7..ed34217 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
@@ -33,6 +33,7 @@ tmp_dir = Script.get_tmp_dir()
 dfs_type = default("/commandParams/dfs_type", "")
 
 is_parallel_execution_enabled = 
int(default("/agentConfigParams/agent/parallel_execution", 0)) == 1
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 sudo = AMBARI_SUDO_BINARY
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/acdde3d5/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
index 9982dc6..e9f2283 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
@@ -44,6 +44,9 @@ def setup_stack_symlinks():
 version = params.current_version if params.current_version is not None 
else params.stack_version_unformatted
 
 if not params.upgrade_suspended:
+  if params.host_sys_prepped:
+Logger.warning("Skipping running stack-selector-tool for stack {0} as 
its a sys_prepped host. This may cause symlink pointers not to be created for 
HDP componets installed later on top of an already sys_prepped 
host.".format(version))
+return
   # On parallel command execution this should be executed by a single 
process at a time.
   with FcntlBasedProcessLock(params.stack_select_lock_file, enabled = 
params.is_parallel_execution_enabled, skip_fcntl_failures = True):
 stack_select.select_all(version)

http://git-wip-us.apache.org/repos/asf/ambari/blob/acdde3d5/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
 

ambari git commit: AMBARI-18370. Do not execute stack-selector-tool after HDP component install on sysprepped hosts. (stoader)

2016-09-14 Thread stoader
Repository: ambari
Updated Branches:
  refs/heads/trunk 02256c3ff -> a54d60918


AMBARI-18370. Do not execute stack-selector-tool after HDP component install on 
sysprepped hosts. (stoader)


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

Branch: refs/heads/trunk
Commit: a54d60918b9df11cd0046d2d96203f60b1ecd546
Parents: 02256c3
Author: Toader, Sebastian 
Authored: Wed Sep 14 13:52:52 2016 +0200
Committer: Toader, Sebastian 
Committed: Wed Sep 14 13:52:52 2016 +0200

--
 .../main/resources/scripts/Ambaripreupload.py   | 11 +-
 .../2.0.6/hooks/after-INSTALL/scripts/params.py |  1 +
 .../scripts/shared_initialization.py|  3 ++
 .../hooks/after-INSTALL/test_after_install.py   | 35 
 4 files changed, 49 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a54d6091/ambari-server/src/main/resources/scripts/Ambaripreupload.py
--
diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 9492e17..09dcd7e 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -417,4 +417,13 @@ with Environment() as env:
   except:
 os.remove("/var/lib/ambari-agent/data/.hdfs_resource_ignore")
 raise
-  print "Completed tarball copy. Ambari preupload script completed."
+  print "Completed tarball copy."
+
+  if not options.upgrade:
+print "Executing stack-selector-tool for stack {0} 
...".format(stack_version)
+Execute(
+  ('/usr/bin/hdp-select', 'set', 'all', stack_version),
+  sudo = True
+)
+
+  print "Ambari preupload script completed."
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a54d6091/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
index 819d8f7..ed34217 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
@@ -33,6 +33,7 @@ tmp_dir = Script.get_tmp_dir()
 dfs_type = default("/commandParams/dfs_type", "")
 
 is_parallel_execution_enabled = 
int(default("/agentConfigParams/agent/parallel_execution", 0)) == 1
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 sudo = AMBARI_SUDO_BINARY
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a54d6091/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
index 9982dc6..e9f2283 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
@@ -44,6 +44,9 @@ def setup_stack_symlinks():
 version = params.current_version if params.current_version is not None 
else params.stack_version_unformatted
 
 if not params.upgrade_suspended:
+  if params.host_sys_prepped:
+Logger.warning("Skipping running stack-selector-tool for stack {0} as 
its a sys_prepped host. This may cause symlink pointers not to be created for 
HDP componets installed later on top of an already sys_prepped 
host.".format(version))
+return
   # On parallel command execution this should be executed by a single 
process at a time.
   with FcntlBasedProcessLock(params.stack_select_lock_file, enabled = 
params.is_parallel_execution_enabled, skip_fcntl_failures = True):
 stack_select.select_all(version)

http://git-wip-us.apache.org/repos/asf/ambari/blob/a54d6091/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
 

ambari git commit: AMBARI-18131. UI - atlas.rest.address needs to be recalculated by StackAdvisor whenever AtlasServer is added/moved/deleted (onechiporenko)

2016-09-14 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 09b5fdc00 -> 64873b97a


AMBARI-18131. UI - atlas.rest.address needs to be recalculated by StackAdvisor 
whenever AtlasServer is added/moved/deleted (onechiporenko)


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

Branch: refs/heads/branch-2.5
Commit: 64873b97aa120af488910e513a11d5e6298da58c
Parents: 09b5fdc
Author: Oleg Nechiporenko 
Authored: Wed Aug 17 16:10:04 2016 +0300
Committer: Oleg Nechiporenko 
Committed: Wed Sep 14 14:55:55 2016 +0300

--
 .../app/controllers/wizard/step7_controller.js  | 11 
 .../app/utils/configs/config_initializer.js | 28 +-
 .../utils/configs/config_initializer_test.js| 58 +++-
 3 files changed, 95 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/64873b97/ambari-web/app/controllers/wizard/step7_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index 6a1f4ec..b8678a5 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -221,9 +221,15 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
 var dependencies = {};
 var hiveMetastore = 
App.configsCollection.getConfigByName('hive.metastore.uris', 'hive-site.xml');
 var clientPort = App.configsCollection.getConfigByName('clientPort', 
'zoo.cfg.xml');
+var atlasTls = App.configsCollection.getConfigByName('atlas.enableTLS', 
'application-properties.xml');
+var atlasHttpPort = 
App.configsCollection.getConfigByName('atlas.server.http.port', 
'application-properties.xml');
+var atlasHttpsPort = 
App.configsCollection.getConfigByName('atlas.server.https.port', 
'application-properties.xml');
 
 if (hiveMetastore) dependencies['hive.metastore.uris'] = 
hiveMetastore.recommendedValue;
 if (clientPort) dependencies.clientPort = clientPort.recommendedValue;
+if (atlasTls) dependencies['atlas.enableTLS'] = atlasTls.recommendedValue;
+if (atlasHttpPort) dependencies['atlas.server.http.port'] = 
atlasHttpPort.recommendedValue;
+if (atlasHttpsPort) dependencies['atlas.server.https.port'] = 
atlasHttpsPort.recommendedValue;
 return dependencies;
   }.property(),
 
@@ -1041,6 +1047,11 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
   this.get('configDependencies').clientPort = config.savedValue;
 }
 }
+if (config.filename === 'application-properties.xml') {
+  if (this.get('configDependencies').hasOwnProperty(config.name)) {
+this.get('configDependencies')[config.name] = config.savedValue;
+  }
+}
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/64873b97/ambari-web/app/utils/configs/config_initializer.js
--
diff --git a/ambari-web/app/utils/configs/config_initializer.js 
b/ambari-web/app/utils/configs/config_initializer.js
index b4c47f2..c8a4cef 100644
--- a/ambari-web/app/utils/configs/config_initializer.js
+++ b/ambari-web/app/utils/configs/config_initializer.js
@@ -141,7 +141,8 @@ App.ConfigInitializer = 
App.ConfigInitializerClass.create(App.MountPointsBasedIn
 'hbase.zookeeper.quorum': '_initHBaseZookeeperQuorum',
 'yarn.resourcemanager.zk-address': '_initYarnRMzkAddress',
 'RANGER_HOST': '_initRangerHost',
-'hive.metastore.uris': '_initHiveMetastoreUris'
+'hive.metastore.uris': '_initHiveMetastoreUris',
+'atlas.rest.address': '_initAtlasRestAddress'
   },
 
   initializerTypes: [
@@ -313,6 +314,31 @@ App.ConfigInitializer = 
App.ConfigInitializerClass.create(App.MountPointsBasedIn
   },
 
   /**
+   * Unique initializer for atlas.rest.address
+   *
+   * @param {configProperty} configProperty
+   * @param {topologyLocalDB} localDB
+   * @param {object} dependencies
+   * @return {Object}
+   * @private
+   */
+  _initAtlasRestAddress: function (configProperty, localDB, dependencies) {
+var atlasTls = dependencies['atlas.enableTLS'];
+var httpPort = dependencies['atlas.server.http.port'];
+var httpsPort = dependencies['atlas.server.https.port'];
+var protocol = atlasTls ? 'https': 'http';
+var port = atlasTls ? httpsPort : httpPort;
+var value = localDB.masterComponentHosts.filterProperty('component', 
'ZOOKEEPER_SERVER').map(function (component) {
+  return protocol + '://' + 

ambari git commit: AMBARI-18040. Add UT for installer (onechiporenko)

2016-09-14 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 1b25a463d -> 09b5fdc00


AMBARI-18040. Add UT for installer (onechiporenko)


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

Branch: refs/heads/branch-2.5
Commit: 09b5fdc003752731583387965ee7f60db0ce9cc8
Parents: 1b25a46
Author: Oleg Nechiporenko 
Authored: Fri Aug 5 13:12:18 2016 +0300
Committer: Oleg Nechiporenko 
Committed: Wed Sep 14 14:33:59 2016 +0300

--
 .../test/controllers/wizard/step1_test.js   | 189 +++
 ambari-web/test/views/wizard/step2_view_test.js |  10 +-
 2 files changed, 190 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/09b5fdc0/ambari-web/test/controllers/wizard/step1_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step1_test.js 
b/ambari-web/test/controllers/wizard/step1_test.js
index c06db26..296fe50 100644
--- a/ambari-web/test/controllers/wizard/step1_test.js
+++ b/ambari-web/test/controllers/wizard/step1_test.js
@@ -209,4 +209,193 @@ describe('App.WizardStep1Controller', function () {
 
   });
 
+  describe('#uploadVdf', function () {
+
+function getModal() {
+  var controller = getController();
+  controller.set('optionsToSelect', Em.Object.create({
+useLocalRepo: {
+  enterUrl: {isSelected: true, url: 'apache.org'},
+  uploadFile: {isSelected: false, file: 'some_file'}
+}
+  }));
+  return controller.uploadVdf();
+}
+
+beforeEach(function () {
+  this.modal = getModal();
+});
+
+describe('#restoreUploadOptions', function () {
+
+  beforeEach(function () {
+wizardStep1Controller.set('optionsToSelect.useLocalRepo', {
+  enterUrl: {isSelected: true, url: 'apache.org'},
+  uploadFile: {isSelected: false, file: 'some_file'}
+});
+this.modal.restoreUploadOptions();
+  });
+
+  it('`enterUrl.isSelected`', function () {
+
expect(this.modal.get('controller.optionsToSelect.useLocalRepo.enterUrl.isSelected')).to.be.false;
+  });
+
+  it('`enterUrl.url`', function () {
+
expect(this.modal.get('controller.optionsToSelect.useLocalRepo.enterUrl.url')).to.be.equal('');
+  });
+
+  it('`uploadFile.isSelected`', function () {
+
expect(this.modal.get('controller.optionsToSelect.useLocalRepo.uploadFile.isSelected')).to.be.true;
+  });
+
+  it('`uploadFile.file`', function () {
+
expect(this.modal.get('controller.optionsToSelect.useLocalRepo.uploadFile.file')).to.be.equal('');
+  });
+
+});
+
+describe('#bodyClass', function () {
+
+  beforeEach(function () {
+this.body = this.modal.get('bodyClass').create();
+  });
+
+  describe('#uploadFileView', function () {
+
+beforeEach(function() {
+  this.fileView = this.body.get('uploadFileView').create();
+});
+
+describe('#click', function () {
+
+  beforeEach(function () {
+this.fileView.set('controller', getController());
+this.fileView.set('controller.optionsToSelect', {
+  useLocalRepo: {
+enterUrl: {isSelected: true, hasError: true},
+uploadFile: {isSelected: false, hasError: true}
+  }
+});
+this.fileView.click();
+  });
+
+  it('`enterUrl.isSelected`', function () {
+
expect(this.fileView.get('controller.optionsToSelect.useLocalRepo.enterUrl.isSelected')).to.be.false;
+  });
+
+  it('`enterUrl.hasError`', function () {
+
expect(this.fileView.get('controller.optionsToSelect.useLocalRepo.enterUrl.hasError')).to.be.false;
+  });
+
+  it('`uploadFile.isSelected`', function () {
+
expect(this.fileView.get('controller.optionsToSelect.useLocalRepo.uploadFile.isSelected')).to.be.true;
+  });
+
+  it('`uploadFile.hasError`', function () {
+
expect(this.fileView.get('controller.optionsToSelect.useLocalRepo.uploadFile.hasError')).to.be.false;
+  });
+
+});
+
+  });
+
+  describe('#enterUrlView', function () {
+
+beforeEach(function() {
+  this.fileView = this.body.get('enterUrlView').create();
+});
+
+describe('#click', function () {
+
+  beforeEach(function () {
+this.fileView.set('controller', getController());
+this.fileView.set('controller.optionsToSelect', {
+  useLocalRepo: {
+enterUrl: 

ambari git commit: AMBARI-18075. Add UT for widgets configs (onechiporenko)

2016-09-14 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d4cec42ee -> 1b25a463d


AMBARI-18075. Add UT for widgets configs (onechiporenko)


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

Branch: refs/heads/branch-2.5
Commit: 1b25a463d55c2f1b5236b5834fbddf51327e4566
Parents: d4cec42
Author: Oleg Nechiporenko 
Authored: Tue Aug 9 11:12:13 2016 +0300
Committer: Oleg Nechiporenko 
Committed: Wed Sep 14 14:31:21 2016 +0300

--
 .../configs/widgets/config_widget_view_test.js  | 313 +++
 1 file changed, 313 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1b25a463/ambari-web/test/views/common/configs/widgets/config_widget_view_test.js
--
diff --git 
a/ambari-web/test/views/common/configs/widgets/config_widget_view_test.js 
b/ambari-web/test/views/common/configs/widgets/config_widget_view_test.js
index f7efd7f..abbc262 100644
--- a/ambari-web/test/views/common/configs/widgets/config_widget_view_test.js
+++ b/ambari-web/test/views/common/configs/widgets/config_widget_view_test.js
@@ -43,6 +43,8 @@ describe('App.ConfigWidgetView', function () {
 
   App.TestAliases.testAsComputedOr(getView(), 'doNotShowWidget', 
['isPropertyUndefined', 'config.showAsTextBox']);
 
+  App.TestAliases.testAsComputedEqual(getView(), 'isPropertyUndefined', 
'config.value', 'Undefined');
+
   describe('#undoAllowed', function () {
 
 Em.A([
@@ -319,4 +321,315 @@ describe('App.ConfigWidgetView', function () {
 
   });
 
+  describe('#showFinalConfig', function () {
+
+[
+  {
+config: {
+  isFinal: true,
+  isNotEditable: true,
+  isHover: true
+},
+e: true
+  },
+  {
+config: {
+  isFinal: true,
+  isNotEditable: false,
+  isHover: true
+},
+e: true
+  },{
+config: {
+  isFinal: true,
+  isNotEditable: true,
+  isHover: false
+},
+e: true
+  },{
+config: {
+  isFinal: true,
+  isNotEditable: false,
+  isHover: false
+},
+e: true
+  },
+  {
+config: {
+  isFinal: false,
+  isNotEditable: true,
+  isHover: true
+},
+e: false
+  },
+  {
+config: {
+  isFinal: false,
+  isNotEditable: false,
+  isHover: true
+},
+e: false
+  },{
+  config: {
+isFinal: false,
+isNotEditable: true,
+isHover: false
+  },
+  e: false
+},{
+  config: {
+isFinal: false,
+isNotEditable: false,
+isHover: false
+  },
+  e: false
+}
+].forEach(function (test) {
+
+  it(JSON.stringify(test.config), function () {
+view.set('config', Em.Object.create(test.config));
+expect(view.get('showFinalConfig')).to.be.equal(test.e);
+  });
+
+})
+
+  });
+
+  describe('#toggleFinalFlag', function () {
+
+[
+  {isNotEditable: true, isFinal: false},
+  {isNotEditable: false, isFinal: true}
+].forEach(function (test) {
+  it('config.isNotEditable ' + test.isNotEditable, function () {
+var config = Em.Object.create({isNotEditable: test.isNotEditable, 
isFinal: false});
+view.toggleFinalFlag({context: config});
+expect(config.get('isFinal')).to.be.equal(test.isFinal);
+  });
+});
+
+  });
+
+  describe('#issueView', function () {
+
+beforeEach(function () {
+  this.issueView = getView().get('issueView').create({config: 
Em.Object.create()});
+  sinon.stub(App, 'tooltip', Em.K);
+});
+
+afterEach(function () {
+  App.tooltip.restore();
+});
+
+describe('#didInsertElement', function () {
+
+  beforeEach(function () {
+this.issueView.errorLevelObserver = Em.K;
+sinon.spy(this.issueView, 'addObserver');
+  });
+
+  afterEach(function () {
+this.issueView.addObserver.restore();
+  });
+
+  [
+'issuedConfig.warnMessage',
+'issuedConfig.errorMessage',
+'parentView.isPropertyUndefined'
+  ].forEach(function (field) {
+it('add observer for ' + field, function () {
+  this.issueView.didInsertElement();
+  expect(this.issueView.addObserver.calledWith(field, this.issueView, 
this.issueView.errorLevelObserver)).to.be.true;
+});
+  });
+
+});
+
+describe('#willDestroyElement', function () {
+
+  beforeEach(function () {
+

ambari git commit: AMBARI-17882. Add new macros for collections (onechiporenko)

2016-09-14 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 17ad59dbb -> d4cec42ee


AMBARI-17882. Add new macros for collections (onechiporenko)


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

Branch: refs/heads/branch-2.5
Commit: d4cec42ee9e9e8b139cf89a4746e0147950940db
Parents: 17ad59d
Author: Oleg Nechiporenko 
Authored: Mon Jul 25 14:56:10 2016 +0300
Committer: Oleg Nechiporenko 
Committed: Wed Sep 14 14:24:02 2016 +0300

--
 ambari-web/app/utils/ember_computed.js  | 125 +
 ambari-web/test/aliases/computed/everyByKey.js  |  91 ++
 ambari-web/test/aliases/computed/filterByKey.js |  74 
 ambari-web/test/aliases/computed/findByKey.js   |  73 
 ambari-web/test/aliases/computed/someByKey.js   |  96 ++
 .../step7/assign_master_controller_test.js  |   2 +-
 ambari-web/test/init_computed_aliases.js|   4 +
 ambari-web/test/utils/ember_computed_test.js| 175 +++
 8 files changed, 639 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d4cec42e/ambari-web/app/utils/ember_computed.js
--
diff --git a/ambari-web/app/utils/ember_computed.js 
b/ambari-web/app/utils/ember_computed.js
index a49ba68..08be4e5 100644
--- a/ambari-web/app/utils/ember_computed.js
+++ b/ambari-web/app/utils/ember_computed.js
@@ -652,6 +652,37 @@ computed.someBy = function (collectionKey, propertyName, 
neededValue) {
 };
 
 /**
+ * A computed property that returns true of some collection's item has 
property with needed value
+ * Needed value is stored in the another property
+ * 
+ * var o = Em.Object.create({
+ *  p1: [{a: 1}, {a: 2}, {a: 3}],
+ *  p2: Em.computed.someByKey('p1', 'a', 'v1'),
+ *  v1: 1
+ * });
+ * console.log(o.get('p2')); // true
+ * o.set('p1.0.a', 2);
+ * console.log(o.get('p2')); // false
+ * 
+ *
+ * @method someByKey
+ * @param {string} collectionKey
+ * @param {string} propertyName
+ * @param {string} neededValueKey
+ * @returns {Ember.ComputedProperty}
+ */
+computed.someByKey = function (collectionKey, propertyName, neededValueKey) {
+  return computed(collectionKey + '.@each.' + propertyName, neededValueKey, 
function () {
+var collection = smartGet(this, collectionKey);
+if (!collection) {
+  return false;
+}
+var neededValue = smartGet(this, neededValueKey);
+return collection.someProperty(propertyName, neededValue);
+  });
+};
+
+/**
  * A computed property that returns true of all collection's items have 
property with needed value
  * 
  * var o = Em.Object.create({
@@ -680,6 +711,37 @@ computed.everyBy = function (collectionKey, propertyName, 
neededValue) {
 };
 
 /**
+ * A computed property that returns true of all collection's items have 
property with needed value
+ * Needed value is stored in the another property
+ * 
+ * var o = Em.Object.create({
+ *  p1: [{a: 1}, {a: 1}, {a: 1}],
+ *  p2: Em.computed.everyByKey('p1', 'a', 'v1'),
+ *  v1: 1
+ * });
+ * console.log(o.get('p2')); // true
+ * o.set('p1.0.a', 2);
+ * console.log(o.get('p2')); // false
+ * 
+ *
+ * @method everyByKey
+ * @param {string} collectionKey
+ * @param {string} propertyName
+ * @param {string} neededValueKey
+ * @returns {Ember.ComputedProperty}
+ */
+computed.everyByKey = function (collectionKey, propertyName, neededValueKey) {
+  return computed(collectionKey + '.@each.' + propertyName, neededValueKey, 
function () {
+var collection = smartGet(this, collectionKey);
+if (!collection) {
+  return false;
+}
+var neededValue = smartGet(this, neededValueKey);
+return collection.everyProperty(propertyName, neededValue);
+  });
+};
+
+/**
  * A computed property that returns array with values of named property on all 
items in the collection
  * 
  * var o = Em.Object.create({
@@ -735,6 +797,38 @@ computed.filterBy = function (collectionKey, propertyName, 
neededValue) {
 };
 
 /**
+ * A computed property that returns array with collection's items that have 
needed property value
+ * Needed value is stored in the another property
+ *
+ * 
+ * var o = Em.Object.create({
+ *  p1: [{a: 1}, {a: 2}, {a: 3}],
+ *  p2: Em.computed.filterByKey('p1', 'a', 'v1'),
+ *  v1: 2
+ * });
+ * console.log(o.get('p2')); // [{a: 2}]
+ * o.set('p1.0.a', 2);
+ * console.log(o.get('p2')); // [{a: 2}, {a: 2}]
+ * 
+ *
+ * @method filterByKey
+ * @param {string} collectionKey
+ * @param {string} propertyName
+ * @param {string} neededValueKey
+ * @returns {Ember.ComputedProperty}
+ */
+computed.filterByKey = function (collectionKey, 

[2/2] ambari git commit: AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)

2016-09-14 Thread dmitriusan
AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)


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

Branch: refs/heads/branch-2.5
Commit: 17ad59dbb532789db37ece700896051f8b4e
Parents: 762f4b4
Author: Lisnichenko Dmitro 
Authored: Wed Sep 14 13:18:50 2016 +0300
Committer: Lisnichenko Dmitro 
Committed: Wed Sep 14 13:18:50 2016 +0300

--
 .../resources/stacks/HDP/0.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/0.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/1.2.0/repos/repoinfo.xml | 16 ++
 .../stacks/HDP/1.3.0/repos/repoinfo.xml | 14 +
 .../stacks/HDP/1.3.1/repos/repoinfo.xml | 12 +++
 .../stacks/HDP/2.0.1/repos/repoinfo.xml |  8 +++
 .../stacks/HDP/2.0.5/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.6.1/repos/repoinfo.xml   |  6 ++
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.7/repos/repoinfo.xml |  6 ++
 .../HDP/2.0.7/services/HBASE/metainfo.xml   |  1 +
 .../stacks/HDP/2.0.8/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.1.1/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0.ECS/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/1.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/2.0/repos/repoinfo.xml |  6 ++
 .../server/controller/RepositoryResponse.java   |  8 +++
 .../internal/RepositoryResourceProvider.java|  3 +++
 .../RepositoryVersionResourceProvider.java  |  3 +--
 .../server/orm/entities/RepositoryEntity.java   |  8 +++
 .../ambari/server/state/RepositoryInfo.java | 17 +++
 .../server/state/stack/RepositoryXml.java   | 14 +
 .../stack/upgrade/RepositoryVersionHelper.java  |  4 
 .../stacks/BIGTOP/0.8/repos/repoinfo.xml|  2 ++
 .../HDP/2.0.6.GlusterFS/repos/repoinfo.xml  | 10 +
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  4 
 .../resources/stacks/HDP/2.0/repos/repoinfo.xml |  4 
 .../stacks/HDP/2.1.GlusterFS/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/2.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.3.ECS/repos/repoinfo.xml   | 18 
 .../stacks/HDP/2.3.GlusterFS/repos/repoinfo.xml | 10 +
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml | 12 +++
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml | 12 +++
 .../resources/stacks/HDP/2.5/repos/repoinfo.xml | 16 ++
 .../stacks/HDPWIN/2.1/repos/repoinfo.xml|  1 +
 .../stacks/HDPWIN/2.2/repos/repoinfo.xml|  1 +
 .../stacks/HDPWIN/2.3/repos/repoinfo.xml|  1 +
 .../src/main/resources/version_definition.xsd   |  1 +
 .../RepositoryVersionResourceProviderTest.java  | 22 ++--
 .../upgrade/RepositoryVersionHelperTest.java|  3 ++-
 .../bad-stacks/HDP/0.1/repos/repoinfo.xml   |  1 +
 .../src/test/resources/hbase_version_test.xml   |  2 ++
 .../resources/stacks/HDP/0.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/0.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/1.2.0/repos/repoinfo.xml | 16 ++
 .../stacks/HDP/1.3.0/repos/repoinfo.xml | 14 +
 .../stacks/HDP/1.3.1/repos/repoinfo.xml | 12 +++
 .../stacks/HDP/2.0.1/repos/repoinfo.xml |  8 +++
 .../stacks/HDP/2.0.5/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.6.1/repos/repoinfo.xml   |  6 ++
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.7/repos/repoinfo.xml |  6 ++
 .../HDP/2.0.7/services/HBASE/metainfo.xml   |  1 +
 .../stacks/HDP/2.0.8/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.1.1/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0.ECS/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0/repos/repoinfo.xml |  2 ++
 .../HDP/2.2.0/repos/version-2.2.0.4-123.xml |  2 ++
 .../2.2.0/repos/version-2.2.0.4-124-suse11.xml  |  2 ++
 .../stacks/OTHER/1.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/2.0/repos/repoinfo.xml |  6 ++
 .../HDP/0.1/repos/repoinfo.xml  |  6 ++
 .../HDP/0.2/repos/repoinfo.xml  |  6 ++
 .../OTHER/1.0/repos/repoinfo.xml|  6 ++
 .../OTHER/2.0/repos/repoinfo.xml|  6 ++
 .../stack1/1.0/repos/repoinfo.xml   |  6 ++
 .../stack2/1.0/repos/repoinfo.xml   |  6 ++
 .../stack3/1.0/repos/repoinfo.xml   

[1/2] ambari git commit: AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)

2016-09-14 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 762f4b469 -> 17ad59dbb


http://git-wip-us.apache.org/repos/asf/ambari/blob/17ad59db/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
index e429adb..d996dfc 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
@@ -21,6 +21,7 @@
   http://dummy_repo
   HDPWIN-2.2
   HDPWIN
+  true
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/17ad59db/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
index 54a0bf0..5aeb7cf 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
@@ -21,6 +21,7 @@
   http://dummy_repo
   HDPWIN-2.3
   HDPWIN
+  true
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/17ad59db/ambari-server/src/main/resources/version_definition.xsd
--
diff --git a/ambari-server/src/main/resources/version_definition.xsd 
b/ambari-server/src/main/resources/version_definition.xsd
index bd49028..35deb6e 100644
--- a/ambari-server/src/main/resources/version_definition.xsd
+++ b/ambari-server/src/main/resources/version_definition.xsd
@@ -122,6 +122,7 @@
   
   
   
+  
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/17ad59db/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
index 8ba141b..a43a1dc 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
@@ -258,7 +258,7 @@ public class RepositoryVersionResourceProviderTest {
 final Set> propertySet = new LinkedHashSet>();
 final Map properties = new LinkedHashMap();
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_DISPLAY_NAME_PROPERTY_ID,
 "name");
-
properties.put(RepositoryVersionResourceProvider.SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID,
 new 
Gson().fromJson("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"1\"}]}]",
 Object.class));
+
properties.put(RepositoryVersionResourceProvider.SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID,
 new 
Gson().fromJson("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"1\",\"Repositories/unique\":\"true\"}]}]",
 Object.class));
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_STACK_NAME_PROPERTY_ID,
 "HDP");
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_STACK_VERSION_PROPERTY_ID,
 "1.1");
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_REPOSITORY_VERSION_PROPERTY_ID,
 "1.1.1.1");
@@ -325,7 +325,7 @@ public class RepositoryVersionResourceProviderTest {
 entity.setDisplayName("name");
 entity.setStack(stackEntity);
 entity.setVersion("1.1");
-
entity.setOperatingSystems("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"http://example.com/repo1\"}]}];);
+
entity.setOperatingSystems("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"http://example.com/repo1\",\"Repositories/unique\":\"true\"}]}];);
 
 final RepositoryVersionDAO repositoryVersionDAO = 
injector.getInstance(RepositoryVersionDAO.class);
 AmbariMetaInfo info = injector.getInstance(AmbariMetaInfo.class);
@@ -369,7 +369,7 @@ public class RepositoryVersionResourceProviderTest {
 

[1/3] ambari git commit: Revert "AMBARI-18324: Externalize skip repo url check to ambari.properties instead of hardcoding it in Ambari Java code (dili)"

2016-09-14 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 580a35139 -> 02256c3ff


Revert "AMBARI-18324: Externalize skip repo url check to ambari.properties 
instead of hardcoding it in Ambari Java code (dili)"

This reverts commit 623c36d2e0832d9a0bc60bc9ff19b302d5e3cefa.


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

Branch: refs/heads/trunk
Commit: 962e06aca097ec02ee52f2284fb804c0c60425ad
Parents: 580a351
Author: Lisnichenko Dmitro 
Authored: Wed Sep 14 12:53:59 2016 +0300
Committer: Lisnichenko Dmitro 
Committed: Wed Sep 14 12:53:59 2016 +0300

--
 .../server/configuration/Configuration.java | 25 +---
 .../RepositoryVersionResourceProvider.java  | 15 +---
 .../server/configuration/ConfigurationTest.java | 20 
 3 files changed, 2 insertions(+), 58 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/962e06ac/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 ee73b8d..0690ca8 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
@@ -2300,14 +2300,6 @@ public class Configuration {
   public static final ConfigurationProperty TASK_ID_LIST_LIMIT = new 
ConfigurationProperty<>(
   "task.query.parameterlist.size", 999);
 
-  /**
-   * A comma separated list of repo ids to skip the repo url check when 
registering a repo for the stack
-   * @return
-   */
-  @Markdown(description = "The list of repo ids to skip the repo url check 
when registering a repo for the stack.")
-  public static final ConfigurationProperty 
SKIP_REPO_URL_EXISTENCE_VALIDATION_LIST = new ConfigurationProperty<>(
-  "no.repo.existence.validation.list", "HDP-UTILS");
-
   private static final Logger LOG = LoggerFactory.getLogger(
 Configuration.class);
 
@@ -4833,22 +4825,6 @@ public class Configuration {
   }
 
   /**
-   * Default to HDP-UTILS
-   * */
-  public List getSkipRepoUrlExistenceValidationList(){
-List list = new ArrayList();
-String propValue = getProperty(SKIP_REPO_URL_EXISTENCE_VALIDATION_LIST);
-for (String repo: propValue.split(",")) {
-  repo = repo.trim();
-  if (!repo.isEmpty()) {
-list.add(repo);
-  }
-}
-LOG.debug("Skip Repo URL Existence Validation on :" + list);
-return list;
-  }
-
-  /**
* Generates a markdown table which includes:
* 
* Property key name
@@ -5211,4 +5187,5 @@ public class Configuration {
 ClusterSizeType clusterSize();
 String value();
   }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/962e06ac/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
index cd440f3..e440460 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
@@ -32,7 +32,6 @@ import org.apache.ambari.server.ObjectNotFoundException;
 import 
org.apache.ambari.server.api.resources.OperatingSystemResourceDefinition;
 import org.apache.ambari.server.api.resources.RepositoryResourceDefinition;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
-import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.NoSuchResourceException;
 import org.apache.ambari.server.controller.spi.Predicate;
@@ -458,14 +457,11 @@ public class RepositoryVersionResourceProvider extends 
AbstractAuthorizedResourc
 
 // List of all repo urls that are already added at stack
 Set existingRepoUrls = new HashSet();
-Configuration configuration = new Configuration();
-List skipRepos = 
configuration.getSkipRepoUrlExistenceValidationList();
 List existingRepoVersions = 

[3/3] ambari git commit: AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)

2016-09-14 Thread dmitriusan
AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 02256c3ff80a40440f06247732fbad70afe8e2eb
Parents: 962e06a
Author: Lisnichenko Dmitro 
Authored: Wed Sep 14 12:54:10 2016 +0300
Committer: Lisnichenko Dmitro 
Committed: Wed Sep 14 12:54:10 2016 +0300

--
 .../resources/stacks/HDP/0.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/0.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/1.2.0/repos/repoinfo.xml | 16 ++
 .../stacks/HDP/1.3.0/repos/repoinfo.xml | 14 +
 .../stacks/HDP/1.3.1/repos/repoinfo.xml | 12 +++
 .../stacks/HDP/2.0.1/repos/repoinfo.xml |  8 +++
 .../stacks/HDP/2.0.5/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.6.1/repos/repoinfo.xml   |  6 ++
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.7/repos/repoinfo.xml |  6 ++
 .../HDP/2.0.7/services/HBASE/metainfo.xml   |  1 +
 .../stacks/HDP/2.0.8/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.1.1/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0.ECS/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/1.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/2.0/repos/repoinfo.xml |  6 ++
 .../server/controller/RepositoryResponse.java   |  8 +++
 .../internal/RepositoryResourceProvider.java|  3 +++
 .../RepositoryVersionResourceProvider.java  |  3 +--
 .../server/orm/entities/RepositoryEntity.java   |  9 
 .../ambari/server/state/RepositoryInfo.java | 17 +++
 .../server/state/stack/RepositoryXml.java   | 14 +
 .../stack/upgrade/RepositoryVersionHelper.java  |  4 
 .../stacks/BIGTOP/0.8/repos/repoinfo.xml|  2 ++
 .../HDP/2.0.6.GlusterFS/repos/repoinfo.xml  | 10 +
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  4 
 .../resources/stacks/HDP/2.0/repos/repoinfo.xml |  4 
 .../stacks/HDP/2.1.GlusterFS/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/2.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.3.ECS/repos/repoinfo.xml   | 18 
 .../stacks/HDP/2.3.GlusterFS/repos/repoinfo.xml | 10 +
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml | 12 +++
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml | 12 +++
 .../resources/stacks/HDP/2.5/repos/repoinfo.xml | 16 ++
 .../stacks/HDPWIN/2.1/repos/repoinfo.xml|  1 +
 .../stacks/HDPWIN/2.2/repos/repoinfo.xml|  1 +
 .../stacks/HDPWIN/2.3/repos/repoinfo.xml|  1 +
 .../src/main/resources/version_definition.xsd   |  1 +
 .../RepositoryVersionResourceProviderTest.java  | 22 ++--
 .../upgrade/RepositoryVersionHelperTest.java|  3 ++-
 .../bad-stacks/HDP/0.1/repos/repoinfo.xml   |  1 +
 .../src/test/resources/hbase_version_test.xml   |  2 ++
 .../resources/stacks/HDP/0.1/repos/repoinfo.xml |  6 ++
 .../resources/stacks/HDP/0.2/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/1.2.0/repos/repoinfo.xml | 16 ++
 .../stacks/HDP/1.3.0/repos/repoinfo.xml | 14 +
 .../stacks/HDP/1.3.1/repos/repoinfo.xml | 12 +++
 .../stacks/HDP/2.0.1/repos/repoinfo.xml |  8 +++
 .../stacks/HDP/2.0.5/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.6.1/repos/repoinfo.xml   |  6 ++
 .../stacks/HDP/2.0.6/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.0.7/repos/repoinfo.xml |  6 ++
 .../HDP/2.0.7/services/HBASE/metainfo.xml   |  1 +
 .../stacks/HDP/2.0.8/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.1.1/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0.ECS/repos/repoinfo.xml |  6 ++
 .../stacks/HDP/2.2.0/repos/repoinfo.xml |  2 ++
 .../HDP/2.2.0/repos/version-2.2.0.4-123.xml |  2 ++
 .../2.2.0/repos/version-2.2.0.4-124-suse11.xml  |  2 ++
 .../stacks/OTHER/1.0/repos/repoinfo.xml |  6 ++
 .../stacks/OTHER/2.0/repos/repoinfo.xml |  6 ++
 .../HDP/0.1/repos/repoinfo.xml  |  6 ++
 .../HDP/0.2/repos/repoinfo.xml  |  6 ++
 .../OTHER/1.0/repos/repoinfo.xml|  6 ++
 .../OTHER/2.0/repos/repoinfo.xml|  6 ++
 .../stack1/1.0/repos/repoinfo.xml   |  6 ++
 .../stack2/1.0/repos/repoinfo.xml   |  6 ++
 .../stack3/1.0/repos/repoinfo.xml   |  

[2/3] ambari git commit: AMBARI-18350. Declare URL uniqueness in repoinfo.xml (dlysnichenko)

2016-09-14 Thread dmitriusan
http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
index e429adb..d996dfc 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/repos/repoinfo.xml
@@ -21,6 +21,7 @@
   http://dummy_repo
   HDPWIN-2.2
   HDPWIN
+  true
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
index 54a0bf0..5aeb7cf 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.3/repos/repoinfo.xml
@@ -21,6 +21,7 @@
   http://dummy_repo
   HDPWIN-2.3
   HDPWIN
+  true
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/main/resources/version_definition.xsd
--
diff --git a/ambari-server/src/main/resources/version_definition.xsd 
b/ambari-server/src/main/resources/version_definition.xsd
index bd49028..35deb6e 100644
--- a/ambari-server/src/main/resources/version_definition.xsd
+++ b/ambari-server/src/main/resources/version_definition.xsd
@@ -122,6 +122,7 @@
   
   
   
+  
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/02256c3f/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
index 8ba141b..a43a1dc 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProviderTest.java
@@ -258,7 +258,7 @@ public class RepositoryVersionResourceProviderTest {
 final Set> propertySet = new LinkedHashSet>();
 final Map properties = new LinkedHashMap();
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_DISPLAY_NAME_PROPERTY_ID,
 "name");
-
properties.put(RepositoryVersionResourceProvider.SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID,
 new 
Gson().fromJson("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"1\"}]}]",
 Object.class));
+
properties.put(RepositoryVersionResourceProvider.SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID,
 new 
Gson().fromJson("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"1\",\"Repositories/unique\":\"true\"}]}]",
 Object.class));
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_STACK_NAME_PROPERTY_ID,
 "HDP");
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_STACK_VERSION_PROPERTY_ID,
 "1.1");
 
properties.put(RepositoryVersionResourceProvider.REPOSITORY_VERSION_REPOSITORY_VERSION_PROPERTY_ID,
 "1.1.1.1");
@@ -325,7 +325,7 @@ public class RepositoryVersionResourceProviderTest {
 entity.setDisplayName("name");
 entity.setStack(stackEntity);
 entity.setVersion("1.1");
-
entity.setOperatingSystems("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"http://example.com/repo1\"}]}];);
+
entity.setOperatingSystems("[{\"OperatingSystems/os_type\":\"redhat6\",\"repositories\":[{\"Repositories/repo_id\":\"1\",\"Repositories/repo_name\":\"1\",\"Repositories/base_url\":\"http://example.com/repo1\",\"Repositories/unique\":\"true\"}]}];);
 
 final RepositoryVersionDAO repositoryVersionDAO = 
injector.getInstance(RepositoryVersionDAO.class);
 AmbariMetaInfo info = injector.getInstance(AmbariMetaInfo.class);
@@ -369,7 +369,7 @@ public class RepositoryVersionResourceProviderTest {
 entity.setDisplayName("name");
 entity.setStack(stackEntity);
 

ambari git commit: revert "AMBARI-18213. Storm components were stopped during RU and can not be started (Dmitry Lysnichenko via ncole)" (dlisnichenko)

2016-09-14 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 37e71db74 -> 580a35139


revert "AMBARI-18213. Storm components were stopped during RU and can not be 
started (Dmitry Lysnichenko via ncole)" (dlisnichenko)


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

Branch: refs/heads/trunk
Commit: 580a35139ecd4ee8c47af948d1e4717533eac8f4
Parents: 37e71db
Author: Lisnichenko Dmitro 
Authored: Wed Sep 14 12:46:32 2016 +0300
Committer: Lisnichenko Dmitro 
Committed: Wed Sep 14 12:46:32 2016 +0300

--
 .../StormUpgradeKerberosDescriptorConfig.java   | 144 ---
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml |   5 -
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml |   3 -
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml |   5 -
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml |   3 -
 5 files changed, 160 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/580a3513/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java
deleted file mode 100644
index 07bdaa6..000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java
+++ /dev/null
@@ -1,144 +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.
- */
-package org.apache.ambari.server.serveraction.upgrades;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
-
-import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.actionmanager.HostRoleStatus;
-import org.apache.ambari.server.agent.CommandReport;
-import org.apache.ambari.server.orm.dao.ArtifactDAO;
-import org.apache.ambari.server.orm.entities.ArtifactEntity;
-import org.apache.ambari.server.serveraction.AbstractServerAction;
-import org.apache.ambari.server.state.kerberos.KerberosConfigurationDescriptor;
-import org.apache.ambari.server.state.kerberos.KerberosDescriptor;
-import org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory;
-import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor;
-
-import com.google.inject.Inject;
-
-
-/**
- * Update Kerberos Descriptor Storm properties when upgrading to Storm 1.0
- */
-public class StormUpgradeKerberosDescriptorConfig extends AbstractServerAction 
{
-
-
-  public static final String KERBEROS_DESCRIPTOR = "kerberos_descriptor";
-  public static final String STORM = "STORM";
-  public static final String NEW_PART = "org.apache";
-  public static final String OLD_PART = "backtype";
-
-  @Inject
-  ArtifactDAO artifactDAO;
-
-  protected StormUpgradeKerberosDescriptorConfig() {
-  }
-
-  /**
-   * Lists config types and properties that may be replaced "backtype" to 
"org.apache"
-   */
-  private static final HashMap TARGET_PROPERTIES = new 
HashMap() {{
-put("storm-site", new String[]{
-"nimbus.authorizer",
-"storm.principal.tolocal",
-"drpc.authorizer"
-});
-
-  }};
-
-  /**
-   * Update Kerberos Descriptor Storm properties when upgrading to Storm 1.0
-   * 
-   * Finds the relevant artifact entities and iterates through them to process 
each independently.
-   */
-  @Override
-  public CommandReport execute(ConcurrentMap 
requestSharedDataContext)
-  throws AmbariException, InterruptedException {
-
-String msg = "";
-
-List artifactEntities = 
artifactDAO.findByName(KERBEROS_DESCRIPTOR);
-
-