[ambari] branch branch-2.7 updated: Use https for hdp repo (#3043)

2019-07-09 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 28f6bc9  Use https for hdp repo (#3043)
28f6bc9 is described below

commit 28f6bc99178b2dba3574f95d136a6c3ed83fec72
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Jul 9 09:59:34 2019 +0200

Use https for hdp repo (#3043)
---
 ambari-metrics/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index 1e8aa70..38da76a 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -74,7 +74,7 @@
 
   apache-hadoop
   hdp
-  
http://nexus-private.hortonworks.com/nexus/content/groups/public
+  
https://nexus-private.hortonworks.com/nexus/content/groups/public
 
 
   apache-snapshots



[ambari] branch branch-2.7 updated: AMBARI-25269. Hive Server Interactive process alert triggered in HA setup (#2958)

2019-05-04 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new d4e80e5  AMBARI-25269. Hive Server Interactive process alert triggered 
in HA setup (#2958)
d4e80e5 is described below

commit d4e80e52cea2b9e24eaae98f3448c9042dab134e
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Sat May 4 11:17:34 2019 +0200

AMBARI-25269. Hive Server Interactive process alert triggered in HA setup 
(#2958)
---
 .../resource_management/libraries/functions/hive_check.py  |  3 ++-
 .../test/python/stacks/2.0.6/HIVE/test_hive_service_check.py   | 10 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
index 39df3b5..da9b417 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
@@ -74,7 +74,8 @@ def check_thrift_port_sasl(address, port, hive_auth="NOSASL", 
key=None, kinitcmd
 
   # -n the user to connect as (ignored when using the hive principal in the 
URL, can be different from the user running the beeline command)
   # -e ';' executes a SQL commmand of NOOP
-  cmd = "beeline -n %s -u '%s' %s -e ';' 2>&1 | awk '{print}' | grep -i -e 
'Connected to:' -e 'Transaction isolation:'" % \
+  cmd = ("beeline -n %s -u '%s' %s -e ';' 2>&1 | awk '{print}' | grep -i " + \
+ "-e 'Connected to:' -e 'Transaction isolation:' -e 'inactive HS2 
instance; use service discovery'") % \
 (format(hive_user), format(";".join(beeline_url)), 
format(credential_str))
 
   Execute(cmd,
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
index 16ac833..39a58ed 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
@@ -46,7 +46,7 @@ class TestServiceCheck(RMFTestCase):
 stack_version = self.STACK_VERSION,
 target = RMFTestCase.TARGET_COMMON_SERVICES
 )
-self.assertResourceCalled('Execute', "beeline -n hive -u 
'jdbc:hive2://c6402.ambari.apache.org:1/;transportMode=binary;auth=noSasl'  
-e ';' 2>&1 | awk '{print}' | grep -i -e 'Connected to:' -e 'Transaction 
isolation:'",
+self.assertResourceCalled('Execute', "beeline -n hive -u 
'jdbc:hive2://c6402.ambari.apache.org:1/;transportMode=binary;auth=noSasl'  
-e ';' 2>&1 | awk '{print}' | grep -i -e 'Connected to:' -e 'Transaction 
isolation:' -e 'inactive HS2 instance; use service discovery'",
   path = ['/bin/', '/usr/bin/', 
'/usr/lib/hive/bin/', '/usr/sbin/'],
   user = 'ambari-qa',
   timeout = 30,
@@ -165,7 +165,7 @@ class TestServiceCheck(RMFTestCase):
 self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/smokeuser.headless.keytab ambari...@example.com; ',
   user = 'ambari-qa',
   )
-self.assertResourceCalled('Execute', "beeline -n hive -u 
'jdbc:hive2://c6402.ambari.apache.org:1/;transportMode=binary;principal=hive/_h...@example.com'
  -e ';' 2>&1 | awk '{print}' | grep -i -e 'Connected to:' -e 'Transaction 
isolation:'",
+self.assertResourceCalled('Execute', "beeline -n hive -u 
'jdbc:hive2://c6402.ambari.apache.org:1/;transportMode=binary;principal=hive/_h...@example.com'
  -e ';' 2>&1 | awk '{print}' | grep -i -e 'Connected to:' -e 'Transaction 
isolation:' -e 'inactive HS2 instance; use service discovery'",
   path = ['/bin/', '/usr/bin/', 
'/usr/lib/hive/bin/', '/usr/sbin/'],
   user = 'ambari-qa',
   timeout = 30,
@@ -283,7 +283,7 @@ class TestServiceCheck(RMFTestCase):
   stack_version = self.STACK_VERSION,
 

[ambari] branch branch-2.7 updated: AMBARI-25270. Admin View build fails due to unavailable npm package ecstatic (#2960)

2019-05-04 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new d042d19  AMBARI-25270. Admin View build fails due to unavailable npm 
package ecstatic (#2960)
d042d19 is described below

commit d042d19fdb96061fec85558b4fc7bf72c1c73a02
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Sat May 4 11:17:12 2019 +0200

AMBARI-25270. Admin View build fails due to unavailable npm package 
ecstatic (#2960)
---
 ambari-admin/src/main/resources/ui/admin-web/package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-admin/src/main/resources/ui/admin-web/package.json 
b/ambari-admin/src/main/resources/ui/admin-web/package.json
index ac903c5..24cb68a 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/package.json
+++ b/ambari-admin/src/main/resources/ui/admin-web/package.json
@@ -18,7 +18,7 @@
 "gulp-size": "0.3.0",
 "gulp-uglify": "0.2.1",
 "gulp-useref": "0.4.2",
-"http-server": "0.6.1",
+"http-server": ">=0.6.1",
 "karma": "0.12.16",
 "karma-chrome-launcher": "0.1.4",
 "karma-jasmine": "0.1.5",



[ambari] branch trunk updated: AMBARI-25250. Blueprint processor should support multiple ZooKeeper nodes for livy.server.recovery.state-store.url (#2938)

2019-04-20 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 15fc310  AMBARI-25250. Blueprint processor should support multiple 
ZooKeeper nodes for livy.server.recovery.state-store.url (#2938)
15fc310 is described below

commit 15fc310803d6206869c5af1d439a8d13176c7230
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Sun Apr 21 05:14:28 2019 +0200

AMBARI-25250. Blueprint processor should support multiple ZooKeeper nodes 
for livy.server.recovery.state-store.url (#2938)
---
 .../controller/internal/BlueprintConfigurationProcessor.java | 4 
 .../controller/internal/BlueprintConfigurationProcessorTest.java | 9 -
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 56c0405..8e22e09 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -2825,6 +2825,7 @@ public class BlueprintConfigurationProcessor {
 Map oozieEnvHeapSizeMap = new HashMap<>();
 Map multiWebhcatSiteMap = new HashMap<>();
 Map multiHbaseSiteMap = new HashMap<>();
+Map livy2Conf = new HashMap<>();
 Map multiStormSiteMap = new HashMap<>();
 Map multiCoreSiteMap = new HashMap<>();
 Map multiHdfsSiteMap = new HashMap<>();
@@ -2898,6 +2899,7 @@ public class BlueprintConfigurationProcessor {
 multiHostTopologyUpdaters.put("accumulo-site", multiAccumuloSiteMap);
 multiHostTopologyUpdaters.put("kms-site", multiRangerKmsSiteMap);
 multiHostTopologyUpdaters.put("application-properties", atlasPropsMap);
+multiHostTopologyUpdaters.put("livy2-conf", livy2Conf);
 
 dbHostTopologyUpdaters.put("hive-site", dbHiveSiteMap);
 
@@ -3224,6 +3226,8 @@ public class BlueprintConfigurationProcessor {
 druidCommon.put("metastore_hostname", HostGroupUpdater.INSTANCE);
 druidCommon.put("druid.metadata.storage.connector.connectURI", 
HostGroupUpdater.INSTANCE);
 druidCommon.put("druid.zk.service.host", new 
MultipleHostTopologyUpdater("ZOOKEEPER_SERVER"));
+
+livy2Conf.put("livy.server.recovery.state-store.url", new 
MultipleHostTopologyUpdater("ZOOKEEPER_SERVER"));
   }
 
   private static void addUnitPropertyUpdaters() {
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index d1a22f0..71afb42 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -2792,6 +2792,10 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
 Map typeProps = new HashMap<>();
 typeProps.put("hbase.zookeeper.quorum", "localhost");
 properties.put("hbase-site", typeProps);
+Map livyConf = new HashMap<>();
+livyConf.put("livy.server.recovery.state-store.url", "/livy2-recovery");
+properties.put("livy2-conf", livyConf);
+Map originalLivyConf = ImmutableMap.copyOf(livyConf);
 
 Configuration clusterConfig = new Configuration(properties, emptyMap());
 
@@ -2827,7 +2831,8 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
 ClusterTopology topology = createClusterTopology(bp, clusterConfig, 
hostGroups);
 BlueprintConfigurationProcessor updater = new 
BlueprintConfigurationProcessor(topology);
 updater.doUpdateForClusterCreate();
-String updatedVal = 
topology.getConfiguration().getFullProperties().get("hbase-site").get("hbase.zookeeper.quorum");
+Map> fullProperties = 
topology.getConfiguration().getFullProperties();
+String updatedVal = 
fullProperties.get("hbase-site").get("hbase.zookeeper.quorum");
 String[] hosts = updatedVal.split(",");
 
 Collection expectedHosts = new HashSet<>();
@@ -2841,6 +2846,8 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
   assertTrue(expectedHosts.contains(host));
   expectedHosts.remove(host);
 }
+
+assertEquals(originalLivyConf, fullProperties.get("livy2-conf"));
   }
 
   @Test



[ambari] branch branch-2.7 updated: AMBARI-25250. Blueprint processor should support multiple ZooKeeper nodes for livy.server.recovery.state-store.url (#2935)

2019-04-16 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 97827c5  AMBARI-25250. Blueprint processor should support multiple 
ZooKeeper nodes for livy.server.recovery.state-store.url (#2935)
97827c5 is described below

commit 97827c52e725009a36a3cd621dbcf776203008e9
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Apr 16 17:30:27 2019 +0200

AMBARI-25250. Blueprint processor should support multiple ZooKeeper nodes 
for livy.server.recovery.state-store.url (#2935)
---
 .../controller/internal/BlueprintConfigurationProcessor.java | 4 
 .../controller/internal/BlueprintConfigurationProcessorTest.java | 9 -
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 68e7392..4500261 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -2826,6 +2826,7 @@ public class BlueprintConfigurationProcessor {
 Map oozieEnvHeapSizeMap = new HashMap<>();
 Map multiWebhcatSiteMap = new HashMap<>();
 Map multiHbaseSiteMap = new HashMap<>();
+Map livy2Conf = new HashMap<>();
 Map multiStormSiteMap = new HashMap<>();
 Map multiCoreSiteMap = new HashMap<>();
 Map multiHdfsSiteMap = new HashMap<>();
@@ -2899,6 +2900,7 @@ public class BlueprintConfigurationProcessor {
 multiHostTopologyUpdaters.put("accumulo-site", multiAccumuloSiteMap);
 multiHostTopologyUpdaters.put("kms-site", multiRangerKmsSiteMap);
 multiHostTopologyUpdaters.put("application-properties", atlasPropsMap);
+multiHostTopologyUpdaters.put("livy2-conf", livy2Conf);
 
 dbHostTopologyUpdaters.put("hive-site", dbHiveSiteMap);
 
@@ -3225,6 +3227,8 @@ public class BlueprintConfigurationProcessor {
 druidCommon.put("metastore_hostname", HostGroupUpdater.INSTANCE);
 druidCommon.put("druid.metadata.storage.connector.connectURI", 
HostGroupUpdater.INSTANCE);
 druidCommon.put("druid.zk.service.host", new 
MultipleHostTopologyUpdater("ZOOKEEPER_SERVER"));
+
+livy2Conf.put("livy.server.recovery.state-store.url", new 
MultipleHostTopologyUpdater("ZOOKEEPER_SERVER"));
   }
 
   private static void addUnitPropertyUpdaters() {
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 48e6bac..80e28e1 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -2764,6 +2764,10 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
 Map typeProps = new HashMap<>();
 typeProps.put("hbase.zookeeper.quorum", "localhost");
 properties.put("hbase-site", typeProps);
+Map livyConf = new HashMap<>();
+livyConf.put("livy.server.recovery.state-store.url", "/livy2-recovery");
+properties.put("livy2-conf", livyConf);
+Map originalLivyConf = ImmutableMap.copyOf(livyConf);
 
 Configuration clusterConfig = new Configuration(properties, emptyMap());
 
@@ -2799,7 +2803,8 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
 ClusterTopology topology = createClusterTopology(bp, clusterConfig, 
hostGroups);
 BlueprintConfigurationProcessor updater = new 
BlueprintConfigurationProcessor(topology);
 updater.doUpdateForClusterCreate();
-String updatedVal = 
topology.getConfiguration().getFullProperties().get("hbase-site").get("hbase.zookeeper.quorum");
+Map> fullProperties = 
topology.getConfiguration().getFullProperties();
+String updatedVal = 
fullProperties.get("hbase-site").get("hbase.zookeeper.quorum");
 String[] hosts = updatedVal.split(",");
 
 Collection expectedHosts = new HashSet<>();
@@ -2813,6 +2818,8 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
   assertTrue(expectedHosts.contains(host));
   expectedHosts.remove(host);
 }
+
+assertEquals(originalLivyConf, fullProperties.get("livy2-conf"));
   }
 
   @Test



[ambari] branch trunk updated (3a1ac6d -> 3dbaaba)

2019-02-27 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git.


omit 3a1ac6d  Merge remote-tracking branch 'origin/trunk' into trunk
omit 2aacb77  Revert "AMBARI-25168 : Need to add stack feature constant for 
kafka-ranger-env.sh removal."
omit aa2f55e  AMBARI-25168 : Need to add stack feature constant for 
kafka-ranger-env.sh removal.
omit 5b33104  AMBARI-25139. Cover all not covered common views
omit 4a22c3e  AMBARI-25150 Implement additional error reporting for 
ambari-web unit tests. (ababiichuk)
omit acd302f  AMBARI-25148 Cover views of Widget Create wizard with unit 
tests
omit cdd00bb  AMBARI-25149. Cover all not covered common views
omit f925abe  AMBARI-24958 Ambari YARN Queue Manager allows duplicate names 
when using rename functionality (asnaik) (#2659)
omit 84c6bb8  AMBARI-25139 Yarn Capacity Scheduler Authorization issues due 
to AuthToLocal Rules (asnaik) (#2807)
omit e466cf2  AMBARI-25145. Cover controllers of High Availability wizard 
with unit tests
omit 784e1ff  AMBARI-25144. Cover config history controller with unit tests
omit c4e483e  AMBARI-25135. Cover service mixin with unit tests
omit 152d2cb  AMBARI-25134. Cover controller of widget edit with unit tests
omit d1c31d9  AMBARI-24981. JournalNode may fail to start due to unreadable 
config file (#2679)
omit 1b72270  AMBARI-25142 Typo in ambari-server 'setup-security' help text 
(asnaik)
omit c87c755  AMBARI-25143 Remove unused models from ambari-web. 
(ababiichuk)
omit 2b185fb  AMBARI-25096 Cluster Installation fails when installing the 
cluster via Redhat satellite repositories (no internet connectivity Cluster)  
(asnaik)
omit 8e380b8  AMBARI-25138 Cover mappers files with unit tests. (ababiichuk)
omit 7e8881d  AMBARI-25020. Allow unattended mpack install with purge 
(#2794)
omit 1f8761d  AMBARI-25140 Cover widget mixin with unit tests
omit d219d03  [AMBARI-25131] Alert notification properties are wiped after 
enabling/disabling the notification (dsen) (#2786)
omit 1c04d50  AMBARI-25116. Fix other strange and buggy code (dlysnichenko) 
(#2785)
omit 6abc7f4  AMBARI-25133. StackAdvisorAdapterTest result depends on 
method execution order (#2795)
omit 6c0cf0b  AMBARI-25132. Cover metric view
omit a6171a7  AMBARI-25117. getAsPost requests don't work when ambari is 
used behind knox proxy (amagyar) (#2775)
omit e56ae38  AMBARI-24606. Deleting a service should do a better job of 
cleaning up the Ambari DB. (#2784)
omit c27d777  AMBARI-25128 Cover widget mixin with unit tests
omit 0bbad89  AMBARI-25123. /var/lib/ambari-agent/cache not updating 
(Ambari 2.7) (aonishuk)
omit 9875862  AMBARI-25111. Intermittent ConcurrentModificationException 
exception during STOMP message emitting. (#2776)
omit 94450eb  AMBARI-25122 UI unit tests are sometimes failing. (ababiichuk)
omit 8bebd21  AMBARI-25121. Cover editable list view
omit eb5eca4  AMBARI-25121. Cover editable list view
omit 7fc5173  AMBARI-25120. Cover Assign Master Components Views
omit 2994e87  AMBARI-25112 Cover errors utils with unit tests. (ababiichuk)
omit 903ac50  AMBARI-25116. Bug at AbstractProviderModule class 
(dlysnichenko) (#2774)
omit 73ff494  AMBARI-25110. Broken link to Query Parameters (#2772)
omit 4f49085  AMBARI-24745. Enable encryption of sensitive data in Ambari 
DB using … (#2755)
omit c0d9e73  AMBARI-25108 Cover views of the modals with unit tests
omit d0999b6  AMBARI-25109. Cover onefs view
omit fd3608c  [AMBARI-25106] Add Ozone JMX ports (dsen)
omit e74430b  AMBARI-25105. Cover views of the JournalNode wizard with unit 
tests
omit c8ec1ee  AMBARI-25069 - Ambari wrties Empty baseurl values written to 
Repo Files when using a local repository causing stack installation failure 
(#2743)
omit a031741  AMBARI-25103 Duplicate title on YARN summary page. 
(ababiichuk)
omit 68458cb  AMBARI-25065 - Unable to add user in views 'grant permissions'
omit 62fa866  AMBARI-25043. Make sure we mask password properties when 
fetching sensitive Ambari configuration via the API (just like we do it for 
service configs) (#2763)
omit aaeadf8  AMBARI-25102 Dasboard metrics will not load for ambari user 
which has dot in their username.
omit dd4e977  AMBARI-25097 Cover views of reassign wizard with unit tests
omit bc65b28  Delete server.sh
omit 4cfd4fb  Delete deploy-gce-perf-cluster.py.rej
omit 34b1d13  Delete agent.sh
omit 64693ef  AMBARI-25095. deploy-gce-perf-cluster.py fails after upgrade 
on gce controller (aonishuk)
omit 77c0381  AMBARI-25094 Remove Flume Live widget from Ambari, alongside 
the Flume service during upgrade to HDP3. (ababiichuk)
omit 5854297  AMBARI-25091 Cover flume metric graphs with unit t

[ambari] branch trunk updated: AMBARI-25168. Need to add stack feature constant for kafka-ranger-env.sh removal (#2835)

2019-02-27 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 5f86977  AMBARI-25168. Need to add stack feature constant for 
kafka-ranger-env.sh removal (#2835)
5f86977 is described below

commit 5f86977297dfe7a17cc64c7bfacd7fa3d5725b4e
Author: Vishal Suvagia 
AuthorDate: Thu Feb 28 12:57:34 2019 +0530

AMBARI-25168. Need to add stack feature constant for kafka-ranger-env.sh 
removal (#2835)
---
 .../src/main/python/resource_management/libraries/functions/constants.py | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
index ba179bc..82efddb 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
@@ -125,3 +125,4 @@ class StackFeature:
   MULTIPLE_ENV_SH_FILES_SUPPORT = "multiple_env_sh_files_support"
   AMS_LEGACY_HADOOP_SINK = "ams_legacy_hadoop_sink"
   RANGER_ALL_ADMIN_CHANGE_DEFAULT_PASSWORD = 
'ranger_all_admin_change_default_password'
+  KAFKA_ENV_INCLUDE_RANGER_SCRIPT='kafka_env_include_ranger_script'



[ambari] branch branch-2.7 updated: AMBARI-25168. Need to add stack feature constant for kafka-ranger-env.sh removal. (#2836)

2019-02-27 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 0c931a1  AMBARI-25168. Need to add stack feature constant for 
kafka-ranger-env.sh removal. (#2836)
0c931a1 is described below

commit 0c931a1874c7bee1137ebcffa07030e84e003d3e
Author: Vishal Suvagia 
AuthorDate: Thu Feb 28 12:46:37 2019 +0530

AMBARI-25168. Need to add stack feature constant for kafka-ranger-env.sh 
removal. (#2836)
---
 .../src/main/python/resource_management/libraries/functions/constants.py | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
index ba179bc..82efddb 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/constants.py
@@ -125,3 +125,4 @@ class StackFeature:
   MULTIPLE_ENV_SH_FILES_SUPPORT = "multiple_env_sh_files_support"
   AMS_LEGACY_HADOOP_SINK = "ams_legacy_hadoop_sink"
   RANGER_ALL_ADMIN_CHANGE_DEFAULT_PASSWORD = 
'ranger_all_admin_change_default_password'
+  KAFKA_ENV_INCLUDE_RANGER_SCRIPT='kafka_env_include_ranger_script'



[ambari] branch branch-2.7 updated: AMBARI-25162. Fix Oozie Service Check (#2827)

2019-02-27 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 853d753  AMBARI-25162. Fix Oozie Service Check (#2827)
853d753 is described below

commit 853d753eac97c4b8de155dacde2019d4af53d7d2
Author: dineshchitlangia 
AuthorDate: Wed Feb 27 05:48:37 2019 -0500

AMBARI-25162. Fix Oozie Service Check (#2827)
---
 .../common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
index ae7cb21..29fcb16 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/service_check.py
@@ -20,6 +20,7 @@ limitations under the License.
 import os
 import glob
 
+from resource_management.core.exceptions import Fail
 from resource_management.core.resources.system import Execute
 from resource_management.core.resources import File
 from resource_management.core.source import StaticFile



[ambari] branch trunk updated: AMBARI-24981. JournalNode may fail to start due to unreadable config file (#2679)

2019-02-05 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 8613d58  AMBARI-24981. JournalNode may fail to start due to unreadable 
config file (#2679)
8613d58 is described below

commit 8613d58c347cc21961726811ac8d7bf43389ee6f
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Feb 5 15:48:25 2019 +0100

AMBARI-24981. JournalNode may fail to start due to unreadable config file 
(#2679)
---
 .../resource_management/TestContentSources.py  |   5 +-
 .../python/resource_management/TestFileResource.py |  39 ++
 .../TestPropertiesFileResource.py  |  16 +--
 .../resource_management/TestRepositoryResource.py  |  12 +-
 .../resource_management/TestXmlConfigResource.py   |  17 ++-
 .../src/main/python/ambari_commons/os_utils.py |   6 +
 .../resource_management/core/providers/system.py   |  68 +-
 .../main/python/resource_management/core/sudo.py   | 140 +++--
 .../libraries/providers/repository.py  |   6 +-
 9 files changed, 158 insertions(+), 151 deletions(-)

diff --git 
a/ambari-agent/src/test/python/resource_management/TestContentSources.py 
b/ambari-agent/src/test/python/resource_management/TestContentSources.py
index eb5eee2..37281bb 100644
--- a/ambari-agent/src/test/python/resource_management/TestContentSources.py
+++ b/ambari-agent/src/test/python/resource_management/TestContentSources.py
@@ -99,13 +99,14 @@ class TestContentSources(TestCase):
 self.assertEqual(opener_mock.call_count, 1)
 request_mock.assert_called_with('http://download/source')
 self.assertEqual(web_file_mock.read.call_count, 1)
-
+
   @patch("__builtin__.open")
   @patch.object(urllib2, "Request")
   @patch.object(urllib2, "build_opener")
   @patch.object(os, "makedirs")
   @patch.object(os.path, "exists")
-  def test_download_source_get_content_cache_new(self, exists_mock, 
makedirs_mock, opener_mock, request_mock, open_mock):
+  @patch("resource_management.core.sudo.create_file")
+  def test_download_source_get_content_cache_new(self, create_mock, 
exists_mock, makedirs_mock, opener_mock, request_mock, open_mock):
 """
 Testing DownloadSource.get_content with cache on non-cached resource
 """
diff --git 
a/ambari-agent/src/test/python/resource_management/TestFileResource.py 
b/ambari-agent/src/test/python/resource_management/TestFileResource.py
index 8fc81e4..bcabdd29 100644
--- a/ambari-agent/src/test/python/resource_management/TestFileResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestFileResource.py
@@ -18,7 +18,7 @@ limitations under the License.
 
 
 from unittest import TestCase
-from mock.mock import patch, MagicMock
+from mock.mock import patch, MagicMock, ANY
 from only_for_platform import get_platform, not_for_platform, os_distro_value, 
PLATFORM_WINDOWS
 
 from ambari_commons.os_check import OSCheck
@@ -103,10 +103,9 @@ class TestFileResource(TestCase):
mode=0777,
content='file-content'
   )
-
 
-create_file_mock.assert_called_with('/directory/file', 'file-content', 
encoding=None)
-self.assertEqual(create_file_mock.call_count, 1)
+
+create_file_mock.assert_called_once('/directory/file', 'file-content', 
encoding=None, on_file_created=ANY)
 ensure_mock.assert_called()
 
 
@@ -130,8 +129,8 @@ class TestFileResource(TestCase):
content='new-content'
   )
 
-read_file_mock.assert_called_with('/directory/file', encoding=None)
-create_file_mock.assert_called_with('/directory/file', 'new-content', 
encoding=None)
+read_file_mock.assert_called_with('/directory/file', encoding=None)
+create_file_mock.assert_called_with('/directory/file', 'new-content', 
encoding=None, on_file_created=ANY)
 
 
   @patch("resource_management.core.sudo.unlink")
@@ -276,16 +275,12 @@ class TestFileResource(TestCase):
   @patch("resource_management.core.sudo.chown")
   @patch("resource_management.core.sudo.chmod")
   @patch("resource_management.core.sudo.stat")
-  @patch("resource_management.core.sudo.create_file")
-  @patch("resource_management.core.sudo.path_exists")
-  @patch("resource_management.core.sudo.path_isdir")
-  def test_ensure_metadata(self, isdir_mock, exists_mock, create_file_mock, 
stat_mock, chmod_mock, chown_mock, getgrnam_mock,
+  def test_ensure_metadata(self, stat_mock, chmod_mock, chown_mock, 
getgrnam_mock,
getpwnam_mock):
 """
 Tests if _ensure_metadata changes ow

[ambari] branch trunk updated: AMBARI-25020. Allow unattended mpack install with purge (#2794)

2019-02-04 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new b2a0297  AMBARI-25020. Allow unattended mpack install with purge 
(#2794)
b2a0297 is described below

commit b2a0297051a9603ab695b640ba37bc13e90877a1
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Feb 4 15:22:13 2019 +0100

AMBARI-25020. Allow unattended mpack install with purge (#2794)
---
 ambari-server/src/main/python/ambari_server/setupMpacks.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ambari-server/src/main/python/ambari_server/setupMpacks.py 
b/ambari-server/src/main/python/ambari_server/setupMpacks.py
index b8c0974..640cc2f 100755
--- a/ambari-server/src/main/python/ambari_server/setupMpacks.py
+++ b/ambari-server/src/main/python/ambari_server/setupMpacks.py
@@ -347,11 +347,12 @@ def validate_purge(options, purge_list, mpack_dir, 
mpack_metadata, replay_mode=F
 
   if not replay_mode:
 purge_resources = set((v) for k, v in RESOURCE_FRIENDLY_NAMES.iteritems() 
if k in purge_list)
+answer = 'yes' if options.silent else 'no'
 warn_msg = "CAUTION: You have specified the --purge option with 
--purge-list={0}. " \
"This will replace all existing {1} currently installed.\n" \
-   "Are you absolutely sure you want to perform the purge 
[yes/no]? (no)".format(
-purge_list, ", ".join(purge_resources))
-okToPurge = get_YN_input(warn_msg, False)
+   "Are you absolutely sure you want to perform the purge 
[yes/no]? ({2})".format(
+purge_list, ", ".join(purge_resources), answer)
+okToPurge = get_YN_input(warn_msg, options.silent, answer)
 if not okToPurge:
   err = "Management pack installation cancelled by user"
   raise FatalException(1, err)



[ambari] branch branch-2.6 updated: AMBARI-25136. Scale hosts ignores rack_info (#2800)

2019-01-31 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new cde0c47  AMBARI-25136. Scale hosts ignores rack_info (#2800)
cde0c47 is described below

commit cde0c47195b723d0bc211c22dacf8c450d865111
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Jan 31 16:51:15 2019 +0100

AMBARI-25136. Scale hosts ignores rack_info (#2800)
---
 .../controller/internal/ScaleClusterRequest.java  |  2 ++
 .../controller/internal/ScaleClusterRequestTest.java  | 19 +++
 2 files changed, 21 insertions(+)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ScaleClusterRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ScaleClusterRequest.java
index 9434f3b..7a799bd 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ScaleClusterRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ScaleClusterRequest.java
@@ -180,6 +180,8 @@ public class ScaleClusterRequest extends BaseClusterRequest 
{
 String rackInfo = null;
 if 
(properties.containsKey(HostResourceProvider.HOST_RACK_INFO_PROPERTY_ID)) {
   rackInfo = (String) 
properties.get(HostResourceProvider.HOST_RACK_INFO_PROPERTY_ID);
+} else if 
(properties.containsKey(HostResourceProvider.RACK_INFO_PROPERTY_ID)) {
+  rackInfo = (String) 
properties.get(HostResourceProvider.RACK_INFO_PROPERTY_ID);
 } else {
   LOGGER.debug("No rack info provided");
 }
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
index 3f96944..5069994 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
@@ -50,6 +50,8 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
+import com.google.common.collect.ImmutableMap;
+
 /**
  * Unit tests for ScaleClusterRequest.
  */
@@ -64,6 +66,7 @@ public class ScaleClusterRequestTest {
   private static final String GROUP2_NAME = "group2";
   private static final String GROUP3_NAME = "group3";
   private static final String PREDICATE = "test/prop=foo";
+  private static final String RACK_A = "/rack/a";
 
   private static final BlueprintFactory blueprintFactory = 
createStrictMock(BlueprintFactory.class);
   private static final Blueprint blueprint = createNiceMock(Blueprint.class);
@@ -130,6 +133,14 @@ public class ScaleClusterRequestTest {
 assertTrue(group1Info.getHostNames().contains(HOST1_NAME));
 assertEquals(1, group1Info.getRequestedHostCount());
 assertNull(group1Info.getPredicate());
+assertEquals(ImmutableMap.of(HOST1_NAME, RACK_A), 
group1Info.getHostRackInfo());
+  }
+
+  @Test
+  public void acceptsRackInfo() throws Exception {
+Map props = 
createScaleClusterPropertiesGroup1_HostName(CLUSTER_NAME, BLUEPRINT_NAME);
+addSingleHostByName(props);
+addSingleHostByName(replaceWithPlainRackInfoKey(props));
   }
 
   @Test
@@ -350,6 +361,7 @@ public class ScaleClusterRequestTest {
 properties.put(HostResourceProvider.BLUEPRINT_PROPERTY_ID, blueprintName);
 properties.put(HostResourceProvider.HOST_GROUP_PROPERTY_ID, GROUP1_NAME);
 properties.put(HostResourceProvider.HOST_HOST_NAME_PROPERTY_ID, 
HOST1_NAME);
+properties.put(HostResourceProvider.HOST_RACK_INFO_PROPERTY_ID, RACK_A);
 
 return properties;
   }
@@ -361,6 +373,13 @@ public class ScaleClusterRequestTest {
 return properties;
   }
 
+  // include rack info under "rack_info" key instead of "Hosts/rack_info"
+  private static Map replaceWithPlainRackInfoKey(Map properties) {
+Object value = 
properties.remove(HostResourceProvider.HOST_RACK_INFO_PROPERTY_ID);
+properties.put(HostResourceProvider.RACK_INFO_PROPERTY_ID, value);
+return properties;
+  }
+
   public static Map 
createScaleClusterPropertiesGroup1_HostCount(String clusterName, String 
blueprintName) {
 Map properties = new LinkedHashMap<>();
 



[ambari] branch branch-2.6 updated: AMBARI-24865. Build error at Findbugs with Maven 3.6 (#2804)

2019-01-31 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new 6b9dde9  AMBARI-24865. Build error at Findbugs with Maven 3.6 (#2804)
6b9dde9 is described below

commit 6b9dde95d317e6f96de67b8d4f3cadbcd2f35950
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Jan 31 16:06:05 2019 +0100

AMBARI-24865. Build error at Findbugs with Maven 3.6 (#2804)
---
 ambari-server/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index acd6289..ad7d535 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -542,7 +542,7 @@
   
 org.codehaus.mojo
 findbugs-maven-plugin
-3.0.3
+3.0.5
 
   false
   Low



[ambari] branch trunk updated: AMBARI-25133. StackAdvisorAdapterTest result depends on method execution order (#2795)

2019-01-29 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new cf82327  AMBARI-25133. StackAdvisorAdapterTest result depends on 
method execution order (#2795)
cf82327 is described below

commit cf82327ca1f3819ea251e38d4b9ed30e8c2e9923
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Jan 29 19:59:53 2019 +0100

AMBARI-25133. StackAdvisorAdapterTest result depends on method execution 
order (#2795)
---
 .../addservice/StackAdvisorAdapterTest.java| 118 ++---
 1 file changed, 59 insertions(+), 59 deletions(-)

diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/StackAdvisorAdapterTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/StackAdvisorAdapterTest.java
index bd80bda..eacfaaf 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/StackAdvisorAdapterTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/StackAdvisorAdapterTest.java
@@ -117,7 +117,7 @@ public class StackAdvisorAdapterTest {
 .put("c7406", ImmutableSet.of("DATANODE", "HDFS_CLIENT", 
"ZOOKEEPER_CLIENT"))
 .build();
 
-  private static final AddServiceInfo.Builder ADD_SERVICE_INFO_BUILDER = new 
AddServiceInfo.Builder()
+  private final AddServiceInfo.Builder addServiceInfoBuilder = new 
AddServiceInfo.Builder()
 .setClusterName("c1");
 
   @Test
@@ -169,58 +169,6 @@ public class StackAdvisorAdapterTest {
   }
 
   @Test
-  public void getLayoutRecommendationInfo() {
-Map>> newServices = ImmutableMap.of(
-  "KAFKA", ImmutableMap.of(
-"KAFKA_BROKER", ImmutableSet.of("c7401")),
-  "SPARK2", ImmutableMap.of(
-"SPARK2_JOBHISTORYSERVER", ImmutableSet.of("c7402"),
-"SPARK2_CLIENT", ImmutableSet.of("c7403", "c7404")),
-  "OOZIE", ImmutableMap.of(
-"OOZIE_SERVER", ImmutableSet.of("c7401"),
-"OOZIE_CLIENT", ImmutableSet.of("c7403", "c7404")));
-
-AddServiceRequest request = 
request(ConfigRecommendationStrategy.ALWAYS_APPLY);
-AddServiceInfo info = ADD_SERVICE_INFO_BUILDER
-  .setRequest(request)
-  .setStack(stack)
-  .setConfig(Configuration.newEmpty())
-  .setNewServices(newServices)
-  .build(); // No LayoutReommendationInfo -> needs to be calculated
-
-LayoutRecommendationInfo layoutRecommendationInfo = 
adapter.getLayoutRecommendationInfo(info);
-layoutRecommendationInfo.getAllServiceLayouts();
-
-assertEquals(
-  ImmutableMap.of(
-"host_group_1", ImmutableSet.of("c7401"),
-"host_group_2", ImmutableSet.of("c7402"),
-"host_group_3", ImmutableSet.of("c7403", "c7404")),
-  layoutRecommendationInfo.getHostGroups());
-
-assertEquals(
-  ImmutableMap.>>builder()
-.put("KAFKA", ImmutableMap.of(
-  "KAFKA_BROKER", ImmutableSet.of("c7401")))
-.put("SPARK2", ImmutableMap.of(
-  "SPARK2_JOBHISTORYSERVER", ImmutableSet.of("c7402"),
-  "SPARK2_CLIENT", ImmutableSet.of("c7403", "c7404")))
-.put("OOZIE", ImmutableMap.of(
-  "OOZIE_SERVER", ImmutableSet.of("c7401"),
-  "OOZIE_CLIENT", ImmutableSet.of("c7403", "c7404")))
-.put("HDFS", ImmutableMap.of(
-  "NAMENODE", ImmutableSet.of("c7401"),
-  "HDFS_CLIENT", ImmutableSet.of("c7401", "c7402")))
-.put("ZOOKEEPER", ImmutableMap.of(
-  "ZOOKEEPER_SERVER", ImmutableSet.of("c7401"),
-  "ZOOKEEPER_CLIENT", ImmutableSet.of("c7401", "c7402")))
-.put("MAPREDUCE2", ImmutableMap.of(
-  "HISTORYSERVER", ImmutableSet.of("c7401")))
-.build(),
-  layoutRecommendationInfo.getAllServiceLayouts());
-  }
-
-  @Test
   public void keepNewServicesOnly() {
 Map>> newServices = ImmutableMap.of(
   "KAFKA", emptyMap(),
@@ -368,7 +316,7 @@ public class StackAdvisorAdapterTest {
   "KAFKA",
   ImmutableMap.of("KAFKA_BROKER", emptySet()));
 
-AddServiceInfo info = ADD_SERVICE_INFO_BUILDER
+AddServiceInfo info = addServiceInfoBuilder
   .setStack(stack)
   .setConfig(Configuration.newEmpty())
   .setNewServ

[ambari] branch branch-2.7 updated: AMBARI-25041. Scale hosts does not install component if service is in maintenance mode (#2787)

2019-01-29 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 6e14430  AMBARI-25041. Scale hosts does not install component if 
service is in maintenance mode (#2787)
6e14430 is described below

commit 6e14430857028efe9418c169547633ecdd46b8de
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Jan 29 16:02:22 2019 +0100

AMBARI-25041. Scale hosts does not install component if service is in 
maintenance mode (#2787)
---
 .../internal/HostComponentResourceProvider.java |  6 +-
 .../controller/internal/RequestOperationLevel.java  | 21 +
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index 96197c0..c245b95 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -390,6 +390,9 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
   (skipInstallForComponents, ";"));
 
requestInfo.put(AmbariManagementControllerImpl.DONT_SKIP_INSTALL_FOR_COMPONENTS,
 StringUtils.join
   (dontSkipInstallForComponents, ";"));
+// although the operation is really for a specific host, the level needs 
to be set to HostComponent
+// to make sure that any service in maintenance mode does not prevent 
install/start on the new host during scale-up
+
requestInfo.putAll(RequestOperationLevel.propertiesFor(Resource.Type.HostComponent,
 cluster));
 
 Request installRequest = 
PropertyHelper.getUpdateRequest(installProperties, requestInfo);
 
@@ -437,6 +440,8 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
 Map requestInfo = new HashMap<>();
 requestInfo.put("context", String.format("Start components on host %s", 
hostName));
 requestInfo.put("phase", "INITIAL_START");
+// see rationale for marking the operation as HostComponent-level at 
"Install components on host"
+
requestInfo.putAll(RequestOperationLevel.propertiesFor(Resource.Type.HostComponent,
 cluster));
 requestInfo.put(Setting.SETTING_NAME_SKIP_FAILURE, 
Boolean.toString(skipFailure));
 
 Predicate clusterPredicate = new EqualsPredicate<>(CLUSTER_NAME, cluster);
@@ -500,7 +505,6 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
 return requestStages.getRequestStatusResponse();
   }
 
-
   /**
* Update the host component identified by the given request object with the
* values carried by the given request object.
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestOperationLevel.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestOperationLevel.java
index ed43722..2e1e18e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestOperationLevel.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestOperationLevel.java
@@ -21,6 +21,8 @@ import java.util.Map;
 
 import org.apache.ambari.server.controller.spi.Resource;
 
+import com.google.common.collect.ImmutableMap;
+
 /**
  * Operation level is specified along with some requests. It identifies
  * the logical level, at which the operation is executed.
@@ -183,4 +185,23 @@ public class RequestOperationLevel {
 ", hostName='" + hostName + '\'' +
 '}';
   }
+
+  /**
+   * Create a map of required properties to be added to a request info map 
which is
+   * then used to create a {@link RequestOperationLevel} object.
+   * Other properties (service name, host name, host component name) can be 
set on
+   * the request info map itself as needed.
+   *
+   * @param type resource type for which to calculate the operation level
+   * @param clusterName cluster name
+   * @return immutable map with required properties: operation level and 
cluster name
+   * @throws IllegalArgumentException if the given resource {@code type} is 
not mapped to any operation level
+   */
+  public static Map propertiesFor(Resource.Type type, String 
clusterName) {
+return ImmutableMap.of(
+  OPERATION_LEVEL_ID, getExternalLevelName(type.name()),
+  OPERATION_CLUSTER_ID, clusterName
+);
+  }
+
 }



[ambari] branch trunk updated: AMBARI-25110. Broken link to Query Parameters (#2772)

2019-01-21 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 94067cb  AMBARI-25110. Broken link to Query Parameters (#2772)
94067cb is described below

commit 94067cb8bbeee702113273aab2757ad17f863d91
Author: bartjanssens92 
AuthorDate: Mon Jan 21 11:49:50 2019 +0100

AMBARI-25110. Broken link to Query Parameters (#2772)

Signed-off-by: bjanssens 
---
 ambari-server/docs/api/v1/index.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-server/docs/api/v1/index.md 
b/ambari-server/docs/api/v1/index.md
index 2ba8679..e8abcb6 100644
--- a/ambari-server/docs/api/v1/index.md
+++ b/ambari-server/docs/api/v1/index.md
@@ -26,7 +26,7 @@ The Ambari API facilitates the management and monitoring of 
the resources of an
 - [Management](#management)
 - [Resources](#resources)
 - [Partial Response](#partial-response)
-- [Query Parameters](#query-parameters)
+- [Query Predicates](#query-predicates)
 - [Batch Requests](#batch-requests)
 - [RequestInfo](#request-info)
 - [Temporal Metrics](#temporal-metrics)



[ambari] branch trunk updated: AMBARI-25061. Refactor AddServiceInfo to use a builder (#2756)

2019-01-07 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 883d95f  AMBARI-25061. Refactor AddServiceInfo to use a builder (#2756)
883d95f is described below

commit 883d95f7a93ed53e637b617acd86cd2bf9b5c3fd
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Jan 7 20:48:20 2019 +0100

AMBARI-25061. Refactor AddServiceInfo to use a builder (#2756)
---
 .../server/topology/addservice/AddServiceInfo.java | 87 ++
 .../topology/addservice/RequestValidator.java  | 13 +++-
 .../ProvisionActionPredicateBuilderTest.java   |  8 +-
 .../addservice/StackAdvisorAdapterTest.java| 61 ---
 4 files changed, 136 insertions(+), 33 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceInfo.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceInfo.java
index 1d675e5..0c0c267 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceInfo.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceInfo.java
@@ -42,18 +42,7 @@ public final class AddServiceInfo {
   private final Configuration config;
   private final LayoutRecommendationInfo recommendationInfo;
 
-  public AddServiceInfo(
-AddServiceRequest request,
-String clusterName,
-RequestStageContainer stages,
-Stack stack,
-Configuration config,
-Map>> newServices
-  ) {
-this(request, clusterName, stages, stack, config, newServices, null, null);
-  }
-
-  AddServiceInfo(
+  private AddServiceInfo(
 AddServiceRequest request,
 String clusterName,
 RequestStageContainer stages,
@@ -73,13 +62,26 @@ public final class AddServiceInfo {
 this.recommendationInfo = recommendationInfo;
   }
 
+  public Builder toBuilder() {
+return new Builder()
+  .setRequest(request)
+  .setClusterName(clusterName)
+  .setStack(stack)
+  .setKerberosDescriptor(kerberosDescriptor)
+  .setNewServices(newServices)
+  .setStages(stages)
+  .setConfig(config)
+  .setRecommendationInfo(recommendationInfo)
+  ;
+  }
+
   public AddServiceInfo withLayoutRecommendation(Map>> services,
  LayoutRecommendationInfo 
recommendation) {
-return new AddServiceInfo(request, clusterName, stages, stack, config, 
services, kerberosDescriptor, recommendation);
+return 
toBuilder().setNewServices(services).setRecommendationInfo(recommendation).build();
   }
 
   public AddServiceInfo withConfig(Configuration newConfig) {
-return new AddServiceInfo(request, clusterName, stages, stack, newConfig, 
newServices, kerberosDescriptor, recommendationInfo);
+return toBuilder().setConfig(newConfig).build();
   }
 
   @Override
@@ -141,4 +143,61 @@ public final class AddServiceInfo {
 return !request.getServices().isEmpty();
   }
 
+  public static class Builder {
+
+private AddServiceRequest request;
+private String clusterName;
+private Stack stack;
+private KerberosDescriptor kerberosDescriptor;
+private Map>> newServices;
+private RequestStageContainer stages;
+private Configuration config;
+private LayoutRecommendationInfo recommendationInfo;
+
+public AddServiceInfo build() {
+  return new AddServiceInfo(request, clusterName, stages, stack, config, 
newServices, kerberosDescriptor, recommendationInfo);
+}
+
+public Builder setRequest(AddServiceRequest request) {
+  this.request = request;
+  return this;
+}
+
+public Builder setClusterName(String clusterName) {
+  this.clusterName = clusterName;
+  return this;
+}
+
+public Builder setStages(RequestStageContainer stages) {
+  this.stages = stages;
+  return this;
+}
+
+public Builder setStack(Stack stack) {
+  this.stack = stack;
+  return this;
+}
+
+public Builder setConfig(Configuration config) {
+  this.config = config;
+  return this;
+}
+
+public Builder setNewServices(Map>> 
newServices) {
+  this.newServices = newServices;
+  return this;
+}
+
+public Builder setKerberosDescriptor(KerberosDescriptor 
kerberosDescriptor) {
+  this.kerberosDescriptor = kerberosDescriptor;
+  return this;
+}
+
+public Builder setRecommendationInfo(LayoutRecommendationInfo 
recommendationInfo) {
+  this.recommendationInfo = recommendationInfo;
+  return this;
+}
+
+  }
+
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/RequestValidator.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/RequestValidator.java
index 59302d1

[ambari] branch trunk updated: AMBARI-25006. Support component-level provision_action in Add Service request (#2725)

2018-12-20 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 1431ab4  AMBARI-25006. Support component-level provision_action in Add 
Service request (#2725)
1431ab4 is described below

commit 1431ab44887c2ff7f9e94f8fcb42e24e3ce33800
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Dec 20 15:56:46 2018 +0100

AMBARI-25006. Support component-level provision_action in Add Service 
request (#2725)
---
 .../AmbariCustomCommandExecutionHelper.java|   5 +-
 .../controller/AmbariManagementControllerImpl.java |  12 +-
 .../internal/HostComponentResourceProvider.java|  11 +-
 .../controller/internal/ProvisionAction.java   |  28 +-
 .../internal/ServiceResourceProvider.java  |   5 +-
 .../server/controller/predicate/OrPredicate.java   |   6 +
 .../server/controller/predicate/Predicates.java|  50 
 .../ambari/server/topology/ProvisionStep.java  |  87 ++
 .../server/topology/addservice/AddServiceInfo.java |  24 +-
 .../addservice/AddServiceOrchestrator.java |  17 +-
 .../addservice}/AddServiceRequest.java | 165 +-
 .../server/topology/addservice/Component.java  | 115 +++
 .../ambari/server/topology/addservice/Host.java|  68 +
 .../ProvisionActionPredicateBuilder.java   | 331 +
 .../topology/addservice/RequestValidator.java  |  36 ++-
 .../addservice/RequestValidatorFactory.java|   1 -
 .../addservice/ResourceProviderAdapter.java|  57 ++--
 .../ambari/server/topology/addservice/Service.java |  96 ++
 .../addservice}/AddServiceRequestTest.java |  18 +-
 .../ProvisionActionPredicateBuilderTest.java   | 202 +
 .../topology/addservice/RequestValidatorTest.java  |  47 ++-
 .../addservice/StackAdvisorAdapterTest.java|  33 +-
 .../test/resources/add_service_api/request1.json   |   3 +-
 23 files changed, 1137 insertions(+), 280 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 52dd6ce..741f9e6 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -66,6 +66,7 @@ import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.internal.RequestOperationLevel;
 import org.apache.ambari.server.controller.internal.RequestResourceFilter;
+import org.apache.ambari.server.controller.internal.RequestResourceProvider;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.metadata.ActionMetadata;
 import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
@@ -450,8 +451,8 @@ public class AmbariCustomCommandExecutionHelper {
 commandTimeout = Math.max(60, commandTimeout);
   }
 
-  if (requestParams != null && requestParams.containsKey("context")) {
-String requestContext = requestParams.get("context");
+  if (requestParams != null && 
requestParams.containsKey(RequestResourceProvider.CONTEXT)) {
+String requestContext = 
requestParams.get(RequestResourceProvider.CONTEXT);
 if (StringUtils.isNotEmpty(requestContext) && 
requestContext.toLowerCase().contains("rolling-restart")) {
   Config clusterEnvConfig = 
cluster.getDesiredConfigByType("cluster-env");
   if (clusterEnvConfig != null) {
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 36e2e14..82bd14f 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
@@ -127,6 +127,7 @@ import 
org.apache.ambari.server.controller.internal.DeleteStatusMetaData;
 import 
org.apache.ambari.server.controller.internal.HostComponentResourceProvider;
 import org.apache.ambari.server.controller.internal.RequestOperationLevel;
 import org.apache.ambari.server.controller.internal.RequestResourceFilter;
+import org.apache.ambari.server.controller.internal.RequestResourceProvider;
 import org.apache.ambari.server.controller.internal.RequestStageContainer;
 import org.apache.ambari.server.controller.internal.URLStreamProvider;
 import 
org

[ambari] branch trunk updated: AMBARI-25053. Validate SQL schema creation scripts with Docker containers (#2728)

2018-12-19 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 3c28378  AMBARI-25053. Validate SQL schema creation scripts with 
Docker containers (#2728)
3c28378 is described below

commit 3c28378fa4e6f4299e7df01c47359b4c8643ef63
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Dec 19 19:53:26 2018 +0100

AMBARI-25053. Validate SQL schema creation scripts with Docker containers 
(#2728)
---
 ambari-funtest/pom.xml | 52 ++-
 .../funtest/server/tests/DeleteServiceTest.java| 31 -
 .../ambari/funtest/server/tests/GetStacksTest.java | 23 +++
 .../tests/RoleBasedAccessControlBasicTest.java | 15 +++--
 .../funtest/server/tests/db/DDLCreateIT.java   | 74 ++
 ambari-project/pom.xml | 49 ++
 .../src/main/resources/Ambari-DDL-MySQL-CREATE.sql |  2 +-
 7 files changed, 212 insertions(+), 34 deletions(-)

diff --git a/ambari-funtest/pom.xml b/ambari-funtest/pom.xml
index 23a9fd7..dd3deea 100644
--- a/ambari-funtest/pom.xml
+++ b/ambari-funtest/pom.xml
@@ -21,8 +21,20 @@
   jar
   Ambari Functional Tests
   Ambari Functional Tests
+  
+1.8
+  
   
 
+  
+maven-compiler-plugin
+3.2
+
+  ${jdk.version}
+  ${jdk.version}
+  false
+ 
+  

  org.vafer
  jdeb
@@ -76,11 +88,16 @@
   
 **/*.java
   
-  once
 
 
   
   
+integration-test
+
+  integration-test
+
+  
+  
 run-verify
 verify
 
@@ -98,6 +115,7 @@
   src/test/resources/os_family.json
   src/test/resources/stacks/**
   derby.log
+  pass.txt
 
   
   
@@ -179,5 +197,37 @@
   org.apache.httpcomponents
   httpclient
 
+
+  org.testcontainers
+  testcontainers
+
+
+  org.testcontainers
+  postgresql
+
+
+  org.testcontainers
+  mariadb
+
+
+  org.mariadb.jdbc
+  mariadb-java-client
+
+
+  org.testcontainers
+  mssqlserver
+
+
+  com.microsoft.sqlserver
+  mssql-jdbc
+
+
+  org.testcontainers
+  mysql
+
+
+  mysql
+  mysql-connector-java
+
   
 
diff --git 
a/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java
 
b/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java
index 1bfc6a2..f677b34 100644
--- 
a/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java
+++ 
b/ambari-funtest/src/test/java/org/apache/ambari/funtest/server/tests/DeleteServiceTest.java
@@ -18,8 +18,11 @@
 
 package org.apache.ambari.funtest.server.tests;
 
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
 import org.apache.ambari.funtest.server.ConnectionParams;
 import org.apache.ambari.funtest.server.WebResponse;
 import org.apache.ambari.funtest.server.api.cluster.DeleteClusterWebRequest;
@@ -29,28 +32,25 @@ import 
org.apache.ambari.funtest.server.api.service.StopServiceWebRequest;
 import org.apache.ambari.funtest.server.utils.ClusterUtils;
 import org.apache.ambari.funtest.server.utils.RestApiUtils;
 import org.apache.ambari.server.orm.dao.ClusterServiceDAO;
-import org.apache.ambari.server.orm.dao.ServiceDesiredStateDAO;
-import org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO;
-import org.apache.ambari.server.orm.dao.HostComponentStateDAO;
 import org.apache.ambari.server.orm.dao.HostComponentDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.HostComponentStateDAO;
+import org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.ServiceDesiredStateDAO;
 import org.apache.ambari.server.orm.entities.ClusterServiceEntity;
-import org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity;
-import 
org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity;
-import org.apache.ambari.server.orm.entities.HostComponentStateEntity;
 import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.HostComponentStateEntity;
+import 
org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity;
 import org.apache.ambari.server.orm.entities.ServiceDesiredStateEntityPK;
 

[ambari] branch trunk updated: AMBARI-25041. Scale hosts does not install component if service is in maintenance mode (#2720)

2018-12-13 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new ab3e2b6  AMBARI-25041. Scale hosts does not install component if 
service is in maintenance mode (#2720)
ab3e2b6 is described below

commit ab3e2b6f17057cbe78d5e3f9385b83394c2aca6a
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Dec 13 16:37:12 2018 +0100

AMBARI-25041. Scale hosts does not install component if service is in 
maintenance mode (#2720)
---
 .../internal/HostComponentResourceProvider.java |  6 +-
 .../controller/internal/RequestOperationLevel.java  | 21 +
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index 7cb532a..8ba2623 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -396,6 +396,9 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
 Map requestInfo = new HashMap<>();
 requestInfo.put("context", String.format("Install components on host %s", 
hostname));
 requestInfo.put(CLUSTER_PHASE_PROPERTY, CLUSTER_PHASE_INITIAL_INSTALL);
+// although the operation is really for a specific host, the level needs 
to be set to HostComponent
+// to make sure that any service in maintenance mode does not prevent 
install/start on the new host during scale-up
+
requestInfo.putAll(RequestOperationLevel.propertiesFor(Resource.Type.HostComponent,
 cluster));
 addProvisionActionProperties(skipInstallForComponents, 
dontSkipInstallForComponents, requestInfo);
 
 Request installRequest = 
PropertyHelper.getUpdateRequest(installProperties, requestInfo);
@@ -469,6 +472,8 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
 Map requestInfo = new HashMap<>();
 requestInfo.put("context", String.format("Start components on host %s", 
hostName));
 requestInfo.put(CLUSTER_PHASE_PROPERTY, CLUSTER_PHASE_INITIAL_START);
+// see rationale for marking the operation as HostComponent-level at 
"Install components on host"
+
requestInfo.putAll(RequestOperationLevel.propertiesFor(Resource.Type.HostComponent,
 cluster));
 requestInfo.put(Setting.SETTING_NAME_SKIP_FAILURE, 
Boolean.toString(skipFailure));
 
 Predicate clusterPredicate = new EqualsPredicate<>(CLUSTER_NAME, cluster);
@@ -532,7 +537,6 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
 return requestStages.getRequestStatusResponse();
   }
 
-
   /**
* Update the host component identified by the given request object with the
* values carried by the given request object.
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestOperationLevel.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestOperationLevel.java
index ed43722..2e1e18e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestOperationLevel.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RequestOperationLevel.java
@@ -21,6 +21,8 @@ import java.util.Map;
 
 import org.apache.ambari.server.controller.spi.Resource;
 
+import com.google.common.collect.ImmutableMap;
+
 /**
  * Operation level is specified along with some requests. It identifies
  * the logical level, at which the operation is executed.
@@ -183,4 +185,23 @@ public class RequestOperationLevel {
 ", hostName='" + hostName + '\'' +
 '}';
   }
+
+  /**
+   * Create a map of required properties to be added to a request info map 
which is
+   * then used to create a {@link RequestOperationLevel} object.
+   * Other properties (service name, host name, host component name) can be 
set on
+   * the request info map itself as needed.
+   *
+   * @param type resource type for which to calculate the operation level
+   * @param clusterName cluster name
+   * @return immutable map with required properties: operation level and 
cluster name
+   * @throws IllegalArgumentException if the given resource {@code type} is 
not mapped to any operation level
+   */
+  public static Map propertiesFor(Resource.Type type, String 
clusterName) {
+return ImmutableMap.of(
+  OPERATION_LEVEL_ID, getExternalLevelName(type.name()),
+  OPERATION_CLUSTER_ID, clusterName
+);
+  }
+
 }



[ambari] branch trunk updated: AMBARI-25039. Parse error should be reported as Bad Request (#2718)

2018-12-13 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 66b6f7f  AMBARI-25039. Parse error should be reported as Bad Request 
(#2718)
66b6f7f is described below

commit 66b6f7f7f061b8d19589378e7d0876a1495bfb62
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Dec 13 16:07:36 2018 +0100

AMBARI-25039. Parse error should be reported as Bad Request (#2718)
---
 .../server/controller/internal/ServiceResourceProvider.java  | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index 48b77af..751ca0e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@ -17,6 +17,7 @@
  */
 package org.apache.ambari.server.controller.internal;
 
+import java.io.UncheckedIOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -79,6 +80,7 @@ import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.topology.STOMPComponentsDeleteHandler;
 import org.apache.ambari.server.topology.addservice.AddServiceOrchestrator;
+import org.apache.ambari.server.utils.LoggingPreconditions;
 import org.apache.ambari.spi.RepositoryType;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
@@ -96,6 +98,7 @@ import com.google.inject.assistedinject.AssistedInject;
 public class ServiceResourceProvider extends 
AbstractControllerResourceProvider {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(ServiceResourceProvider.class);
+  private static final LoggingPreconditions CHECK = new 
LoggingPreconditions(LOG);
 
   public static final String SERVICE_CLUSTER_NAME_PROPERTY_ID = 
PropertyHelper.getPropertyId(
   "ServiceInfo", "cluster_name");
@@ -1246,7 +1249,11 @@ public class ServiceResourceProvider extends 
AbstractControllerResourceProvider
   }
 
   private static AddServiceRequest createAddServiceRequest(Map 
requestInfoProperties) {
-return 
AddServiceRequest.of(requestInfoProperties.get(Request.REQUEST_INFO_BODY_PROPERTY));
+try {
+  return 
AddServiceRequest.of(requestInfoProperties.get(Request.REQUEST_INFO_BODY_PROPERTY));
+} catch (UncheckedIOException e) {
+  return CHECK.wrapInUnchecked(e, IllegalArgumentException::new, "Could 
not parse input as valid Add Service request: " + e.getCause().getMessage());
+}
   }
 
 }



[ambari] branch trunk updated: AMBARI-25037. Allow skipping parts of Add Service request validation (#2717)

2018-12-13 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 2411ccf  AMBARI-25037. Allow skipping parts of Add Service request 
validation (#2717)
2411ccf is described below

commit 2411ccf6d633aa97cf48d181b6254f3ac36d5f89
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Dec 13 16:06:59 2018 +0100

AMBARI-25037. Allow skipping parts of Add Service request validation (#2717)
---
 .../server/controller/AddServiceRequest.java   |  45 -
 .../topology/addservice/RequestValidator.java  |  29 --
 .../server/controller/AddServiceRequestTest.java   |   4 +
 .../topology/addservice/RequestValidatorTest.java  | 112 ++---
 .../test/resources/add_service_api/request1.json   |   1 +
 5 files changed, 142 insertions(+), 49 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
index 04d63a1..02577ca 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
@@ -71,15 +71,17 @@ public class AddServiceRequest {
   private static final String STACK_VERSION = "stack_version";
   private static final String SERVICES = "services";
   private static final String COMPONENTS = "components";
+  private static final String VALIDATION = "validation";
 
   public static final Set TOP_LEVEL_PROPERTIES = ImmutableSet.of(
-OPERATION_TYPE, CONFIG_RECOMMENDATION_STRATEGY, PROVISION_ACTION_PROPERTY,
+OPERATION_TYPE, CONFIG_RECOMMENDATION_STRATEGY, PROVISION_ACTION_PROPERTY, 
VALIDATION,
 STACK_NAME, STACK_VERSION, SERVICES, COMPONENTS, CONFIGURATIONS
   );
 
   private final OperationType operationType;
   private final ConfigRecommendationStrategy recommendationStrategy;
   private final ProvisionAction provisionAction;
+  private final ValidationType validationType;
   private final String stackName;
   private final String stackVersion;
   private final Set services;
@@ -93,6 +95,7 @@ public class AddServiceRequest {
 @JsonProperty(OPERATION_TYPE) OperationType operationType,
 @JsonProperty(CONFIG_RECOMMENDATION_STRATEGY) ConfigRecommendationStrategy 
recommendationStrategy,
 @JsonProperty(PROVISION_ACTION_PROPERTY) ProvisionAction provisionAction,
+@JsonProperty(VALIDATION) ValidationType validationType,
 @JsonProperty(STACK_NAME) String stackName,
 @JsonProperty(STACK_VERSION) String stackVersion,
 @JsonProperty(SERVICES) Set services,
@@ -101,7 +104,7 @@ public class AddServiceRequest {
 @JsonProperty(CREDENTIALS) Set credentials,
 @JsonProperty(CONFIGURATIONS) Collection> configs
   ) {
-this(operationType, recommendationStrategy, provisionAction, stackName, 
stackVersion, services, components,
+this(operationType, recommendationStrategy, provisionAction, 
validationType, stackName, stackVersion, services, components,
   security, credentials,
   ConfigurableHelper.parseConfigs(configs)
 );
@@ -111,6 +114,7 @@ public class AddServiceRequest {
 OperationType operationType,
 ConfigRecommendationStrategy recommendationStrategy,
 ProvisionAction provisionAction,
+ValidationType validationType,
 String stackName,
 String stackVersion,
 Set services,
@@ -122,6 +126,7 @@ public class AddServiceRequest {
 this.operationType = null != operationType ? operationType : 
OperationType.ADD_SERVICE;
 this.recommendationStrategy = null != recommendationStrategy ? 
recommendationStrategy : ConfigRecommendationStrategy.NEVER_APPLY;
 this.provisionAction = null != provisionAction ? provisionAction : 
ProvisionAction.INSTALL_AND_START;
+this.validationType = validationType != null ? validationType : 
ValidationType.DEFAULT;
 this.stackName = stackName;
 this.stackVersion = stackVersion;
 this.services = null != services ? services : emptySet();
@@ -160,6 +165,12 @@ public class AddServiceRequest {
 return provisionAction;
   }
 
+  @JsonProperty(VALIDATION)
+  @ApiModelProperty(name = VALIDATION)
+  public ValidationType getValidationType() {
+return validationType;
+  }
+
   @JsonProperty(STACK_NAME)
   @ApiModelProperty(name = STACK_NAME)
   public String getStackName() {
@@ -233,6 +244,7 @@ public class AddServiceRequest {
 AddServiceRequest other = (AddServiceRequest) obj;
 
 return Objects.equals(operationType, other.operationType) &&
+  Objects.equals(validationType, other.validationType) &&
   Objects.equals(recommendationStrategy, other.recommendationStrategy) &&
   Object

[ambari] branch trunk updated: AMBARI-25040. Handle blueprint/VDF stack version mismatch (#2719)

2018-12-12 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 6c9c06c  AMBARI-25040. Handle blueprint/VDF stack version mismatch 
(#2719)
6c9c06c is described below

commit 6c9c06c34bd31562962e5e956c201db3990fc8db
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Dec 12 20:20:31 2018 +0100

AMBARI-25040. Handle blueprint/VDF stack version mismatch (#2719)
---
 .../ambari/server/topology/AmbariContext.java  | 43 +++
 .../ambari/server/topology/AmbariContextTest.java  | 84 ++
 .../topology/addservice/RequestValidatorTest.java  | 14 +---
 .../org/apache/ambari/server/utils/Assertions.java | 35 +
 4 files changed, 136 insertions(+), 40 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
index dcb4739..34268ca 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/AmbariContext.java
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -265,23 +266,35 @@ public class AmbariContext {
 repoVersion = stackRepoVersions.get(0);
 LOG.warn("Cluster is being provisioned using the single matching 
repository version {}", repoVersion.getVersion());
   }
-} else if (null != repoVersionId){
-  repoVersion = repositoryVersionDAO.findByPK(repoVersionId);
-
-  if (null == repoVersion) {
-throw new IllegalArgumentException(String.format(
-  "Could not identify repository version with repository version id %s 
for installing services. "
-+ "Specify a valid repository version id with '%s'",
-  repoVersionId, ProvisionClusterRequest.REPO_VERSION_ID_PROPERTY));
-  }
 } else {
-  repoVersion = repositoryVersionDAO.findByStackAndVersion(stackId, 
repoVersionString);
+  if (null != repoVersionId) {
+repoVersion = repositoryVersionDAO.findByPK(repoVersionId);
+
+if (null == repoVersion) {
+  throw new IllegalArgumentException(String.format(
+"Could not identify repository version with repository version id 
%s for installing services. "
+  + "Specify a valid repository version id with '%s'",
+repoVersionId, ProvisionClusterRequest.REPO_VERSION_ID_PROPERTY));
+}
+  } else {
+repoVersion = repositoryVersionDAO.findByStackAndVersion(stackId, 
repoVersionString);
+
+if (null == repoVersion) {
+  throw new IllegalArgumentException(String.format(
+"Could not identify repository version with stack %s and version 
%s for installing services. "
+  + "Specify a valid version with '%s'",
+stackId, repoVersionString, 
ProvisionClusterRequest.REPO_VERSION_PROPERTY));
+}
+  }
 
-  if (null == repoVersion) {
-throw new IllegalArgumentException(String.format(
-  "Could not identify repository version with stack %s and version %s 
for installing services. "
-+ "Specify a valid version with '%s'",
-  stackId, repoVersionString, 
ProvisionClusterRequest.REPO_VERSION_PROPERTY));
+  if (!Objects.equals(repoVersion.getStackId(), stackId)) {
+String repoVersionPair = repoVersionId != null
+  ? String.format("'%s' = %d", 
ProvisionClusterRequest.REPO_VERSION_ID_PROPERTY, repoVersionId)
+  : String.format("'%s' = '%s'", 
ProvisionClusterRequest.REPO_VERSION_PROPERTY, repoVersionString);
+String msg = String.format(
+  "The stack specified in the blueprint (%s) and the repository 
version (%s for %s) should match",
+  stackId, repoVersion.getStackId(), repoVersionPair);
+throw new IllegalArgumentException(msg);
   }
 }
 
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java
index ab0c152..dbab576 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/AmbariContextTest.java
@@ -19,6 +19,7 @@
 package org.apache.ambari.server.topology;
 
 import static java.util.Collections.singletonList;
+import static o

[ambari] branch trunk updated: AMBARI-25000. START_ONLY provision action may be applied to the wrong component (#2708)

2018-12-11 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 2ae3987  AMBARI-25000. START_ONLY provision action may be applied to 
the wrong component (#2708)
2ae3987 is described below

commit 2ae3987d2b2b443036f4ee5119ff6152340cf468
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Dec 11 20:06:26 2018 +0100

AMBARI-25000. START_ONLY provision action may be applied to the wrong 
component (#2708)
---
 .../controller/AmbariManagementControllerImpl.java | 13 +---
 .../internal/HostComponentResourceProvider.java| 38 --
 .../server/topology/ClusterTopologyImpl.java   |  3 +-
 .../addservice/ResourceProviderAdapter.java| 10 +--
 .../HostComponentResourceProviderTest.java | 84 ++
 5 files changed, 127 insertions(+), 21 deletions(-)

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 642960d..36e2e14 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
@@ -124,6 +124,7 @@ import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.configuration.Configuration.DatabaseType;
 import 
org.apache.ambari.server.controller.internal.DeleteHostComponentStatusMetaData;
 import org.apache.ambari.server.controller.internal.DeleteStatusMetaData;
+import 
org.apache.ambari.server.controller.internal.HostComponentResourceProvider;
 import org.apache.ambari.server.controller.internal.RequestOperationLevel;
 import org.apache.ambari.server.controller.internal.RequestResourceFilter;
 import org.apache.ambari.server.controller.internal.RequestStageContainer;
@@ -294,8 +295,6 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 
   private static final String PASSWORD = "password";
 
-  public static final String SKIP_INSTALL_FOR_COMPONENTS = 
"skipInstallForComponents";
-  public static final String DONT_SKIP_INSTALL_FOR_COMPONENTS = 
"dontSkipInstallForComponents";
   public static final String CLUSTER_NAME_VALIDATION_REGEXP = 
"^[a-zA-Z0-9_-]{1,100}$";
   public static final Pattern CLUSTER_NAME_PTRN = 
Pattern.compile(CLUSTER_NAME_VALIDATION_REGEXP);
 
@@ -3355,15 +3354,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 isClientComponent = serviceComponent.isClientComponent();
   }
 }
-// Skip INSTALL for service components if START_ONLY is set for component, 
or if START_ONLY is set on cluster
-// level and no other provsion action is specified for component
-String skipInstallForComponents = 
requestProperties.get(SKIP_INSTALL_FOR_COMPONENTS);
-return !isClientComponent &&
-  
CLUSTER_PHASE_INITIAL_INSTALL.equals(requestProperties.get(CLUSTER_PHASE_PROPERTY))
 &&
-  skipInstallForComponents != null &&
-  (skipInstallForComponents.contains(componentName) ||
-(skipInstallForComponents.equals("ALL") && 
!requestProperties.get(DONT_SKIP_INSTALL_FOR_COMPONENTS).contains(componentName))
-  );
+return 
HostComponentResourceProvider.shouldSkipInstallTaskForComponent(componentName, 
isClientComponent, requestProperties);
 
   }
 
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index d24034d..7cb532a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -34,7 +34,6 @@ import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.AmbariManagementController;
-import org.apache.ambari.server.controller.AmbariManagementControllerImpl;
 import org.apache.ambari.server.controller.MaintenanceStateHelper;
 import org.apache.ambari.server.controller.RequestStatusResponse;
 import org.apache.ambari.server.controller.ServiceComponentHostRequest;
@@ -72,6 +71,7 @@ import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 import com.googl

[ambari] branch trunk updated: AMBARI-25030. Improve component-host association syntax in Add Service request (#2711)

2018-12-11 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 6231892  AMBARI-25030. Improve component-host association syntax in 
Add Service request (#2711)
6231892 is described below

commit 6231892fdc052016eba183935d69277b56a73917
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Dec 11 18:04:53 2018 +0100

AMBARI-25030. Improve component-host association syntax in Add Service 
request (#2711)
---
 .../server/controller/AddServiceRequest.java   | 167 -
 .../ambari/server/topology/Configuration.java  |  16 ++
 .../topology/addservice/RequestValidator.java  |   4 +-
 .../server/controller/AddServiceRequestTest.java   |  87 ++-
 .../test/resources/add_service_api/request1.json   |  14 +-
 .../test/resources/add_service_api/request2.json   |  16 +-
 .../test/resources/add_service_api/request4.json   |  16 +-
 7 files changed, 188 insertions(+), 132 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
index 4a88a6d..04d63a1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
@@ -20,6 +20,7 @@ package org.apache.ambari.server.controller;
 
 import static java.util.Collections.emptySet;
 import static java.util.stream.Collectors.toMap;
+import static java.util.stream.Collectors.toSet;
 import static 
org.apache.ambari.server.controller.internal.BaseClusterRequest.PROVISION_ACTION_PROPERTY;
 import static 
org.apache.ambari.server.controller.internal.ClusterResourceProvider.CREDENTIALS;
 import static 
org.apache.ambari.server.controller.internal.ClusterResourceProvider.SECURITY;
@@ -29,6 +30,7 @@ import static 
org.apache.ambari.server.topology.Configurable.CONFIGURATIONS;
 
 import java.io.IOException;
 import java.io.UncheckedIOException;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -51,6 +53,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 
@@ -64,10 +67,10 @@ import io.swagger.annotations.ApiModelProperty;
 @JsonInclude(JsonInclude.Include.NON_EMPTY)
 public class AddServiceRequest {
 
-  static final String STACK_NAME = "stack_name";
-  static final String STACK_VERSION = "stack_version";
-  static final String SERVICES = "services";
-  static final String COMPONENTS = "components";
+  private static final String STACK_NAME = "stack_name";
+  private static final String STACK_VERSION = "stack_version";
+  private static final String SERVICES = "services";
+  private static final String COMPONENTS = "components";
 
   public static final Set TOP_LEVEL_PROPERTIES = ImmutableSet.of(
 OPERATION_TYPE, CONFIG_RECOMMENDATION_STRATEGY, PROVISION_ACTION_PROPERTY,
@@ -104,7 +107,6 @@ public class AddServiceRequest {
 );
   }
 
-
   private AddServiceRequest(
 OperationType operationType,
 ConfigRecommendationStrategy recommendationStrategy,
@@ -219,25 +221,74 @@ public class AddServiceRequest {
 return security;
   }
 
+  @Override
+  public boolean equals(Object obj) {
+if (this == obj) {
+  return true;
+}
+if (obj == null || getClass() != obj.getClass()) {
+  return false;
+}
+
+AddServiceRequest other = (AddServiceRequest) obj;
+
+return Objects.equals(operationType, other.operationType) &&
+  Objects.equals(recommendationStrategy, other.recommendationStrategy) &&
+  Objects.equals(provisionAction, other.provisionAction) &&
+  Objects.equals(stackName, other.stackName) &&
+  Objects.equals(stackVersion, other.stackVersion) &&
+  Objects.equals(services, other.services) &&
+  Objects.equals(components, other.components) &&
+  Objects.equals(security, other.security) &&
+  Objects.equals(configuration, other.configuration);
+// credentials is ignored for equality, since it's not serialized
+  }
+
+  @Override
+  public int hashCode() {
+return Objects.hash(operationType, recommendationStrategy, 
provisionAction, stackName, stackVersion,
+  services, components, configuration, security);
+// credentials is ignored for hashcode

[ambari] branch trunk updated: AMBARI-25033. Layout recommendation adds unwanted components (#2714)

2018-12-11 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new f4b8e4b  AMBARI-25033. Layout recommendation adds unwanted components 
(#2714)
f4b8e4b is described below

commit f4b8e4bc093f1b25ee748e6dce8f0b1e7b80cdee
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Dec 11 18:00:17 2018 +0100

AMBARI-25033. Layout recommendation adds unwanted components (#2714)
---
 .../org/apache/ambari/server/topology/addservice/AddServiceInfo.java | 4 
 .../ambari/server/topology/addservice/AddServiceOrchestrator.java| 5 +
 2 files changed, 9 insertions(+)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceInfo.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceInfo.java
index 2df7c4d..46fe3f3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceInfo.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceInfo.java
@@ -115,4 +115,8 @@ public final class AddServiceInfo {
 return sb.toString();
   }
 
+  public boolean requiresLayoutRecommendation() {
+return !request.getServices().isEmpty();
+  }
+
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java
index 71cce4a..c4b6529 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java
@@ -127,6 +127,11 @@ public class AddServiceOrchestrator {
* @throws IllegalArgumentException if the request cannot be satisfied
*/
   private AddServiceInfo recommendLayout(AddServiceInfo request) {
+if (!request.requiresLayoutRecommendation()) {
+  LOG.info("Using layout specified in request for {}", request);
+  return request;
+}
+
 LOG.info("Recommending layout for {}", request);
 return stackAdvisorAdapter.recommendLayout(request);
   }



[ambari] branch trunk updated: AMBARI-25007. Process Kerberos descriptor for Add Service request (#2705)

2018-12-10 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new aedbcb7  AMBARI-25007. Process Kerberos descriptor for Add Service 
request (#2705)
aedbcb7 is described below

commit aedbcb7100588d7a78ae04241a0b61ee64f6fe3b
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Dec 10 22:51:50 2018 +0100

AMBARI-25007. Process Kerberos descriptor for Add Service request (#2705)
---
 .../api/query/render/ClusterBlueprintRenderer.java |   9 +-
 .../internal/ArtifactResourceProvider.java |   7 +
 .../server/state/kerberos/KerberosDescriptor.java  |   9 +-
 .../state/kerberos/KerberosServiceDescriptor.java  |   3 +-
 .../ambari/server/topology/BlueprintImpl.java  |   3 +-
 .../server/topology/SecurityConfiguration.java |  68 +--
 .../topology/SecurityConfigurationFactory.java |  26 +--
 .../ambari/server/topology/TopologyManager.java|  21 +--
 .../server/topology/addservice/AddServiceInfo.java |  20 +-
 .../addservice/AddServiceOrchestrator.java |  53 +-
 .../topology/addservice/RequestValidator.java  | 132 -
 .../addservice/ResourceProviderAdapter.java| 130 ++---
 .../ambari/server/utils/LoggingPreconditions.java  |  70 +++
 .../server/controller/AddServiceRequestTest.java   |  17 +-
 .../internal/BlueprintResourceProviderTest.java|   3 +-
 .../internal/ClusterResourceProviderTest.java  |   7 +-
 .../ambari/server/topology/BlueprintImplTest.java  |   2 +-
 .../topology/addservice/RequestValidatorTest.java  | 207 +++--
 .../addservice/StackAdvisorAdapterTest.java|   2 +-
 .../test/resources/add_service_api/request1.json   |   3 +
 20 files changed, 631 insertions(+), 161 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
index 9139cec..7a31b01 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
@@ -55,7 +55,6 @@ import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.ResourceProvider;
 import org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
-import org.apache.ambari.server.controller.utilities.PredicateBuilder;
 import org.apache.ambari.server.state.SecurityType;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.topology.AmbariContext;
@@ -68,6 +67,7 @@ import org.apache.ambari.server.topology.HostGroupInfo;
 import org.apache.ambari.server.topology.InvalidTopologyException;
 import org.apache.ambari.server.topology.InvalidTopologyTemplateException;
 import org.apache.ambari.server.topology.SecurityConfigurationFactory;
+import org.apache.ambari.server.topology.addservice.ResourceProviderAdapter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -331,11 +331,8 @@ public class ClusterBlueprintRenderer extends BaseRenderer 
implements Renderer {
 return blueprintSetting;
   }
 
-  private Map getKerberosDescriptor(ClusterController 
clusterController, String clusterName) throws AmbariException {
-PredicateBuilder pb = new PredicateBuilder();
-Predicate predicate = 
pb.begin().property("Artifacts/cluster_name").equals(clusterName).and().
-  
property(ArtifactResourceProvider.ARTIFACT_NAME_PROPERTY).equals("kerberos_descriptor").
-  end().toPredicate();
+  private static Map getKerberosDescriptor(ClusterController 
clusterController, String clusterName) throws AmbariException {
+Predicate predicate = 
ResourceProviderAdapter.predicateForKerberosDescriptorArtifact(clusterName);
 
 ResourceProvider artifactProvider =
clusterController.ensureResourceProvider(Resource.Type.Artifact);
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java
index 2aca1cd..0c71b13 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java
@@ -75,6 +75,9 @@ public class ArtifactResourceProvider extends 
AbstractResourceProvider {
   public static final String CLUSTER_NAME_PROPERTY = RESPONSE_KEY + 
PropertyHelper.EXTERNAL_PATH_SEP + CLUSTER_NAME;
   public static final String SERVICE_NA

[ambari] branch trunk updated: AMBARI-25025. Duplicate kerberos_descriptor name reported as HTTP 500 (#2707)

2018-12-10 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 7e5cf0a  AMBARI-25025. Duplicate kerberos_descriptor name reported as 
HTTP 500 (#2707)
7e5cf0a is described below

commit 7e5cf0afbded4326883d9779b85024f476bfb62a
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Dec 10 21:46:07 2018 +0100

AMBARI-25025. Duplicate kerberos_descriptor name reported as HTTP 500 
(#2707)
---
 .../KerberosDescriptorResourceProvider.java| 108 +++-
 .../orm/entities/KerberosDescriptorEntity.java |  20 +++
 .../KerberosDescriptorResourceProviderTest.java| 190 -
 3 files changed, 186 insertions(+), 132 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
index d02d64a..6e20c8a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/KerberosDescriptorResourceProvider.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.ambari.server.controller.internal;
 
 import java.util.Collections;
@@ -26,32 +43,16 @@ import 
org.apache.ambari.server.topology.KerberosDescriptorFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Strings;
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Sets;
+import com.google.common.collect.ImmutableSet;
 import com.google.inject.assistedinject.Assisted;
 
-/**
- * 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.
- */
 public class KerberosDescriptorResourceProvider extends 
AbstractControllerResourceProvider {
 
   private static final Logger LOGGER = 
LoggerFactory.getLogger(KerberosDescriptorResourceProvider.class);
 
-  private static final String KERBEROS_DESCRIPTOR_NAME_PROPERTY_ID =
+  static final String KERBEROS_DESCRIPTOR_NAME_PROPERTY_ID =
   PropertyHelper.getPropertyId("KerberosDescriptors", 
"kerberos_descriptor_name");
 
   private static final String KERBEROS_DESCRIPTOR_TEXT_PROPERTY_ID =
@@ -60,16 +61,12 @@ public class KerberosDescriptorResourceProvider extends 
AbstractControllerResour
   /**
* The key property ids for a KerberosDescriptor resource.
*/
-  private static final Map keyPropertyIds = 
ImmutableMap.builder()
-  .put(Resource.Type.KerberosDescriptor, 
KERBEROS_DESCRIPTOR_NAME_PROPERTY_ID)
-  .build();
+  private static final Map KEY_PROPERTY_IDS = 
ImmutableMap.of(Resource.Type.KerberosDescriptor, 
KERBEROS_DESCRIPTOR_NAME_PROPERTY_ID);
 
   /**
* The property ids for a KerberosDescriptor resource.
*/
-  private static final Set propertyIds = Sets.newHashSet(
-  KERBEROS_DESCRIPTOR_NAME_PROPERTY_ID,
-  KERBEROS_DESCRIPTOR_TEXT_PROPERTY_ID);
+  private static final Set PROPERTY_IDS = 
ImmutableSet.of(KERBEROS_DESCRIPTOR_NAME_PROPERTY_ID, 
KERBEROS_DESCRIPTOR_TEXT_PROPERTY_ID);
 
   private KerberosDes

[ambari] branch trunk updated: AMBARI-25008. Set unique version tag for config created by Add Service (#2699)

2018-12-06 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new c0e396f9 AMBARI-25008. Set unique version tag for config created by 
Add Service (#2699)
c0e396f9 is described below

commit c0e396f9fcb98fcb6931be748e2187aa3352565c
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Dec 6 18:23:04 2018 +0100

AMBARI-25008. Set unique version tag for config created by Add Service 
(#2699)
---
 .../ambari/server/topology/addservice/ResourceProviderAdapter.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java
index 99f097b..3e23643 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java
@@ -344,7 +344,7 @@ public class ResourceProviderAdapter {
   ) {
 List configRequests = configTypes
   .peek(configType -> LOG.info("Creating request for config type {} for 
{}", configType, addServiceRequest))
-  .map(configType -> new 
ConfigurationRequest(addServiceRequest.clusterName(), configType, "ADD_SERVICE",
+  .map(configType -> new 
ConfigurationRequest(addServiceRequest.clusterName(), configType, 
"ADD_SERVICE_" + System.currentTimeMillis(),
 fullProperties.getOrDefault(configType, ImmutableMap.of()),
 fullAttributes.getOrDefault(configType, ImmutableMap.of(
   .collect(toList());



[ambari] branch trunk updated: AMBARI-24999. Disallow changing Kerberos-related configs in Add Service request (#2693)

2018-12-05 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new e70dd4e  AMBARI-24999. Disallow changing Kerberos-related configs in 
Add Service request (#2693)
e70dd4e is described below

commit e70dd4e7434bc3828629d329684a12b574dfd9d3
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Dec 5 18:11:40 2018 +0100

AMBARI-24999. Disallow changing Kerberos-related configs in Add Service 
request (#2693)
---
 .../server/topology/addservice/RequestValidator.java | 10 --
 .../topology/addservice/RequestValidatorTest.java| 20 
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/RequestValidator.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/RequestValidator.java
index 3106697..8b72114 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/RequestValidator.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/RequestValidator.java
@@ -48,6 +48,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 import com.google.inject.assistedinject.Assisted;
 
@@ -58,6 +59,8 @@ public class RequestValidator {
 
   private static final Logger LOG = 
LoggerFactory.getLogger(RequestValidator.class);
 
+  private static final Set NOT_ALLOWED_CONFIG_TYPES = 
ImmutableSet.of("kerberos-env", "krb5-conf");
+
   private final AddServiceRequest request;
   private final Cluster cluster;
   private final AmbariManagementController controller;
@@ -185,12 +188,15 @@ public class RequestValidator {
   @VisibleForTesting
   void validateConfiguration() {
 Configuration config = request.getConfiguration();
+
+for (String type : NOT_ALLOWED_CONFIG_TYPES) {
+  checkArgument(!config.getProperties().containsKey(type), "Cannot change 
'%s' configuration in Add Service request", type);
+}
+
 Configuration clusterConfig = getClusterDesiredConfigs();
 
clusterConfig.setParentConfiguration(state.getStack().getValidDefaultConfig());
 config.setParentConfiguration(clusterConfig);
 
-// no validation here so far
-
 state = state.with(config);
   }
 
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/RequestValidatorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/RequestValidatorTest.java
index 041b326..9b313e9 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/RequestValidatorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/topology/addservice/RequestValidatorTest.java
@@ -375,6 +375,26 @@ public class RequestValidatorTest extends EasyMockSupport {
 verifyConfigOverrides(requestConfig, clusterConfig, stackConfig, config);
   }
 
+  @Test
+  public void rejectsKerberosEnvChange() {
+Configuration requestConfig = Configuration.newEmpty();
+requestConfig.setProperty("kerberos-env", "some-property", "some-value");
+
expect(request.getConfiguration()).andReturn(requestConfig.copy()).anyTimes();
+replayAll();
+
+assertThrows(IllegalArgumentException.class, 
validator::validateConfiguration);
+  }
+
+  @Test
+  public void rejectsKrb5ConfChange() {
+Configuration requestConfig = Configuration.newEmpty();
+requestConfig.setProperty("krb5-conf", "some-property", "some-value");
+
expect(request.getConfiguration()).andReturn(requestConfig.copy()).anyTimes();
+replayAll();
+
+assertThrows(IllegalArgumentException.class, 
validator::validateConfiguration);
+  }
+
   private static void verifyConfigOverrides(Configuration requestConfig, 
Configuration clusterConfig, Configuration stackConfig, Configuration 
actualConfig) {
 requestConfig.getProperties().forEach(
   (type, properties) -> properties.forEach(



[ambari] branch trunk updated: AMBARI-24988. Support provision_action in complex Add Service request (#2691)

2018-12-05 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new b268518  AMBARI-24988. Support provision_action in complex Add Service 
request (#2691)
b268518 is described below

commit b268518b25ee9f78d00926b27516a773ea58967c
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Dec 5 18:00:47 2018 +0100

AMBARI-24988. Support provision_action in complex Add Service request 
(#2691)
---
 .../controller/AmbariManagementControllerImpl.java | 32 ++--
 .../internal/HostComponentResourceProvider.java|  8 +++--
 .../controller/internal/ProvisionAction.java   | 26 +---
 .../addservice/AddServiceOrchestrator.java | 11 +--
 .../addservice/ResourceProviderAdapter.java| 35 +-
 5 files changed, 79 insertions(+), 33 deletions(-)

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 465d1ee..642960d 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
@@ -283,9 +283,9 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   private static final Type hostAttributesType =
   new TypeToken>() {}.getType();
 
-  private static final String CLUSTER_PHASE_PROPERTY = "phase";
-  private static final String CLUSTER_PHASE_INITIAL_INSTALL = 
"INITIAL_INSTALL";
-  private static final String CLUSTER_PHASE_INITIAL_START = "INITIAL_START";
+  public static final String CLUSTER_PHASE_PROPERTY = "phase";
+  public static final String CLUSTER_PHASE_INITIAL_INSTALL = "INITIAL_INSTALL";
+  public static final String CLUSTER_PHASE_INITIAL_START = "INITIAL_START";
   private static final String AMBARI_SERVER_HOST = "ambari_server_host";
   private static final String AMBARI_SERVER_PORT = "ambari_server_port";
   private static final String AMBARI_SERVER_USE_SSL = "ambari_server_use_ssl";
@@ -2962,7 +2962,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   // reset Kerberos-related configs.
   // Check if it's blueprint install. If it is, then do 
not configure this service
   // at this time.
-  if (!hostComponentAlreadyExists(cluster, scHost) && 
!("INITIAL_INSTALL".equals(requestProperties.get("phase" {
+  if (!hostComponentAlreadyExists(cluster, scHost) && 
!(CLUSTER_PHASE_INITIAL_INSTALL.equals(requestProperties.get(CLUSTER_PHASE_PROPERTY
 {
 componentsToConfigureForKerberos.add(scHost);
   }
 
@@ -3279,8 +3279,9 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   RoleGraph rg = roleGraphFactory.createNew(rco);
 
 
-  if (CommandExecutionType.DEPENDENCY_ORDERED == 
configs.getStageExecutionType() && "INITIAL_START".equals
-(requestProperties.get("phase"))) {
+  if (CommandExecutionType.DEPENDENCY_ORDERED == 
configs.getStageExecutionType() &&
+
CLUSTER_PHASE_INITIAL_START.equals(requestProperties.get(CLUSTER_PHASE_PROPERTY))
+  ) {
 LOG.info("Set DEPENDENCY_ORDERED CommandExecutionType on stage: {}", 
stage.getRequestContext());
 rg.setCommandExecutionType(CommandExecutionType.DEPENDENCY_ORDERED);
   }
@@ -3347,23 +3348,22 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   ServiceComponentHost sch) throws 
AmbariException {
 boolean isClientComponent = false;
 Service service = cluster.getService(sch.getServiceName());
+String componentName = sch.getServiceComponentName();
 if (service != null) {
-  ServiceComponent serviceComponent = 
service.getServiceComponent(sch.getServiceComponentName());
+  ServiceComponent serviceComponent = 
service.getServiceComponent(componentName);
   if (serviceComponent != null) {
 isClientComponent = serviceComponent.isClientComponent();
   }
 }
 // Skip INSTALL for service components if START_ONLY is set for component, 
or if START_ONLY is set on cluster
 // level and no other provsion action is specified for component
-if (requestProperties.get(SKIP_INSTALL_FOR_COMPONENTS) != null &&
-  
(re

[ambari] branch trunk updated: AMBARI-24982. APT/DPKG existence check broken for packages with long names. (#2680)

2018-12-04 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new c1dca27  AMBARI-24982. APT/DPKG existence check broken for packages 
with long names. (#2680)
c1dca27 is described below

commit c1dca2715258d385b8946f5fc537392c668b30ae
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Dec 4 23:21:37 2018 +0100

AMBARI-24982. APT/DPKG existence check broken for packages with long names. 
(#2680)
---
 .../src/main/python/ambari_commons/repo_manager/apt_manager.py  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py 
b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
index 5882253..c986e3b 100644
--- a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
+++ b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py
@@ -49,7 +49,7 @@ class AptManagerProperties(GenericManagerProperties):
   repo_update_cmd = [repo_manager_bin, 'update', '-qq']
 
   available_packages_cmd = [repo_cache_bin, "dump"]
-  installed_packages_cmd = [pkg_manager_bin, "-l"]
+  installed_packages_cmd = ['COLUMNS=999', pkg_manager_bin, "-l"]
 
   repo_definition_location = "/etc/apt/sources.list.d"
 



[ambari-infra] branch master updated: AMBARI-18361. Avoid unnecessary compilation (#22)

2018-12-03 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-infra.git


The following commit(s) were added to refs/heads/master by this push:
 new 100a72e  AMBARI-18361. Avoid unnecessary compilation (#22)
100a72e is described below

commit 100a72e55e95f12a52659695fb694b7806975938
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Dec 3 13:48:19 2018 +0100

AMBARI-18361. Avoid unnecessary compilation (#22)
---
 ambari-infra-manager/pom.xml | 7 +--
 ambari-infra-solr-plugin/pom.xml | 7 +--
 pom.xml  | 3 ++-
 3 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/ambari-infra-manager/pom.xml b/ambari-infra-manager/pom.xml
index 06923ba..419ccd5 100644
--- a/ambari-infra-manager/pom.xml
+++ b/ambari-infra-manager/pom.xml
@@ -51,11 +51,6 @@
   
 org.apache.maven.plugins
 maven-compiler-plugin
-3.0
-
-  ${jdk.version}
-  ${jdk.version}
-
   
   
 org.codehaus.mojo
@@ -303,7 +298,7 @@
   jersey-media-json-jettison
   ${jersey.version}
 
-
+
 
   org.apache.solr
   solr-solrj
diff --git a/ambari-infra-solr-plugin/pom.xml b/ambari-infra-solr-plugin/pom.xml
index 9de8e72..e9bec08 100644
--- a/ambari-infra-solr-plugin/pom.xml
+++ b/ambari-infra-solr-plugin/pom.xml
@@ -60,11 +60,6 @@
   
 org.apache.maven.plugins
 maven-compiler-plugin
-3.3
-
-  ${jdk.version}
-  ${jdk.version}
-
   
   
 org.apache.maven.plugins
@@ -90,4 +85,4 @@
   
 
   
-
\ No newline at end of file
+
diff --git a/pom.xml b/pom.xml
index b6f52f9..af47dc8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -194,10 +194,11 @@
   
   
 maven-compiler-plugin
-3.2
+3.3
 
   ${jdk.version}
   ${jdk.version}
+  false
 
   
   



[ambari] branch trunk updated: AMBARI-24972. Improve Add Service request validation. (#2670)

2018-11-30 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new d459997  AMBARI-24972. Improve Add Service request validation. (#2670)
d459997 is described below

commit d4599975382e053b7a614fa2aa5531383f8ee98f
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Sat Dec 1 00:26:32 2018 +0100

AMBARI-24972. Improve Add Service request validation. (#2670)
---
 .../server/controller/AddServiceRequest.java   |  15 +-
 .../ambari/server/controller/ControllerModule.java |   2 +
 .../ambari/server/controller/internal/Stack.java   |   5 +
 .../apache/ambari/server/state/ConfigHelper.java   |  13 +-
 .../ambari/server/topology/BlueprintFactory.java   |  23 --
 .../ambari/server/topology/Configuration.java  |  17 +
 .../server/topology/DefaultStackFactory.java   |  34 ++
 .../ambari/server/topology/StackFactory.java   |  26 ++
 .../addservice/AddServiceOrchestrator.java | 104 +
 .../topology/addservice/RequestValidator.java  | 281 +
 .../addservice/RequestValidatorFactory.java|  31 ++
 .../server/controller/AddServiceRequestTest.java   |   3 +-
 .../server/topology/BlueprintFactoryTest.java  |   4 +-
 .../topology/addservice/RequestValidatorTest.java  | 433 +
 14 files changed, 862 insertions(+), 129 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
index 9c0ccb5..4a88a6d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
@@ -18,7 +18,6 @@
 
 package org.apache.ambari.server.controller;
 
-import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Collections.emptySet;
 import static java.util.stream.Collectors.toMap;
 import static 
org.apache.ambari.server.controller.internal.BaseClusterRequest.PROVISION_ACTION_PROPERTY;
@@ -63,7 +62,7 @@ import io.swagger.annotations.ApiModelProperty;
  */
 @ApiModel
 @JsonInclude(JsonInclude.Include.NON_EMPTY)
-public final class AddServiceRequest {
+public class AddServiceRequest {
 
   static final String STACK_NAME = "stack_name";
   static final String STACK_VERSION = "stack_version";
@@ -130,8 +129,6 @@ public final class AddServiceRequest {
 this.credentials = null != credentials
   ? credentials.stream().collect(toMap(Credential::getAlias, 
Function.identity()))
   : ImmutableMap.of();
-
-checkArgument(!this.services.isEmpty() || !this.components.isEmpty(), 
"Either services or components must be specified");
   }
 
   // TODO move to JsonUtils -- pick part of 0252c08d86f
@@ -278,6 +275,11 @@ public final class AddServiceRequest {
 public int hashCode() {
   return Objects.hash(name, fqdn);
 }
+
+@Override
+public String toString() {
+  return name;
+}
   }
 
   @ApiModel
@@ -315,5 +317,10 @@ public final class AddServiceRequest {
 public int hashCode() {
   return Objects.hash(name);
 }
+
+@Override
+public String toString() {
+  return name;
+}
   }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
index 403565a..0f530cb 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
@@ -520,9 +520,11 @@ public class ControllerModule extends AbstractModule {
 install(new 
FactoryModuleBuilder().build(MetricPropertyProviderFactory.class));
 install(new FactoryModuleBuilder().build(UpgradeContextFactory.class));
 install(new FactoryModuleBuilder().build(MpackManagerFactory.class));
+install(new 
FactoryModuleBuilder().build(org.apache.ambari.server.topology.addservice.RequestValidatorFactory.class));
 
 bind(HostRoleCommandFactory.class).to(HostRoleCommandFactoryImpl.class);
 bind(SecurityHelper.class).toInstance(SecurityHelperImpl.getInstance());
+
bind(org.apache.ambari.server.topology.StackFactory.class).to(org.apache.ambari.server.topology.DefaultStackFactory.class);
 bind(BlueprintFactory.class);
 
 install(new FactoryModuleBuilder().implement(AmbariEvent.class, 
Names.named("userCreated"), 
UserCreatedEvent.class).build(AmbariEventFactory.class));
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/Stack.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/S

[ambari] branch trunk updated: AMBARI-24947. Support for complex Add Service request in secure cluster (#2653)

2018-11-27 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new a6250a9  AMBARI-24947. Support for complex Add Service request in 
secure cluster (#2653)
a6250a9 is described below

commit a6250a91fcb69af5baa14ea38ed835effc653a89
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Nov 28 08:17:07 2018 +0100

AMBARI-24947. Support for complex Add Service request in secure cluster 
(#2653)
---
 .../server/controller/AddServiceRequest.java   |  85 ++
 .../ambari/server/controller/KerberosHelper.java   |   5 +
 .../server/controller/KerberosHelperImpl.java  |  12 +-
 .../internal/ClusterResourceProvider.java  |   4 +-
 .../internal/ProvisionClusterRequest.java  |  13 ++-
 .../internal/ServiceResourceProvider.java  |   6 +-
 .../topology/ClusterConfigurationRequest.java  | 123 +---
 .../ambari/server/topology/Configuration.java  |  65 +++
 .../apache/ambari/server/topology/Credential.java  |  65 ++-
 .../server/topology/SecurityConfiguration.java |  52 -
 .../ambari/server/topology/TopologyManager.java|  38 +++---
 .../server/topology/addservice/AddServiceInfo.java |   9 +-
 .../addservice/AddServiceOrchestrator.java | 128 -
 .../addservice/ResourceProviderAdapter.java|  92 +++
 .../ambari/server/utils/ShellCommandUtil.java  |   3 +
 .../org/apache/ambari/server/utils/StageUtils.java |  24 
 .../server/controller/AddServiceRequestTest.java   |  17 +++
 .../topology/ClusterConfigurationRequestTest.java  |   2 +-
 .../test/resources/add_service_api/request1.json   |  16 ++-
 19 files changed, 545 insertions(+), 214 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
index 61edde3..f3217d1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
@@ -20,7 +20,10 @@ package org.apache.ambari.server.controller;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Collections.emptySet;
+import static java.util.stream.Collectors.toMap;
 import static 
org.apache.ambari.server.controller.internal.BaseClusterRequest.PROVISION_ACTION_PROPERTY;
+import static 
org.apache.ambari.server.controller.internal.ClusterResourceProvider.CREDENTIALS;
+import static 
org.apache.ambari.server.controller.internal.ClusterResourceProvider.SECURITY;
 import static 
org.apache.ambari.server.controller.internal.ProvisionClusterRequest.CONFIG_RECOMMENDATION_STRATEGY;
 import static 
org.apache.ambari.server.controller.internal.ServiceResourceProvider.OPERATION_TYPE;
 import static org.apache.ambari.server.topology.Configurable.CONFIGURATIONS;
@@ -31,19 +34,24 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
+import java.util.function.Function;
 
 import org.apache.ambari.annotations.ApiIgnore;
 import org.apache.ambari.server.controller.internal.ProvisionAction;
 import org.apache.ambari.server.topology.ConfigRecommendationStrategy;
 import org.apache.ambari.server.topology.ConfigurableHelper;
 import org.apache.ambari.server.topology.Configuration;
+import org.apache.ambari.server.topology.Credential;
+import org.apache.ambari.server.topology.SecurityConfiguration;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 
 import io.swagger.annotations.ApiModel;
@@ -73,30 +81,42 @@ public final class AddServiceRequest {
   private final String stackVersion;
   private final Set services;
   private final Set components;
+  private final SecurityConfiguration security;
+  private final Map credentials;
   private final Configuration configuration;
 
   @JsonCreator
-  public AddServiceRequest(@JsonProperty(OPERATION_TYPE) OperationType 
operationType,
-   @JsonProperty(CONFIG_RECOMMENDATION_STRATEGY) 
ConfigRecommendationStrategy recommendationStrategy,
-   
@JsonProperty(PROVISION_ACTION_PROPERTY)ProvisionAction provisionAction,
-   @JsonProperty(STACK_NAME) String stackName,
-   @JsonProperty(STACK_VERSION) String stackV

[ambari] branch trunk updated: AMBARI-24922. No need to create test jar if tests are skipped. (#2630)

2018-11-26 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 04012a1  AMBARI-24922. No need to create test jar if tests are 
skipped. (#2630)
04012a1 is described below

commit 04012a1733a1378f3662a8d4a681fdff11adb6c4
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Nov 27 05:45:32 2018 +0100

AMBARI-24922. No need to create test jar if tests are skipped. (#2630)
---
 ambari-project/pom.xml | 1 +
 ambari-server/pom.xml  | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 3c57f54..b0ce441 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -91,6 +91,7 @@
   
   
 true
+true
   
 
   
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index c410c42..535f6b5 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -194,6 +194,7 @@
   run
 
 
+  ${skipSurefireTests}
   
 
   
@@ -206,6 +207,7 @@
   run
 
 
+  ${skipSurefireTests}
   
 
   
@@ -722,6 +724,7 @@
   test-jar
 
 
+  ${skipSurefireTests}
   target/test-classes/checks
 
   



[ambari] branch trunk updated: AMBARI-22643. Trying to create some duplicate resources leads to HTTP 500 (#2650)

2018-11-26 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 93bfa66  AMBARI-22643. Trying to create some duplicate resources leads 
to HTTP 500 (#2650)
93bfa66 is described below

commit 93bfa6646545226c80eb149c10e20ece7b95fab9
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Nov 26 21:52:26 2018 +0100

AMBARI-22643. Trying to create some duplicate resources leads to HTTP 500 
(#2650)
---
 .../server/controller/internal/CredentialResourceProvider.java | 3 ++-
 .../controller/internal/RepositoryVersionResourceProvider.java | 7 ---
 .../ambari/server/controller/internal/UserResourceProvider.java| 7 ---
 .../controller/internal/VersionDefinitionResourceProvider.java | 4 ++--
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
index 9e6fe3d..309a71d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CredentialResourceProvider.java
@@ -26,6 +26,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.DuplicateResourceException;
 import org.apache.ambari.server.StaticallyInject;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
@@ -368,7 +369,7 @@ public class CredentialResourceProvider extends 
AbstractControllerResourceProvid
   String alias = getAlias(properties);
 
   if (credentialStoreService.containsCredential(clusterName, alias)) {
-throw new AmbariException("A credential with the alias of " + alias + 
" already exists");
+throw new DuplicateResourceException("A credential with the alias of " 
+ alias + " already exists");
   }
 
   credentialStoreService.setCredential(clusterName, alias, 
createCredential(properties), credentialStoreType);
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 81bf1fa..4645da4 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
@@ -29,6 +29,7 @@ import java.util.Map.Entry;
 import java.util.Set;
 
 import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.DuplicateResourceException;
 import org.apache.ambari.server.ObjectNotFoundException;
 import 
org.apache.ambari.server.api.resources.OperatingSystemResourceDefinition;
 import org.apache.ambari.server.api.resources.RepositoryResourceDefinition;
@@ -201,10 +202,10 @@ public class RepositoryVersionResourceProvider extends 
AbstractAuthorizedResourc
   RepositoryVersionEntity entity = 
toRepositoryVersionEntity(properties);
 
   if (repositoryVersionDAO.findByDisplayName(entity.getDisplayName()) 
!= null) {
-throw new AmbariException("Repository version with name " + 
entity.getDisplayName() + " already exists");
+throw new DuplicateResourceException("Repository version with name 
" + entity.getDisplayName() + " already exists");
   }
   if (repositoryVersionDAO.findByStackAndVersion(entity.getStack(), 
entity.getVersion()) != null) {
-throw new AmbariException("Repository version for stack " + 
entity.getStack() + " and version " + entity.getVersion() + " already exists");
+throw new DuplicateResourceException("Repository version for stack 
" + entity.getStack() + " and version " + entity.getVersion() + " already 
exists");
   }
 
   validateRepositoryVersion(repositoryVersionDAO, ambariMetaInfo, 
entity);
@@ -479,7 +480,7 @@ public class RepositoryVersionResourceProvider extends 
AbstractAuthorizedResourc
   for (RepoDefinitionEntity repositoryEntity : 
os.getRepoDefinitionEntities()) {
 String baseUrl = repositoryEntity.getBaseUrl();
 if (!skipUrlCheck && os.isAmbariManaged() && 
existingRepoUrls.contains(baseUrl)) {
-  throw new AmbariException("Base url " + baseUrl + " is 

[ambari] branch trunk updated: AMBARI-24948. Test ordering issue in ExecutionCommandWrapperTest. (#2649)

2018-11-23 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new fd346f5  AMBARI-24948. Test ordering issue in 
ExecutionCommandWrapperTest. (#2649)
fd346f5 is described below

commit fd346f5fc28c1dfe605c3e53cb039c657ac2a2ab
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Nov 23 22:47:59 2018 +0100

AMBARI-24948. Test ordering issue in ExecutionCommandWrapperTest. (#2649)
---
 .../server/actionmanager/ExecutionCommandWrapperTest.java  | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
index a5c6ac1..9cd4716 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java
@@ -325,9 +325,9 @@ public class ExecutionCommandWrapperTest {
 Cluster cluster = clusters.getCluster(CLUSTER1);
 
 StackId stackId = cluster.getDesiredStackVersion();
-RepositoryVersionEntity repositoryVersion = 
ormTestHelper.getOrCreateRepositoryVersion(stackId, "0.1-");
+RepositoryVersionEntity repositoryVersion = 
ormTestHelper.getOrCreateRepositoryVersion(new StackId("HDP", "0.2"), 
"0.2-");
 repositoryVersion.setResolved(true); // has build number
-Service service = cluster.getService("HDFS");
+Service service = cluster.addService("HIVE", repositoryVersion);
 service.setDesiredRepositoryVersion(repositoryVersion);
 
 repositoryVersion.addRepoOsEntities(new ArrayList<>());
@@ -342,10 +342,10 @@ public class ExecutionCommandWrapperTest {
 executionCommand.setTaskId(1);
 executionCommand.setRequestAndStage(1, 1);
 executionCommand.setHostname(HOST1);
-executionCommand.setRole("NAMENODE");
+executionCommand.setRole("HIVE_SERVER");
 executionCommand.setRoleParams(Collections.emptyMap());
 executionCommand.setRoleCommand(RoleCommand.INSTALL);
-executionCommand.setServiceName("HDFS");
+executionCommand.setServiceName("HIVE");
 executionCommand.setCommandType(AgentCommandType.EXECUTION_COMMAND);
 executionCommand.setCommandParams(commandParams);
 
@@ -366,10 +366,10 @@ public class ExecutionCommandWrapperTest {
 executionCommand.setTaskId(1);
 executionCommand.setRequestAndStage(1, 1);
 executionCommand.setHostname(HOST1);
-executionCommand.setRole("NAMENODE");
+executionCommand.setRole("HIVE_SERVER");
 executionCommand.setRoleParams(Collections. emptyMap());
 executionCommand.setRoleCommand(RoleCommand.START);
-executionCommand.setServiceName("HDFS");
+executionCommand.setServiceName("HIVE");
 executionCommand.setCommandType(AgentCommandType.EXECUTION_COMMAND);
 executionCommand.setCommandParams(commandParams);
 
@@ -379,7 +379,7 @@ public class ExecutionCommandWrapperTest {
 
 processedExecutionCommand = execCommWrap.getExecutionCommand();
 commandParams = processedExecutionCommand.getCommandParams();
-Assert.assertEquals("0.1-", commandParams.get(KeyNames.VERSION));
+Assert.assertEquals("0.2-", commandParams.get(KeyNames.VERSION));
   }
 
   @AfterClass



[ambari] branch trunk updated: AMBARI-24934. Accept legacy JSON configuration in Add Service request (#2640)

2018-11-21 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new e62cc46  AMBARI-24934. Accept legacy JSON configuration in Add Service 
request (#2640)
e62cc46 is described below

commit e62cc462fb5d2ac0f2c90912d044db352c477c74
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Nov 21 17:34:49 2018 +0100

AMBARI-24934. Accept legacy JSON configuration in Add Service request 
(#2640)
---
 .../ambari/server/topology/ConfigurableHelper.java | 51 --
 .../ambari/server/topology/ConfigurableTest.java   | 42 ++
 .../resources/add_service_api/configurable3.json   | 10 +
 3 files changed, 63 insertions(+), 40 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/ConfigurableHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/ConfigurableHelper.java
index 53cef2f..572f12d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/ConfigurableHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/ConfigurableHelper.java
@@ -44,7 +44,7 @@ import com.google.common.collect.Sets;
  */
 public class ConfigurableHelper {
 
-  static final ImmutableSet PERMITTED_CONFIG_FIELDS = 
ImmutableSet.of(PROPERTIES_PROPERTY_ID, PROPERTIES_ATTRIBUTES_PROPERTY_ID);
+  private static final ImmutableSet PERMITTED_CONFIG_FIELDS = 
ImmutableSet.of(PROPERTIES_PROPERTY_ID, PROPERTIES_ATTRIBUTES_PROPERTY_ID);
 
   /**
* Parses configuration maps The configs can be in fully structured JSON, 
e.g.
@@ -65,8 +65,6 @@ public class ConfigurableHelper {
* }]
* 
* In the latter case it calls {@link 
ConfigurationFactory#getConfiguration(Collection)}
-   * @param configs
-   * @return
*/
   public static Configuration parseConfigs(@Nullable Collection> configs) {
 Configuration configuration;
@@ -74,7 +72,7 @@ public class ConfigurableHelper {
 if (null == configs || configs.isEmpty()) {
   configuration = Configuration.newEmpty();
 }
-else if (!configs.isEmpty() && 
configs.iterator().next().keySet().iterator().next().contains("/")) {
+else if 
(configs.iterator().next().keySet().iterator().next().contains("/")) {
   // Configuration has keys with slashes like "zk.cfg/properties/dataDir" 
means it is coming through
   // the resource framework and must be parsed with configuration factories
   checkFlattenedConfig(configs);
@@ -96,24 +94,31 @@ public class ConfigurableHelper {
 checkArgument(configEntry.getValue() instanceof Map,
   "The value for %s must be a JSON object (found: %s)", configName, 
getClassName(configEntry.getValue()));
 
-Map configData = (Map) 
configEntry.getValue();
+Map configData = (Map) configEntry.getValue();
 
 Set extraKeys = Sets.difference(configData.keySet(), 
PERMITTED_CONFIG_FIELDS);
-checkArgument(extraKeys.isEmpty(), "Invalid fields in %s 
configuration: %s", configName, extraKeys);
+boolean legacy = extraKeys.size() == configData.keySet().size();
+checkArgument(legacy || extraKeys.isEmpty(), "Invalid fields in %s 
configuration: %s", configName, extraKeys);
 
-if (configData.containsKey(PROPERTIES_PROPERTY_ID)) {
-  checkMap(PROPERTIES_PROPERTY_ID, 
configData.get(PROPERTIES_PROPERTY_ID), String.class);
-
-  Map properties = (Map)configData.get(PROPERTIES_PROPERTY_ID);
+if (legacy) {
+  checkMap("don't care", configData, String.class);
+  Map properties = (Map)configData;
   allProperties.put(configName, properties);
-}
-if (configData.containsKey(PROPERTIES_ATTRIBUTES_PROPERTY_ID)) {
-  checkMap(PROPERTIES_ATTRIBUTES_PROPERTY_ID, 
configData.get(PROPERTIES_ATTRIBUTES_PROPERTY_ID), Map.class);
-  Map> attributes =
-(Map>)configData.get(PROPERTIES_ATTRIBUTES_PROPERTY_ID);
-  attributes.entrySet().forEach( entry -> checkMap(entry.getKey(), 
entry.getValue(), String.class));
-
-  allAttributes.put(configName, attributes);
+} else {
+  if (configData.containsKey(PROPERTIES_PROPERTY_ID)) {
+checkMap(PROPERTIES_PROPERTY_ID, 
configData.get(PROPERTIES_PROPERTY_ID), String.class);
+
+Map properties = (Map) 
configData.get(PROPERTIES_PROPERTY_ID);
+allProperties.put(configName, properties);
+  }
+  if (configData.containsKey(PROPERTIES_ATTRIBUTES_PROPERTY_ID)) {
+checkMap(PROPERTIES_ATTRIBUTES_PROPERTY_ID, 
configData.get(PROPERTIES_ATTRIBUTES_PROPERTY_ID), Map.class);
+Map> attributes =
+  (Map>) 
configData.

[ambari] branch trunk updated: AMBARI-24926. Apply user-defined configuration for Add Service request. (#2639)

2018-11-21 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new fe80b39  AMBARI-24926. Apply user-defined configuration for Add 
Service request. (#2639)
fe80b39 is described below

commit fe80b390b03a47bda87dde95bc9feb11a49818a0
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Nov 21 17:34:28 2018 +0100

AMBARI-24926. Apply user-defined configuration for Add Service request. 
(#2639)
---
 .../addservice/AddServiceOrchestrator.java |   5 +-
 .../addservice/ResourceProviderAdapter.java| 182 +
 2 files changed, 149 insertions(+), 38 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java
index e137d4a..d30ab09 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/AddServiceOrchestrator.java
@@ -113,8 +113,8 @@ public class AddServiceOrchestrator {
   throw new IllegalArgumentException("No new services to be added");
 }
 
-Configuration config = stack.getValidDefaultConfig();
-// TODO add user-defined config
+Configuration config = request.getConfiguration();
+config.setParentConfiguration(stack.getValidDefaultConfig());
 
 RequestStageContainer stages = new 
RequestStageContainer(actionManager.getNextRequestId(), null, requestFactory, 
actionManager);
 AddServiceInfo validatedRequest = new 
AddServiceInfo(cluster.getClusterName(), stack, config, stages, newServices);
@@ -149,6 +149,7 @@ public class AddServiceOrchestrator {
*/
   private void createResources(AddServiceInfo request) {
 LOG.info("Creating resources for {}", request);
+resourceProviders.updateExistingConfigs(request);
 resourceProviders.createServices(request);
 resourceProviders.createComponents(request);
 resourceProviders.createConfigs(request);
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java
index 722d5f6..ee52c7f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/addservice/ResourceProviderAdapter.java
@@ -20,12 +20,12 @@ package org.apache.ambari.server.topology.addservice;
 import static java.util.stream.Collectors.toList;
 import static java.util.stream.Collectors.toSet;
 
-import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Set;
+import java.util.stream.Stream;
 
 import javax.inject.Inject;
 import javax.inject.Singleton;
@@ -56,13 +56,16 @@ import 
org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.ClusterControllerHelper;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.security.authorization.AuthorizationException;
+import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.State;
+import org.apache.ambari.server.topology.Configuration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
 
 /**
  * Creates resources using the resource providers.
@@ -76,6 +79,9 @@ public class ResourceProviderAdapter {
   @Inject
   private AmbariManagementController controller;
 
+  @Inject
+  private ConfigHelper configHelper;
+
   public void createServices(AddServiceInfo request) {
 LOG.info("Creating service resources for {}", request);
 
@@ -83,7 +89,7 @@ public class ResourceProviderAdapter {
   .map(service -> createServiceRequestProperties(request, service))
   .collect(toSet());
 
-createResources(properties, Resource.Type.Service);
+createResources(request, properties, Resource.Type.Service);
   }
 
   public void createComponents(AddServiceInfo request) {
@@ -94,7 +100,7 @@ public class ResourceProviderAdapter {
 .map(component -> createComponentRequestProperties(request, 
componentsOfService.getKey(), component)))
   .collect(toSet());
 
-createResources(properties, Resource.Type.Component);
+createResources(request, properties, Resource.Type.Component);

[ambari] branch trunk updated: AMBARI-24916. Add setup-jdbc command (#2634)

2018-11-20 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new ae3d9aa  AMBARI-24916. Add setup-jdbc command (#2634)
ae3d9aa is described below

commit ae3d9aa3abfa589a568a77e4c7cf0c7656bdfc65
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Nov 21 07:36:49 2018 +0100

AMBARI-24916. Add setup-jdbc command (#2634)
---
 ambari-server/sbin/ambari-server   |  4 +++
 ambari-server/src/main/python/ambari-server.py | 31 +++---
 .../src/main/python/ambari_server/serverSetup.py   |  8 ++---
 .../src/main/python/ambari_server/setupActions.py  |  1 +
 ambari-server/src/test/python/TestAmbariServer.py  | 38 +++---
 5 files changed, 46 insertions(+), 36 deletions(-)

diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index 3289ff8..4d0c334 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -133,6 +133,10 @@ case "${1:-}" in
 echo -e "Updating jce policy"
 $PYTHON "$AMBARI_PYTHON_EXECUTABLE" "$@"
 ;;
+  setup-jdbc)
+echo -e "Setting up JDBC driver"
+$PYTHON "$AMBARI_PYTHON_EXECUTABLE" "$@"
+;;
   setup-pam)
 echo -e "Setting up PAM properties..."
 $PYTHON "$AMBARI_PYTHON_EXECUTABLE" "$@"
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 8cfa147..4cf7325 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -41,13 +41,13 @@ from ambari_server.enableStack import enable_stack_version
 from ambari_server.hostUpdate import update_host_names
 from ambari_server.kerberos_setup import setup_kerberos
 from ambari_server.serverConfiguration import configDefaults, 
get_ambari_properties, PID_NAME
-from ambari_server.serverSetup import reset, setup, setup_jce_policy
+from ambari_server.serverSetup import reset, setup, setup_jce_policy, 
setup_jdbc
 from ambari_server.serverUpgrade import upgrade, set_current
 from ambari_server.serverUtils import is_server_runing, refresh_stack_hash, 
wait_for_server_to_stop
 from ambari_server.setupActions import BACKUP_ACTION, LDAP_SETUP_ACTION, 
LDAP_SYNC_ACTION, PSTART_ACTION, \
   REFRESH_STACK_HASH_ACTION, RESET_ACTION, RESTORE_ACTION, 
UPDATE_HOST_NAMES_ACTION, CHECK_DATABASE_ACTION, \
   SETUP_ACTION, SETUP_SECURITY_ACTION, RESTART_ACTION, START_ACTION, 
STATUS_ACTION, STOP_ACTION, UPGRADE_ACTION, \
-  SETUP_JCE_ACTION, SET_CURRENT_ACTION, ENABLE_STACK_ACTION, SETUP_SSO_ACTION, 
\
+  SETUP_JCE_ACTION, SETUP_JDBC_ACTION, SET_CURRENT_ACTION, 
ENABLE_STACK_ACTION, SETUP_SSO_ACTION, \
   DB_PURGE_ACTION, INSTALL_MPACK_ACTION, UNINSTALL_MPACK_ACTION, 
UPGRADE_MPACK_ACTION, PAM_SETUP_ACTION, \
   MIGRATE_LDAP_PAM_ACTION, KERBEROS_SETUP_ACTION
 from ambari_server.setupHttps import setup_https, setup_truststore
@@ -455,6 +455,21 @@ def init_action_parser(action, parser):
   # -h reserved for help
 
 @OsFamilyFuncImpl(OsFamilyImpl.DEFAULT)
+def add_jdbc_parser_options(parser):
+  add_parser_options('--jdbc-driver', dest="jdbc_driver", default=None, 
parser=parser,
+help="Specifies the path to the JDBC driver JAR file or archive " \
+ "with all required files(jdbc jar, libraries and etc), for the " \
+ "database type specified with the --jdbc-db option. " \
+ "Used only with --jdbc-db option. Archive is supported only for" \
+ " sqlanywhere database.",
+required_for_actions = (SETUP_JDBC_ACTION,))
+  add_parser_options('--jdbc-db', dest="jdbc_db", default=None, parser=parser,
+help="Specifies the database type 
[postgres|mysql|mssql|oracle|hsqldb|sqlanywhere] for the " \
+ "JDBC driver specified with the --jdbc-driver option. Used only with 
--jdbc-driver option.",
+required_for_actions = (SETUP_JDBC_ACTION,))
+
+
+@OsFamilyFuncImpl(OsFamilyImpl.DEFAULT)
 def init_setup_parser_options(parser):
   database_group = optparse.OptionGroup(parser, 'Database options (command 
need to include all options)')
   database_group.add_option('--database', default=None, help="Database to use 
embedded|oracle|mysql|mssql|postgres|sqlanywhere", dest="dbms")
@@ -467,15 +482,7 @@ def init_setup_parser_options(parser):
   parser.add_option_group(database_group)
 
   jdbc_group = optparse.OptionGroup(parser, 'JDBC options (command need to 
include all options)')
-  jdbc_group.add_option('--jdbc-driver', default=None, help="Specifies the 
path to 

[ambari] branch trunk updated: AMBARI-24917. Implement complex Add Service request using default configs (#2631)

2018-11-19 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 94d1860  AMBARI-24917. Implement complex Add Service request using 
default configs (#2631)
94d1860 is described below

commit 94d18601e8adef6bd43d2ce1e70d3c1e4f14ae3c
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Nov 20 08:14:45 2018 +0100

AMBARI-24917. Implement complex Add Service request using default configs 
(#2631)
---
 .../ambari/server/api/handlers/CreateHandler.java  |   2 +-
 .../internal/HostComponentResourceProvider.java|   2 +-
 .../internal/ServiceResourceProvider.java  |   8 +-
 .../ambari/server/controller/internal/Stack.java   |  24 +++
 .../server/controller/internal/UnitUpdater.java|  23 ++-
 .../server/topology/addservice/AddServiceInfo.java |  46 +-
 .../addservice/AddServiceOrchestrator.java |  61 ++-
 .../addservice/ResourceProviderAdapter.java| 183 +++--
 8 files changed, 312 insertions(+), 37 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
index 484547a..b5dddf8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/handlers/CreateHandler.java
@@ -77,7 +77,7 @@ public class CreateHandler extends BaseManagementHandler {
 } catch (ResourceAlreadyExistsException e) {
   result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.CONFLICT, 
e.getMessage()));
 } catch(IllegalArgumentException e) {
-  LOG.error("Bad request received: " + e.getMessage());
+  LOG.error("Bad request received: " + e.getMessage(), e);
   result = new ResultImpl(new 
ResultStatus(ResultStatus.STATUS.BAD_REQUEST, e.getMessage()));
 } catch (RuntimeException e) {
   if (LOG.isErrorEnabled()) {
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index d6f52a4..79441d5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -799,7 +799,7 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
* @throws NoSuchResourceExceptionthe query didn't match any 
resources
* @throws NoSuchParentResourceException  a specified parent resource 
doesn't exist
*/
-  private RequestStageContainer doUpdateResources(final RequestStageContainer 
stages, final Request request,
+  public RequestStageContainer doUpdateResources(final RequestStageContainer 
stages, final Request request,
   Predicate predicate, boolean 
performQueryEvaluation,
   boolean useGeneratedConfigs, 
boolean useClusterHostInfo)
   throws 
UnsupportedPropertyException,
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index a4aaf0b..eaa8cb1 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@ -254,9 +254,9 @@ public class ServiceResourceProvider extends 
AbstractControllerResourceProvider
 if (request.getProperties().size() == 1) {
   Map requestProperties = 
request.getProperties().iterator().next();
   if (isAddServiceRequest(requestProperties)) {
-processAddServiceRequest(requestProperties, 
request.getRequestInfoProperties());
+RequestStatusResponse response = 
processAddServiceRequest(requestProperties, request.getRequestInfoProperties());
 notifyCreate(Resource.Type.Service, request);
-return getRequestStatus(null);
+return getRequestStatus(response);
   }
 }
 
@@ -1228,11 +1228,11 @@ public class ServiceResourceProvider extends 
AbstractControllerResourceProvider
 return 
OperationType.ADD_SERVICE.name().equals(properties.get(OPERATION_TYPE));
   }
 
-  private void processAddServiceRequest(Map requestProperties, 
Map requestInfoProperties) throws NoSuchParentResourceException 
{
+  private RequestStatusResponse processAddServic

[ambari] branch trunk updated: AMBARI-24901. Handle complex "Add Service" request in ServiceResourceProvider (#2611)

2018-11-15 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 1d87a0a  AMBARI-24901. Handle complex "Add Service" request in 
ServiceResourceProvider (#2611)
1d87a0a is described below

commit 1d87a0a1ee8d5202ed1894bc2917fc8ab7d569fa
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Nov 15 21:38:53 2018 +0100

AMBARI-24901. Handle complex "Add Service" request in 
ServiceResourceProvider (#2611)
---
 .../ambari/server/api/services/ServiceService.java |   8 +-
 .../server/controller/AddServiceRequest.java   |  26 -
 .../internal/ServiceResourceProvider.java  |  38 ++
 .../ambari/server/controller/internal/Stack.java   |   5 +
 .../server/topology/addservice/AddServiceInfo.java |  47 
 .../addservice/AddServiceOrchestrator.java | 127 +
 .../addservice/ResourceProviderAdapter.java|  95 +++
 .../server/controller/AddServiceRequestTest.java   |   2 +-
 8 files changed, 339 insertions(+), 9 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceService.java
index d12cbc4..9440f39 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ServiceService.java
@@ -153,7 +153,7 @@ public class ServiceService extends BaseService {
   @Path("{serviceName}")
   @Produces(MediaType.TEXT_PLAIN)
   @ApiOperation(value = "Creates a service",
-  nickname = "ServiceService#createServices"
+  nickname = "ServiceService#createService"
   )
   @ApiImplicitParams({
   @ApiImplicitParam(dataType = SERVICE_REQUEST_TYPE, paramType = 
PARAM_TYPE_BODY)
@@ -176,7 +176,7 @@ public class ServiceService extends BaseService {
 
   /**
* Handles: POST /clusters/{clusterId}/services
-   * Create multiple services.
+   * Create services, possibly more than one.
*
* @param bodyhttp body
* @param headers http headers
@@ -185,8 +185,8 @@ public class ServiceService extends BaseService {
*/
   @POST
   @Produces(MediaType.TEXT_PLAIN)
-  @ApiOperation(value = "Creates a service",
-  nickname = "ServiceService#createService"
+  @ApiOperation(value = "Creates services",
+  nickname = "ServiceService#createServices"
   )
   @ApiImplicitParams({
   @ApiImplicitParam(dataType = SERVICE_REQUEST_TYPE, paramType = 
PARAM_TYPE_BODY, allowMultiple = true)
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
index 83a66d8..22a32ce 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AddServiceRequest.java
@@ -22,7 +22,11 @@ import static 
com.google.common.base.Preconditions.checkArgument;
 import static java.util.Collections.emptySet;
 import static 
org.apache.ambari.server.controller.internal.BaseClusterRequest.PROVISION_ACTION_PROPERTY;
 import static 
org.apache.ambari.server.controller.internal.ProvisionClusterRequest.CONFIG_RECOMMENDATION_STRATEGY;
+import static 
org.apache.ambari.server.controller.internal.ServiceResourceProvider.OPERATION_TYPE;
+import static org.apache.ambari.server.topology.Configurable.CONFIGURATIONS;
 
+import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -39,6 +43,8 @@ import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.ImmutableSet;
 
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -50,12 +56,16 @@ import io.swagger.annotations.ApiModelProperty;
 @JsonInclude(JsonInclude.Include.NON_EMPTY)
 public final class AddServiceRequest {
 
-  static final String OPERATION_TYPE = "operation_type";
   static final String STACK_NAME = "stack_name";
   static final String STACK_VERSION = "stack_version";
   static final String SERVICES = "services";
   static final String COMPONENTS = "components";
 
+  public static final Set TOP_LEVEL_PROPERTIES = ImmutableSet.of(
+OPERATION_TYPE, CONFIG_RECOMMENDATION_STRATEGY, PROVISION_

[ambari] branch branch-feature-jdk11 updated: AMBARI-24759. Ambari Server test failures with JDK11 (#2586)

2018-11-09 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-jdk11 by this 
push:
 new 1ab78e8  AMBARI-24759. Ambari Server test failures with JDK11 (#2586)
1ab78e8 is described below

commit 1ab78e856171a90d8b09fc54d355d401cafffa1f
Author: Gabor Boros <6317425+g-bo...@users.noreply.github.com>
AuthorDate: Fri Nov 9 14:23:50 2018 +0100

AMBARI-24759. Ambari Server test failures with JDK11 (#2586)
---
 ambari-project/pom.xml| 11 ++-
 ambari-server/pom.xml | 18 --
 .../server/actionmanager/TestActionScheduler.java | 17 +
 .../server/alerts/AmbariPerformanceRunnableTest.java  |  2 ++
 .../commands/StackAdvisorCommandTest.java |  7 ---
 .../checks/HostsMasterMaintenanceCheckTest.java   | 11 ---
 .../checks/HostsRepositoryVersionCheckTest.java   |  8 +++-
 .../org/apache/ambari/server/checks/LZOCheckTest.java |  7 +--
 .../checks/RequiredServicesInRepositoryCheckTest.java |  3 ---
 .../checks/ServicesMaintenanceModeCheckTest.java  | 19 ---
 .../ambari/server/checks/ServicesUpCheckTest.java |  6 ++
 .../server/configuration/ConfigurationTest.java   |  4 ++--
 .../controller/AmbariManagementControllerTest.java|  1 +
 .../internal/ClientConfigResourceProviderTest.java|  2 ++
 ...iceComponentConfigurationResourceProviderTest.java |  2 ++
 .../server/metric/system/impl/MetricsSourceTest.java  |  2 ++
 .../apache/ambari/server/state/CheckHelperTest.java   |  8 
 .../services/AlertNoticeDispatchServiceTest.java  |  3 +++
 .../server/topology/AsyncCallableServiceTest.java |  2 ++
 .../server/topology/ConfigureClusterTaskTest.java |  2 ++
 .../apache/ambari/server/utils/PasswordUtilsTest.java |  1 +
 .../apache/ambari/server/view/ViewExtractorTest.java  |  3 +++
 .../apache/ambari/server/view/ViewRegistryTest.java   |  6 +-
 .../server/view/persistence/DataStoreImplTest.java|  4 
 pom.xml   |  2 +-
 25 files changed, 77 insertions(+), 74 deletions(-)

diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 88e849f..b738e63 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -29,7 +29,7 @@
 false
 5.5.2
 ${project.parent.basedir}
-1.6.3
+2.0.0-beta.5
 9.4.12.v20180830
 1.0.0
 8.9
@@ -41,6 +41,7 @@
 4.2.7.RELEASE
 2.9.5
 42.2.2
+2.3.0
 4
 false
 -Xmx1024m -Xms512m
@@ -251,7 +252,7 @@
   
 org.mockito
 mockito-core
-1.10.19
+2.18.0
   
   
 org.hamcrest
@@ -287,7 +288,7 @@
   
   
 org.powermock
-powermock-api-mockito
+powermock-api-mockito2
 ${powermock.version}
   
   
@@ -378,7 +379,7 @@
   
 javax.xml.bind
 jaxb-api
-2.3.0
+${jaxb.version}
   
   
 com.sun.jersey
@@ -624,7 +625,7 @@
   
 org.easymock
 easymock
-3.4
+3.6
   
   
 io.swagger
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index bc7cdcf..134fa36 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -46,7 +46,7 @@
 src/main/resources/stack-hooks
 
src/main/resources/stacks/${stack.distribution}
 src/main/resources
-2.7.2
+3.1.1
 2.7.0.0.0
 src/main/package 
 ALL 
@@ -1519,7 +1519,7 @@
 
 
   org.powermock
-  powermock-api-mockito
+  powermock-api-mockito2
   test
 
 
@@ -1815,6 +1815,20 @@
 
   
 
+
+  javax.xml.bind
+  jaxb-api
+
+
+  com.sun.xml.bind
+  jaxb-impl
+  ${jaxb.version}
+
+
+  com.sun.xml.bind
+  jaxb-core
+  ${jaxb.version}
+
   
 
   
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
index 220cd52..9414a89 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
@@ -425,6 +425,7 @@ public class TestActionScheduler {
 ServiceComponentHost sch = mock(ServiceComponentHost.class);
 UnitOfWork unitOfWork = mock(UnitOfWork.class);
 AgentCommandsPublisher agentCommandsPublisher = 
mock(AgentCommandsPublisher.class);
+when(oneClusterMock.getClusterName()).thenReturn("cluster1");
 when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
 when(oneClusterMock.getService(anyString())).thenReturn(servic

[ambari] 03/03: AMBARI-24752. Upgrade ambari-utility, ambari-server-spi deps for JDK11 (#2434)

2018-11-08 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit d4d112b2efeda1614d8bacb79bf1100a30b3ae65
Author: Gabor Boros <6317425+g-bo...@users.noreply.github.com>
AuthorDate: Wed Oct 10 20:48:49 2018 +0200

AMBARI-24752. Upgrade ambari-utility, ambari-server-spi deps for JDK11 
(#2434)
---
 ambari-agent/pom.xml  | 2 +-
 ambari-project/pom.xml| 5 +
 ambari-server-spi/pom.xml | 4 
 ambari-utility/pom.xml| 4 
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 8d08587..52b532b 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -411,7 +411,7 @@
   
 org.apache.maven.plugins
 maven-shade-plugin
-2.3
+3.2.0
 
   
 shade-zkmigrator
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index b20140a..88e849f 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -376,6 +376,11 @@
 3.1.0
   
   
+javax.xml.bind
+jaxb-api
+2.3.0
+  
+  
 com.sun.jersey
 jersey-core
 1.19
diff --git a/ambari-server-spi/pom.xml b/ambari-server-spi/pom.xml
index 9c177f0..34f1335 100644
--- a/ambari-server-spi/pom.xml
+++ b/ambari-server-spi/pom.xml
@@ -184,5 +184,9 @@
   junit
   test
 
+
+javax.xml.bind
+jaxb-api
+
   
 
diff --git a/ambari-utility/pom.xml b/ambari-utility/pom.xml
index 35b5bd9..bb86e5e 100644
--- a/ambari-utility/pom.xml
+++ b/ambari-utility/pom.xml
@@ -52,6 +52,10 @@
   
 
 
+  javax.xml.bind
+  jaxb-api
+
+
   com.fasterxml.jackson.jaxrs
   jackson-jaxrs-json-provider
   provided



[ambari] 01/03: AMBARI-24729. Ambari Server stops with Java 9 due to Guice error (#2418)

2018-11-08 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit f6ca8bc9734eb4d60a1cccaabb3ec57ebd7ee9ee
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Oct 5 17:39:28 2018 +0200

AMBARI-24729. Ambari Server stops with Java 9 due to Guice error (#2418)
---
 ambari-agent/pom.xml  | 1 +
 ambari-project/pom.xml| 6 +++---
 ambari-server/pom.xml | 2 +-
 .../apache/ambari/server/orm/entities/ClusterConfigEntity.java| 2 +-
 .../server/orm/entities/HostComponentDesiredStateEntity.java  | 3 ++-
 .../ambari/server/orm/entities/HostComponentStateEntity.java  | 4 ++--
 .../apache/ambari/server/orm/entities/UpgradeHistoryEntity.java   | 8 +---
 .../server/serveraction/upgrades/FinalizeUpgradeAction.java   | 2 +-
 .../ambari/server/stack/upgrade/ConfigurationCondition.java   | 4 ++--
 .../java/org/apache/ambari/server/stack/upgrade/Grouping.java | 4 ++--
 .../org/apache/ambari/server/stack/upgrade/HostOrderItem.java | 4 ++--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java  | 2 +-
 pom.xml   | 2 +-
 13 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index da0f3b1..8d08587 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -88,6 +88,7 @@
 
   com.google.guava
   guava
+  20.0
 
 
   org.apache.hadoop
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 3c57f54..b20140a 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -36,7 +36,7 @@
 1.5.19
 3.1.5
 1.7.20
-4.1.0
+4.2.1
 4.3.18.RELEASE
 4.2.7.RELEASE
 2.9.5
@@ -230,7 +230,7 @@
   
   
 org.eclipse.persistence
-eclipselink
+org.eclipse.persistence.jpa
 ${eclipselink.version}
   
   
@@ -241,7 +241,7 @@
   
 com.google.guava
 guava
-18.0
+26.0-jre
   
   
 com.google.code.findbugs
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 53ca716..bc7cdcf 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1238,7 +1238,7 @@
 
 
   org.eclipse.persistence
-  eclipselink
+  org.eclipse.persistence.jpa
 
 
   org.hamcrest
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
index 287ee89..f6de06d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
@@ -303,7 +303,7 @@ public class ClusterConfigEntity {
*/
   @Override
   public String toString() {
-return com.google.common.base.Objects.toStringHelper(this)
+return com.google.common.base.MoreObjects.toStringHelper(this)
   .add("clusterId", clusterId)
   .add("type", type)
   .add("version", version)
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
index 3a2506d..eba273f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
@@ -41,6 +41,7 @@ import org.apache.ambari.server.state.HostComponentAdminState;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.State;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 
 
@@ -278,7 +279,7 @@ public class HostComponentDesiredStateEntity {
*/
   @Override
   public String toString() {
-return Objects.toStringHelper(this).add("serviceName", 
serviceName).add("componentName",
+return MoreObjects.toStringHelper(this).add("serviceName", 
serviceName).add("componentName",
 componentName).add("hostId", hostId).add("desiredState", 
desiredState).toString();
   }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
index 0d295a4..dacaa55 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
+++ 
b/ambari-server/

[ambari] 02/03: AMBARI-24730. Support Java 9+ in Ambari Server setup (#2427)

2018-11-08 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit 62cdb4a7a591872053aa6702325c7b0c0b4c55d1
Author: Gabor Boros <6317425+g-bo...@users.noreply.github.com>
AuthorDate: Sat Oct 6 07:36:54 2018 +0200

AMBARI-24730. Support Java 9+ in Ambari Server setup (#2427)
---
 .../src/main/python/ambari_server/serverSetup.py   | 18 +++---
 ambari-server/src/test/python/TestAmbariServer.py  |  4 ++--
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py 
b/ambari-server/src/main/python/ambari_server/serverSetup.py
index a32ac38..b91d8eb 100644
--- a/ambari-server/src/main/python/ambari_server/serverSetup.py
+++ b/ambari-server/src/main/python/ambari_server/serverSetup.py
@@ -80,7 +80,7 @@ UNTAR_JDK_ARCHIVE = "tar --no-same-owner -xvf {0}"
 JDK_PROMPT = "[{0}] {1}\n"
 JDK_VALID_CHOICES = "^[{0}{1:d}]$"
 
-JDK_VERSION_CHECK_CMD = """{0} -version 2>&1 | grep -i version | sed 
's/.*version ".*\.\(.*\)\..*"/\\1/; 1q' 2>&1"""
+JDK_VERSION_CHECK_CMD = """{0} -version 2>&1 | grep -i version 2>&1"""
 
 def get_supported_jdbc_drivers():
   factory = DBMSConfigFactory()
@@ -1272,6 +1272,17 @@ def setup_jce_policy(args):
   print 'NOTE: Restart Ambari Server to apply changes' + \
 ' ("ambari-server restart|stop|start")'
 
+def get_java_major_version(cmd_out):
+  version_short = re.split("[java|openjdk|.*] version", cmd_out)[1].split(" 
")[1][1:-1]
+  if re.match("^1\.[0-9].*", version_short): # 1.8.0_112
+return version_short.split(".")[1]
+  elif re.match("^[1-9][0-9]*\.[0-9].*", version_short): # 10.0.2
+return version_short.split(".")[0]
+  elif re.match("^[1-9][0-9]*$", version_short): # 11
+return version_short
+  elif re.match("^[1-9][0-9]*-.*$", version_short): # 12-ea
+return version_short.split("-")[0]
+
 def check_ambari_java_version_is_valid(java_home, java_bin, min_version, 
properties):
   """
   Check that ambari uses the proper (minimum) JDK with a shell command.
@@ -1292,11 +1303,12 @@ def check_ambari_java_version_is_valid(java_home, 
java_bin, min_version, propert
   err = "Checking JDK version command returned with exit code %s" % 
process.returncode
   raise FatalException(process.returncode, err)
 else:
-  actual_jdk_version = int(out)
+  java_major_version = get_java_major_version(out)
+  actual_jdk_version = int(java_major_version)
   print 'JDK version found: {0}'.format(actual_jdk_version)
   if actual_jdk_version < min_version:
 print 'Minimum JDK version is {0} for Ambari. Setup JDK again only for 
Ambari Server.'.format(min_version)
-properties.process_pair(STACK_JAVA_VERSION, out)
+properties.process_pair(STACK_JAVA_VERSION, java_major_version)
 result = False
   else:
 print 'Minimum JDK version is {0} for Ambari. Skipping to setup 
different JDK for Ambari Server.'.format(min_version)
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index 14f3387..0402494 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -3150,7 +3150,7 @@ class TestAmbariServer(TestCase):
 # case 1:  jdk7 is picked for stacks
 properties = Properties()
 p = MagicMock()
-p.communicate.return_value = ('7', None)
+p.communicate.return_value = ('java version "1.7.0_80"', None)
 p.returncode = 0
 popenMock.return_value = p
 result = check_ambari_java_version_is_valid('/usr/jdk64/jdk_1.7.0/', 
'java', 8, properties)
@@ -3159,7 +3159,7 @@ class TestAmbariServer(TestCase):
 
 # case 2: jdk8 is picked for stacks
 properties = Properties()
-p.communicate.return_value = ('8', None)
+p.communicate.return_value = ('java version "1.8.0_112"', None)
 p.returncode = 0
 result = check_ambari_java_version_is_valid('/usr/jdk64/jdk_1.8.0/', 
'java', 8, properties)
 self.assertFalse(properties.get_property(STACK_JAVA_VERSION))



[ambari] branch branch-feature-jdk11 updated (bc3b720 -> d4d112b)

2018-11-08 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a change to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git.


omit bc3b720  AMBARI-24752. Upgrade ambari-utility, ambari-server-spi deps 
for JDK11 (#2434)
omit b6309a8  AMBARI-24730. Support Java 9+ in Ambari Server setup (#2427)
omit 67d8a64  AMBARI-24729. Ambari Server stops with Java 9 due to Guice 
error (#2418)
 add ce9cdfa  [AMBARI-24728] Orchestration Should Save Upgrade Pack for 
source or target (#2417)
 add 27d3aba  AMBARI-24727 - Autoscaling based on metric alerts (#2416)
 add af3f9ff  AMBARI-24714. Avoid multi-threading and caching issues when 
aborting requests and processing agent reports at the same time (#2411)
 add d1e7241  [AMBARI-24726] Remove outdated 
functions.list_ambari_managed_repos module (dgrinenko) (#2413)
 add 62476c0  BUG-111390 - Infra Solr: manage autoscaling properties in 
Ambari (#2414)
 add ade6c79  AMBARI-24734. Cover pluralize_view
 add 7177f04  Merge pull request #2425 from hiveww/AMBARI-24734-trunk
 add d4b97b0  AMBARI-24487 repoVersion entity should show resolved full 
stack version when available (dgrinenko) (#2412)
 add 9204bb5  AMBARI-23058. yum installation fails if there is any 
transaction files (aonishuk)
 add e175b93  AMBARI-24722. Failed to force_non_member_install a stack 
version on hosts. (#2415)
 add e02749c  AMBARI-24712. Backport Execution Command Library from branch 
'branch-feature-AMBARI-14714' to Ambari 2.8.0
 add 21b0549  AMBARI-24712. Updated cluster_settings.py fns if-else 
structure.
 add afabe00  AMBARI-24712. Backport Execution Command Library from branch 
'branch-feature-AMBARI-14714' to Ambari 2.8.0
 add 25f6e0c  [AMBARI-24737] - Expose Upgrade Check Classes via an Ambari 
Client Library (#2429)
 add cf74bb1  AMBARI-24742. Implementing a new service to be used in case 
we want to encrypt/decrypt sensitive information using custom/environment 
master key (also injected into Guice) (#2430)
 add d3e45e9  AMBARI-21150: Mpack API and DB Schema changes (mradhakrishnan)
 add cf2b52a  AMBARI-21231: Download and extract mpacks. Add unit tests 
(mradhakrishnan)
 add 9106dcc  AMBARI-21231: Mpack to Stack Linkage and Parsing mpacks at 
bootstrap  (mradhakrishnan)
 add f9d7051  AMBARI-21077: Fix build issues after reverting patch for 
AMBARI-21077 and merging latest trunk (jluniya)
 add ab5721c  AMBARI-21523: DELETE Api for Mpacks  (mradhakrishnan)
 add 32023fb  AMBARI-21796 : Clear versionDefinition map during new mpack 
registration and mpack deletion (mradhakrishnan)
 add 4ae9222  AMBARI-21849 : Clean up repo_version table during mpack 
delete, add create validation for mpacks (mradhakrishnan)
 add 4cfd7a9  AMBARI-21849 : Addendum to fix checkstyle issues and null 
check (mradhakrishnan)
 add a82e169  AMBARI-22082: Create missing parent directory when expanding 
mpack tarball (jluniya)
 add 3959182  AMBARI-22283 : Add stack name and version to mpack API 
(mradhakrishnan)
 add aaa56f2  AMBARI-22283 : Add stack name and version to mpack API 
(mradhakrishnan)
 add 562e52b  AMBARI-22283 : Add stack name and version to mpack API 
(mradhakrishnan)
 add 10bf7ba  [AMBARI-22904] Revised mpack APIs (#252)
 add 29aa64d  AMBARI-22971: Remove current_mpack_id to mpack_id in stacks 
table (jluniya)
 add 27f19ad  [AMBARI-22992] Update error handling during mpack 
installation (#363)
 add a77b2f9  AMBARI-22979: Update software registry API to support new 
mpack schema (jluniya) (#433)
 add ffe161f  [AMBARI-23223] Stack Mpack link broken in stacks api
 add 9360b63  [AMBARI-23254] Mpack should have both displayName and 
description
 add fab74c2  [AMBARI-23223] Review comments
 add a6536f3  Modifications to choose only necessary changes from Ambari3.0 
to Ambari2.8 (mradhakrishnan)
 add 2b89b14  Merge branch 'trunk' into AMBARI-24711
 add a019793  Fix unit tests due to mpack backport (mradhakrishnan)
 add 6adc889  Merge pull request #2401 from apache/AMBARI-24711
 add 2415a03  AMBARI-24757. Grafana start failing on U14 fails with error 
"AttributeError: 'module' object has no attribute 'PROTOCOL_TLSv1_2'" (aonishuk)
 add 09c3720  AMBARI-24751. Cover helpers views
 add 87d652f  Merge pull request #2433 from hiveww/AMBARI-24751-trunk
 add 9103295  AMBARI-24758. Ambari-agent takes up too many cpu of perf 
(aonishuk)
 add 39aedf6  Update AmbariAgent.py
 add cd9d442  Update ams_alert.py
 add 8b3af69   AMBARI-24291. Start All Services on 100-nodes cluster timed 
out after 1 hour. (#1850)
 add c629c63  AMBARI-24767. Error while starting Timeline v2 Reader during 
Move operation (amagyar) (#2447)
 add 4fde749  [AMBARI-24733] Rolling Restarts: Option to pause, resume and 
abort re… (#2424)
  

[ambari] branch branch-2.7 updated: AMBARI-24865. Build error at Findbugs with Maven 3.6. (#2582)

2018-11-07 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 74b3733  AMBARI-24865. Build error at Findbugs with Maven 3.6. (#2582)
74b3733 is described below

commit 74b3733af13062f4c79057c6331de0272ae048bf
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Nov 7 14:43:12 2018 +0100

AMBARI-24865. Build error at Findbugs with Maven 3.6. (#2582)
---
 ambari-server/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 727e493..1978f43 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -661,7 +661,7 @@
   
 org.codehaus.mojo
 findbugs-maven-plugin
-3.0.3
+3.0.5
 
   false
   Low



[ambari] branch trunk updated: AMBARI-24865. Build error at Findbugs with Maven 3.6. (#2581)

2018-11-07 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 6972507  AMBARI-24865. Build error at Findbugs with Maven 3.6. (#2581)
6972507 is described below

commit 697250782673f04201610ee3502e9d573d28b5d6
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Nov 7 13:20:35 2018 +0100

AMBARI-24865. Build error at Findbugs with Maven 3.6. (#2581)
---
 ambari-server/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 12c1cf0..53ca716 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -640,7 +640,7 @@
   
 org.codehaus.mojo
 findbugs-maven-plugin
-3.0.3
+3.0.5
 
   false
   Low



[ambari] branch trunk updated: AMBARI-24843. Make Ambaripreupload.py more configurable - fallback to default driver (#2575)

2018-11-05 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 7eee67d  AMBARI-24843. Make Ambaripreupload.py more configurable - 
fallback to default driver (#2575)
7eee67d is described below

commit 7eee67dd3850a560cd63410b7ed0a6dc79f07baf
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Nov 5 20:24:13 2018 +0100

AMBARI-24843. Make Ambaripreupload.py more configurable - fallback to 
default driver (#2575)
---
 ambari-server/src/main/resources/scripts/Ambaripreupload.py | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 18feadc..0de7ac2 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -48,7 +48,7 @@ from resource_management.libraries.functions.format import 
format
 from resource_management.libraries.functions.oozie_prepare_war import 
prepare_war
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 
-DEFAULT_SQL_DRIVER_PATH = get_value_from_properties(get_ambari_properties(), 
JDBC_DRIVER_PATH_PROPERTY, "/var/lib/ambari-server/resources/sqljdbc41.jar")
+DEFAULT_SQL_DRIVER_PATH = "/var/lib/ambari-server/resources/sqljdbc41.jar"
 
 with Environment() as env:
   def get_stack_version():
@@ -78,7 +78,8 @@ with Environment() as env:
 return stack_version
 
   parser = OptionParser()
-  parser.add_option("-d", "--database-driver", dest="sql_driver_path", 
default=DEFAULT_SQL_DRIVER_PATH,
+  parser.add_option("-d", "--database-driver", dest="sql_driver_path",
+default=get_value_from_properties(get_ambari_properties(), 
JDBC_DRIVER_PATH_PROPERTY, DEFAULT_SQL_DRIVER_PATH),
 help="Path to JDBC driver")
   parser.add_option("-f", "--fs-type", dest="fs_type", default="wasb",
 help="Expected protocol of fs.defaultFS")
@@ -90,7 +91,11 @@ with Environment() as env:
 
   if not os.path.exists(options.sql_driver_path):
 Logger.error("SQL driver file {} does not 
exist".format(options.sql_driver_path))
-sys.exit(1)
+if os.path.exists(DEFAULT_SQL_DRIVER_PATH):
+  Logger.warning("Fallback to SQL driver 
{}".format(DEFAULT_SQL_DRIVER_PATH))
+  options.sql_driver_path = DEFAULT_SQL_DRIVER_PATH
+else:
+  sys.exit(1)
 
   Logger.info("Using SQL driver from {}".format(options.sql_driver_path))
   sql_driver_filename = os.path.basename(options.sql_driver_path)



[ambari] branch branch-2.7 updated: AMBARI-24843. Make Ambaripreupload.py more configurable - fallback to default driver (#2573)

2018-11-05 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 77d87ee  AMBARI-24843. Make Ambaripreupload.py more configurable - 
fallback to default driver (#2573)
77d87ee is described below

commit 77d87ee506c020c83a0910d73726081c4c1503ef
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Nov 5 18:11:39 2018 +0100

AMBARI-24843. Make Ambaripreupload.py more configurable - fallback to 
default driver (#2573)
---
 ambari-server/src/main/resources/scripts/Ambaripreupload.py | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 18feadc..0de7ac2 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -48,7 +48,7 @@ from resource_management.libraries.functions.format import 
format
 from resource_management.libraries.functions.oozie_prepare_war import 
prepare_war
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 
-DEFAULT_SQL_DRIVER_PATH = get_value_from_properties(get_ambari_properties(), 
JDBC_DRIVER_PATH_PROPERTY, "/var/lib/ambari-server/resources/sqljdbc41.jar")
+DEFAULT_SQL_DRIVER_PATH = "/var/lib/ambari-server/resources/sqljdbc41.jar"
 
 with Environment() as env:
   def get_stack_version():
@@ -78,7 +78,8 @@ with Environment() as env:
 return stack_version
 
   parser = OptionParser()
-  parser.add_option("-d", "--database-driver", dest="sql_driver_path", 
default=DEFAULT_SQL_DRIVER_PATH,
+  parser.add_option("-d", "--database-driver", dest="sql_driver_path",
+default=get_value_from_properties(get_ambari_properties(), 
JDBC_DRIVER_PATH_PROPERTY, DEFAULT_SQL_DRIVER_PATH),
 help="Path to JDBC driver")
   parser.add_option("-f", "--fs-type", dest="fs_type", default="wasb",
 help="Expected protocol of fs.defaultFS")
@@ -90,7 +91,11 @@ with Environment() as env:
 
   if not os.path.exists(options.sql_driver_path):
 Logger.error("SQL driver file {} does not 
exist".format(options.sql_driver_path))
-sys.exit(1)
+if os.path.exists(DEFAULT_SQL_DRIVER_PATH):
+  Logger.warning("Fallback to SQL driver 
{}".format(DEFAULT_SQL_DRIVER_PATH))
+  options.sql_driver_path = DEFAULT_SQL_DRIVER_PATH
+else:
+  sys.exit(1)
 
   Logger.info("Using SQL driver from {}".format(options.sql_driver_path))
   sql_driver_filename = os.path.basename(options.sql_driver_path)



[ambari] branch trunk updated: AMBARI-24852. NPE in default host group replacement (#2571)

2018-11-02 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 2574ed4  AMBARI-24852. NPE in default host group replacement (#2571)
2574ed4 is described below

commit 2574ed43e4cb52807d9d4b0e35257fcfbb7815ad
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Nov 2 20:39:16 2018 +0100

AMBARI-24852. NPE in default host group replacement (#2571)
---
 .../controller/internal/BlueprintConfigurationProcessor.java   | 10 ++
 .../internal/BlueprintConfigurationProcessorTest.java  |  4 
 2 files changed, 14 insertions(+)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 22ab053..1b62c29 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -1767,6 +1767,11 @@ public class BlueprintConfigurationProcessor {
  Map> 
properties,
  ClusterTopology topology) {
 
+  if (origValue == null) {
+LOG.info("Property {} is null, skipping search for host group 
placeholder", propertyName);
+return null;
+  }
+
   HostGroups hostGroups = new HostGroups(topology, propertyName);
 
   //todo: getHostStrings (?)
@@ -1807,6 +1812,11 @@ public class BlueprintConfigurationProcessor {
 String origValue,
 Map> properties,
 ClusterTopology topology) {
+  if (origValue == null) {
+LOG.info("Property {} is null, skipping search for host group 
placeholder", propertyName);
+return Collections.emptyList();
+  }
+
   //todo: getHostStrings
   Matcher m = HostGroup.HOSTGROUP_REGEX.matcher(origValue);
   Set hostGroups = new HashSet<>();
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 28a9bcd..f718862 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -2249,6 +2249,7 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
 "dfs.https.address", "testhost3")),
   "myservice-site", new HashMap<>(ImmutableMap.of(
 "myservice_slave_address", "%HOSTGROUP::group1%:8080";
+hostGroupProperties.get("hdfs-site").put("null_property", null);
 
 Configuration clusterConfig = new Configuration(new HashMap<>(), new 
HashMap<>());
 clusterConfig.setParentConfiguration(new Configuration(stackProperties, 
emptyMap()));
@@ -2387,6 +2388,9 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
   "%HOSTGROUP::master3%:8080",
   clusterConfig.getProperties(),
   topology)));
+
+assertEquals(emptyList(),
+  updater.getRequiredHostGroups("mycomponent.urls", null, 
clusterConfig.getProperties(), topology));
   }
 
   @Test



[ambari] branch branch-2.7 updated: AMBARI-24844. Improve copy of atlas.war (#2558)

2018-11-01 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new a750bf1  AMBARI-24844. Improve copy of atlas.war (#2558)
a750bf1 is described below

commit a750bf11d4c7f24c901ee2d87c1d746870da6747
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Nov 1 13:30:27 2018 +0100

AMBARI-24844. Improve copy of atlas.war (#2558)
---
 .../ATLAS/0.1.0.2.3/package/scripts/metadata.py  | 10 +++---
 .../src/test/python/stacks/2.3/ATLAS/test_metadata_server.py | 12 +++-
 .../src/test/python/stacks/2.5/ATLAS/test_atlas_server.py|  5 +++--
 3 files changed, 17 insertions(+), 10 deletions(-)

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 c65662a..b713012 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
@@ -85,9 +85,13 @@ def metadata(type='server'):
 group=params.user_group,
 create_parents = True
   )
-  File(format("{expanded_war_dir}/atlas.war"),
-   content = 
StaticFile(format('{metadata_home}/server/webapp/atlas.war'))
-  )
+
+  war_source = format('{metadata_home}/server/webapp/atlas.war')
+  war_target = format("{expanded_war_dir}/atlas.war")
+  Execute(('cp', war_source, war_target),
+  sudo = True,
+  not_if = war_source == war_target)
+
   File(format("{conf_dir}/atlas-log4j.xml"),
mode=0644,
owner=params.metadata_user,
diff --git 
a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py 
b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
index f28b37f..4fd31ad 100644
--- a/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
+++ b/ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
@@ -82,8 +82,9 @@ class TestMetadataServer(RMFTestCase):
 cd_access='a',
 mode=0644
   )
-  self.assertResourceCalled('File', 
self.stack_root+'/current/atlas-server/server/webapp/atlas.war',
-  content = 
StaticFile(self.stack_root+'/current/atlas-server/server/webapp/atlas.war'),
+  self.assertResourceCalled('Execute', ('cp', 
'/usr/hdp/current/atlas-server/server/webapp/atlas.war', 
'/usr/hdp/current/atlas-server/server/webapp/atlas.war'),
+sudo = True,
+not_if = True,
   )
   host_name = u"c6401.ambari.apache.org"
   app_props =  
dict(self.getConfig()['configurations']['application-properties'])
@@ -217,9 +218,10 @@ class TestMetadataServer(RMFTestCase):
   cd_access='a',
   mode=0644
 )
-self.assertResourceCalled('File', 
self.stack_root+'/current/atlas-server/server/webapp/atlas.war',
-  content = 
StaticFile(self.stack_root+'/current/atlas-server/server/webapp/atlas.war'),
-  )
+self.assertResourceCalled('Execute', ('cp', 
self.stack_root+'/current/atlas-server/server/webapp/atlas.war', 
self.stack_root+'/current/atlas-server/server/webapp/atlas.war'),
+  sudo = True,
+  not_if = True,
+)
 host_name = u"c6401.ambari.apache.org"
 app_props =  
dict(self.getConfig()['configurations']['application-properties'])
 app_props['atlas.server.bind.address'] = host_name
diff --git 
a/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py 
b/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py
index 6b49689..cdbaad5 100644
--- a/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py
+++ b/ambari-server/src/test/python/stacks/2.5/ATLAS/test_atlas_server.py
@@ -77,8 +77,9 @@ class TestAtlasServer(RMFTestCase):
   cd_access='a',
   mode=0644
 )
-self.assertResourceCalled('File', 
'/usr/hdp/current/atlas-server/server/webapp/atlas.war',
-  content = 
StaticFile('/usr/hdp/current/atlas-server/server/webapp/atlas.war'),
+self.assertResourceCalled('Execute', ('cp', 
'/usr/hdp/current/atlas-server/server/webapp/atlas.war', 
'/usr/hdp/current/atlas-server/server/webapp/atlas.war'),
+  sudo = True,
+  not_if = True,
 )
 host_name = u"c6401.ambari.apache.org"
 app_props =  dict(self.getConfig()['configurations'][



[ambari] branch branch-2.7 updated: AMBARI-24852. NPE in default host group replacement (#2567)

2018-10-31 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 7186cf4  AMBARI-24852. NPE in default host group replacement (#2567)
7186cf4 is described below

commit 7186cf4034b4ae87e5301eafd3c31622b35150ab
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Nov 1 02:09:51 2018 +0100

AMBARI-24852. NPE in default host group replacement (#2567)
---
 .../controller/internal/BlueprintConfigurationProcessor.java   | 10 ++
 .../internal/BlueprintConfigurationProcessorTest.java  |  4 
 2 files changed, 14 insertions(+)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 19c8e9f..31a157f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -1737,6 +1737,11 @@ public class BlueprintConfigurationProcessor {
  Map> 
properties,
  ClusterTopology topology) {
 
+  if (origValue == null) {
+LOG.info("Property {} is null, skipping search for host group 
placeholder", propertyName);
+return null;
+  }
+
   HostGroups hostGroups = new HostGroups(topology, propertyName);
 
   //todo: getHostStrings (?)
@@ -1777,6 +1782,11 @@ public class BlueprintConfigurationProcessor {
 String origValue,
 Map> properties,
 ClusterTopology topology) {
+  if (origValue == null) {
+LOG.info("Property {} is null, skipping search for host group 
placeholder", propertyName);
+return Collections.emptyList();
+  }
+
   //todo: getHostStrings
   Matcher m = HostGroup.HOSTGROUP_REGEX.matcher(origValue);
   Set hostGroups = new HashSet<>();
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 996c09d..48e6bac 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -2248,6 +2248,7 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
 "dfs.https.address", "testhost3")),
   "myservice-site", new HashMap<>(ImmutableMap.of(
 "myservice_slave_address", "%HOSTGROUP::group1%:8080";
+hostGroupProperties.get("hdfs-site").put("null_property", null);
 
 Configuration clusterConfig = new Configuration(new HashMap<>(), new 
HashMap<>());
 clusterConfig.setParentConfiguration(new Configuration(stackProperties, 
emptyMap()));
@@ -2386,6 +2387,9 @@ public class BlueprintConfigurationProcessorTest extends 
EasyMockSupport {
   "%HOSTGROUP::master3%:8080",
   clusterConfig.getProperties(),
   topology)));
+
+assertEquals(emptyList(),
+  updater.getRequiredHostGroups("mycomponent.urls", null, 
clusterConfig.getProperties(), topology));
   }
 
   @Test



[ambari] branch trunk updated: AMBARI-24843. Make Ambaripreupload.py more configurable (#2566)

2018-10-31 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new cce16fb  AMBARI-24843. Make Ambaripreupload.py more configurable 
(#2566)
cce16fb is described below

commit cce16fb367cc1d0184ab0561750fc8f7757f5021
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Oct 31 13:28:55 2018 +0100

AMBARI-24843. Make Ambaripreupload.py more configurable (#2566)
---
 .../src/main/resources/scripts/Ambaripreupload.py  | 127 +++--
 1 file changed, 67 insertions(+), 60 deletions(-)

diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 1986a50..18feadc 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -7,30 +7,34 @@ 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 functools
+import glob
 import os
+import re
 import sys
 import tarfile
+import tempfile
+import time
+
 from contextlib import closing
 from optparse import OptionParser
+from xml.dom import minidom
+
 os.environ["PATH"] += os.pathsep + "/var/lib/ambari-agent"
 sys.path.append("/usr/lib/ambari-server/lib")
 
-import glob
-import re
-import tempfile
-import time
-import functools
-from xml.dom import minidom
+from ambari_server.serverClassPath import JDBC_DRIVER_PATH_PROPERTY
+from ambari_server.serverConfiguration import get_value_from_properties, 
get_ambari_properties
 
 from resource_management.core import File
 from resource_management.core import shell
@@ -44,18 +48,7 @@ from resource_management.libraries.functions.format import 
format
 from resource_management.libraries.functions.oozie_prepare_war import 
prepare_war
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 
-
-SQL_DRIVER_PATH = "/var/lib/ambari-server/resources/sqljdbc41.jar"
- 
-"""
-This file provides helper methods needed for the versioning of RPMs. 
Specifically, it does dynamic variable
-interpretation to replace strings like {{ stack_version_formatted }}  where 
the value of the
-variables cannot be determined ahead of time, but rather, depends on what 
files are found.
- 
-It assumes that {{ stack_version_formatted }} is constructed as 
${major.minor.patch.rev}-${build_number}
-E.g., 998.2.2.1.0-998
-Please note that "-${build_number}" is optional.
-"""
+DEFAULT_SQL_DRIVER_PATH = get_value_from_properties(get_ambari_properties(), 
JDBC_DRIVER_PATH_PROPERTY, "/var/lib/ambari-server/resources/sqljdbc41.jar")
 
 with Environment() as env:
   def get_stack_version():
@@ -72,34 +65,44 @@ with Environment() as env:
 Logger.warning("Could not verify HDP version by calling '%s'. Return 
Code: %s, Output: %s." %
(get_stack_version_cmd, str(code), str(out)))
 return 1
- 
+
   matches = re.findall(r"([\d\.]+\-\d+)", out)
   stack_version = matches[0] if matches and len(matches) > 0 else None
- 
+
   if not stack_version:
 Logger.error("Could not parse HDP version from output of hdp-select: 
%s" % str(out))
 return 1
 else:
   stack_version = options.hdp_version
-  
+
 return stack_version
-  
+
   parser = OptionParser()
+  parser.add_option("-d", "--database-driver", dest="sql_driver_path", 
default=DEFAULT_SQL_DRIVER_PATH,
+help="Path to JDBC driver")
+  parser.add_option("-f", "--fs-type", dest="fs_type", default="wasb",
+help="Expected protocol of fs.defaultFS")
   parser.add_option("-v", "--hdp-version", dest="hdp_version", default="",
 help="hdp-version used in path of tarballs")
   parser.add_option("-u", "--upgrade", dest="upgrade", action="store_true",
-help="flag to indicate script is being run for upgrade", 
default=False)  
+  

[ambari] branch branch-2.6 updated: AMBARI-24843. Make Ambaripreupload.py more configurable (#2563)

2018-10-31 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new 2237560  AMBARI-24843. Make Ambaripreupload.py more configurable 
(#2563)
2237560 is described below

commit 2237560490df7f8a23c056853d493a31309547dd
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Oct 31 09:44:26 2018 +0100

AMBARI-24843. Make Ambaripreupload.py more configurable (#2563)
---
 .../src/main/resources/scripts/Ambaripreupload.py  | 178 ++---
 1 file changed, 89 insertions(+), 89 deletions(-)

diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index e0595a8..69eb14e 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -7,57 +7,48 @@ 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 functools
+import glob
 import os
+import re
 import sys
 import tarfile
+import tempfile
+import time
+
 from contextlib import closing
 from optparse import OptionParser
+from xml.dom import minidom
+
 os.environ["PATH"] += os.pathsep + "/var/lib/ambari-agent"
 sys.path.append("/usr/lib/ambari-server/lib")
 
-import glob
-from logging import thread
-import re
-import tempfile
-import time
-import functools
-from xml.dom import minidom
-from xml.dom.minidom import parseString
- 
-from resource_management import *
+from ambari_server.serverClassPath import JDBC_DRIVER_PATH_PROPERTY
+from ambari_server.serverConfiguration import get_value_from_properties, 
get_ambari_properties
+
+from resource_management.core import File
 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.environment import Environment
 from resource_management.core.logger import Logger
-from resource_management.core.resources.system import Execute, Directory
-from resource_management.libraries.functions.default import default
+from resource_management.core.resources.system import Directory
+from resource_management.core.resources.system import Execute
+from resource_management.core.source import StaticFile
+from resource_management.libraries import ConfigDictionary
 from resource_management.libraries.functions.format import format
 from resource_management.libraries.functions.oozie_prepare_war import 
prepare_war
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
-from resource_management.libraries.resources.execute_hadoop import 
ExecuteHadoop
-from resource_management import Script
 
-SQL_DRIVER_PATH = "/var/lib/ambari-server/resources/sqljdbc41.jar"
- 
-"""
-This file provides helper methods needed for the versioning of RPMs. 
Specifically, it does dynamic variable
-interpretation to replace strings like {{ stack_version_formatted }}  where 
the value of the
-variables cannot be determined ahead of time, but rather, depends on what 
files are found.
- 
-It assumes that {{ stack_version_formatted }} is constructed as 
${major.minor.patch.rev}-${build_number}
-E.g., 998.2.2.1.0-998
-Please note that "-${build_number}" is optional.
-"""
+DEFAULT_SQL_DRIVER_PATH = get_value_from_properties(get_ambari_properties(), 
JDBC_DRIVER_PATH_PROPERTY, "/var/lib/ambari-server/resources/sqljdbc41.jar")
 
 with Environment() as env:
   def get_stack_version():
@@ -74,34 +65,44 @@ with Environment() as env:
 Logger.warning("Could not verify HDP version by calling '%s'. Return 
Code: %s, Output: %s." %
(get_stack_version_cmd, str(code), str(out)))
 return 1
- 
+
   matches = re.findall(r"([\d\.]+\-\d+)", out)
   stack_version = matches[0] if matches and len(matches) > 0 else None
- 
+
   if not stack_version:
 Logger.error("Could not parse HDP version from output of hdp-select: 
%s" % str(out))
 return 1
 else:
   stack_version = options.hdp_version

[ambari] branch branch-2.7 updated: AMBARI-24843. Make Ambaripreupload.py more configurable (#2556)

2018-10-29 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 14c0326  AMBARI-24843. Make Ambaripreupload.py more configurable 
(#2556)
14c0326 is described below

commit 14c03264d69754c0e2cc6e9dbec66410968f5bc0
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Oct 29 22:50:51 2018 +0100

AMBARI-24843. Make Ambaripreupload.py more configurable (#2556)
---
 .../src/main/resources/scripts/Ambaripreupload.py  | 127 +++--
 1 file changed, 67 insertions(+), 60 deletions(-)

diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 1986a50..18feadc 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -7,30 +7,34 @@ 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 functools
+import glob
 import os
+import re
 import sys
 import tarfile
+import tempfile
+import time
+
 from contextlib import closing
 from optparse import OptionParser
+from xml.dom import minidom
+
 os.environ["PATH"] += os.pathsep + "/var/lib/ambari-agent"
 sys.path.append("/usr/lib/ambari-server/lib")
 
-import glob
-import re
-import tempfile
-import time
-import functools
-from xml.dom import minidom
+from ambari_server.serverClassPath import JDBC_DRIVER_PATH_PROPERTY
+from ambari_server.serverConfiguration import get_value_from_properties, 
get_ambari_properties
 
 from resource_management.core import File
 from resource_management.core import shell
@@ -44,18 +48,7 @@ from resource_management.libraries.functions.format import 
format
 from resource_management.libraries.functions.oozie_prepare_war import 
prepare_war
 from resource_management.libraries.resources.hdfs_resource import HdfsResource
 
-
-SQL_DRIVER_PATH = "/var/lib/ambari-server/resources/sqljdbc41.jar"
- 
-"""
-This file provides helper methods needed for the versioning of RPMs. 
Specifically, it does dynamic variable
-interpretation to replace strings like {{ stack_version_formatted }}  where 
the value of the
-variables cannot be determined ahead of time, but rather, depends on what 
files are found.
- 
-It assumes that {{ stack_version_formatted }} is constructed as 
${major.minor.patch.rev}-${build_number}
-E.g., 998.2.2.1.0-998
-Please note that "-${build_number}" is optional.
-"""
+DEFAULT_SQL_DRIVER_PATH = get_value_from_properties(get_ambari_properties(), 
JDBC_DRIVER_PATH_PROPERTY, "/var/lib/ambari-server/resources/sqljdbc41.jar")
 
 with Environment() as env:
   def get_stack_version():
@@ -72,34 +65,44 @@ with Environment() as env:
 Logger.warning("Could not verify HDP version by calling '%s'. Return 
Code: %s, Output: %s." %
(get_stack_version_cmd, str(code), str(out)))
 return 1
- 
+
   matches = re.findall(r"([\d\.]+\-\d+)", out)
   stack_version = matches[0] if matches and len(matches) > 0 else None
- 
+
   if not stack_version:
 Logger.error("Could not parse HDP version from output of hdp-select: 
%s" % str(out))
 return 1
 else:
   stack_version = options.hdp_version
-  
+
 return stack_version
-  
+
   parser = OptionParser()
+  parser.add_option("-d", "--database-driver", dest="sql_driver_path", 
default=DEFAULT_SQL_DRIVER_PATH,
+help="Path to JDBC driver")
+  parser.add_option("-f", "--fs-type", dest="fs_type", default="wasb",
+help="Expected protocol of fs.defaultFS")
   parser.add_option("-v", "--hdp-version", dest="hdp_version", default="",
 help="hdp-version used in path of tarballs")
   parser.add_option("-u", "--upgrade", dest="upgrade", action="store_true",
-help="flag to indicate script is being run for upgrade", 
default=False)  
+  

[ambari] branch branch-2.7 updated: AMBARI-24837. Make Grafana connection attempts and retry delay configurable (#2557)

2018-10-29 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 032b861  AMBARI-24837. Make Grafana connection attempts and retry 
delay configurable (#2557)
032b861 is described below

commit 032b861386e81c6d071cacc771e57e6480754d3e
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Oct 29 21:43:05 2018 +0100

AMBARI-24837. Make Grafana connection attempts and retry delay configurable 
(#2557)
---
 .../0.1.0/configuration/ams-grafana-env.xml| 22 +
 .../0.1.0/package/scripts/metrics_grafana.py   |  3 +-
 .../0.1.0/package/scripts/metrics_grafana_util.py  | 54 +++---
 .../AMBARI_METRICS/0.1.0/package/scripts/params.py |  3 ++
 4 files changed, 55 insertions(+), 27 deletions(-)

diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
index b05d73b..60323ba 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
@@ -99,4 +99,26 @@ export AMS_GRAFANA_PID_DIR={{ams_grafana_pid_dir}}
 
 
   
+  
+metrics_grafana_connect_retry_delay
+20
+Grafana connect retry delay
+The time in seconds after which connection to Grafana is 
retried in case of failure
+
+  int
+  1
+
+
+  
+  
+metrics_grafana_connect_attempts
+15
+Grafana connect attempts
+The number of attempts for connection to Grafana
+
+  int
+  1
+
+
+  
 
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
index 387b018..baad306 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
@@ -22,7 +22,6 @@ from resource_management import Script, Execute
 from resource_management.libraries.functions import format
 from status import check_service_status
 from ams import ams
-from metrics_grafana_util import create_ams_datasource, create_ams_dashboards, 
create_grafana_admin_pwd
 from resource_management.core.logger import Logger
 from resource_management.core import sudo
 
@@ -54,6 +53,8 @@ class AmsGrafana(Script):
 else:
   Logger.info("Grafana Server has started with pid: 
{0}".format(sudo.read_file(pidfile).strip()))
 
+from metrics_grafana_util import create_ams_datasource, 
create_ams_dashboards, create_grafana_admin_pwd
+
 #Set Grafana admin pwd
 create_grafana_admin_pwd()
 # Create datasource
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
index d6964ad..53679c4 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
@@ -35,8 +35,6 @@ import ambari_simplejson as json
 import ambari_commons.network as network
 import os
 
-GRAFANA_CONNECT_TRIES = 15
-GRAFANA_CONNECT_TIMEOUT = 20
 GRAFANA_SEARCH_BUILTIN_DASHBOARDS = "/api/search?tag=builtin"
 GRAFANA_DATASOURCE_URL = "/api/datasources"
 GRAFANA_USER_URL = "/api/user"
@@ -46,14 +44,15 @@ METRICS_GRAFANA_DATASOURCE_NAME = "AMBARI_METRICS"
 Server = namedtuple('Server', [ 'protocol', 'host', 'port', 'user', 'password' 
])
 
 def perform_grafana_get_call(url, server):
+  import params
+
   grafana_https_enabled = server.protocol.lower() == 'https'
   response = None
   ca_certs = None
   if grafana_https_enabled:
-import params
 ca_certs = params.ams_grafana_ca_cert
 
-  for i in xrange(0, GRAFANA_CONNECT_TRIES):
+  for i in xrange(0, params.grafana_connect_attempts):
 try:
   conn = network.get_http_connection(
 server.host,
@@ -73,10 +72,10 @@ def perform_grafana_get_call(url, server):
   Logger.info("Http response: %s %s" % (response.status, response.reason))
   break
 except (httplib.HTTPException, socket.error) as ex:
-  if i < GRAFANA_CONNECT_TRIES - 1:
-time.sleep(GRAFANA_CONNE

[ambari] branch branch-2.6 updated: AMBARI-24837. Make Grafana connection attempts and retry delay configurable (#2525)

2018-10-29 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new c22b8e7  AMBARI-24837. Make Grafana connection attempts and retry 
delay configurable (#2525)
c22b8e7 is described below

commit c22b8e7cafdff214079653e8cbef1fd6baa467b4
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Mon Oct 29 13:43:18 2018 +0100

AMBARI-24837. Make Grafana connection attempts and retry delay configurable 
(#2525)
---
 .../0.1.0/configuration/ams-grafana-env.xml| 22 +
 .../0.1.0/package/scripts/metrics_grafana.py   |  3 +-
 .../0.1.0/package/scripts/metrics_grafana_util.py  | 54 +++---
 .../AMBARI_METRICS/0.1.0/package/scripts/params.py |  3 ++
 4 files changed, 55 insertions(+), 27 deletions(-)

diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
index eaafc6b..b60d3d9 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-grafana-env.xml
@@ -90,4 +90,26 @@ export AMS_GRAFANA_PID_DIR={{ams_grafana_pid_dir}}
 
 
   
+  
+metrics_grafana_connect_retry_delay
+20
+Grafana connect retry delay
+The time in seconds after which connection to Grafana is 
retried in case of failure
+
+  int
+  1
+
+
+  
+  
+metrics_grafana_connect_attempts
+15
+Grafana connect attempts
+The number of attempts for connection to Grafana
+
+  int
+  1
+
+
+  
 
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
index 7fe168b..8b696f4 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
@@ -22,7 +22,6 @@ from resource_management import Script, Execute
 from resource_management.libraries.functions import format
 from status import check_service_status
 from ams import ams
-from metrics_grafana_util import create_ams_datasource, create_ams_dashboards, 
create_grafana_admin_pwd
 from resource_management.core.logger import Logger
 from resource_management.core import sudo
 
@@ -54,6 +53,8 @@ class AmsGrafana(Script):
 else:
   Logger.info("Grafana Server has started with pid: 
{0}".format(sudo.read_file(pidfile).strip()))
 
+from metrics_grafana_util import create_ams_datasource, 
create_ams_dashboards, create_grafana_admin_pwd
+
 #Set Grafana admin pwd
 create_grafana_admin_pwd()
 # Create datasource
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
index 25c12cf..fe33aa3 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
@@ -35,8 +35,6 @@ import ambari_simplejson as json
 import ambari_commons.network as network
 import os
 
-GRAFANA_CONNECT_TRIES = 15
-GRAFANA_CONNECT_TIMEOUT = 20
 GRAFANA_SEARCH_BUILTIN_DASHBOARDS = "/api/search?tag=builtin"
 GRAFANA_DATASOURCE_URL = "/api/datasources"
 GRAFANA_USER_URL = "/api/user"
@@ -46,14 +44,15 @@ METRICS_GRAFANA_DATASOURCE_NAME = "AMBARI_METRICS"
 Server = namedtuple('Server', [ 'protocol', 'host', 'port', 'user', 'password' 
])
 
 def perform_grafana_get_call(url, server):
+  import params
+
   grafana_https_enabled = server.protocol.lower() == 'https'
   response = None
   ca_certs = None
   if grafana_https_enabled:
-import params
 ca_certs = params.ams_grafana_ca_cert
 
-  for i in xrange(0, GRAFANA_CONNECT_TRIES):
+  for i in xrange(0, params.grafana_connect_attempts):
 try:
   conn = network.get_http_connection(
 server.host,
@@ -73,10 +72,10 @@ def perform_grafana_get_call(url, server):
   Logger.info("Http response: %s %s" % (response.status, response.reason))
   break
 except (httplib.HTTPException, socket.error) as ex:
-  if i < GRAFANA_CONNECT_TRIES - 1:
-time.sleep(GRAFANA_CONNE

[ambari] branch trunk updated: AMBARI-24461. Python 2/3 compatible topology_script.py (#2038)

2018-10-28 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 2dea9fb  AMBARI-24461. Python 2/3 compatible topology_script.py (#2038)
2dea9fb is described below

commit 2dea9fb811a66dcf25b2b1f526560c16d0aeb2fd
Author: Peter Parente 
AuthorDate: Mon Oct 29 02:53:47 2018 -0400

AMBARI-24461. Python 2/3 compatible topology_script.py (#2038)
---
 .../stack-hooks/before-START/files/topology_script.py   | 13 +
 .../HDF/2.0/hooks/before-START/files/topology_script.py | 13 +
 .../ODPi/2.0/hooks/before-START/files/topology_script.py| 13 +
 3 files changed, 27 insertions(+), 12 deletions(-)

diff --git 
a/ambari-server/src/main/resources/stack-hooks/before-START/files/topology_script.py
 
b/ambari-server/src/main/resources/stack-hooks/before-START/files/topology_script.py
index 0f7a55c..e026ba7 100644
--- 
a/ambari-server/src/main/resources/stack-hooks/before-START/files/topology_script.py
+++ 
b/ambari-server/src/main/resources/stack-hooks/before-START/files/topology_script.py
@@ -18,9 +18,14 @@ limitations under the License.
 '''
 
 import sys, os
-from string import join
-import ConfigParser
-
+try:
+  # Python 2
+  from string import join
+  import ConfigParser
+except ImportError:
+  # Python 3
+  join = ' '.join
+  import configparser as ConfigParser
 
 DEFAULT_RACK = "/default-rack"
 DATA_FILE_NAME =  os.path.dirname(os.path.abspath(__file__)) + 
"/topology_mappings.data"
@@ -60,7 +65,7 @@ class TopologyScript():
   def execute(self, args):
 rack_map = self.load_rack_map()
 rack = self.get_racks(rack_map, args)
-print rack
+print(rack)
 
 if __name__ == "__main__":
   TopologyScript().execute(sys.argv)
diff --git 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/files/topology_script.py
 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/files/topology_script.py
index 0f7a55c..e026ba7 100644
--- 
a/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/files/topology_script.py
+++ 
b/contrib/management-packs/hdf-ambari-mpack/src/main/resources/stacks/HDF/2.0/hooks/before-START/files/topology_script.py
@@ -18,9 +18,14 @@ limitations under the License.
 '''
 
 import sys, os
-from string import join
-import ConfigParser
-
+try:
+  # Python 2
+  from string import join
+  import ConfigParser
+except ImportError:
+  # Python 3
+  join = ' '.join
+  import configparser as ConfigParser
 
 DEFAULT_RACK = "/default-rack"
 DATA_FILE_NAME =  os.path.dirname(os.path.abspath(__file__)) + 
"/topology_mappings.data"
@@ -60,7 +65,7 @@ class TopologyScript():
   def execute(self, args):
 rack_map = self.load_rack_map()
 rack = self.get_racks(rack_map, args)
-print rack
+print(rack)
 
 if __name__ == "__main__":
   TopologyScript().execute(sys.argv)
diff --git 
a/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/files/topology_script.py
 
b/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/files/topology_script.py
index 0f7a55c..e026ba7 100755
--- 
a/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/files/topology_script.py
+++ 
b/contrib/management-packs/odpi-ambari-mpack/src/main/resources/stacks/ODPi/2.0/hooks/before-START/files/topology_script.py
@@ -18,9 +18,14 @@ limitations under the License.
 '''
 
 import sys, os
-from string import join
-import ConfigParser
-
+try:
+  # Python 2
+  from string import join
+  import ConfigParser
+except ImportError:
+  # Python 3
+  join = ' '.join
+  import configparser as ConfigParser
 
 DEFAULT_RACK = "/default-rack"
 DATA_FILE_NAME =  os.path.dirname(os.path.abspath(__file__)) + 
"/topology_mappings.data"
@@ -60,7 +65,7 @@ class TopologyScript():
   def execute(self, args):
 rack_map = self.load_rack_map()
 rack = self.get_racks(rack_map, args)
-print rack
+print(rack)
 
 if __name__ == "__main__":
   TopologyScript().execute(sys.argv)



[ambari] branch trunk updated: AMBARI-24835. Fix javadoc errors in ambari-utility (#2523)

2018-10-26 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 5311ecb  AMBARI-24835. Fix javadoc errors in ambari-utility (#2523)
5311ecb is described below

commit 5311ecbfef9de3828c4a9b20700a6819f98297bc
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Oct 26 21:38:58 2018 +0200

AMBARI-24835. Fix javadoc errors in ambari-utility (#2523)
---
 .../ambari/annotations/SwaggerOverwriteNestedAPI.java| 16 ++--
 .../ambari/annotations/SwaggerPreferredParent.java   |  5 ++---
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git 
a/ambari-utility/src/main/java/org/apache/ambari/annotations/SwaggerOverwriteNestedAPI.java
 
b/ambari-utility/src/main/java/org/apache/ambari/annotations/SwaggerOverwriteNestedAPI.java
index 29e4024..7cfb94a 100644
--- 
a/ambari-utility/src/main/java/org/apache/ambari/annotations/SwaggerOverwriteNestedAPI.java
+++ 
b/ambari-utility/src/main/java/org/apache/ambari/annotations/SwaggerOverwriteNestedAPI.java
@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
 
 /**
  * The {@link SwaggerOverwriteNestedAPI} is used to overwrite default values of
- * {@link org.apache.ambari.swagger.NestedApiRecord} when {@link 
org.apache.ambari.swagger.AmbariSwaggerReader}
+ * {@code NestedApiRecord} when {@link 
org.apache.ambari.swagger.AmbariSwaggerReader}
  * processes nested API classes for Swagger annotations.
  *
  * It can be useful to overcome the limitations of multi-nested service 
endpoints or endpoints without Path
@@ -38,26 +38,22 @@ import java.lang.annotation.Target;
 public @interface SwaggerOverwriteNestedAPI {
 
 /**
- * Class name of parent object
- * @return
+ * @return class name of parent object
  */
-Class parentApi();
+Class parentApi();
 
 /**
- * Parent API path, usually top-level API path starting with slash.
- * @return
+ * @return parent API path, usually top-level API path starting with slash.
  */
 String parentApiPath();
 
 /**
- * Path annotation value of the method in parent class.
- * @return
+ * @return path annotation value of the method in parent class.
  */
 String parentMethodPath();
 
 /**
- * Array of Strings to provide path parameters. Only string types are 
supported as of now.
- * @return
+ * @return array of Strings to provide path parameters. Only string types 
are supported as of now.
  */
 String[] pathParameters();
 }
diff --git 
a/ambari-utility/src/main/java/org/apache/ambari/annotations/SwaggerPreferredParent.java
 
b/ambari-utility/src/main/java/org/apache/ambari/annotations/SwaggerPreferredParent.java
index fcd7590..222f9db 100644
--- 
a/ambari-utility/src/main/java/org/apache/ambari/annotations/SwaggerPreferredParent.java
+++ 
b/ambari-utility/src/main/java/org/apache/ambari/annotations/SwaggerPreferredParent.java
@@ -33,8 +33,7 @@ import java.lang.annotation.Target;
 public @interface SwaggerPreferredParent {
 
 /**
- * Class name of preferred parent object
- * @return
+ * @return class name of preferred parent object
  */
-Class preferredParent();
+Class preferredParent();
 }



[ambari] branch branch-2.7 updated: AMBARI-24823. Set path encoding for GCS (#2513)

2018-10-25 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 6242f3a  AMBARI-24823. Set path encoding for GCS (#2513)
6242f3a is described below

commit 6242f3ab12686e92ecf218f833d6c61ee3dca4a9
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Oct 25 18:00:32 2018 +0200

AMBARI-24823. Set path encoding for GCS (#2513)
---
 .../HDFS/2.1.0.2.0/configuration/core-site.xml| 11 +++
 .../main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml |  6 ++
 .../stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml|  4 
 .../main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml|  1 +
 .../main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml |  6 ++
 .../stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml|  4 
 .../main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml|  1 +
 .../main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml |  6 ++
 .../stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml|  4 
 .../main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml|  1 +
 10 files changed, 44 insertions(+)

diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/core-site.xml
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/core-site.xml
index 253e514..1e1c205 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/core-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/core-site.xml
@@ -213,6 +213,17 @@ DEFAULT
 
   
   
+fs.gs.path.encoding
+uri-path
+The path encoding codec to be used for GCS
+
+  
+  
+fs.gs.working.dir
+/
+
+  
+  
 fs.s3a.user.agent.prefix
 User-Agent: APN/1.0 Hortonworks/1.0 HDP/{{version}}
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
index 95a0d30..d0f69f2 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
@@ -401,6 +401,12 @@
 
 
   
+
+  
+core-site
+
+
+  
 
   
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
index bde3665..9424706 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
@@ -307,6 +307,10 @@
 
   
 
+  
+
+  
+
   
   
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
index 8824c74..296a041 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
@@ -699,6 +699,7 @@
   
 
   
+  
 
 
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
index cfe40c5..1bffdbe 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
@@ -285,6 +285,12 @@
 
 
   
+
+  
+core-site
+
+
+  
 
   
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
index 55de1c0..a411884 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
@@ -456,6 +456,10 @@
 
   
 
+  
+
+  
+
   
   
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
index aa0b24b..24e96c8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
@@ -704,6 +704,7 @@
   
 
   
+  
 
 
 
diff --git 
a/

[ambari] branch branch-2.7 updated: AMBARI-24820. Set cloud storage tracking property for GCS (#2510)

2018-10-24 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new e243d05  AMBARI-24820. Set cloud storage tracking property for GCS 
(#2510)
e243d05 is described below

commit e243d05b1cffda3b7bd56e424d7b7b5b71406e00
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Oct 25 01:04:07 2018 +0200

AMBARI-24820. Set cloud storage tracking property for GCS (#2510)
---
 .../common-services/HDFS/2.1.0.2.0/configuration/core-site.xml | 10 ++
 .../main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml  |  1 +
 .../main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml  |  1 +
 .../main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml  |  1 +
 4 files changed, 13 insertions(+)

diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/core-site.xml
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/core-site.xml
index 4933a4a..253e514 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/core-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/configuration/core-site.xml
@@ -203,6 +203,16 @@ DEFAULT
 
   
   
+fs.gs.application.name.suffix
+ (GPN:Hortonworks; version 1.0) HDP/{{version}}
+
+  true
+  false
+  false
+
+
+  
+  
 fs.s3a.user.agent.prefix
 User-Agent: APN/1.0 Hortonworks/1.0 HDP/{{version}}
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
index 4195484..95a0d30 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
@@ -398,6 +398,7 @@
   
 core-site
 
+
 
   
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
index 8871ff9..cfe40c5 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
@@ -282,6 +282,7 @@
   
 core-site
 
+
 
   
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
index 690f916..ecbe956 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
@@ -301,6 +301,7 @@
   
 core-site
 
+
 
   
 



[ambari] branch trunk updated: AMBARI-24822. TrimmingStrategy implementations should be singletons (#2512)

2018-10-24 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 816e24c  AMBARI-24822. TrimmingStrategy implementations should be 
singletons (#2512)
816e24c is described below

commit 816e24cf69f5752e773e2d76677e4da80f011700
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Oct 24 20:38:23 2018 +0200

AMBARI-24822. TrimmingStrategy implementations should be singletons (#2512)
---
 .../internal/DefaultTrimmingStrategy.java  | 31 
 .../DeleteSpacesAtTheEndTrimmingStrategy.java  | 34 --
 .../internal/DirectoriesTrimmingStrategy.java  | 32 -
 .../internal/PasswordTrimmingStrategy.java | 31 
 .../PropertyValueTrimmingStrategyDefiner.java  | 24 ++---
 .../controller/internal/TrimmingStrategy.java  | 41 --
 6 files changed, 51 insertions(+), 142 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultTrimmingStrategy.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultTrimmingStrategy.java
deleted file mode 100644
index 7a3f863..000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DefaultTrimmingStrategy.java
+++ /dev/null
@@ -1,31 +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.controller.internal;
-
-public class DefaultTrimmingStrategy implements TrimmingStrategy {
-  @Override
-  public String trim(String stringToTrim) {
-return stringToTrim.trim();
-  }
-
-  @Override
-  public String toString(){
-return "DefaultTrimmingStrategy";
-  }
-}
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DeleteSpacesAtTheEndTrimmingStrategy.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DeleteSpacesAtTheEndTrimmingStrategy.java
deleted file mode 100644
index 7f5fed6..000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DeleteSpacesAtTheEndTrimmingStrategy.java
+++ /dev/null
@@ -1,34 +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.controller.internal;
-
-public class DeleteSpacesAtTheEndTrimmingStrategy implements TrimmingStrategy {
-  @Override
-  public String trim(String stringToTrim) {
-if (" ".equals(stringToTrim)) {
-  return stringToTrim;
-}
-return stringToTrim.replaceAll("\\s+$", "");
-  }
-
-  @Override
-  public String toString(){
-return "DeleteSpacesAtTheEndTrimmingStrategy";
-  }
-}
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DirectoriesTrimmingStrategy.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DirectoriesTrimmingStrategy.java
deleted file mode 100644
index aa0b508..000
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/DirectoriesTrimmingStrategy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreemen

[ambari-logsearch] branch master updated: Make rule to set version is update-version, not set-version (#12)

2018-10-24 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-logsearch.git


The following commit(s) were added to refs/heads/master by this push:
 new 5fec024  Make rule to set version is update-version, not set-version 
(#12)
5fec024 is described below

commit 5fec024d2b1ee7eb9f53e2ad9b976b65a7276cd6
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Oct 24 16:06:15 2018 +0200

Make rule to set version is update-version, not set-version (#12)
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 47d09a1..21b94fc 100644
--- a/README.md
+++ b/README.md
@@ -83,7 +83,7 @@ Also you can run from the IDE, but make sure all of the 
ambari logsearch modules
 ## Update version (for release or specific builds)
 
 ```bash
-make set-version new-version="2.8.0.0-11"
+make update-version new-version="2.8.0.0-11"
 ```
 
 ## Contributing



[ambari] branch trunk updated: AMBARI-24709. Implement support for Minimal Blueprint Export (#2489)

2018-10-24 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 1a8b193  AMBARI-24709. Implement support for Minimal Blueprint Export 
(#2489)
1a8b193 is described below

commit 1a8b193fbc8da67597044cb26ee1a8cabcc86cd8
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Oct 24 15:09:56 2018 +0200

AMBARI-24709. Implement support for Minimal Blueprint Export (#2489)
---
 .../api/query/render/ClusterBlueprintRenderer.java |  61 ++--
 .../api/resources/ClusterResourceDefinition.java   |  11 +-
 .../internal/BlueprintConfigurationProcessor.java  | 157 +---
 .../controller/internal/BlueprintExportType.java   | 164 +
 .../internal/ExportBlueprintRequest.java   |  61 +++-
 .../server/controller/internal/UnitUpdater.java|  18 ++-
 .../apache/ambari/server/state/PropertyInfo.java   |   7 +
 .../ambari/server/topology/Configuration.java  |  16 +-
 .../query/render/ClusterBlueprintRendererTest.java |  43 +++---
 .../BlueprintConfigurationProcessorTest.java   | 141 +-
 .../internal/ExportBlueprintRequestTest.java   |  42 +-
 11 files changed, 516 insertions(+), 205 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
index 7ac240a..9139cec 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
@@ -41,6 +41,7 @@ import 
org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.AmbariServer;
 import org.apache.ambari.server.controller.internal.ArtifactResourceProvider;
 import 
org.apache.ambari.server.controller.internal.BlueprintConfigurationProcessor;
+import org.apache.ambari.server.controller.internal.BlueprintExportType;
 import org.apache.ambari.server.controller.internal.BlueprintResourceProvider;
 import org.apache.ambari.server.controller.internal.ExportBlueprintRequest;
 import org.apache.ambari.server.controller.internal.RequestImpl;
@@ -72,6 +73,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * Renderer which renders a cluster resource as a blueprint.
@@ -92,6 +94,12 @@ public class ClusterBlueprintRenderer extends BaseRenderer 
implements Renderer {
*/
   private final AmbariManagementController controller = 
AmbariServer.getController();
 
+  private final BlueprintExportType exportType;
+
+  public ClusterBlueprintRenderer(BlueprintExportType exportType) {
+this.exportType = exportType;
+  }
+
 
   // - Renderer --
 
@@ -184,7 +192,6 @@ public class ClusterBlueprintRenderer extends BaseRenderer 
implements Renderer {
* Create a blueprint resource.
*
* @param clusterNode  cluster tree node
-   *
* @return a new blueprint resource
*/
   private Resource createBlueprintResource(TreeNode clusterNode) {
@@ -198,7 +205,7 @@ public class ClusterBlueprintRenderer extends BaseRenderer 
implements Renderer {
 }
 
 BlueprintConfigurationProcessor configProcessor = new 
BlueprintConfigurationProcessor(topology);
-configProcessor.doUpdateForBlueprintExport();
+configProcessor.doUpdateForBlueprintExport(exportType);
 
 Stack stack = topology.getBlueprint().getStack();
 blueprintResource.setProperty("Blueprints/stack_name", stack.getName());
@@ -223,10 +230,16 @@ public class ClusterBlueprintRenderer extends 
BaseRenderer implements Renderer {
 List> groupList = formatGroupsAsList(topology);
 blueprintResource.setProperty("host_groups", groupList);
 
-blueprintResource.setProperty("configurations", 
processConfigurations(topology));
+List>>> configurations = 
processConfigurations(topology);
+if (exportType.include(configurations)) {
+  blueprintResource.setProperty("configurations", configurations);
+}
 
 //Fetch settings section for blueprint
-blueprintResource.setProperty("settings", getSettings(clusterNode, stack));
+Collection> settings = getSettings(clusterNode, stack);
+if (exportType.include(settings)) {
+  blueprintResource.setProperty("settings", settings);
+}
 
 return blueprintResource;
   }
@@ -261,7 +274,7 @@ public class ClusterBlueprintRenderer extends BaseRenderer 
implements Renderer {
* @return A Collec

[ambari] branch trunk updated: AMBARI-21157. Fix unintended newline in license (#2496)

2018-10-23 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 88af062  AMBARI-21157. Fix unintended newline in license (#2496)
88af062 is described below

commit 88af062a0a3d0b1c98f3fafbc9c1144f296c8cff
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Oct 23 09:34:25 2018 +0200

AMBARI-21157. Fix unintended newline in license (#2496)
---
 .../server/controller/internal/ConfigurationTopologyException.java | 3 +--
 .../ambari/server/controller/internal/ExportBlueprintRequest.java  | 3 +--
 .../main/java/org/apache/ambari/server/topology/BlueprintFactory.java  | 3 +--
 .../src/main/java/org/apache/ambari/server/topology/BlueprintImpl.java | 3 +--
 .../java/org/apache/ambari/server/topology/BlueprintValidator.java | 3 +--
 .../java/org/apache/ambari/server/topology/ClusterTopologyImpl.java| 3 +--
 .../src/main/java/org/apache/ambari/server/topology/Configuration.java | 3 +--
 .../java/org/apache/ambari/server/topology/ConfigurationFactory.java   | 3 +--
 .../src/main/java/org/apache/ambari/server/topology/Credential.java| 3 +--
 .../src/main/java/org/apache/ambari/server/topology/HostGroupImpl.java | 3 +--
 .../main/java/org/apache/ambari/server/topology/HostOfferResponse.java | 3 +--
 .../org/apache/ambari/server/topology/NoSuchBlueprintException.java| 3 +--
 .../org/apache/ambari/server/topology/NoSuchHostGroupException.java| 3 +--
 .../java/org/apache/ambari/server/topology/SecurityConfiguration.java  | 3 +--
 .../apache/ambari/server/topology/SecurityConfigurationFactory.java| 3 +--
 .../java/org/apache/ambari/server/topology/TopologyRequestFactory.java | 3 +--
 .../org/apache/ambari/server/topology/TopologyRequestFactoryImpl.java  | 3 +--
 .../java/org/apache/ambari/server/topology/tasks/TopologyTask.java | 3 +--
 18 files changed, 18 insertions(+), 36 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationTopologyException.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationTopologyException.java
index 6c7a9e6..0489e17 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationTopologyException.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigurationTopologyException.java
@@ -10,8 +10,7 @@
  * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distribut
- * ed on an "AS IS" BASIS,
+ * 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.
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
index f15cd3e..e604bf3 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequest.java
@@ -10,8 +10,7 @@
  * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distribut
- * ed on an "AS IS" BASIS,
+ * 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.
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java
index 24b4785..054979f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintFactory.java
@@ -10,8 +10,7 @@
  * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distribut
- * ed on an "AS IS" BASIS,
+ * 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.
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/Bl

[ambari] branch trunk updated: AMBARI-24795. Allow skipping Python unit tests (#2482)

2018-10-17 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new a8200b9  AMBARI-24795. Allow skipping Python unit tests (#2482)
a8200b9 is described below

commit a8200b9bc31224190f8985a6ac8a9e910ac263e7
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Oct 17 18:34:46 2018 +0200

AMBARI-24795. Allow skipping Python unit tests (#2482)
---
 ambari-agent/pom.xml   |  2 +-
 ambari-project/pom.xml | 12 
 ambari-server/pom.xml  | 12 
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 9930475..6f8a01b 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -214,7 +214,7 @@
   
 ${path.python.1}${pathsep}$PYTHONPATH
   
-  ${skipTests}
+  ${skipPythonTests}
 
 python-test
 test
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 53addad..6a19230 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -27,6 +27,7 @@
   Apache Ambari Project POM
   pom
   
+false
 5.5.2
 ${project.parent.basedir}
 1.6.3
@@ -82,6 +83,17 @@
 
   
 
+
+  skipTestRun
+  
+
+  skipTests
+
+  
+  
+true
+  
+
   
   
 
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index ecf40de..874b94a 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -47,7 +47,6 @@
 src/main/resources/stack-hooks
 
src/main/resources/stacks/${stack.distribution}
 src/main/resources
-false
 2.7.2
 2.7.0.0.0
 src/main/package 
@@ -882,17 +881,6 @@
   
 
 
-  skipTestRun
-  
-
-  skipTests
-
-  
-  
-true
-  
-
-
   copy-swagger-generated-resources
   
 generate.swagger.resources



[ambari] branch trunk updated: AMBARI-24774. Wrong settings in exported blueprint (#2475)

2018-10-17 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 5a8af96  AMBARI-24774. Wrong settings in exported blueprint (#2475)
5a8af96 is described below

commit 5a8af96159fe1fe43d2569d847a88de44dcf59c6
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Oct 17 15:53:35 2018 +0200

AMBARI-24774. Wrong settings in exported blueprint (#2475)
---
 .../api/query/render/ClusterBlueprintRenderer.java | 189 +++-
 .../query/render/ClusterBlueprintRendererTest.java | 333 +++--
 2 files changed, 227 insertions(+), 295 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
index 9713a59..7ac240a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/ClusterBlueprintRenderer.java
@@ -56,6 +56,7 @@ import 
org.apache.ambari.server.controller.spi.SystemException;
 import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PredicateBuilder;
 import org.apache.ambari.server.state.SecurityType;
+import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.topology.AmbariContext;
 import org.apache.ambari.server.topology.ClusterTopology;
 import org.apache.ambari.server.topology.ClusterTopologyImpl;
@@ -69,23 +70,27 @@ import 
org.apache.ambari.server.topology.SecurityConfigurationFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.ImmutableMap;
+
 /**
  * Renderer which renders a cluster resource as a blueprint.
  */
 public class ClusterBlueprintRenderer extends BaseRenderer implements Renderer 
{
 
+  private final static Logger LOG = 
LoggerFactory.getLogger(ClusterBlueprintRenderer.class);
+
+  static final String SERVICE_SETTINGS = "service_settings";
+  static final String COMPONENT_SETTINGS = "component_settings";
+  static final String CREDENTIAL_STORE_ENABLED = "credential_store_enabled";
+  static final String RECOVERY_ENABLED = "recovery_enabled";
+  static final String TRUE = Boolean.TRUE.toString();
+  static final String FALSE = Boolean.FALSE.toString();
+
   /**
* Management Controller used to get stack information.
*/
-  private AmbariManagementController controller = AmbariServer.getController();
-
-//  /**
-//   * Map of configuration type to configuration properties which are 
required that a user
-//   * input.  These properties will be stripped from the exported blueprint.
-//   */
-//  private Map> propertiesToStrip = new 
HashMap>();
-
-  private final static Logger LOG = 
LoggerFactory.getLogger(ClusterBlueprintRenderer.class);
+  private final AmbariManagementController controller = 
AmbariServer.getController();
 
 
   // - Renderer --
@@ -189,7 +194,6 @@ public class ClusterBlueprintRenderer extends BaseRenderer 
implements Renderer {
 try {
   topology = createClusterTopology(clusterNode);
 } catch (InvalidTopologyTemplateException | InvalidTopologyException e) {
-  //todo
   throw new RuntimeException("Unable to process blueprint export request: 
" + e, e);
 }
 
@@ -206,8 +210,7 @@ public class ClusterBlueprintRenderer extends BaseRenderer 
implements Renderer {
 
   try {
 String clusterName = 
topology.getAmbariContext().getClusterName(topology.getClusterId());
-Map kerberosDescriptor = 
getKerberosDescriptor(topology.getAmbariContext()
-  .getClusterController(), clusterName);
+Map kerberosDescriptor = 
getKerberosDescriptor(AmbariContext.getClusterController(), clusterName);
 if (kerberosDescriptor != null) {
   
securityConfigMap.put(SecurityConfigurationFactory.KERBEROS_DESCRIPTOR_PROPERTY_ID,
 kerberosDescriptor);
 }
@@ -220,13 +223,10 @@ public class ClusterBlueprintRenderer extends 
BaseRenderer implements Renderer {
 List> groupList = formatGroupsAsList(topology);
 blueprintResource.setProperty("host_groups", groupList);
 
-//todo: ensure that this is properly handled in config processor
-//determinePropertiesToStrip(topology);
-
 blueprintResource.setProperty("configurations", 
processConfigurations(topology));
 
 //Fetch settings section for blueprint
-blueprintResource.setProperty("settings", getSettings(clusterNode));
+blueprintRes

[ambari] branch branch-feature-jdk11 updated: AMBARI-24752. Upgrade ambari-utility, ambari-server-spi deps for JDK11 (#2434)

2018-10-10 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-jdk11 by this 
push:
 new bc3b720  AMBARI-24752. Upgrade ambari-utility, ambari-server-spi deps 
for JDK11 (#2434)
bc3b720 is described below

commit bc3b7200d4737b6a74fca199ec8b41508d083d15
Author: Gabor Boros <6317425+g-bo...@users.noreply.github.com>
AuthorDate: Wed Oct 10 20:48:49 2018 +0200

AMBARI-24752. Upgrade ambari-utility, ambari-server-spi deps for JDK11 
(#2434)
---
 ambari-agent/pom.xml  | 2 +-
 ambari-project/pom.xml| 5 +
 ambari-server-spi/pom.xml | 4 
 ambari-utility/pom.xml| 4 
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 013e872..aa87089 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -412,7 +412,7 @@
   
 org.apache.maven.plugins
 maven-shade-plugin
-2.3
+3.2.0
 
   
 shade-zkmigrator
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 4f66528..7e8624a 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -365,6 +365,11 @@
 3.1.0
   
   
+javax.xml.bind
+jaxb-api
+2.3.0
+  
+  
 com.sun.jersey
 jersey-core
 1.19
diff --git a/ambari-server-spi/pom.xml b/ambari-server-spi/pom.xml
index cad3270..80c2fd5 100644
--- a/ambari-server-spi/pom.xml
+++ b/ambari-server-spi/pom.xml
@@ -173,5 +173,9 @@
   junit
   test
 
+
+javax.xml.bind
+jaxb-api
+
   
 
diff --git a/ambari-utility/pom.xml b/ambari-utility/pom.xml
index f29b389..886c9a9 100644
--- a/ambari-utility/pom.xml
+++ b/ambari-utility/pom.xml
@@ -53,6 +53,10 @@
   
 
 
+  javax.xml.bind
+  jaxb-api
+
+
   com.fasterxml.jackson.jaxrs
   jackson-jaxrs-json-provider
   provided



[ambari] branch branch-feature-jdk11 updated: AMBARI-24730. Support Java 9+ in Ambari Server setup (#2427)

2018-10-05 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-jdk11 by this 
push:
 new b6309a8  AMBARI-24730. Support Java 9+ in Ambari Server setup (#2427)
b6309a8 is described below

commit b6309a8160151387510875a6d27c340da58eb626
Author: Gabor Boros <6317425+g-bo...@users.noreply.github.com>
AuthorDate: Sat Oct 6 07:36:54 2018 +0200

AMBARI-24730. Support Java 9+ in Ambari Server setup (#2427)
---
 .../src/main/python/ambari_server/serverSetup.py   | 18 +++---
 ambari-server/src/test/python/TestAmbariServer.py  |  4 ++--
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py 
b/ambari-server/src/main/python/ambari_server/serverSetup.py
index a32ac38..b91d8eb 100644
--- a/ambari-server/src/main/python/ambari_server/serverSetup.py
+++ b/ambari-server/src/main/python/ambari_server/serverSetup.py
@@ -80,7 +80,7 @@ UNTAR_JDK_ARCHIVE = "tar --no-same-owner -xvf {0}"
 JDK_PROMPT = "[{0}] {1}\n"
 JDK_VALID_CHOICES = "^[{0}{1:d}]$"
 
-JDK_VERSION_CHECK_CMD = """{0} -version 2>&1 | grep -i version | sed 
's/.*version ".*\.\(.*\)\..*"/\\1/; 1q' 2>&1"""
+JDK_VERSION_CHECK_CMD = """{0} -version 2>&1 | grep -i version 2>&1"""
 
 def get_supported_jdbc_drivers():
   factory = DBMSConfigFactory()
@@ -1272,6 +1272,17 @@ def setup_jce_policy(args):
   print 'NOTE: Restart Ambari Server to apply changes' + \
 ' ("ambari-server restart|stop|start")'
 
+def get_java_major_version(cmd_out):
+  version_short = re.split("[java|openjdk|.*] version", cmd_out)[1].split(" 
")[1][1:-1]
+  if re.match("^1\.[0-9].*", version_short): # 1.8.0_112
+return version_short.split(".")[1]
+  elif re.match("^[1-9][0-9]*\.[0-9].*", version_short): # 10.0.2
+return version_short.split(".")[0]
+  elif re.match("^[1-9][0-9]*$", version_short): # 11
+return version_short
+  elif re.match("^[1-9][0-9]*-.*$", version_short): # 12-ea
+return version_short.split("-")[0]
+
 def check_ambari_java_version_is_valid(java_home, java_bin, min_version, 
properties):
   """
   Check that ambari uses the proper (minimum) JDK with a shell command.
@@ -1292,11 +1303,12 @@ def check_ambari_java_version_is_valid(java_home, 
java_bin, min_version, propert
   err = "Checking JDK version command returned with exit code %s" % 
process.returncode
   raise FatalException(process.returncode, err)
 else:
-  actual_jdk_version = int(out)
+  java_major_version = get_java_major_version(out)
+  actual_jdk_version = int(java_major_version)
   print 'JDK version found: {0}'.format(actual_jdk_version)
   if actual_jdk_version < min_version:
 print 'Minimum JDK version is {0} for Ambari. Setup JDK again only for 
Ambari Server.'.format(min_version)
-properties.process_pair(STACK_JAVA_VERSION, out)
+properties.process_pair(STACK_JAVA_VERSION, java_major_version)
 result = False
   else:
 print 'Minimum JDK version is {0} for Ambari. Skipping to setup 
different JDK for Ambari Server.'.format(min_version)
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index affea57..52224d4 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -3150,7 +3150,7 @@ class TestAmbariServer(TestCase):
 # case 1:  jdk7 is picked for stacks
 properties = Properties()
 p = MagicMock()
-p.communicate.return_value = ('7', None)
+p.communicate.return_value = ('java version "1.7.0_80"', None)
 p.returncode = 0
 popenMock.return_value = p
 result = check_ambari_java_version_is_valid('/usr/jdk64/jdk_1.7.0/', 
'java', 8, properties)
@@ -3159,7 +3159,7 @@ class TestAmbariServer(TestCase):
 
 # case 2: jdk8 is picked for stacks
 properties = Properties()
-p.communicate.return_value = ('8', None)
+p.communicate.return_value = ('java version "1.8.0_112"', None)
 p.returncode = 0
 result = check_ambari_java_version_is_valid('/usr/jdk64/jdk_1.8.0/', 
'java', 8, properties)
 self.assertFalse(properties.get_property(STACK_JAVA_VERSION))



[ambari] branch branch-feature-jdk11 updated: AMBARI-24729. Ambari Server stops with Java 9 due to Guice error (#2418)

2018-10-05 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-jdk11 by this 
push:
 new 67d8a64  AMBARI-24729. Ambari Server stops with Java 9 due to Guice 
error (#2418)
67d8a64 is described below

commit 67d8a64f77ebe934ae1c9ec9fb889f17177685be
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Oct 5 17:39:28 2018 +0200

AMBARI-24729. Ambari Server stops with Java 9 due to Guice error (#2418)
---
 ambari-agent/pom.xml  | 1 +
 ambari-project/pom.xml| 6 +++---
 ambari-server/pom.xml | 2 +-
 .../apache/ambari/server/orm/entities/ClusterConfigEntity.java| 2 +-
 .../server/orm/entities/HostComponentDesiredStateEntity.java  | 3 ++-
 .../ambari/server/orm/entities/HostComponentStateEntity.java  | 4 ++--
 .../apache/ambari/server/orm/entities/UpgradeHistoryEntity.java   | 8 +---
 .../server/serveraction/upgrades/FinalizeUpgradeAction.java   | 2 +-
 .../ambari/server/stack/upgrade/ConfigurationCondition.java   | 4 ++--
 .../java/org/apache/ambari/server/stack/upgrade/Grouping.java | 4 ++--
 .../org/apache/ambari/server/stack/upgrade/HostOrderItem.java | 4 ++--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java  | 2 +-
 pom.xml   | 2 +-
 13 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 9930475..013e872 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -89,6 +89,7 @@
 
   com.google.guava
   guava
+  20.0
 
 
   org.apache.hadoop
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 3c568fe..4f66528 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -36,7 +36,7 @@
 1.5.19
 3.1.4
 1.7.20
-4.1.0
+4.2.1
 4.3.17.RELEASE
 4.2.7.RELEASE
 2.9.5
@@ -219,7 +219,7 @@
   
   
 org.eclipse.persistence
-eclipselink
+org.eclipse.persistence.jpa
 ${eclipselink.version}
   
   
@@ -230,7 +230,7 @@
   
 com.google.guava
 guava
-18.0
+26.0-jre
   
   
 com.google.code.findbugs
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index ecf40de..1d13cf9 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1273,7 +1273,7 @@
 
 
   org.eclipse.persistence
-  eclipselink
+  org.eclipse.persistence.jpa
 
 
   org.hamcrest
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
index 287ee89..f6de06d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ClusterConfigEntity.java
@@ -303,7 +303,7 @@ public class ClusterConfigEntity {
*/
   @Override
   public String toString() {
-return com.google.common.base.Objects.toStringHelper(this)
+return com.google.common.base.MoreObjects.toStringHelper(this)
   .add("clusterId", clusterId)
   .add("type", type)
   .add("version", version)
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
index 3a2506d..eba273f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentDesiredStateEntity.java
@@ -41,6 +41,7 @@ import org.apache.ambari.server.state.HostComponentAdminState;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.State;
 
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Objects;
 
 
@@ -278,7 +279,7 @@ public class HostComponentDesiredStateEntity {
*/
   @Override
   public String toString() {
-return Objects.toStringHelper(this).add("serviceName", 
serviceName).add("componentName",
+return MoreObjects.toStringHelper(this).add("serviceName", 
serviceName).add("componentName",
 componentName).add("hostId", hostId).add("desiredState", 
desiredState).toString();
   }
 }
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostComponentStateEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/serv

[ambari] branch branch-feature-jdk11 created (now 44436e1)

2018-10-03 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a change to branch branch-feature-jdk11
in repository https://gitbox.apache.org/repos/asf/ambari.git.


  at 44436e1  AMBARI-23771. Customize Services - Alignment between 
Final/Set Recommended buttons and text boxes not proper in new tabs (akovalenko)

No new revisions were added by this update.



[ambari] branch branch-2.7 updated: AMBARI-24671. Workaround for non-atomic directory creation (#2407)

2018-10-03 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new ffe3aba  AMBARI-24671. Workaround for non-atomic directory creation 
(#2407)
ffe3aba is described below

commit ffe3aba719e90ddba3ef25eb425e353a08d5b560
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Oct 3 09:02:19 2018 +0200

AMBARI-24671. Workaround for non-atomic directory creation (#2407)
---
 .../src/main/resources/scripts/Ambaripreupload.py  | 35 ++
 1 file changed, 35 insertions(+)

diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index ab98c64..1986a50 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -36,6 +36,7 @@ from resource_management.core import File
 from resource_management.core import shell
 from resource_management.core.environment import Environment
 from resource_management.core.logger import Logger
+from resource_management.core.resources.system import Directory
 from resource_management.core.resources.system import Execute
 from resource_management.core.source import StaticFile
 from resource_management.libraries import ConfigDictionary
@@ -325,6 +326,40 @@ with Environment() as env:
   env.set_params(params)
   hadoop_conf_dir = params.hadoop_conf_dir
 
+  Directory('/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir',
+owner=params.hdfs_user,
+group=params.user_group,
+mode=01777
+  )
+  Directory('/var/log/hadoop',
+create_parents = True,
+owner='root',
+group=params.user_group,
+mode=0775,
+cd_access='a',
+  )
+  Directory('/var/run/hadoop',
+create_parents = True,
+owner='root',
+group='root',
+cd_access='a',
+  )
+  Directory('/var/run/hadoop/hdfs',
+owner=params.hdfs_user,
+cd_access='a',
+  )
+  Directory('/tmp/hadoop-hdfs',
+create_parents = True,
+owner=params.hdfs_user,
+cd_access='a',
+  )
+  Directory('/tmp/hbase-hbase',
+owner='hbase',
+mode=0775,
+create_parents = True,
+cd_access="a",
+  )
+
   oozie_libext_dir = params.oozie_libext_dir
   sql_driver_filename = os.path.basename(SQL_DRIVER_PATH)
   oozie_home=params.oozie_home



[ambari] branch trunk updated: AMBARI-24707. Build fails due to missing ambari-utility (#2395)

2018-09-27 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 06ea839  AMBARI-24707. Build fails due to missing ambari-utility 
(#2395)
06ea839 is described below

commit 06ea8398cb82975f14524e323614ac0812b2357c
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Sep 28 07:51:36 2018 +0200

AMBARI-24707. Build fails due to missing ambari-utility (#2395)
---
 pom.xml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/pom.xml b/pom.xml
index cba30bc..36a928d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -420,6 +420,7 @@
   
   
 ambari-serviceadvisor
+ambari-utility
 ambari-web
 ambari-project
 ambari-views
@@ -440,6 +441,7 @@
   
   
 ambari-serviceadvisor
+ambari-utility
 ambari-web
 ambari-project
 ambari-views
@@ -462,6 +464,7 @@
 ambari-funtest
 ambari-agent
 ambari-serviceadvisor
+ambari-utility
   
 
 
@@ -481,6 +484,7 @@
 ambari-funtest
 ambari-agent
 ambari-serviceadvisor
+ambari-utility
 
 
 
@@ -498,6 +502,7 @@
   
   
 ambari-serviceadvisor
+ambari-utility
 ambari-web
 ambari-project
 ambari-views



[ambari] branch branch-2.7 updated: AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts (#2374)

2018-09-26 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new ebc084e  AMBARI-24622. Allow skipping package operations for LZO on 
sysprepped hosts (#2374)
ebc084e is described below

commit ebc084e74cf10ba14ab7cae86864b988f87b50b5
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Sep 26 20:25:08 2018 +0200

AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts 
(#2374)
---
 .../resource_management/libraries/functions/lzo_utils.py  | 11 +++
 .../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml  | 11 +++
 2 files changed, 22 insertions(+)

diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
index 4ba7ef3..7d7046c 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
@@ -74,6 +74,13 @@ def should_install_lzo():
 
   return True
 
+def skip_package_operations():
+  """
+  Return true if LZO packages are assumed to be pre-installed
+  Needs to be separate from should_install_lzo, as that one is used during 
tarball creation, too
+  """
+  return default("/ambariLevelParams/host_sys_prepped", False) and 
default("/configurations/cluster-env/sysprep_skip_lzo_package_operations", 
False)
+
 def install_lzo_if_needed():
   """
   Install lzo package if {#should_install_lzo} is true
@@ -81,6 +88,10 @@ def install_lzo_if_needed():
   if not should_install_lzo():
 return
 
+  if skip_package_operations():
+Logger.info("Skipping LZO package installation as host is sys prepped")
+return
+
   # If user has just accepted GPL license. GPL repository can not yet be 
present.
   Script.repository_util.create_repo_files()
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 4688791..dec4eb7 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -148,6 +148,17 @@
 
   
   
+sysprep_skip_lzo_package_operations
+Whether LZO packages are also pre-installed on sysprepped 
cluster
+false
+In sysprepped environments true value indicates that LZO 
packages are pre-installed and should not be managed by Ambari
+
+  true
+  boolean
+
+
+  
+  
 sysprep_skip_setup_jce
 Whether to skip setting up the unlimited key JCE policy on 
sysprepped cluster
 false



[ambari] branch branch-2.7 updated: AMBARI-24548. Allow skipping Hive Metastore schema creation for sysprepped cluster (#2218)

2018-09-25 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 9904962  AMBARI-24548. Allow skipping Hive Metastore schema creation 
for sysprepped cluster (#2218)
9904962 is described below

commit 990496261fcd42ff4c123535b5a2aaf6d8c584b0
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Sep 25 19:32:42 2018 +0200

AMBARI-24548. Allow skipping Hive Metastore schema creation for sysprepped 
cluster (#2218)
---
 .../common-services/HIVE/0.12.0.2.0/package/scripts/hive.py   |  4 
 .../common-services/HIVE/0.12.0.2.0/package/scripts/params.py |  2 ++
 .../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml  | 11 +++
 3 files changed, 17 insertions(+)

diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index 7f93b05..93d6c6c 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -348,6 +348,10 @@ def setup_metastore():
 def create_metastore_schema():
   import params
 
+  if params.sysprep_skip_hive_schema_create:
+Logger.info("Skipping creation of Hive Metastore schema as host is sys 
prepped")
+return
+
   create_schema_cmd = format("export HIVE_CONF_DIR={hive_server_conf_dir} ; "
  "{hive_schematool_bin}/schematool -initSchema "
  "-dbType {hive_metastore_db_type} "
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
index 895ec81..efc99fe 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
@@ -26,5 +26,7 @@ if OSCheck.is_windows_family():
 else:
   from params_linux import *
 
+host_sys_prepped = default("/ambariLevelParams/host_sys_prepped", False)
+sysprep_skip_hive_schema_create = host_sys_prepped and 
default("/configurations/cluster-env/sysprep_skip_hive_schema_create", False)
 sysprep_skip_copy_tarballs_hdfs = get_sysprep_skip_copy_tarballs_hdfs()
 retryAble = default("/commandParams/command_retry_enabled", False)
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 1c33171..4688791 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -137,6 +137,17 @@
 
   
   
+sysprep_skip_hive_schema_create
+Whether to skip creating the Hive Metastore DB schema on 
sysprepped cluster
+false
+Whether to skip creating the Hive Metastore DB schema on 
sysprepped cluster, during fresh install
+
+  true
+  boolean
+
+
+  
+  
 sysprep_skip_setup_jce
 Whether to skip setting up the unlimited key JCE policy on 
sysprepped cluster
 false



[ambari] branch branch-2.7 updated: AMBARI-24681. Cannot deploy cluster without HDFS_CLIENT (#2370)

2018-09-25 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new d4c46c3  AMBARI-24681. Cannot deploy cluster without HDFS_CLIENT 
(#2370)
d4c46c3 is described below

commit d4c46c3f145eedcf1e9beaf945b61d7db72ef096
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Sep 25 11:31:06 2018 +0200

AMBARI-24681. Cannot deploy cluster without HDFS_CLIENT (#2370)
---
 .../main/resources/stack-hooks/after-INSTALL/scripts/params.py   | 7 +--
 .../stack-hooks/after-INSTALL/scripts/shared_initialization.py   | 4 ++--
 .../src/main/resources/stack-hooks/before-ANY/scripts/hook.py| 2 +-
 .../src/main/resources/stack-hooks/before-ANY/scripts/params.py  | 7 +--
 .../stack-hooks/before-ANY/scripts/shared_initialization.py  | 4 ++--
 .../main/resources/stack-hooks/before-INSTALL/scripts/params.py  | 6 +++---
 .../main/resources/stack-hooks/before-START/scripts/params.py| 9 +
 .../stack-hooks/before-START/scripts/shared_initialization.py| 2 +-
 8 files changed, 24 insertions(+), 17 deletions(-)

diff --git 
a/ambari-server/src/main/resources/stack-hooks/after-INSTALL/scripts/params.py 
b/ambari-server/src/main/resources/stack-hooks/after-INSTALL/scripts/params.py
index dc64b0b..5b6e864 100644
--- 
a/ambari-server/src/main/resources/stack-hooks/after-INSTALL/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stack-hooks/after-INSTALL/scripts/params.py
@@ -97,10 +97,13 @@ mapred_log_dir_prefix = 
default("/configurations/mapred-env/mapred_log_dir_prefi
 hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
 user_group = config['configurations']['cluster-env']['user_group']
 
+namenode_hosts = default("/clusterHostInfo/namenode_hosts", [])
 hdfs_client_hosts = default("/clusterHostInfo/hdfs_client_hosts", [])
-has_hdfs_clients = not len(hdfs_client_hosts) == 0
+has_hdfs_clients = len(hdfs_client_hosts) > 0
+has_namenode = len(namenode_hosts) > 0
+has_hdfs = has_hdfs_clients or has_namenode
 
-if has_hdfs_clients or dfs_type == 'HCFS':
+if has_hdfs or dfs_type == 'HCFS':
   hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 
   mount_table_xml_inclusion_file_full_path = None
diff --git 
a/ambari-server/src/main/resources/stack-hooks/after-INSTALL/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stack-hooks/after-INSTALL/scripts/shared_initialization.py
index 0633545..8e0c2f3 100644
--- 
a/ambari-server/src/main/resources/stack-hooks/after-INSTALL/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stack-hooks/after-INSTALL/scripts/shared_initialization.py
@@ -77,8 +77,8 @@ def setup_config():
   else:
 Logger.warning("Parameter hadoop_conf_dir is missing or directory does not 
exist. This is expected if this host does not have any Hadoop components.")
 
-  if is_hadoop_conf_dir_present and (params.has_hdfs_clients or 
stackversion.find('Gluster') >= 0 or params.dfs_type == 'HCFS'):
-# create core-site only if the hadoop config diretory exists
+  if is_hadoop_conf_dir_present and (params.has_hdfs or 
stackversion.find('Gluster') >= 0 or params.dfs_type == 'HCFS'):
+# create core-site only if the hadoop config directory exists
 XmlConfig("core-site.xml",
   conf_dir=params.hadoop_conf_dir,
   configurations=params.config['configurations']['core-site'],
diff --git 
a/ambari-server/src/main/resources/stack-hooks/before-ANY/scripts/hook.py 
b/ambari-server/src/main/resources/stack-hooks/before-ANY/scripts/hook.py
index dba7bce..25ca3a9 100644
--- a/ambari-server/src/main/resources/stack-hooks/before-ANY/scripts/hook.py
+++ b/ambari-server/src/main/resources/stack-hooks/before-ANY/scripts/hook.py
@@ -29,7 +29,7 @@ class BeforeAnyHook(Hook):
 env.set_params(params)
 
 setup_users()
-if params.has_hdfs_clients or params.dfs_type == 'HCFS':
+if params.has_hdfs or params.dfs_type == 'HCFS':
   setup_hadoop_env()
 setup_java()
 
diff --git 
a/ambari-server/src/main/resources/stack-hooks/before-ANY/scripts/params.py 
b/ambari-server/src/main/resources/stack-hooks/before-ANY/scripts/params.py
index 26ff345..1d69dac 100644
--- a/ambari-server/src/main/resources/stack-hooks/before-ANY/scripts/params.py
+++ b/ambari-server/src/main/resources/stack-hooks/before-ANY/scripts/params.py
@@ -177,6 +177,7 @@ zeppelin_group = 
config['configurations']['zeppelin-env']["zeppelin_group"]
 user_group = config['configurations']['cluster-env']['user_group']
 
 ganglia_server_hosts = def

[ambari] branch trunk updated: AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts (#2360)

2018-09-22 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new b1966bd  AMBARI-24622. Allow skipping package operations for LZO on 
sysprepped hosts (#2360)
b1966bd is described below

commit b1966bd200225389c5a3cbc29d46892712d19fbe
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Sat Sep 22 21:10:02 2018 +0200

AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts 
(#2360)
---
 .../resource_management/libraries/functions/lzo_utils.py  | 11 +++
 1 file changed, 11 insertions(+)

diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
index 4ba7ef3..7d7046c 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
@@ -74,6 +74,13 @@ def should_install_lzo():
 
   return True
 
+def skip_package_operations():
+  """
+  Return true if LZO packages are assumed to be pre-installed
+  Needs to be separate from should_install_lzo, as that one is used during 
tarball creation, too
+  """
+  return default("/ambariLevelParams/host_sys_prepped", False) and 
default("/configurations/cluster-env/sysprep_skip_lzo_package_operations", 
False)
+
 def install_lzo_if_needed():
   """
   Install lzo package if {#should_install_lzo} is true
@@ -81,6 +88,10 @@ def install_lzo_if_needed():
   if not should_install_lzo():
 return
 
+  if skip_package_operations():
+Logger.info("Skipping LZO package installation as host is sys prepped")
+return
+
   # If user has just accepted GPL license. GPL repository can not yet be 
present.
   Script.repository_util.create_repo_files()
 



[ambari] branch trunk updated: AMBARI-24671. Workaround for non-atomic directory creation (#2361)

2018-09-22 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 40a3040  AMBARI-24671. Workaround for non-atomic directory creation 
(#2361)
40a3040 is described below

commit 40a3040aab66a05cc2dec198cbc9cee3cdc7a7b2
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Sat Sep 22 21:09:08 2018 +0200

AMBARI-24671. Workaround for non-atomic directory creation (#2361)
---
 .../src/main/resources/scripts/Ambaripreupload.py  | 35 ++
 1 file changed, 35 insertions(+)

diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index dca9bb5..ff4f0d7 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -36,6 +36,7 @@ from resource_management.core import File
 from resource_management.core import shell
 from resource_management.core.environment import Environment
 from resource_management.core.logger import Logger
+from resource_management.core.resources.system import Directory
 from resource_management.core.resources.system import Execute
 from resource_management.core.source import StaticFile
 from resource_management.libraries import ConfigDictionary
@@ -324,6 +325,40 @@ with Environment() as env:
   env.set_params(params)
   hadoop_conf_dir = params.hadoop_conf_dir
 
+  Directory('/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir',
+owner=params.hdfs_user,
+group=params.user_group,
+mode=01777
+  )
+  Directory('/var/log/hadoop',
+create_parents = True,
+owner='root',
+group=params.user_group,
+mode=0775,
+cd_access='a',
+  )
+  Directory('/var/run/hadoop',
+create_parents = True,
+owner='root',
+group='root',
+cd_access='a',
+  )
+  Directory('/var/run/hadoop/hdfs',
+owner=params.hdfs_user,
+cd_access='a',
+  )
+  Directory('/tmp/hadoop-hdfs',
+create_parents = True,
+owner=params.hdfs_user,
+cd_access='a',
+  )
+  Directory('/tmp/hbase-hbase',
+owner='hbase',
+mode=0775,
+create_parents = True,
+cd_access="a",
+  )
+
   oozie_libext_dir = params.oozie_libext_dir
   sql_driver_filename = os.path.basename(SQL_DRIVER_PATH)
   oozie_home=params.oozie_home



[ambari] branch trunk updated: AMBARI-24674. Upgrade checkstyle version to 8.9 (#2362)

2018-09-22 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new ef774a4  AMBARI-24674. Upgrade checkstyle version to 8.9 (#2362)
ef774a4 is described below

commit ef774a4f8c283040bcdbcdd5570a9155deef3997
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Sat Sep 22 21:08:15 2018 +0200

AMBARI-24674. Upgrade checkstyle version to 8.9 (#2362)
---
 ambari-project/pom.xml |  2 +-
 .../ambari/server/api/services/ConfigGroupService.java |  1 -
 .../ambari/server/api/services/ConfigurationService.java   |  1 -
 .../ambari/server/api/services/HostComponentService.java   |  1 -
 .../ambari/server/api/services/RequestScheduleService.java |  1 -
 .../server/api/services/ServiceConfigVersionService.java   |  1 -
 .../server/api/services/views/ViewInstanceService.java |  1 -
 .../server/api/services/views/ViewPermissionService.java   |  1 -
 .../server/api/services/views/ViewPrivilegeService.java|  1 -
 .../ambari/server/api/services/views/ViewService.java  |  1 -
 .../ambari/server/api/services/views/ViewUrlsService.java  |  1 -
 .../server/api/services/views/ViewVersionService.java  |  1 -
 .../server/controller/ServiceConfigVersionResponse.java|  2 --
 .../apache/ambari/server/stack/StackServiceDirectory.java  |  1 -
 .../server/checks/AtlasMigrationPropertyCheckTest.java |  2 --
 .../ambari/server/stack/StackServiceDirectoryTest.java |  1 -
 .../AvoidTransactionalOnPrivateMethodsCheck.java   | 13 -
 .../checkstyle/UndocumentedRestApiOperationCheck.java  | 13 -
 .../AvoidTransactionalOnPrivateMethodsCheckTest.java   | 14 +-
 .../checkstyle/UndocumentedRestApiOperationCheckTest.java  | 14 +-
 20 files changed, 35 insertions(+), 38 deletions(-)

diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 24d5878..3c568fe 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -32,7 +32,7 @@
 1.6.3
 9.4.11.v20180605
 1.0.0
-6.19 
+8.9
 1.5.19
 3.1.4
 1.7.20
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigGroupService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigGroupService.java
index efa0375..093134d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigGroupService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigGroupService.java
@@ -36,7 +36,6 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.controller.ConfigGroupResponse;
 import org.apache.ambari.server.controller.spi.Resource;
-
 import org.apache.http.HttpStatus;
 
 import io.swagger.annotations.Api;
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigurationService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigurationService.java
index 81ce705..71e1fa4 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigurationService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ConfigurationService.java
@@ -34,7 +34,6 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.controller.ConfigurationResponse;
 import org.apache.ambari.server.controller.spi.Resource;
-
 import org.apache.http.HttpStatus;
 
 import io.swagger.annotations.Api;
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
index 2f2051a..a37883f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostComponentService.java
@@ -48,7 +48,6 @@ import 
org.apache.ambari.server.controller.HostComponentSwagger;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.Validate;
-
 import org.apache.http.HttpStatus;
 
 import io.swagger.annotations.Api;
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestScheduleService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestScheduleService.java
index 68494d4..8c08384 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestScheduleService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestScheduleService.java
@@ -35,7 +35,6 @@ import javax.ws.rs.core.U

[ambari] branch branch-2.6 updated: AMBARI-24671. Workaround for non-atomic directory creation (#2357)

2018-09-21 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new f91518c  AMBARI-24671. Workaround for non-atomic directory creation 
(#2357)
f91518c is described below

commit f91518cbe132256dcfb1cab90277c1d425e1c7e1
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Sep 21 17:05:18 2018 +0200

AMBARI-24671. Workaround for non-atomic directory creation (#2357)
---
 .../src/main/resources/scripts/Ambaripreupload.py  | 36 --
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/ambari-server/src/main/resources/scripts/Ambaripreupload.py 
b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
index 3fb56f0..e0595a8 100644
--- a/ambari-server/src/main/resources/scripts/Ambaripreupload.py
+++ b/ambari-server/src/main/resources/scripts/Ambaripreupload.py
@@ -312,10 +312,40 @@ with Environment() as env:
 with closing(tarfile.open(params.slider_tarball, "w:gz")) as tar:
   for filepath in glob.glob(format("{slider_lib_dir}/*.jar")):
 tar.add(os.path.realpath(filepath), arcname=os.path.basename(filepath))
-  
+
   env.set_params(params)
   hadoop_conf_dir = params.hadoop_conf_dir
-   
+
+  Directory('/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir',
+owner=params.hdfs_user,
+group=params.user_group,
+mode=01777
+  )
+  Directory('/var/log/hadoop',
+create_parents = True,
+owner='root',
+group=params.user_group,
+mode=0775,
+cd_access='a',
+  )
+  Directory('/var/run/hadoop',
+create_parents = True,
+owner='root',
+group='root',
+cd_access='a',
+  )
+  Directory('/tmp/hadoop-hdfs',
+create_parents = True,
+owner=params.hdfs_user,
+cd_access='a',
+  )
+  Directory('/tmp/hbase-hbase',
+owner='hbase',
+mode=0775,
+create_parents = True,
+cd_access="a",
+  )
+
   oozie_libext_dir = params.oozie_libext_dir
   sql_driver_filename = os.path.basename(SQL_DRIVER_PATH)
   oozie_home=params.oozie_home
@@ -460,4 +490,4 @@ with Environment() as env:
   sudo = True
 )
 
-  print "Ambari preupload script completed."
\ No newline at end of file
+  print "Ambari preupload script completed."



[ambari] branch branch-2.6 updated: AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts (#2303)

2018-09-15 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new f148c17  AMBARI-24622. Allow skipping package operations for LZO on 
sysprepped hosts (#2303)
f148c17 is described below

commit f148c17b4ac745335d3047ca1953f2a67815d1ab
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Sun Sep 16 08:38:01 2018 +0200

AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts 
(#2303)
---
 .../resource_management/libraries/functions/lzo_utils.py  | 11 +++
 .../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml  | 11 +++
 2 files changed, 22 insertions(+)

diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
index e125e4e..c0ca05e 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
@@ -82,6 +82,13 @@ def should_install_lzo():
 
   return True
 
+def skip_package_operations():
+  """
+  Return true if LZO packages are assumed to be pre-installed
+  Needs to be separate from should_install_lzo, as that one is used during 
tarball creation, too
+  """
+  return default("/hostLevelParams/host_sys_prepped", False) and 
default("/configurations/cluster-env/sysprep_skip_lzo_package_operations", 
False)
+
 def install_lzo_if_needed():
   """
   Install lzo package if {#should_install_lzo} is true
@@ -89,6 +96,10 @@ def install_lzo_if_needed():
   if not should_install_lzo():
 return
 
+  if skip_package_operations():
+Logger.info("Skipping LZO package installation as host is sys prepped")
+return
+
   # If user has just accepted GPL license. GPL repository can not yet be 
present.
   Script.repository_util.create_repo_files()
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 591b9f5..773db68 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -148,6 +148,17 @@
 
   
   
+sysprep_skip_lzo_package_operations
+Whether LZO packages are also pre-installed on sysprepped 
cluster
+false
+In sysprepped environments true value indicates that LZO 
packages are pre-installed and should not be managed by Ambari
+
+  true
+  boolean
+
+
+  
+  
 sysprep_skip_setup_jce
 Whether to skip setting up the unlimited key JCE policy on 
sysprepped cluster
 false



[ambari] branch branch-2.6 updated: AMBARI-24548. Allow skipping Hive Metastore schema creation for sysprepped cluster (#2199)

2018-08-30 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new d622164  AMBARI-24548. Allow skipping Hive Metastore schema creation 
for sysprepped cluster (#2199)
d622164 is described below

commit d6221644397d26a38c3b2f34b8fa867d5838ce8f
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Thu Aug 30 22:19:03 2018 +0200

AMBARI-24548. Allow skipping Hive Metastore schema creation for sysprepped 
cluster (#2199)
---
 .../common-services/HIVE/0.12.0.2.0/package/scripts/hive.py   |  4 
 .../common-services/HIVE/0.12.0.2.0/package/scripts/params.py |  2 ++
 .../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml  | 11 +++
 3 files changed, 17 insertions(+)

diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index b8d8361..5d5c9b0 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -391,6 +391,10 @@ def hive(name=None):
 def create_metastore_schema():
   import params
 
+  if params.sysprep_skip_hive_schema_create:
+Logger.info("Skipping creation of Hive Metastore schema as host is sys 
prepped")
+return
+
   create_schema_cmd = format("export HIVE_CONF_DIR={hive_server_conf_dir} ; "
  "{hive_schematool_bin}/schematool -initSchema "
  "-dbType {hive_metastore_db_type} "
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
index 895ec81..14a4a71 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
@@ -26,5 +26,7 @@ if OSCheck.is_windows_family():
 else:
   from params_linux import *
 
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+sysprep_skip_hive_schema_create = host_sys_prepped and 
default("/configurations/cluster-env/sysprep_skip_hive_schema_create", False)
 sysprep_skip_copy_tarballs_hdfs = get_sysprep_skip_copy_tarballs_hdfs()
 retryAble = default("/commandParams/command_retry_enabled", False)
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 89cf70d..591b9f5 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -137,6 +137,17 @@
 
   
   
+sysprep_skip_hive_schema_create
+Whether to skip creating the Hive Metastore DB schema on 
sysprepped cluster
+false
+Whether to skip creating the Hive Metastore DB schema on 
sysprepped cluster, during fresh install
+
+  true
+  boolean
+
+
+  
+  
 sysprep_skip_setup_jce
 Whether to skip setting up the unlimited key JCE policy on 
sysprepped cluster
 false



[ambari] branch branch-2.7 updated: AMBARI-24540. Allow skipping Oozie DB schema creation for sysprepped cluster (#2180)

2018-08-28 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 9d02e74  AMBARI-24540. Allow skipping Oozie DB schema creation for 
sysprepped cluster (#2180)
9d02e74 is described below

commit 9d02e74ebcd04856a096fccf21acb1b72bd4c713
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Aug 29 05:43:00 2018 +0200

AMBARI-24540. Allow skipping Oozie DB schema creation for sysprepped 
cluster (#2180)
---
 .../OOZIE/4.0.0.2.0/package/scripts/oozie_service.py  | 11 +++
 .../common-services/OOZIE/4.0.0.2.0/package/scripts/params.py |  1 +
 .../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml  | 11 +++
 3 files changed, 19 insertions(+), 4 deletions(-)

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 612bb29..b8b7b9c 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
@@ -112,10 +112,13 @@ def oozie_service(action = 'start', upgrade_type=None):
  user=params.oozie_user,
 )
 
-  Execute( format("cd {oozie_tmp_dir} && {oozie_home}/bin/ooziedb.sh 
create -sqlfile oozie.sql -run"), 
-   user = params.oozie_user, not_if = no_op_test,
-   ignore_failures = True 
-  )
+  if params.sysprep_skip_oozie_schema_create:
+Logger.info("Skipping creation of oozie schema as host is sys prepped")
+  else:
+Execute( format("cd {oozie_tmp_dir} && {oozie_home}/bin/ooziedb.sh 
create -sqlfile oozie.sql -run"),
+ user = params.oozie_user, not_if = no_op_test,
+ ignore_failures = True
+)
   
   if params.security_enabled:
 Execute(kinit_if_needed,
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
index 5972396..c0257b6 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
@@ -37,3 +37,4 @@ host_sys_prepped = 
default("/ambariLevelParams/host_sys_prepped", False)
 sysprep_skip_copy_oozie_share_lib_to_hdfs = False
 if host_sys_prepped:
   sysprep_skip_copy_oozie_share_lib_to_hdfs = 
default("/configurations/cluster-env/sysprep_skip_copy_oozie_share_lib_to_hdfs",
 False)
+sysprep_skip_oozie_schema_create = host_sys_prepped and 
default("/configurations/cluster-env/sysprep_skip_oozie_schema_create", False)
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 0f5d76c..1c33171 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -126,6 +126,17 @@
 
   
   
+sysprep_skip_oozie_schema_create
+Whether to skip creating the Oozie DB schema on sysprepped 
cluster
+false
+Whether to skip creating the Oozie DB schema on sysprepped 
cluster, during fresh install
+
+  true
+  boolean
+
+
+  
+  
 sysprep_skip_setup_jce
 Whether to skip setting up the unlimited key JCE policy on 
sysprepped cluster
 false



[ambari] branch branch-2.6 updated: AMBARI-24540. Remove duplicate `host_sys_prepped` variable (#2179)

2018-08-28 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new 350997c  AMBARI-24540. Remove duplicate `host_sys_prepped` variable 
(#2179)
350997c is described below

commit 350997c663f9f6641ffa97d0f8f122f39ab16592
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Aug 28 22:16:53 2018 +0200

AMBARI-24540. Remove duplicate `host_sys_prepped` variable (#2179)
---
 .../resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py | 1 +
 .../common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py | 2 --
 .../src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml   | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
index f39d632..f12d931 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
@@ -37,3 +37,4 @@ host_sys_prepped = 
default("/hostLevelParams/host_sys_prepped", False)
 sysprep_skip_copy_oozie_share_lib_to_hdfs = False
 if host_sys_prepped:
   sysprep_skip_copy_oozie_share_lib_to_hdfs = 
default("/configurations/cluster-env/sysprep_skip_copy_oozie_share_lib_to_hdfs",
 False)
+sysprep_skip_oozie_schema_create = host_sys_prepped and 
default("/configurations/cluster-env/sysprep_skip_oozie_schema_create", False)
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
index 1c318e8..8f38843 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
@@ -68,8 +68,6 @@ stack_name_uppercase = stack_name.upper()
 upgrade_direction = default("/commandParams/upgrade_direction", None)
 agent_stack_retry_on_unavailability = 
config['hostLevelParams']['agent_stack_retry_on_unavailability']
 agent_stack_retry_count = expect("/hostLevelParams/agent_stack_retry_count", 
int)
-host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
-sysprep_skip_oozie_schema_create = host_sys_prepped and 
default("/configurations/cluster-env/sysprep_skip_oozie_schema_create", False)
 
 stack_root = status_params.stack_root
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index ed5322a..89cf70d 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -129,7 +129,7 @@
 sysprep_skip_oozie_schema_create
 Whether to skip creating the Oozie DB schema on sysprepped 
cluster
 false
-Whether to skip creating the Oozie DB schema on sysprepped 
cluster, during both fresh install and stack upgrade
+Whether to skip creating the Oozie DB schema on sysprepped 
cluster, during fresh install
 
   true
   boolean



[ambari] branch branch-2.7 updated: AMBARI-24553. Cannot start Hive Metastore without HDFS (#2186)

2018-08-28 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 87b288c  AMBARI-24553. Cannot start Hive Metastore without HDFS (#2186)
87b288c is described below

commit 87b288c0d6ac4722f34fa6e6842987441e982866
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Aug 28 22:17:25 2018 +0200

AMBARI-24553. Cannot start Hive Metastore without HDFS (#2186)
---
 .../resources/stacks/HDP/2.6/services/HIVE/configuration/hive-env.xml| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-env.xml
index 674d633..6f44ff7 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-env.xml
@@ -60,6 +60,7 @@
 hive-env template
 This is the jinja template for hive-env.sh file
 
+export JAVA_HOME={{java64_home}}
 export HADOOP_USER_CLASSPATH_FIRST=true  #this prevents old metrics libs from 
mapreduce lib from bringing in old jar deps overriding HIVE_LIB
 if [ "$SERVICE" = "cli" ]; then
   if [ -z "$DEBUG" ]; then



[ambari] branch branch-2.6 updated: AMBARI-24540. Allow skipping Oozie DB schema creation for sysprepped cluster (#2171)

2018-08-27 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
 new 1f05db9  AMBARI-24540. Allow skipping Oozie DB schema creation for 
sysprepped cluster (#2171)
1f05db9 is described below

commit 1f05db9a322433ce7dc252288fb835133f281407
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Tue Aug 28 08:52:19 2018 +0200

AMBARI-24540. Allow skipping Oozie DB schema creation for sysprepped 
cluster (#2171)
---
 .../OOZIE/4.0.0.2.0/package/scripts/oozie_service.py  | 11 +++
 .../OOZIE/4.0.0.2.0/package/scripts/params_linux.py   |  2 ++
 .../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml  | 11 +++
 3 files changed, 20 insertions(+), 4 deletions(-)

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 7b15a63..4a229ab 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
@@ -109,10 +109,13 @@ def oozie_service(action = 'start', upgrade_type=None):
  user=params.oozie_user,
 )
 
-  Execute( format("cd {oozie_tmp_dir} && {oozie_home}/bin/ooziedb.sh 
create -sqlfile oozie.sql -run"), 
-   user = params.oozie_user, not_if = no_op_test,
-   ignore_failures = True 
-  )
+  if params.sysprep_skip_oozie_schema_create:
+Logger.info("Skipping creation of oozie schema as host is sys prepped")
+  else:
+Execute( format("cd {oozie_tmp_dir} && {oozie_home}/bin/ooziedb.sh 
create -sqlfile oozie.sql -run"),
+ user = params.oozie_user, not_if = no_op_test,
+ ignore_failures = True
+)
   
   if params.security_enabled:
 Execute(kinit_if_needed,
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
index 8f38843..1c318e8 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params_linux.py
@@ -68,6 +68,8 @@ stack_name_uppercase = stack_name.upper()
 upgrade_direction = default("/commandParams/upgrade_direction", None)
 agent_stack_retry_on_unavailability = 
config['hostLevelParams']['agent_stack_retry_on_unavailability']
 agent_stack_retry_count = expect("/hostLevelParams/agent_stack_retry_count", 
int)
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+sysprep_skip_oozie_schema_create = host_sys_prepped and 
default("/configurations/cluster-env/sysprep_skip_oozie_schema_create", False)
 
 stack_root = status_params.stack_root
 
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index ed1f30d..ed5322a 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -126,6 +126,17 @@
 
   
   
+sysprep_skip_oozie_schema_create
+Whether to skip creating the Oozie DB schema on sysprepped 
cluster
+false
+Whether to skip creating the Oozie DB schema on sysprepped 
cluster, during both fresh install and stack upgrade
+
+  true
+  boolean
+
+
+  
+  
 sysprep_skip_setup_jce
 Whether to skip setting up the unlimited key JCE policy on 
sysprepped cluster
 false



[ambari] branch trunk updated: Fixed Spelling. (#1918)

2018-08-16 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 99c9070  Fixed Spelling. (#1918)
99c9070 is described below

commit 99c9070b2ac2774da5e1b41f46a15e0ffd1cd9fb
Author: Jimmy Casey 
AuthorDate: Thu Aug 16 17:04:55 2018 +0100

Fixed Spelling. (#1918)
---
 ambari-common/src/test/python/coilmq/scheduler.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ambari-common/src/test/python/coilmq/scheduler.py 
b/ambari-common/src/test/python/coilmq/scheduler.py
index 4ac7c3e..013de47 100644
--- a/ambari-common/src/test/python/coilmq/scheduler.py
+++ b/ambari-common/src/test/python/coilmq/scheduler.py
@@ -32,7 +32,7 @@ class SubscriberPriorityScheduler(object):
 @abc.abstractmethod
 def choice(self, subscribers, message):
 """
-Chooses which subscriber (from list) should recieve specified message.
+Chooses which subscriber (from list) should receive specified message.
 
 @param subscribers: Collection of subscribed connections eligible to 
receive message. 
 @type subscribers: C{list} of L{coilmq.server.StompConnection}



[ambari] branch branch-2.7 updated: AMBARI-21158. Eliminate Maven warning in Log Feeder Container Registry (#2076)

2018-08-15 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 6101d44  AMBARI-21158. Eliminate Maven warning in Log Feeder Container 
Registry (#2076)
6101d44 is described below

commit 6101d44baeb2ab2c73795a600606f45251cdcc6d
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Aug 15 15:08:34 2018 +0200

AMBARI-21158. Eliminate Maven warning in Log Feeder Container Registry 
(#2076)
---
 ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml 
b/ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml
index 001d6fa..bdcff62 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml
@@ -73,6 +73,7 @@
   
 org.apache.maven.plugins
 maven-jar-plugin
+3.1.0
 
   
 **/log4j.properties



[ambari] branch trunk updated: AMBARI-21158. Eliminate Maven warning in Log Feeder Container Registry (#2075)

2018-08-15 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new 47aa256  AMBARI-21158. Eliminate Maven warning in Log Feeder Container 
Registry (#2075)
47aa256 is described below

commit 47aa2562fee6d16e8cd4e38fd701d577b2e77bc2
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Wed Aug 15 11:37:44 2018 +0200

AMBARI-21158. Eliminate Maven warning in Log Feeder Container Registry 
(#2075)
---
 ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml 
b/ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml
index 001d6fa..bdcff62 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-logfeeder-container-registry/pom.xml
@@ -73,6 +73,7 @@
   
 org.apache.maven.plugins
 maven-jar-plugin
+3.1.0
 
   
 **/log4j.properties



[ambari] branch branch-2.7 updated: AMBARI-23811. TimelineMetricsFilterTest fails if dir name contains @ due to AMBARI-24066 (#2032)

2018-08-10 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new 79414c3  AMBARI-23811. TimelineMetricsFilterTest fails if dir name 
contains @ due to AMBARI-24066 (#2032)
79414c3 is described below

commit 79414c352647b03bffddfce8e3b64a5c97204aa5
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Aug 10 23:19:58 2018 +0200

AMBARI-23811. TimelineMetricsFilterTest fails if dir name contains @ due to 
AMBARI-24066 (#2032)
---
 .../metrics/core/timeline/TimelineMetricsFilterTest.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/core/timeline/TimelineMetricsFilterTest.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/core/timeline/TimelineMetricsFilterTest.java
index 70b47c7..d903137 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/core/timeline/TimelineMetricsFilterTest.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/core/timeline/TimelineMetricsFilterTest.java
@@ -27,7 +27,6 @@ import org.easymock.EasyMock;
 import org.junit.Test;
 
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -91,9 +90,7 @@ public class TimelineMetricsFilterTest {
 expect(configuration.getMetricsConf()).andReturn(metricsConf).once();
 replay(configuration);
 
-URL fileUrl = 
ClassLoader.getSystemResource("test_data/metric_blacklist.dat");
-
-metricsConf.set("timeline.metrics.blacklist.file", fileUrl.getPath());
+metricsConf.set("timeline.metrics.blacklist.file", 
getTestBlacklistFilePath());
 TimelineMetricsFilter.initializeMetricFilter(configuration);
 
 TimelineMetric timelineMetric = new TimelineMetric();
@@ -183,8 +180,7 @@ public class TimelineMetricsFilterTest {
 metricsConf.set("timeline.metrics.apps.whitelist", "namenode,nimbus");
 metricsConf.set("timeline.metrics.apps.blacklist", 
"datanode,kafka_broker");
 metricsConf.set("timeline.metrics.whitelist.file", 
getTestWhitelistFilePath());
-URL fileUrl2 = 
ClassLoader.getSystemResource("test_data/metric_blacklist.dat");
-metricsConf.set("timeline.metrics.blacklist.file", fileUrl2.getPath());
+metricsConf.set("timeline.metrics.blacklist.file", 
getTestBlacklistFilePath());
 expect(configuration.getMetricsConf()).andReturn(metricsConf).once();
 
 Set whitelist = new HashSet<>();
@@ -256,4 +252,8 @@ public class TimelineMetricsFilterTest {
   private static String getTestWhitelistFilePath() throws URISyntaxException {
 return 
ClassLoader.getSystemResource("test_data/metric_whitelist.dat").toURI().getPath();
   }
+
+  private static String getTestBlacklistFilePath() throws URISyntaxException {
+return 
ClassLoader.getSystemResource("test_data/metric_blacklist.dat").toURI().getPath();
+  }
 }



[ambari] branch trunk updated: AMBARI-23811. TimelineMetricsFilterTest fails if dir name contains @ due to AMBARI-24066 (#2031)

2018-08-10 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new c37b7ff  AMBARI-23811. TimelineMetricsFilterTest fails if dir name 
contains @ due to AMBARI-24066 (#2031)
c37b7ff is described below

commit c37b7ff02798e49fad2eba51d51450b9da704193
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Aug 10 23:17:59 2018 +0200

AMBARI-23811. TimelineMetricsFilterTest fails if dir name contains @ due to 
AMBARI-24066 (#2031)
---
 .../metrics/core/timeline/TimelineMetricsFilterTest.java | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/core/timeline/TimelineMetricsFilterTest.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/core/timeline/TimelineMetricsFilterTest.java
index 70b47c7..d903137 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/core/timeline/TimelineMetricsFilterTest.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/ambari/metrics/core/timeline/TimelineMetricsFilterTest.java
@@ -27,7 +27,6 @@ import org.easymock.EasyMock;
 import org.junit.Test;
 
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -91,9 +90,7 @@ public class TimelineMetricsFilterTest {
 expect(configuration.getMetricsConf()).andReturn(metricsConf).once();
 replay(configuration);
 
-URL fileUrl = 
ClassLoader.getSystemResource("test_data/metric_blacklist.dat");
-
-metricsConf.set("timeline.metrics.blacklist.file", fileUrl.getPath());
+metricsConf.set("timeline.metrics.blacklist.file", 
getTestBlacklistFilePath());
 TimelineMetricsFilter.initializeMetricFilter(configuration);
 
 TimelineMetric timelineMetric = new TimelineMetric();
@@ -183,8 +180,7 @@ public class TimelineMetricsFilterTest {
 metricsConf.set("timeline.metrics.apps.whitelist", "namenode,nimbus");
 metricsConf.set("timeline.metrics.apps.blacklist", 
"datanode,kafka_broker");
 metricsConf.set("timeline.metrics.whitelist.file", 
getTestWhitelistFilePath());
-URL fileUrl2 = 
ClassLoader.getSystemResource("test_data/metric_blacklist.dat");
-metricsConf.set("timeline.metrics.blacklist.file", fileUrl2.getPath());
+metricsConf.set("timeline.metrics.blacklist.file", 
getTestBlacklistFilePath());
 expect(configuration.getMetricsConf()).andReturn(metricsConf).once();
 
 Set whitelist = new HashSet<>();
@@ -256,4 +252,8 @@ public class TimelineMetricsFilterTest {
   private static String getTestWhitelistFilePath() throws URISyntaxException {
 return 
ClassLoader.getSystemResource("test_data/metric_whitelist.dat").toURI().getPath();
   }
+
+  private static String getTestBlacklistFilePath() throws URISyntaxException {
+return 
ClassLoader.getSystemResource("test_data/metric_blacklist.dat").toURI().getPath();
+  }
 }



[ambari] branch trunk updated: AMBARI-24434. Cannot deploy HBase without HDFS (#2021)

2018-08-10 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
 new ec55bee  AMBARI-24434. Cannot deploy HBase without HDFS (#2021)
ec55bee is described below

commit ec55beefd4cc16eb0242eb0de1326faac2b39e6d
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Aug 10 15:52:31 2018 +0200

AMBARI-24434. Cannot deploy HBase without HDFS (#2021)
---
 .../controller/internal/BlueprintConfigurationProcessor.java   |  2 +-
 .../common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py  | 10 +-
 .../HBASE/0.96.0.2.0/package/scripts/params_linux.py   |  2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 985d2f0..6e1ec46 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -2905,7 +2905,7 @@ public class BlueprintConfigurationProcessor {
 hdfsSiteMap.put("dfs.namenode.https-address", new 
SingleHostTopologyUpdater("NAMENODE"));
 hdfsSiteMap.put("dfs.namenode.rpc-address", new 
SingleHostTopologyUpdater("NAMENODE"));
 coreSiteMap.put("fs.defaultFS", new SingleHostTopologyUpdater("NAMENODE"));
-hbaseSiteMap.put("hbase.rootdir", new 
SingleHostTopologyUpdater("NAMENODE"));
+hbaseSiteMap.put("hbase.rootdir", new 
OptionalSingleHostTopologyUpdater("NAMENODE"));
 accumuloSiteMap.put("instance.volumes", new 
SingleHostTopologyUpdater("NAMENODE"));
 // HDFS shared.edits JournalNode Quorum URL uses semi-colons as separators
 multiHdfsSiteMap.put("dfs.namenode.shared.edits.dir", new 
MultipleHostTopologyUpdater("JOURNALNODE", ';', false, false, true));
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
index 9bf990d..d086baf 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
@@ -208,7 +208,7 @@ def hbase(name=None):
   group=params.user_group,
   owner=params.hbase_user
 )
-  if name == "master":
+  if name == "master" and params.default_fs:
 if not params.hbase_hdfs_root_dir_protocol or 
params.hbase_hdfs_root_dir_protocol == urlparse(params.default_fs).scheme:
   params.HdfsResource(params.hbase_hdfs_root_dir,
type="directory",
@@ -230,6 +230,14 @@ def hbase(name=None):
   )
 params.HdfsResource(None, action="execute")
 
+  if name in ('master', 'regionserver') and not params.default_fs:
+Directory(params.hbase_staging_dir,
+  owner = params.hbase_user,
+  create_parents = True,
+  cd_access = "a",
+  mode = 0711,
+)
+
   if params.phoenix_enabled:
 Package(params.phoenix_package,
 
retry_on_repo_unavailability=params.agent_stack_retry_on_unavailability,
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
index 0f01ea3..911700b 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
@@ -260,7 +260,7 @@ hdfs_user = 
config['configurations']['hadoop-env']['hdfs_user']
 hdfs_principal_name = 
config['configurations']['hadoop-env']['hdfs_principal_name']
 
 hdfs_site = config['configurations']['hdfs-site']
-default_fs = config['configurations']['core-site']['fs.defaultFS']
+default_fs = default('configurations/core-site/fs.defaultFS', None)
 
 dfs_type = default("/clusterLevelParams/dfs_type", "")
 



[ambari] branch branch-2.7 updated: AMBARI-24434. Cannot deploy HBase without HDFS (#2005)

2018-08-10 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
 new d662de9  AMBARI-24434. Cannot deploy HBase without HDFS (#2005)
d662de9 is described below

commit d662de940e1d7b53bafb5f639d189126ac612221
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Aug 10 09:08:32 2018 +0200

AMBARI-24434. Cannot deploy HBase without HDFS (#2005)
---
 .../controller/internal/BlueprintConfigurationProcessor.java   |  2 +-
 .../common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py  | 10 +-
 .../HBASE/0.96.0.2.0/package/scripts/params_linux.py   |  2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 985d2f0..6e1ec46 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -2905,7 +2905,7 @@ public class BlueprintConfigurationProcessor {
 hdfsSiteMap.put("dfs.namenode.https-address", new 
SingleHostTopologyUpdater("NAMENODE"));
 hdfsSiteMap.put("dfs.namenode.rpc-address", new 
SingleHostTopologyUpdater("NAMENODE"));
 coreSiteMap.put("fs.defaultFS", new SingleHostTopologyUpdater("NAMENODE"));
-hbaseSiteMap.put("hbase.rootdir", new 
SingleHostTopologyUpdater("NAMENODE"));
+hbaseSiteMap.put("hbase.rootdir", new 
OptionalSingleHostTopologyUpdater("NAMENODE"));
 accumuloSiteMap.put("instance.volumes", new 
SingleHostTopologyUpdater("NAMENODE"));
 // HDFS shared.edits JournalNode Quorum URL uses semi-colons as separators
 multiHdfsSiteMap.put("dfs.namenode.shared.edits.dir", new 
MultipleHostTopologyUpdater("JOURNALNODE", ';', false, false, true));
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
index 9bf990d..d086baf 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
@@ -208,7 +208,7 @@ def hbase(name=None):
   group=params.user_group,
   owner=params.hbase_user
 )
-  if name == "master":
+  if name == "master" and params.default_fs:
 if not params.hbase_hdfs_root_dir_protocol or 
params.hbase_hdfs_root_dir_protocol == urlparse(params.default_fs).scheme:
   params.HdfsResource(params.hbase_hdfs_root_dir,
type="directory",
@@ -230,6 +230,14 @@ def hbase(name=None):
   )
 params.HdfsResource(None, action="execute")
 
+  if name in ('master', 'regionserver') and not params.default_fs:
+Directory(params.hbase_staging_dir,
+  owner = params.hbase_user,
+  create_parents = True,
+  cd_access = "a",
+  mode = 0711,
+)
+
   if params.phoenix_enabled:
 Package(params.phoenix_package,
 
retry_on_repo_unavailability=params.agent_stack_retry_on_unavailability,
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
index 0f01ea3..911700b 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
@@ -260,7 +260,7 @@ hdfs_user = 
config['configurations']['hadoop-env']['hdfs_user']
 hdfs_principal_name = 
config['configurations']['hadoop-env']['hdfs_principal_name']
 
 hdfs_site = config['configurations']['hdfs-site']
-default_fs = config['configurations']['core-site']['fs.defaultFS']
+default_fs = default('configurations/core-site/fs.defaultFS', None)
 
 dfs_type = default("/clusterLevelParams/dfs_type", "")
 



[ambari] branch merge-trunk-into-branch-feature-AMBARI-14714 deleted (was c40a67d)

2018-08-06 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a change to branch 
merge-trunk-into-branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git.


 was c40a67d  Merge remote-tracking branch 'origin/trunk' into 
merge-trunk-into-branch-feature-AMBARI-14714

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[ambari] branch branch-feature-AMBARI-14714 updated: AMBARI-24194. Fix broken Java UTs in ambari-server code -- Part 2 (#1758)

2018-07-14 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by 
this push:
 new 05e3957  AMBARI-24194. Fix broken Java UTs in ambari-server code -- 
Part 2 (#1758)
05e3957 is described below

commit 05e3957366355ac3bf0be6160febe6d90c5b8387
Author: sduan 
AuthorDate: Sat Jul 14 03:58:50 2018 -0700

AMBARI-24194. Fix broken Java UTs in ambari-server code -- Part 2 (#1758)
---
 .../ambari/server/agent/HeartbeatProcessor.java|  44 +++---
 .../KerberosAdminPersistedCredentialCheck.java |  12 +-
 .../server/agent/HeartbeatProcessorTest.java   |  14 +-
 .../ambari/server/agent/TestHeartbeatHandler.java  |   2 +
 .../KerberosAdminPersistedCredentialCheckTest.java | 150 +++--
 .../checks/MissingOsInRepoVersionCheckTest.java|   3 +
 6 files changed, 124 insertions(+), 101 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
index e5bf9dc..4d0c072 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartbeatProcessor.java
@@ -416,7 +416,7 @@ public class HeartbeatProcessor extends AbstractService{
   }
 }
   }
-} else if (CHECK_KEYTABS.equalsIgnoreCase(customCommand)) {
+} else if (CHECK_KEYTABS.equalsIgnoreCase(customCommand) && 
structuredOutputJson != null) {
   JsonElement checkKeytabsStructuredOutRoot = structuredOutputJson.get(
   StructuredOutputType.CHECK_KEYTABS.getRoot());
 
@@ -524,29 +524,31 @@ public class HeartbeatProcessor extends AbstractService{
   hostName, now));
 }
   } else if (report.getStatus().equals("FAILED")) {
-JsonElement upgradeStructedOutput = structuredOutputJson.get(
-StructuredOutputType.UPGRADE_SUMMARY.getRoot());
-if (null != upgradeStructedOutput) {
-  try {
-UpgradeSummaryStructuredOuut upgradeStructuredOutput = 
gson.fromJson(
-upgradeStructedOutput, UpgradeSummaryStructuredOuut.class);
-
-if (null != upgradeStructuredOutput.direction) {
-  scHost.setUpgradeState(UpgradeState.FAILED);
+if (structuredOutputJson != null) {
+  JsonElement upgradeStructedOutput = structuredOutputJson.get(
+  StructuredOutputType.UPGRADE_SUMMARY.getRoot());
+  if (null != upgradeStructedOutput) {
+try {
+  UpgradeSummaryStructuredOuut upgradeStructuredOutput = 
gson.fromJson(
+  upgradeStructedOutput, 
UpgradeSummaryStructuredOuut.class);
+
+  if (null != upgradeStructuredOutput.direction) {
+scHost.setUpgradeState(UpgradeState.FAILED);
+  }
+} catch (JsonSyntaxException ex) {
+  LOG.warn("Structured output was found, but not parseable: 
{}",
+  structuredOutputString);
 }
-  } catch (JsonSyntaxException ex) {
-LOG.warn("Structured output was found, but not parseable: {}",
-structuredOutputString);
   }
-}
 
-LOG.error("Operation failed - may be retried. Service component 
host: "
-+ schName + ", host: " + hostName + " Action id " + 
report.getActionId() + " and taskId " + report.getTaskId());
-if (actionManager.isInProgressCommand(report)) {
-  scHost.handleEvent(new ServiceComponentHostOpFailedEvent
-  (schName, hostName, now));
-} else {
-  LOG.info("Received report for a command that is no longer 
active. " + report);
+  LOG.error("Operation failed - may be retried. Service component 
host: "
+  + schName + ", host: " + hostName + " Action id " + 
report.getActionId() + " and taskId " + report.getTaskId());
+  if (actionManager.isInProgressCommand(report)) {
+scHost.handleEvent(new ServiceComponentHostOpFailedEvent
+(schName, hostName, now));
+  } else {
+LOG.info("Received report for a command that is no longer 
active. " + report);
+  }
 }
   } else if (report.getStatus().equals("IN_PROGRESS")) {
 scHost.handleEvent(new 
ServiceComponentHostOpInProgressEvent(schName,
diff --git 
a/ambari-server/src/

[ambari] branch branch-feature-AMBARI-14714 updated: AMBARI-14714. Fix few more unit tests (#1761) - unused imports

2018-07-13 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by 
this push:
 new 9ece1fc  AMBARI-14714. Fix few more unit tests (#1761) - unused imports
9ece1fc is described below

commit 9ece1fc39b0c3484d68aaa4683bce49f8dc51554
Author: Doroszlai, Attila 
AuthorDate: Sat Jul 14 08:35:50 2018 +0200

AMBARI-14714. Fix few more unit tests (#1761) - unused imports
---
 .../apache/ambari/server/configuration/RecoveryConfigHelperTest.java| 1 -
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog252Test.java| 2 --
 2 files changed, 3 deletions(-)

diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java
index 5ff64ce..b5e753d 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/configuration/RecoveryConfigHelperTest.java
@@ -46,7 +46,6 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.Service;
-import org.apache.ambari.server.state.ServiceGroup;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.utils.EventBusSynchronizer;
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog252Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog252Test.java
index 481faaf..aadde20 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog252Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog252Test.java
@@ -64,11 +64,9 @@ import org.apache.ambari.server.controller.KerberosHelper;
 import org.apache.ambari.server.controller.KerberosHelperImpl;
 import org.apache.ambari.server.controller.MaintenanceStateHelper;
 import org.apache.ambari.server.controller.RootServiceResponseFactory;
-import org.apache.ambari.server.events.MetadataUpdateEvent;
 import org.apache.ambari.server.hooks.HookService;
 import org.apache.ambari.server.hooks.users.UserHookService;
 import org.apache.ambari.server.metadata.CachedRoleCommandOrderProvider;
-import org.apache.ambari.server.metadata.ClusterMetadataGenerator;
 import org.apache.ambari.server.metadata.RoleCommandOrderProvider;
 import org.apache.ambari.server.mpack.MpackManagerFactory;
 import org.apache.ambari.server.orm.DBAccessor;



[ambari] branch branch-feature-AMBARI-14714 updated: AMBARI-14714. Fix few more unit tests (#1761)

2018-07-13 Thread adoroszlai
This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by 
this push:
 new 1d4447e  AMBARI-14714. Fix few more unit tests (#1761)
1d4447e is described below

commit 1d4447ee2f2652f84fa17a9814aa1ebf30664b0f
Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com>
AuthorDate: Fri Jul 13 17:55:23 2018 +0200

AMBARI-14714. Fix few more unit tests (#1761)
---
 .../internal/HostComponentResourceProvider.java|  4 +-
 .../server/state/ServiceComponentSupport.java  |  2 +-
 .../server/agent/DummyHeartbeatConstants.java  |  2 +-
 .../ambari/server/agent/HeartbeatTestHelper.java   |  7 ++-
 .../configuration/RecoveryConfigHelperTest.java| 23 +++
 .../controller/AmbariManagementControllerTest.java | 73 ++
 .../server/state/ServiceComponentSupportTest.java  |  3 +-
 .../server/upgrade/UpgradeCatalog252Test.java  | 11 +---
 8 files changed, 56 insertions(+), 69 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index 3dab4c8..7272303 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -578,6 +578,8 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
 }
 
 for (ServiceComponentHostRequest request : requests) {
+  logRequestInfo("Received a updateHostComponent request", request);
+
   validateServiceComponentHostRequest(request);
 
   Cluster cluster = clusters.getCluster(request.getClusterName());
@@ -595,8 +597,6 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
   ServiceComponent sc = getServiceComponent(
   request.getClusterName(), request.getServiceGroupName(), 
request.getServiceName(), request.getComponentName());
 
-  logRequestInfo("Received a updateHostComponent request", request);
-
   if((clusterName == null || clusterName.isEmpty())
   && (request.getClusterName() != null
   && !request.getClusterName().isEmpty())) {
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java
index 6332705..dc93faa 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ServiceComponentSupport.java
@@ -51,7 +51,7 @@ public class ServiceComponentSupport {
* Collects the service names from the cluster which are not supported 
(service doesn't exist or was deleted) in the given stack.
*/
   public Set unsupportedServices(Cluster cluster, String stackName, 
String stackVersion) {
-Set serviceNames = 
cluster.getServices().stream().map(Service::getName).collect(toSet());
+Set serviceNames = 
cluster.getServices().stream().map(Service::getServiceType).collect(toSet());
 return serviceNames.stream()
   .filter(serviceName -> !isServiceSupported(serviceName, stackName, 
stackVersion))
   .collect(toSet());
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/agent/DummyHeartbeatConstants.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/agent/DummyHeartbeatConstants.java
index 45ec647..f869c2f 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/agent/DummyHeartbeatConstants.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/agent/DummyHeartbeatConstants.java
@@ -41,7 +41,7 @@ public interface DummyHeartbeatConstants {
 
   String HDFS = "HDFS";
   String HBASE = "HBASE";
-  String CORE_SERVICE_GROUP = "core";
+  String CORE_SERVICE_GROUP = "CORE";
 
   String DATANODE = Role.DATANODE.name();
   String NAMENODE = Role.NAMENODE.name();
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
index 4fa806f..f552288 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/agent/HeartbeatTestHelper.java
@@ -26,6 +26,7 @@ import static 
org.apache.ambari.server.agent.DummyHeartbeatConstants.DummyOs;
 import static 
org.apache.ambari.server.agent.DummyHeartbeatConstants.DummyRepositoryVersion;
 import s

  1   2   3   4   5   6   7   8   9   >