You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2017/10/16 20:23:53 UTC

[01/15] ambari git commit: AMBARI-22235. Druid service check failed during EU. (b-slim via nishantmonu51)

Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-20859 77d40577b -> 7bb4de144


AMBARI-22235. Druid service check failed during EU. (b-slim via nishantmonu51)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: c8c1812b07ba0f64093190519cf829df8ea639d0
Parents: 20faae7
Author: Nishant <ni...@gmail.com>
Authored: Fri Oct 13 22:06:41 2017 +0530
Committer: Nishant <ni...@gmail.com>
Committed: Fri Oct 13 22:06:41 2017 +0530

----------------------------------------------------------------------
 .../stacks/HDP/2.6/services/DRUID/kerberos.json | 45 ++++----------------
 .../HDP/2.6/services/SUPERSET/kerberos.json     | 10 +----
 2 files changed, 11 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c8c1812b/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json b/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
index 198c351..f186e31 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
@@ -16,7 +16,7 @@
         {
           "name": "druid",
           "principal": {
-            "value": "${druid-env/druid_user}@${realm}",
+            "value": "${druid-env/druid_user}${principal_suffix}@${realm}",
             "type": "user",
             "configuration": "druid-common/druid.hadoop.security.kerberos.principal",
             "local_username": "${druid-env/druid_user}"
@@ -41,49 +41,22 @@
       ],
       "components": [
         {
-          "name": "DRUID_HISTORICAL",
-          "identities": [
-            {
-              "name": "druid_druid_historical_druid",
-              "reference": "/druid"
-            }
-          ]
+          "name": "DRUID_HISTORICAL"
         },
         {
-          "name": "DRUID_BROKER",
-          "identities": [
-            {
-              "name": "druid_druid_broker_druid",
-              "reference": "/druid"
-            }
-          ]
+          "name": "DRUID_BROKER"
         },
         {
-          "name": "DRUID_OVERLORD",
-          "identities": [
-            {
-              "name": "druid_druid_historical_druid",
-              "reference": "/druid"
-            }
-          ]
+          "name": "DRUID_OVERLORD"
         },
         {
-          "name": "DRUID_COORDINATOR",
-          "identities": [
-            {
-              "name": "druid_druid_coordinator_druid",
-              "reference": "/druid"
-            }
-          ]
+          "name": "DRUID_COORDINATOR"
         },
         {
-          "name": "DRUID_MIDDLEMANAGER",
-          "identities": [
-            {
-              "name": "druid_druid_middlemanager_druid",
-              "reference": "/druid"
-            }
-          ]
+          "name": "DRUID_MIDDLEMANAGER"
+        },
+        {
+          "name": "DRUID_ROUTER"
         }
       ],
       "configurations": [

http://git-wip-us.apache.org/repos/asf/ambari/blob/c8c1812b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SUPERSET/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SUPERSET/kerberos.json b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SUPERSET/kerberos.json
index 5d5125d..0de6737 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SUPERSET/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SUPERSET/kerberos.json
@@ -6,7 +6,7 @@
         {
           "name": "superset",
           "principal": {
-            "value": "${superset-env/superset_user}@${realm}",
+            "value": "${superset-env/superset_user}${principal_suffix}@${realm}",
             "type": "user",
             "configuration": "superset/KERBEROS_PRINCIPAL",
             "local_username": "${superset-env/superset_user}"
@@ -31,13 +31,7 @@
       ],
       "components": [
         {
-          "name": "SUPERSET",
-          "identities": [
-            {
-              "name": "superset_superset_superset",
-              "reference": "/superset"
-            }
-          ]
+          "name": "SUPERSET"
         }
       ],
       "configurations": [


[03/15] ambari git commit: AMBARI-22242. Express Upgrade from IOP 4.2 to HDP 2.6.2 AMS failed to restart before finalizing. (swagle)

Posted by rl...@apache.org.
AMBARI-22242. Express Upgrade from IOP 4.2 to HDP 2.6.2 AMS failed to restart before finalizing. (swagle)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 62a0a18ce57c7290989ab3ff5ffb08e88225570e
Parents: 6e1cac8
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Fri Oct 13 20:55:36 2017 -0700
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Fri Oct 13 20:55:36 2017 -0700

----------------------------------------------------------------------
 .../AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py    | 4 ++--
 .../AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py      | 4 ++--
 .../AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/62a0a18c/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
index fc2576d..1c6f2a1 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
@@ -44,13 +44,13 @@ class AmsCollector(Script):
     hbase('regionserver', action)
     ams(name='collector')
 
-  def start(self, env):
+  def start(self, env, upgrade_type=None):
     self.configure(env, action = 'start') # for security
     # stop hanging components before start
     ams_service('collector', action = 'stop')
     ams_service('collector', action = 'start')
 
-  def stop(self, env):
+  def stop(self, env, upgrade_type=None):
     import params
     env.set_params(params)
     # Sometimes, stop() may be called before start(), in case restart() is initiated right after installation

http://git-wip-us.apache.org/repos/asf/ambari/blob/62a0a18c/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py
----------------------------------------------------------------------
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 1f0e049..387b018 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
@@ -38,7 +38,7 @@ class AmsGrafana(Script):
     env.set_params(params)
     ams(name='grafana', action=action)
 
-  def start(self, env):
+  def start(self, env, upgrade_type=None):
     import params
     env.set_params(params)
     self.configure(env, action = 'start')
@@ -61,7 +61,7 @@ class AmsGrafana(Script):
     # Create pre-built dashboards
     create_ams_dashboards()
 
-  def stop(self, env):
+  def stop(self, env, upgrade_type=None):
     import params
     env.set_params(params)
     self.configure(env, action = 'stop')

http://git-wip-us.apache.org/repos/asf/ambari/blob/62a0a18c/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py
index a377f6d..16c7997 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py
@@ -35,14 +35,14 @@ class AmsMonitor(Script):
     env.set_params(params)
     ams(name='monitor')
 
-  def start(self, env):
+  def start(self, env, upgrade_type=None):
     self.configure(env) # for security
 
     ams_service( 'monitor',
                  action = 'start'
     )
 
-  def stop(self, env):
+  def stop(self, env, upgrade_type=None):
     import params
     env.set_params(params)
 


[04/15] ambari git commit: AMBARI-22241: accumulo_script.py doesn't override init (Josh Elser via jluniya)

Posted by rl...@apache.org.
AMBARI-22241: accumulo_script.py doesn't override init (Josh Elser via jluniya)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 329067797ecf70b765f6cd5a9febf89dcfbac0a5
Parents: 62a0a18
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Fri Oct 13 21:15:50 2017 -0700
Committer: Jayush Luniya <jl...@hortonworks.com>
Committed: Fri Oct 13 21:15:50 2017 -0700

----------------------------------------------------------------------
 .../ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py         | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/32906779/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py
index 6aafb05..2a95820 100644
--- a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py
+++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/accumulo_script.py
@@ -37,6 +37,7 @@ from accumulo_service import accumulo_service
 class AccumuloScript(Script):
 
   def __init__(self, component):
+    Script.__init__(self)
     self.component = component
 
 


[02/15] ambari git commit: AMBARI-22237. Restarting Storm Supervisor from Ambari always fails while Stop and Start works fine. (Arpit Khare, swagle via swagle)

Posted by rl...@apache.org.
AMBARI-22237. Restarting Storm Supervisor from Ambari always fails while Stop and Start works fine. (Arpit Khare, swagle via swagle)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 6e1cac85e33132c93fd843e402e3702ee584b947
Parents: c8c1812
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Fri Oct 13 20:55:22 2017 -0700
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Fri Oct 13 20:55:22 2017 -0700

----------------------------------------------------------------------
 .../STORM/0.9.1/package/scripts/supervisord_service.py              | 1 +
 .../STORM/1.0.1.3.0/package/scripts/supervisord_service.py          | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6e1cac85/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/supervisord_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/supervisord_service.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/supervisord_service.py
index 6ff9f9c..498db15 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/supervisord_service.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/supervisord_service.py
@@ -20,6 +20,7 @@ limitations under the License.
 
 from resource_management.core.resources.system import Execute
 from resource_management.libraries.functions.format import format
+from resource_management.core.exceptions import Fail
 
 def supervisord_service(component_name, action):
   Execute(format("supervisorctl {action} storm-{component_name}"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e1cac85/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/supervisord_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/supervisord_service.py b/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/supervisord_service.py
index 6ff9f9c..498db15 100644
--- a/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/supervisord_service.py
+++ b/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/supervisord_service.py
@@ -20,6 +20,7 @@ limitations under the License.
 
 from resource_management.core.resources.system import Execute
 from resource_management.libraries.functions.format import format
+from resource_management.core.exceptions import Fail
 
 def supervisord_service(component_name, action):
   Execute(format("supervisorctl {action} storm-{component_name}"),


[07/15] ambari git commit: AMBARI-22238 : Maven cleanup of ambari utility, logsearch and ambari metrics modules. (avijayan)

Posted by rl...@apache.org.
AMBARI-22238 : Maven cleanup of ambari utility, logsearch and ambari metrics modules. (avijayan)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 499fec3c1ec7ddd18fae3a415da7e4d5de82d63b
Parents: 43fb597
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Sun Oct 15 09:41:13 2017 -0700
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Sun Oct 15 09:41:13 2017 -0700

----------------------------------------------------------------------
 ambari-infra/ambari-infra-assembly/pom.xml            |  4 ++++
 ambari-logsearch/ambari-logsearch-assembly/pom.xml    |  4 +++-
 ambari-logsearch/ambari-logsearch-logfeeder/pom.xml   |  4 ++++
 ambari-logsearch/ambari-logsearch-server/pom.xml      |  4 ++++
 ambari-metrics/ambari-metrics-assembly/pom.xml        |  2 ++
 ambari-metrics/ambari-metrics-common/pom.xml          |  6 ++++++
 ambari-metrics/ambari-metrics-timelineservice/pom.xml | 10 ++++++++++
 ambari-utility/pom.xml                                |  6 ++++++
 8 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/499fec3c/ambari-infra/ambari-infra-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-assembly/pom.xml b/ambari-infra/ambari-infra-assembly/pom.xml
index dfb5c01..2b4959b 100644
--- a/ambari-infra/ambari-infra-assembly/pom.xml
+++ b/ambari-infra/ambari-infra-assembly/pom.xml
@@ -120,6 +120,9 @@
                       <sources>
                         <source>
                           <location>${solr.client.dir}/target/package</location>
+                          <exclude>
+                            <exclude>libs/checkstyle*.jar</exclude>
+                          </exclude>
                         </source>
                       </sources>
                     </mapping>
@@ -324,6 +327,7 @@
                         <group>root</group>
                         <prefix>${solr.client.mapping.path}</prefix>
                       </mapper>
+                      <excludes>libs/checkstyle*.jar</excludes>
                     </data>
                   </dataSet>
                 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/499fec3c/ambari-logsearch/ambari-logsearch-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/pom.xml b/ambari-logsearch/ambari-logsearch-assembly/pom.xml
index e8a9426..cbc62ce 100644
--- a/ambari-logsearch/ambari-logsearch-assembly/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-assembly/pom.xml
@@ -94,6 +94,7 @@
                             <exclude>classes/user_pass.json</exclude>
                             <exclude>classes/HadoopServiceConfig.json</exclude>
                             <exclude>solr_configsets/**</exclude>
+                            <exclude>libs/checkstyle*.jar</exclude>
                           </excludes>
                         </source>
                       </sources>
@@ -241,7 +242,7 @@
                         <group>root</group>
                       </mapper>
                       <excludes>
-                        classes/log4j.xml,classes/logsearch.properties,classes/user_pass.json,classes/HadoopServiceConfig.json,solr_configsets/**
+                        classes/log4j.xml,classes/logsearch.properties,classes/user_pass.json,classes/HadoopServiceConfig.json,solr_configsets/**,libs/checkstyle*.jar
                       </excludes>
                     </data>
                     <data>
@@ -267,6 +268,7 @@
                         <user>root</user>
                         <group>root</group>
                       </mapper>
+                      <excludes>libs/checkstyle*.jar</excludes>
                     </data>
                   </dataSet>
                 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/499fec3c/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
index 091f957..b1b6ece 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
@@ -163,6 +163,10 @@
           <groupId>org.apache.curator</groupId>
           <artifactId>curator-recipes</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>jdk.tools</groupId>
+          <artifactId>jdk.tools</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/ambari/blob/499fec3c/ambari-logsearch/ambari-logsearch-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-server/pom.xml b/ambari-logsearch/ambari-logsearch-server/pom.xml
index e90c58d..2ad35f5 100755
--- a/ambari-logsearch/ambari-logsearch-server/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-server/pom.xml
@@ -380,6 +380,10 @@
           <artifactId>guava</artifactId>
           <groupId>com.google.guava</groupId>
         </exclusion>
+        <exclusion>
+          <groupId>jdk.tools</groupId>
+          <artifactId>jdk.tools</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/ambari/blob/499fec3c/ambari-metrics/ambari-metrics-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-assembly/pom.xml b/ambari-metrics/ambari-metrics-assembly/pom.xml
index d9875ce..9925947 100644
--- a/ambari-metrics/ambari-metrics-assembly/pom.xml
+++ b/ambari-metrics/ambari-metrics-assembly/pom.xml
@@ -245,6 +245,7 @@
                           <excludes>
                             <exclude>*tests.jar</exclude>
                             <exclude>findbugs*.jar</exclude>
+                            <exclude>jdk.tools*.jar</exclude>
                           </excludes>
                         </source>
                         <source>
@@ -265,6 +266,7 @@
                             <exclude>bin/*</exclude>
                             <exclude>lib/*tests.jar</exclude>
                             <exclude>lib/findbugs*.jar</exclude>
+                            <exclude>lib/jdk.tools*.jar</exclude>
                           </excludes>
                         </source>
                       </sources>

http://git-wip-us.apache.org/repos/asf/ambari/blob/499fec3c/ambari-metrics/ambari-metrics-common/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-common/pom.xml b/ambari-metrics/ambari-metrics-common/pom.xml
index cae9734..aa16ba9 100644
--- a/ambari-metrics/ambari-metrics-common/pom.xml
+++ b/ambari-metrics/ambari-metrics-common/pom.xml
@@ -155,6 +155,12 @@
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-annotations</artifactId>
       <version>2.6.0</version>
+      <exclusions>
+        <exclusion>
+          <groupId>jdk.tools</groupId>
+          <artifactId>jdk.tools</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.codehaus.jackson</groupId>

http://git-wip-us.apache.org/repos/asf/ambari/blob/499fec3c/ambari-metrics/ambari-metrics-timelineservice/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
index a5eb572..ca72bc7 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/pom.xml
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -326,6 +326,10 @@
           <groupId>org.apache.hadoop</groupId>
           <artifactId>hadoop-annotations</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>net.sourceforge.findbugs</groupId>
+          <artifactId>annotations</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
 
@@ -377,6 +381,12 @@
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-annotations</artifactId>
       <version>${hadoop.version}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>jdk.tools</groupId>
+          <artifactId>jdk.tools</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.mockito</groupId>

http://git-wip-us.apache.org/repos/asf/ambari/blob/499fec3c/ambari-utility/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-utility/pom.xml b/ambari-utility/pom.xml
index 1e86d40..4a32872 100644
--- a/ambari-utility/pom.xml
+++ b/ambari-utility/pom.xml
@@ -55,6 +55,12 @@
     <dependency>
       <groupId>com.puppycrawl.tools</groupId>
       <artifactId>checkstyle</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>com.sun</groupId>
+          <artifactId>tools</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>com.puppycrawl.tools</groupId>


[05/15] ambari git commit: AMBARI-22203. ZKFC start failed due to hadoop-hdfs-zkfc is not supported (partial revert) (ncole)

Posted by rl...@apache.org.
AMBARI-22203. ZKFC start failed due to hadoop-hdfs-zkfc is not supported (partial revert) (ncole)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 8c017c1fdebdbd0261749df0434dc86744dcf986
Parents: 3290677
Author: Nate Cole <nc...@hortonworks.com>
Authored: Sat Oct 14 14:53:14 2017 -0400
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Sat Oct 14 14:53:14 2017 -0400

----------------------------------------------------------------------
 .../main/resources/stacks/HDP/2.0.6/properties/stack_packages.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8c017c1f/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
index c217ea8..b8655d7 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/properties/stack_packages.json
@@ -368,7 +368,7 @@
             "hadoop-hdfs-zkfc"
           ],
           "STANDARD": [
-            "hadoop-client"
+            "hadoop-hdfs-zkfc"
           ]
         }
       },


[08/15] ambari git commit: AMBARI-22232 : Need to add a new property to support proxy users for Atlas service. (Vishal Suvagia via mugdha)

Posted by rl...@apache.org.
AMBARI-22232 : Need to add a new property to support proxy users for Atlas service. (Vishal Suvagia via mugdha)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: df1081378e51c309589540673e140faaf9329ee4
Parents: 499fec3
Author: Vishal Suvagia <vi...@yahoo.com>
Authored: Sat Oct 14 16:22:31 2017 +0530
Committer: Mugdha Varadkar <mu...@apache.org>
Committed: Mon Oct 16 11:15:23 2017 +0530

----------------------------------------------------------------------
 .../AtlasProxyUserConfigCalculation.java        |  48 +++++++++
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml |   4 +
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml     |   3 +
 .../configuration/application-properties.xml    |  15 +++
 .../stacks/HDP/2.6/services/stack_advisor.py    |   7 ++
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |   4 +
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml     |   3 +
 .../AtlasProxyUserConfigCalculationTest.java    | 108 +++++++++++++++++++
 .../stacks/2.6/common/test_stack_advisor.py     |   3 +-
 9 files changed, 194 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
new file mode 100644
index 0000000..85fb200
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
@@ -0,0 +1,48 @@
+package org.apache.ambari.server.serveraction.upgrades;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.actionmanager.HostRoleStatus;
+import org.apache.ambari.server.agent.CommandReport;
+import org.apache.ambari.server.serveraction.AbstractServerAction;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+
+import javax.inject.Inject;
+import java.text.MessageFormat;
+import java.util.Map;
+import java.util.concurrent.ConcurrentMap;
+
+public class AtlasProxyUserConfigCalculation extends AbstractUpgradeServerAction {
+
+  private static final String ATLAS_APPLICATION_PROPERTIES_CONFIG_TYPE = "application-properties";
+  private static final String KNOX_ENV_CONFIG_TYPE = "knox-env";
+  private static final String KNOX_USER_CONFIG = "knox_user";
+
+  @Override
+  public CommandReport execute(ConcurrentMap<String, Object> requestSharedDataContext) throws AmbariException, InterruptedException {
+    String clusterName = getExecutionCommand().getClusterName();
+    Cluster cluster = getClusters().getCluster(clusterName);
+    String outputMessage = "";
+
+    Config atlasApplicationProperties = cluster.getDesiredConfigByType(ATLAS_APPLICATION_PROPERTIES_CONFIG_TYPE);
+    if (null == atlasApplicationProperties) {
+      return createCommandReport(0, HostRoleStatus.COMPLETED, "{}",
+        MessageFormat.format("Config type {0} not found, skipping updating property in same.", ATLAS_APPLICATION_PROPERTIES_CONFIG_TYPE), "");
+    }
+
+    Config knoxEnvConfig = cluster.getDesiredConfigByType(KNOX_ENV_CONFIG_TYPE);
+    String atlasProxyUsers = "knox";
+    if (null != knoxEnvConfig && knoxEnvConfig.getProperties().containsKey(KNOX_USER_CONFIG)) {
+      atlasProxyUsers = knoxEnvConfig.getProperties().get(KNOX_USER_CONFIG);
+    }
+
+    Map<String, String> currentAtlasApplicationProperties = atlasApplicationProperties.getProperties();
+    currentAtlasApplicationProperties.put("atlas.proxyusers", atlasProxyUsers);
+    atlasApplicationProperties.setProperties(currentAtlasApplicationProperties);
+    atlasApplicationProperties.save();
+
+    outputMessage = outputMessage + MessageFormat.format("Successfully updated {0} config type.\n", ATLAS_APPLICATION_PROPERTIES_CONFIG_TYPE);
+    return createCommandReport(0, HostRoleStatus.COMPLETED, "{}", outputMessage, "");
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
index 1af3b18..cd69a9c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
@@ -488,6 +488,10 @@
         <task xsi:type="configure" id="atlas_log4j_update_logger_settings"/>
       </execute-stage>
 
+      <execute-stage service="ATLAS" component="ATLAS_SERVER" title="Applying Atlas proxy-user configurations.">
+        <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.AtlasProxyUserConfigCalculation"/>
+      </execute-stage>
+
       <!--KAFKA-->
       <execute-stage service="KAFKA" component="KAFKA_BROKER" title="Parameterizing Kafka Log4J Properties">
         <task xsi:type="configure" id="kafka_log4j_parameterize">

http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
index 0a01a04..a6d3f29 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
@@ -1123,6 +1123,9 @@
           <task xsi:type="configure" id="atlas_env_gc_worker"/>
           <task xsi:type="configure" id="hdp_2_6_atlas_kafka_auto_commit_enable_property_delete"/>
           <task xsi:type="configure" id="atlas_log4j_update_logger_settings"/>
+          <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.AtlasProxyUserConfigCalculation" >
+            <summary>Applying Atlas proxy-user configurations.</summary>
+          </task>
         </pre-upgrade>
         <pre-downgrade />
         <upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/application-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/application-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/application-properties.xml
index c271dc3..523cb21 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/application-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/application-properties.xml
@@ -109,4 +109,19 @@
     <deleted>true</deleted>
     <on-ambari-upgrade add="false"/>
   </property>
+  <property>
+    <name>atlas.proxyusers</name>
+    <value/>
+    <description>Proxy users for Atlas</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <depends-on>
+      <property>
+        <type>knox-env</type>
+        <name>knox_user</name>
+      </property>
+    </depends-on>
+    <on-ambari-upgrade add="false"/>
+  </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
index 94f28db..fc12d37 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/stack_advisor.py
@@ -83,6 +83,13 @@ class HDP26StackAdvisor(HDP25StackAdvisor):
         knox_port = services['configurations']["gateway-site"]["properties"]['gateway.port']
       putAtlasApplicationProperty('atlas.sso.knox.providerurl', 'https://{0}:{1}/gateway/knoxsso/api/v1/websso'.format(knox_host, knox_port))
 
+    knox_service_user = ''
+    if 'KNOX' in servicesList and 'knox-env' in services['configurations']:
+      knox_service_user = services['configurations']['knox-env']['properties']['knox_user']
+    else:
+      knox_service_user = 'knox'
+    putAtlasApplicationProperty('atlas.proxyusers',knox_service_user)
+
   def recommendDruidConfigurations(self, configurations, clusterData, services, hosts):
 
       # druid is not in list of services to be installed

http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
index ebb81d9..832c505 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml
@@ -376,6 +376,10 @@
         <task xsi:type="configure" id="atlas_hbase_conf_dir"/>
       </execute-stage>
 
+      <execute-stage service="ATLAS" component="ATLAS_SERVER" title="Applying Atlas proxy-user configurations.">
+        <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.AtlasProxyUserConfigCalculation"/>
+      </execute-stage>
+
       <!-- KMS -->
       <execute-stage service="RANGER_KMS" component="RANGER_KMS_SERVER" title="Apply config changes for Ranger Kms plugin">
         <task xsi:type="configure" id="hdp_2_6_maint_ranger_kms_plugin_cluster_name"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
index ae5972e..d0e11a1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml
@@ -1050,6 +1050,9 @@
           <task xsi:type="configure" id="hdp_2_6_atlas_kafka_auto_commit_enable_property_delete"/>
           <task xsi:type="configure" id="atlas_log4j_update_logger_settings"/>
           <task xsi:type="configure" id="atlas_hbase_conf_dir"/>
+          <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.AtlasProxyUserConfigCalculation" >
+            <summary>Applying Atlas proxy-user configurations.</summary>
+          </task>
         </pre-upgrade>
         <pre-downgrade/> <!--  no-op to prevent config changes on downgrade -->
         <upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
new file mode 100644
index 0000000..3f8bca9
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
@@ -0,0 +1,108 @@
+package org.apache.ambari.server.serveraction.upgrades;
+
+import com.google.inject.Injector;
+import org.apache.ambari.server.actionmanager.ExecutionCommandWrapper;
+import org.apache.ambari.server.actionmanager.HostRoleCommand;
+import org.apache.ambari.server.agent.CommandReport;
+import org.apache.ambari.server.agent.ExecutionCommand;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.easymock.EasyMock;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.easymock.EasyMock.*;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+public class AtlasProxyUserConfigCalculationTest {
+
+  private Injector m_injector;
+  private Clusters m_clusters;
+  private Field m_clusterField;
+
+  @Before
+  public void setup() throws Exception {
+    m_injector = createMock(Injector.class);
+    m_clusters = createMock(Clusters.class);
+    Cluster cluster = createMock(Cluster.class);
+
+    Map<String, String> mockKnoxEnvProperties = new HashMap<String, String>() {
+      {
+        put("knox_user", "knox_cstm");
+      }
+    };
+
+    Map<String, String> mockAtlasApplicationProperties = new HashMap<String, String>();
+
+    Config knoxEnvConfig = createMock(Config.class);
+    expect(knoxEnvConfig.getType()).andReturn("knox-env").anyTimes();
+    expect(knoxEnvConfig.getProperties()).andReturn(mockKnoxEnvProperties).anyTimes();
+
+
+    Config atlasApplicationPropertiesConfig = createMock(Config.class);
+    expect(atlasApplicationPropertiesConfig.getType()).andReturn("application-properties").anyTimes();
+    expect(atlasApplicationPropertiesConfig.getProperties()).andReturn(mockAtlasApplicationProperties).anyTimes();
+
+
+    atlasApplicationPropertiesConfig.setProperties(anyObject(Map.class));
+    expectLastCall().atLeastOnce();
+
+    atlasApplicationPropertiesConfig.save();
+    expectLastCall().atLeastOnce();
+
+    expect(cluster.getDesiredConfigByType("knox-env")).andReturn(knoxEnvConfig).atLeastOnce();
+    expect(cluster.getDesiredConfigByType("application-properties")).andReturn(atlasApplicationPropertiesConfig).atLeastOnce();
+    expect(m_clusters.getCluster((String) anyObject())).andReturn(cluster).anyTimes();
+    expect(m_injector.getInstance(Clusters.class)).andReturn(m_clusters).atLeastOnce();
+
+    replay(m_injector, m_clusters, cluster, knoxEnvConfig, atlasApplicationPropertiesConfig);
+
+    m_clusterField = AbstractUpgradeServerAction.class.getDeclaredField("m_clusters");
+    m_clusterField.setAccessible(true);
+
+  }
+
+  @Test
+  public void testAction() throws Exception {
+
+    Map<String, String> commandParams = new HashMap<String, String>();
+    commandParams.put("clusterName", "cl1");
+
+    ExecutionCommand executionCommand = new ExecutionCommand();
+    executionCommand.setCommandParams(commandParams);
+    executionCommand.setClusterName("cl1");
+
+    HostRoleCommand hrc = createMock(HostRoleCommand.class);
+    expect(hrc.getRequestId()).andReturn(1L).anyTimes();
+    expect(hrc.getStageId()).andReturn(2L).anyTimes();
+    expect(hrc.getExecutionCommandWrapper()).andReturn(new ExecutionCommandWrapper(executionCommand)).anyTimes();
+    replay(hrc);
+
+    AtlasProxyUserConfigCalculation action = new AtlasProxyUserConfigCalculation();
+    m_clusterField.set(action, m_clusters);
+    action.setExecutionCommand(executionCommand);
+    action.setHostRoleCommand(hrc);
+
+    CommandReport report = action.execute(null);
+    Assert.assertNotNull(report);
+
+    Cluster cl = m_clusters.getCluster("cl1");
+    Config config = cl.getDesiredConfigByType("application-properties");
+    Map<String, String> map = config.getProperties();
+
+    Assert.assertTrue(map.containsKey("atlas.proxyusers"));
+    Assert.assertEquals("knox_cstm", map.get("atlas.proxyusers"));
+
+    report = action.execute(null);
+    Assert.assertNotNull(report);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/df108137/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py
index ade08c1..f4c5508 100644
--- a/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.6/common/test_stack_advisor.py
@@ -1303,7 +1303,8 @@ class TestHDP26StackAdvisor(TestCase):
           "atlas.graph.storage.hostname": "",
           "atlas.kafka.bootstrap.servers": "",
           "atlas.kafka.zookeeper.connect": "",
-          "atlas.authorizer.impl": "simple"
+          "atlas.authorizer.impl": "simple",
+          'atlas.proxyusers': 'knox'
         }
       },
       "infra-solr-env": {


[14/15] ambari git commit: AMBARI-22232 - Need to add a new property to support proxy users property for Atlas service (Vishal Suvagia via jonathanhurley)

Posted by rl...@apache.org.
AMBARI-22232  - Need to add a new property to support proxy users property for Atlas service (Vishal Suvagia via jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 523f505dca99d1a8b9dd07ffabc1bad110910566
Parents: 5f86f15
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Mon Oct 16 12:56:57 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Oct 16 12:58:02 2017 -0400

----------------------------------------------------------------------
 .../AtlasProxyUserConfigCalculation.java        | 11 ++++------
 .../AtlasProxyUserConfigCalculationTest.java    | 22 +++++++++++---------
 2 files changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/523f505d/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
index 40d64b5..1a99299 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
@@ -17,19 +17,16 @@
  */
 package org.apache.ambari.server.serveraction.upgrades;
 
+import java.text.MessageFormat;
+import java.util.Map;
+import java.util.concurrent.ConcurrentMap;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.agent.CommandReport;
-import org.apache.ambari.server.serveraction.AbstractServerAction;
 import org.apache.ambari.server.state.Cluster;
-import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.Config;
 
-import javax.inject.Inject;
-import java.text.MessageFormat;
-import java.util.Map;
-import java.util.concurrent.ConcurrentMap;
-
 public class AtlasProxyUserConfigCalculation extends AbstractUpgradeServerAction {
 
   private static final String ATLAS_APPLICATION_PROPERTIES_CONFIG_TYPE = "application-properties";

http://git-wip-us.apache.org/repos/asf/ambari/blob/523f505d/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
index 33ec7f3..7cb6255 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
@@ -17,7 +17,16 @@
  */
 package org.apache.ambari.server.serveraction.upgrades;
 
-import com.google.inject.Injector;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.ambari.server.actionmanager.ExecutionCommandWrapper;
 import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.agent.CommandReport;
@@ -25,20 +34,13 @@ import org.apache.ambari.server.agent.ExecutionCommand;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.Config;
-import org.easymock.EasyMock;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
 
-import static org.easymock.EasyMock.*;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+
+import com.google.inject.Injector;
 
 public class AtlasProxyUserConfigCalculationTest {
 


[13/15] ambari git commit: AMBARI-22220 - Should be able to switch the extension version to which a stack version is linked

Posted by rl...@apache.org.
AMBARI-22220 - Should be able to switch the extension version to which a stack version is linked


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 5f86f159fae5f65b25ef77b5c9eb9cb7d1179834
Parents: 0317cf7
Author: Tim Thorpe <tt...@apache.org>
Authored: Mon Oct 16 06:16:35 2017 -0700
Committer: Tim Thorpe <tt...@apache.org>
Committed: Mon Oct 16 06:16:35 2017 -0700

----------------------------------------------------------------------
 .../controller/AmbariManagementController.java  |   6 +-
 .../AmbariManagementControllerImpl.java         |  50 ++++----
 .../controller/AmbariManagementHelper.java      |  26 ++++
 .../internal/ExtensionLinkResourceProvider.java |  15 +++
 .../ambari/server/stack/ExtensionHelper.java    |  31 ++++-
 .../server/stack/StackManagerExtensionTest.java |  22 +++-
 .../resources/extensions/EXT/0.2/metainfo.xml   |   4 +-
 .../resources/extensions/EXT/0.4/metainfo.xml   |  32 +++++
 .../EXT/0.4/services/OOZIE2/metainfo.xml        | 118 +++++++++++++++++++
 .../services/OOZIE2/themes/broken_theme.json    |   3 +
 10 files changed, 273 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
index f0f13e1..45f9b3a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
@@ -369,18 +369,18 @@ public interface AmbariManagementController {
   void createExtensionLink(ExtensionLinkRequest request) throws AmbariException;
 
   /**
-   * Update a link between an extension and a stack
+   * Update a link - switch the link's extension version while keeping the same stack version and extension name
    *
    * @throws AmbariException if we fail to link the extension to the stack
    */
   void updateExtensionLink(ExtensionLinkRequest request) throws AmbariException;
 
   /**
-   * Update a link between an extension and a stack
+   * Update a link - switch the link's extension version while keeping the same stack version and extension name
    *
    * @throws AmbariException if we fail to link the extension to the stack
    */
-  void updateExtensionLink(ExtensionLinkEntity linkEntity) throws AmbariException;
+  void updateExtensionLink(ExtensionLinkEntity oldLinkEntity, ExtensionLinkRequest newLinkRequest) throws AmbariException;
 
   /**
    * Delete a link between an extension and a stack

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index b0eb8ac..1b1f524 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
@@ -1126,7 +1126,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     try {
       cluster = clusters.getCluster(request.getClusterName());
     } catch (ClusterNotFoundException e) {
-      LOG.info(e.getMessage());
+      LOG.error("Cluster not found ", e);
       throw new ParentObjectNotFoundException("Parent Cluster resource doesn't exist", e);
     }
 
@@ -4795,9 +4795,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
       properties = ambariMetaInfo.getServiceProperties(stackName, stackVersion, serviceName);
     }
     for (PropertyInfo property: properties) {
-      if (property.shouldBeConfigured()) {
-        response.add(property.convertToResponse());
-      }
+      response.add(property.convertToResponse());
     }
 
     return response;
@@ -5622,12 +5620,9 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
   }
 
   /**
-   * This method will update a link between an extension version and a stack version (Extension Link).
-   * Updating will only force ambari server to reread the stack and extension directories.
+   * Update a link - switch the link's extension version while keeping the same stack version and extension name
    *
-   * An extension version is like a stack version but it contains custom services.  Linking an extension
-   * version to the current stack version allows the cluster to install the custom services contained in
-   * the extension version.
+   * @throws AmbariException if we fail to link the extension to the stack
    */
   @Override
   public void updateExtensionLink(ExtensionLinkRequest request) throws AmbariException {
@@ -5641,32 +5636,43 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
       throw new AmbariException("Unable to find extension link"
             + ", linkId=" + request.getLinkId(), e);
     }
-    updateExtensionLink(linkEntity);
+    updateExtensionLink(linkEntity, request);
   }
 
   /**
-   * This method will update a link between an extension version and a stack version (Extension Link).
-   * Updating will only force ambari server to reread the stack and extension directories.
+   * Update a link - switch the link's extension version while keeping the same stack version and extension name
    *
-   * An extension version is like a stack version but it contains custom services.  Linking an extension
-   * version to the current stack version allows the cluster to install the custom services contained in
-   * the extension version.
+   * @throws AmbariException if we fail to link the extension to the stack
    */
   @Override
-  public void updateExtensionLink(ExtensionLinkEntity linkEntity) throws AmbariException {
-    StackInfo stackInfo = ambariMetaInfo.getStack(linkEntity.getStack().getStackName(), linkEntity.getStack().getStackVersion());
+  public void updateExtensionLink(ExtensionLinkEntity oldLinkEntity, ExtensionLinkRequest newLinkRequest) throws AmbariException {
+    StackInfo stackInfo = ambariMetaInfo.getStack(oldLinkEntity.getStack().getStackName(), oldLinkEntity.getStack().getStackVersion());
 
     if (stackInfo == null) {
-      throw new StackAccessException("stackName=" + linkEntity.getStack().getStackName() + ", stackVersion=" + linkEntity.getStack().getStackVersion());
+      throw new StackAccessException(String.format("stackName=%s, stackVersion=%s", oldLinkEntity.getStack().getStackName(), oldLinkEntity.getStack().getStackVersion()));
     }
 
-    ExtensionInfo extensionInfo = ambariMetaInfo.getExtension(linkEntity.getExtension().getExtensionName(), linkEntity.getExtension().getExtensionVersion());
+    if (newLinkRequest.getExtensionName() == null || newLinkRequest.getExtensionVersion() == null) {
+      throw new AmbariException(String.format("Invalid extension name or version: %s/%s",
+		  newLinkRequest.getExtensionName(), newLinkRequest.getExtensionVersion()));
+    }
 
-    if (extensionInfo == null) {
-      throw new StackAccessException("extensionName=" + linkEntity.getExtension().getExtensionName() + ", extensionVersion=" + linkEntity.getExtension().getExtensionVersion());
+    if (!newLinkRequest.getExtensionName().equals(oldLinkEntity.getExtension().getExtensionName())) {
+      throw new AmbariException(String.format("Update is not allowed to switch the extension name, only the version.  Old name/new name: %s/%s",
+		  oldLinkEntity.getExtension().getExtensionName(), newLinkRequest.getExtensionName()));
+    }
+
+    ExtensionInfo oldExtensionInfo = ambariMetaInfo.getExtension(oldLinkEntity.getExtension().getExtensionName(), oldLinkEntity.getExtension().getExtensionVersion());
+    ExtensionInfo newExtensionInfo = ambariMetaInfo.getExtension(newLinkRequest.getExtensionName(), newLinkRequest.getExtensionVersion());
+
+    if (oldExtensionInfo == null) {
+      throw new StackAccessException(String.format("Old extensionName=%s, extensionVersion=%s", oldLinkEntity.getExtension().getExtensionName(), oldLinkEntity.getExtension().getExtensionVersion()));
+    }
+    if (newExtensionInfo == null) {
+      throw new StackAccessException(String.format("New extensionName=%s, extensionVersion=%s", newLinkRequest.getExtensionName(), newLinkRequest.getExtensionVersion()));
     }
 
-    ambariMetaInfo.getStackManager().linkStackToExtension(stackInfo, extensionInfo);
+    helper.updateExtensionLink(ambariMetaInfo.getStackManager(), oldLinkEntity, stackInfo, oldExtensionInfo, newExtensionInfo);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementHelper.java
index 0c8edfe..e98c2e9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementHelper.java
@@ -162,6 +162,32 @@ public class AmbariManagementHelper {
     }
   }
 
+  /**
+   * Updates the extension version of the currently linked extension to the stack version
+   */
+  public void updateExtensionLink(StackManager stackManager, ExtensionLinkEntity linkEntity, StackInfo stackInfo,
+                                  ExtensionInfo oldExtensionInfo, ExtensionInfo newExtensionInfo) throws AmbariException {
+    //validateUpdateExtensionLinkRequest(stackInfo, extensionInfo);
+    ExtensionHelper.validateUpdateLink(stackManager, stackInfo, oldExtensionInfo, newExtensionInfo);
+
+    ExtensionEntity extension = extensionDAO.find(newExtensionInfo.getName(), newExtensionInfo.getVersion());
+    linkEntity.setExtension(extension);
+
+    try {
+      linkEntity = linkDAO.merge(linkEntity);
+    } catch (RollbackException e) {
+      String message = "Unable to update extension link";
+      LOG.debug(message, e);
+      String errorMessage = message
+              + ", stackName=" + stackInfo.getName()
+              + ", stackVersion=" + stackInfo.getVersion()
+              + ", extensionName=" + newExtensionInfo.getName()
+              + ", extensionVersion=" + newExtensionInfo.getVersion();
+      LOG.warn(errorMessage);
+      throw new AmbariException(errorMessage, e);
+    }
+  }
+
   private ExtensionLinkEntity createExtensionLinkEntity(StackInfo stackInfo, ExtensionInfo extensionInfo) throws AmbariException {
     StackEntity stack = stackDAO.find(stackInfo.getName(), stackInfo.getVersion());
     ExtensionEntity extension = extensionDAO.find(extensionInfo.getName(), extensionInfo.getVersion());

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java
index 9b894ff..db904bf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ExtensionLinkResourceProvider.java
@@ -196,6 +196,21 @@ public class ExtensionLinkResourceProvider extends AbstractControllerResourcePro
         throws SystemException, UnsupportedPropertyException,
         NoSuchResourceException, NoSuchParentResourceException {
 
+    final Set<ExtensionLinkRequest> requests = new HashSet<>();
+    for (Map<String, Object> propertyMap : request.getProperties()) {
+      requests.add(getRequest(propertyMap));
+    }
+
+    RequestStatusResponse response = modifyResources(new Command<RequestStatusResponse>() {
+      @Override
+      public RequestStatusResponse invoke() throws AmbariException {
+        for (ExtensionLinkRequest extensionLinkRequest : requests) {
+          getManagementController().updateExtensionLink(extensionLinkRequest);
+        }
+        return null;
+      }
+    });
+
     //Need to reread the stacks/extensions directories so the latest information is available
     try {
       getManagementController().updateStacks();

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionHelper.java
index 91dc870..3a143f4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionHelper.java
@@ -18,6 +18,9 @@
 
 package org.apache.ambari.server.stack;
 
+import java.util.ArrayList;
+import java.util.Collection;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ServiceNotFoundException;
 import org.apache.ambari.server.state.Cluster;
@@ -72,6 +75,12 @@ public class ExtensionHelper {
     validateRequiredExtensions(stack, extension);
   }
 
+  public static void validateUpdateLink(StackManager stackManager, StackInfo stack, ExtensionInfo oldExtension, ExtensionInfo newExtension) throws AmbariException {
+    validateSupportedStackVersion(stack, newExtension);
+    validateServiceDuplication(stackManager, stack, oldExtension, newExtension);
+    validateRequiredExtensions(stack, newExtension);
+  }
+
   private static void validateSupportedStackVersion(StackInfo stack, ExtensionInfo extension) throws AmbariException {
     for (ExtensionMetainfoXml.Stack validStack : extension.getStacks()) {
       if (validStack.getName().equals(stack.getName())) {
@@ -93,8 +102,28 @@ public class ExtensionHelper {
   }
 
   private static void validateServiceDuplication(StackManager stackManager, StackInfo stack, ExtensionInfo extension) throws AmbariException {
+    validateServiceDuplication(stackManager, stack, extension, extension.getServices());
+  }
+
+  private static void validateServiceDuplication(StackManager stackManager, StackInfo stack, ExtensionInfo oldExtension, ExtensionInfo newExtension) throws AmbariException {
+    ArrayList<ServiceInfo> services = new ArrayList<>(newExtension.getServices().size());
+    for (ServiceInfo service : newExtension.getServices()) {
+      boolean found = false;
+      for (ServiceInfo current : oldExtension.getServices()) {
+        if (service.getName().equals(current.getName())) {
+          found = true;
+        }
+      }
+      if (!found) {
+        services.add(service);
+      }
+    }
+    validateServiceDuplication(stackManager, stack, newExtension, services);
+  }
+
+  private static void validateServiceDuplication(StackManager stackManager, StackInfo stack, ExtensionInfo extension, Collection<ServiceInfo> services) throws AmbariException {
     LOG.debug("Looking for duplicate services");
-    for (ServiceInfo service : extension.getServices()) {
+    for (ServiceInfo service : services) {
       LOG.debug("Looking for duplicate service " + service.getName());
       if (service != null) {
         ServiceInfo stackService = null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerExtensionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerExtensionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerExtensionTest.java
index cef30b5..6617b33 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerExtensionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerExtensionTest.java
@@ -81,6 +81,9 @@ public class StackManagerExtensionTest  {
     ExtensionEntity extension3 = new ExtensionEntity();
     extension3.setExtensionName("EXT");
     extension3.setExtensionVersion("0.3");
+    ExtensionEntity extension4 = new ExtensionEntity();
+    extension4.setExtensionName("EXT");
+    extension4.setExtensionVersion("0.4");
     ExtensionLinkEntity link1 = new ExtensionLinkEntity();
     link1.setLinkId(new Long(-1));
     link1.setStack(stack1);
@@ -96,6 +99,7 @@ public class StackManagerExtensionTest  {
     expect(extensionDao.find("EXT", "0.1")).andReturn(extension1).atLeastOnce();
     expect(extensionDao.find("EXT", "0.2")).andReturn(extension2).atLeastOnce();
     expect(extensionDao.find("EXT", "0.3")).andReturn(extension3).atLeastOnce();
+    expect(extensionDao.find("EXT", "0.4")).andReturn(extension4).atLeastOnce();
 
     expect(linkDao.findByStack("HDP", "0.1")).andReturn(linkList).atLeastOnce();
     expect(linkDao.findByStack(EasyMock.anyObject(String.class),
@@ -104,6 +108,8 @@ public class StackManagerExtensionTest  {
     expect(linkDao.findByStackAndExtension("HDP", "0.2", "EXT", "0.2")).andReturn(null).atLeastOnce();
     expect(linkDao.findByStackAndExtension("HDP", "0.1", "EXT", "0.1")).andReturn(link1).atLeastOnce();
 
+    expect(linkDao.merge(link1)).andReturn(link1).atLeastOnce();
+
     replay(actionMetadata, stackDao, metaInfoDao, osFamily, extensionDao, linkDao); //linkEntity
 
     String stacks = ClassLoader.getSystemClassLoader().getResource("stacks_with_extensions").getPath();
@@ -144,7 +150,7 @@ public class StackManagerExtensionTest  {
     assertNotNull("EXT 0.2's parent: " + extension.getParentExtensionVersion(), extension.getParentExtensionVersion());
     assertEquals("EXT 0.2's parent: " + extension.getParentExtensionVersion(), "0.1", extension.getParentExtensionVersion());
     assertNotNull(extension.getService("OOZIE2"));
-    assertTrue("Extension is not set to auto link", extension.isAutoLink());
+    assertTrue("Extension is set to auto link", !extension.isAutoLink());
     oozie = extension.getService("OOZIE2");
     assertNotNull("Package dir is " + oozie.getServicePackageFolder(), oozie.getServicePackageFolder());
     assertTrue("Package dir is " + oozie.getServicePackageFolder(), oozie.getServicePackageFolder().contains("extensions/EXT/0.1/services/OOZIE2/package"));
@@ -156,18 +162,24 @@ public class StackManagerExtensionTest  {
     assertNotNull(themes);
     assertTrue("Number of themes is " + themes.size(), themes.size() == 0);
 
+    extension = stackManager.getExtension("EXT", "0.3");
+    assertTrue("Extension is not set to auto link", extension.isAutoLink());
+
     StackInfo stack = stackManager.getStack("HDP", "0.1");
     assertNotNull(stack.getService("OOZIE2"));
     oozie = stack.getService("OOZIE2");
     assertNotNull("Package dir is " + oozie.getServicePackageFolder(), oozie.getServicePackageFolder());
     assertTrue("Package dir is " + oozie.getServicePackageFolder(), oozie.getServicePackageFolder().contains("extensions/EXT/0.1/services/OOZIE2/package"));
     assertEquals(oozie.getVersion(), "3.2.0");
-
     assertTrue("Extensions found: " + stack.getExtensions().size(), stack.getExtensions().size() == 1);
     extension = stack.getExtensions().iterator().next();
     assertEquals("Extension name: " + extension.getName(), extension.getName(), "EXT");
     assertEquals("Extension version: " + extension.getVersion(), extension.getVersion(), "0.1");
 
+    ExtensionInfo extensionInfo2 = stackManager.getExtension("EXT", "0.2");
+    helper.updateExtensionLink(stackManager, link1, stack, extension, extensionInfo2);
+    assertEquals(link1.getExtension().getExtensionVersion(), link1.getExtension().getExtensionVersion(), "0.2");
+
     stack = stackManager.getStack("HDP", "0.2");
     assertTrue("Extensions found: " + stack.getExtensions().size(), stack.getExtensions().size() == 0);
 
@@ -177,15 +189,13 @@ public class StackManagerExtensionTest  {
     assertNotNull(extension.getService("OOZIE2"));
     oozie = extension.getService("OOZIE2");
     assertEquals(oozie.getVersion(), "4.0.0");
-
     assertEquals("Extension name: " + extension.getName(), extension.getName(), "EXT");
-    assertEquals("Extension version: " + extension.getVersion(), extension.getVersion(), "0.3");
+    assertEquals("Extension version: " + extension.getVersion(), extension.getVersion(), "0.4");
 
     stack = stackManager.getStack("HDP", "0.4");
     assertTrue("Extensions found: " + stack.getExtensions().size(), stack.getExtensions().size() == 1);
     extension = stack.getExtensions().iterator().next();
     assertEquals("Extension name: " + extension.getName(), extension.getName(), "EXT");
-    assertEquals("Extension version: " + extension.getVersion(), extension.getVersion(), "0.3");
+    assertEquals("Extension version: " + extension.getVersion(), extension.getVersion(), "0.4");
   }
-
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/test/resources/extensions/EXT/0.2/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/extensions/EXT/0.2/metainfo.xml b/ambari-server/src/test/resources/extensions/EXT/0.2/metainfo.xml
index c95a20f..fa84c53 100644
--- a/ambari-server/src/test/resources/extensions/EXT/0.2/metainfo.xml
+++ b/ambari-server/src/test/resources/extensions/EXT/0.2/metainfo.xml
@@ -20,12 +20,12 @@
     <active>true</active>
   </versions>
   <extends>0.1</extends>
-  <auto-link>true</auto-link>
+  <auto-link>false</auto-link>
   <prerequisites>
     <min-stack-versions>
       <stack>
         <name>HDP</name>
-        <version>0.3</version>
+        <version>0.1</version>
       </stack>
     </min-stack-versions>
   </prerequisites>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/test/resources/extensions/EXT/0.4/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/extensions/EXT/0.4/metainfo.xml b/ambari-server/src/test/resources/extensions/EXT/0.4/metainfo.xml
new file mode 100644
index 0000000..0e74813
--- /dev/null
+++ b/ambari-server/src/test/resources/extensions/EXT/0.4/metainfo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.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.
+-->
+<metainfo>
+  <versions>
+    <active>true</active>
+  </versions>
+  <extends>0.3</extends>
+  <auto-link>true</auto-link>
+  <prerequisites>
+    <min-stack-versions>
+      <stack>
+        <name>HDP</name>
+        <version>0.3</version>
+      </stack>
+    </min-stack-versions>
+  </prerequisites>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/test/resources/extensions/EXT/0.4/services/OOZIE2/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/extensions/EXT/0.4/services/OOZIE2/metainfo.xml b/ambari-server/src/test/resources/extensions/EXT/0.4/services/OOZIE2/metainfo.xml
new file mode 100644
index 0000000..9176551
--- /dev/null
+++ b/ambari-server/src/test/resources/extensions/EXT/0.4/services/OOZIE2/metainfo.xml
@@ -0,0 +1,118 @@
+<?xml version="1.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.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>OOZIE2</name>
+      <comment>System for workflow coordination and execution of Apache Hadoop jobs</comment>
+      <version>4.0.0</version>
+
+      <components>
+        <component>
+          <name>OOZIE2_SERVER</name>
+          <category>MASTER</category>
+          <cardinality>1</cardinality>
+          <dependencies>
+            <dependency>
+              <name>HDFS/HDFS_CLIENT</name>
+              <scope>host</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+            <dependency>
+              <name>MAPREDUCE/MAPREDUCE_CLIENT</name>
+              <scope>host</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+          </dependencies>
+          <commandScript>
+            <script>scripts/oozie2_server.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>600</timeout>
+          </commandScript>
+        </component>
+
+        <component>
+          <name>OOZIE2_CLIENT</name>
+          <category>CLIENT</category>
+          <cardinality>0+</cardinality>
+          <dependencies>
+            <dependency>
+              <name>HDFS/HDFS_CLIENT</name>
+              <scope>host</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+            <dependency>
+              <name>MAPREDUCE/MAPREDUCE_CLIENT</name>
+              <scope>host</scope>
+              <auto-deploy>
+                <enabled>true</enabled>
+              </auto-deploy>
+            </dependency>
+          </dependencies>
+          <commandScript>
+            <script>scripts/oozie2_client.py</script>
+            <scriptType>PYTHON</scriptType>
+          </commandScript>
+        </component>
+      </components>
+
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>any</osFamily>
+          <packages>
+            <package>
+              <name>oozie2.noarch</name>
+            </package>
+            <package>
+              <name>oozie2-client.noarch</name>
+            </package>
+            <package>
+              <name>extjs-2.2-1</name>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+
+      <commandScript>
+        <script>scripts/service_check.py</script>
+        <scriptType>PYTHON</scriptType>
+        <timeout>300</timeout>
+      </commandScript>
+
+      <configuration-dependencies>
+        <config-type>global</config-type>
+        <config-type>oozie2-site</config-type>
+      </configuration-dependencies>
+
+      <themes>
+        <theme>
+          <fileName>broken_theme.json</fileName>
+          <default>true</default>
+        </theme>
+      </themes>
+
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5f86f159/ambari-server/src/test/resources/extensions/EXT/0.4/services/OOZIE2/themes/broken_theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/extensions/EXT/0.4/services/OOZIE2/themes/broken_theme.json b/ambari-server/src/test/resources/extensions/EXT/0.4/services/OOZIE2/themes/broken_theme.json
new file mode 100644
index 0000000..6e8b5bf
--- /dev/null
+++ b/ambari-server/src/test/resources/extensions/EXT/0.4/services/OOZIE2/themes/broken_theme.json
@@ -0,0 +1,3 @@
+{
+  "configuration": {
+}


[15/15] ambari git commit: Merge branch 'trunk' into branch-feature-AMBARI-20859

Posted by rl...@apache.org.
Merge branch 'trunk' into branch-feature-AMBARI-20859


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 7bb4de14443e1d80ad0c9fd7e01075acae854cb0
Parents: 77d4057 523f505
Author: Robert Levas <rl...@hortonworks.com>
Authored: Mon Oct 16 16:22:38 2017 -0400
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Mon Oct 16 16:22:38 2017 -0400

----------------------------------------------------------------------
 ambari-infra/ambari-infra-assembly/pom.xml      |   4 +
 .../ambari-logsearch-assembly/pom.xml           |   4 +-
 .../ambari-logsearch-logfeeder/pom.xml          |   4 +
 .../ambari-logsearch-server/pom.xml             |   4 +
 ambari-metrics/ambari-metrics-assembly/pom.xml  |   2 +
 ambari-metrics/ambari-metrics-common/pom.xml    |   6 +
 .../ambari-metrics-timelineservice/pom.xml      |  10 ++
 .../controller/AmbariManagementController.java  |   6 +-
 .../AmbariManagementControllerImpl.java         |  50 ++++----
 .../controller/AmbariManagementHelper.java      |  26 ++++
 .../internal/ExtensionLinkResourceProvider.java |  15 +++
 .../AtlasProxyUserConfigCalculation.java        |  62 +++++++++
 .../ambari/server/stack/ExtensionHelper.java    |  31 ++++-
 .../server/upgrade/UpgradeCatalog260.java       |  19 +++
 .../package/scripts/accumulo_script.py          |   1 +
 .../0.1.0/package/scripts/metrics_collector.py  |   4 +-
 .../0.1.0/package/scripts/metrics_grafana.py    |   4 +-
 .../0.1.0/package/scripts/metrics_monitor.py    |   4 +-
 .../package/scripts/hive_interactive.py         |  13 ++
 .../package/scripts/hive_interactive.py         |  13 ++
 .../package/scripts/supervisord_service.py      |   1 +
 .../package/scripts/supervisord_service.py      |   1 +
 .../ZEPPELIN/0.7.0/package/scripts/master.py    |  52 ++++++--
 .../ZEPPELIN/0.7.0/package/scripts/params.py    |  15 ++-
 .../HDP/2.0.6/properties/stack_packages.json    |   2 +-
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml |   4 +
 .../stacks/HDP/2.5/upgrades/upgrade-2.6.xml     |   3 +
 .../configuration/application-properties.xml    |  15 +++
 .../stacks/HDP/2.6/services/DRUID/kerberos.json |  45 ++-----
 .../HDP/2.6/services/SUPERSET/kerberos.json     |  10 +-
 .../stacks/HDP/2.6/services/stack_advisor.py    |   7 +
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml |   4 +
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml     |   3 +
 .../AtlasProxyUserConfigCalculationTest.java    | 127 +++++++++++++++++++
 .../server/stack/StackManagerExtensionTest.java |  22 +++-
 .../stacks/2.5/HIVE/test_hive_server_int.py     |  16 +++
 .../stacks/2.6/ZEPPELIN/test_zeppelin_070.py    |   3 +
 .../stacks/2.6/common/test_stack_advisor.py     |   3 +-
 .../resources/extensions/EXT/0.2/metainfo.xml   |   4 +-
 .../resources/extensions/EXT/0.4/metainfo.xml   |  32 +++++
 .../EXT/0.4/services/OOZIE2/metainfo.xml        | 118 +++++++++++++++++
 .../services/OOZIE2/themes/broken_theme.json    |   3 +
 ambari-utility/pom.xml                          |   6 +
 43 files changed, 675 insertions(+), 103 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7bb4de14/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/7bb4de14/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------


[12/15] ambari git commit: AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam)

Posted by rl...@apache.org.
AMBARI-22233.Zeppelin service check failed during EU from 2.5 to 2.6 as ZeppelinServer can not be instantiated(Prabhjyot Singh Via Venkata Sairam)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 0317cf7163165f4a6f90b2337bf97382679dfee4
Parents: 2a8ac0d
Author: Venkata Sairam <ve...@gmail.com>
Authored: Mon Oct 16 18:20:06 2017 +0530
Committer: Venkata Sairam <ve...@gmail.com>
Committed: Mon Oct 16 18:20:06 2017 +0530

----------------------------------------------------------------------
 .../ZEPPELIN/0.7.0/package/scripts/master.py    | 40 +++++++++++++++++---
 .../stacks/2.6/ZEPPELIN/test_zeppelin_070.py    |  3 ++
 2 files changed, 37 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0317cf71/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
index 9d179b8..6ccdfba 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
@@ -192,7 +192,7 @@ class Master(Script):
       notebook_directory = "/user/" + format("{zeppelin_user}") + "/" + \
                            params.config['configurations']['zeppelin-config']['zeppelin.notebook.dir']
 
-    if not self.is_path_exists_in_HDFS(notebook_directory, params.zeppelin_user):
+    if not self.is_directory_exists_in_HDFS(notebook_directory, params.zeppelin_user):
       # hdfs dfs -mkdir {notebook_directory}
       params.HdfsResource(format("{notebook_directory}"),
                           type="directory",
@@ -243,7 +243,7 @@ class Master(Script):
       self.create_zeppelin_dir(params)
 
     if params.conf_stored_in_hdfs:
-      if not self.is_path_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user):
+      if not self.is_directory_exists_in_HDFS(self.get_zeppelin_conf_FS_directory(params), params.zeppelin_user):
         # hdfs dfs -mkdir {zeppelin's conf directory}
         params.HdfsResource(self.get_zeppelin_conf_FS_directory(params),
                             type="directory",
@@ -314,15 +314,17 @@ class Master(Script):
   def get_zeppelin_conf_FS(self, params):
     return self.get_zeppelin_conf_FS_directory(params) + "/interpreter.json"
 
-  def is_path_exists_in_HDFS(self, path, as_user):
+  def is_directory_exists_in_HDFS(self, path, as_user):
     kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
     kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};")
-    path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -e {path};echo $?"),
+
+    #-d: if the path is a directory, return 0.
+    path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -d {path};echo $?"),
                              user=as_user)[1]
 
     # if there is no kerberos setup then the string will contain "-bash: kinit: command not found"
     if "\n" in path_exists:
-      path_exists = path_exists.split("\n")[1]
+      path_exists = path_exists.split("\n").pop()
 
     # '1' means it does not exists
     if path_exists == '0':
@@ -330,6 +332,31 @@ class Master(Script):
     else:
       return False
 
+  def is_file_exists_in_HDFS(self, path, as_user):
+    kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
+    kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};")
+
+    #-f: if the path is a file, return 0.
+    path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -f {path};echo $?"),
+                             user=as_user)[1]
+
+    # if there is no kerberos setup then the string will contain "-bash: kinit: command not found"
+    if "\n" in path_exists:
+      path_exists = path_exists.split("\n").pop()
+
+    # '1' means it does not exists
+    if path_exists == '0':
+      #-z: if the file is zero length, return 0.
+      path_exists = shell.call(format("{kinit_if_needed} hdfs --config {hadoop_conf_dir} dfs -test -z {path};echo $?"),
+                               user=as_user)[1]
+
+      if "\n" in path_exists:
+        path_exists = path_exists.split("\n").pop()
+      if path_exists != '0':
+        return True
+
+    return False
+
   def get_interpreter_settings(self):
     import params
     import json
@@ -338,7 +365,7 @@ class Master(Script):
     if params.conf_stored_in_hdfs:
       zeppelin_conf_fs = self.get_zeppelin_conf_FS(params)
 
-      if self.is_path_exists_in_HDFS(zeppelin_conf_fs, params.zeppelin_user):
+      if self.is_file_exists_in_HDFS(zeppelin_conf_fs, params.zeppelin_user):
         # copy from hdfs to /etc/zeppelin/conf/interpreter.json
         kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths',None))
         kinit_if_needed = format("{kinit_path_local} -kt {zeppelin_kerberos_keytab} {zeppelin_kerberos_principal};")
@@ -358,6 +385,7 @@ class Master(Script):
     File(interpreter_config,
          group=params.zeppelin_group,
          owner=params.zeppelin_user,
+         mode=0644,
          content=json.dumps(config_data, indent=2))
 
     if params.conf_stored_in_hdfs:

http://git-wip-us.apache.org/repos/asf/ambari/blob/0317cf71/ambari-server/src/test/python/stacks/2.6/ZEPPELIN/test_zeppelin_070.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/ZEPPELIN/test_zeppelin_070.py b/ambari-server/src/test/python/stacks/2.6/ZEPPELIN/test_zeppelin_070.py
index 400350c..f5027b2 100644
--- a/ambari-server/src/test/python/stacks/2.6/ZEPPELIN/test_zeppelin_070.py
+++ b/ambari-server/src/test/python/stacks/2.6/ZEPPELIN/test_zeppelin_070.py
@@ -364,6 +364,7 @@ class TestZeppelin070(RMFTestCase):
                           content=interpreter_json_generated.template_after_base,
                           owner='zeppelin',
                           group='zeppelin',
+                          mode=0644
                           )
 
 
@@ -392,6 +393,7 @@ class TestZeppelin070(RMFTestCase):
                               content=interpreter_json_generated.template_after_without_spark_and_livy,
                               owner='zeppelin',
                               group='zeppelin',
+                              mode=0644
                               )
 
     self.assertResourceCalled('HdfsResource',
@@ -419,6 +421,7 @@ class TestZeppelin070(RMFTestCase):
                               content=interpreter_json_generated.template_after_kerberos,
                               owner='zeppelin',
                               group='zeppelin',
+                              mode=0644
                               )
 
     self.assertResourceCalled('HdfsResource', 'hdfs:///user/zeppelin/conf/interpreter.json',


[11/15] ambari git commit: AMBARI-22223.jdbc(spark[2]) URLs not configured correctly for secure clusters(Prabhjyot Singh via Venkata Sairam)

Posted by rl...@apache.org.
AMBARI-22223.jdbc(spark[2]) URLs not configured correctly for secure clusters(Prabhjyot Singh via Venkata Sairam)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 2a8ac0ded9a9916dd71b84ac21a2a6165db60284
Parents: d4458da
Author: Venkata Sairam <ve...@gmail.com>
Authored: Mon Oct 16 18:15:58 2017 +0530
Committer: Venkata Sairam <ve...@gmail.com>
Committed: Mon Oct 16 18:15:58 2017 +0530

----------------------------------------------------------------------
 .../ZEPPELIN/0.7.0/package/scripts/master.py         | 12 ++++++++----
 .../ZEPPELIN/0.7.0/package/scripts/params.py         | 15 +++++++++------
 2 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2a8ac0de/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
index 6a84d79..9d179b8 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/master.py
@@ -492,8 +492,10 @@ class Master(Script):
           interpreter['properties']['spark.proxy.user.property'] = 'hive.server2.proxy.user'
           interpreter['properties']['spark.url'] = 'jdbc:hive2://' + \
               params.spark_thrift_server_hosts + ':' + params.spark_hive_thrift_port + '/'
-          if params.spark_hive_principal:
-            interpreter['properties']['spark.url'] += ';principal=' + params.spark_hive_principal
+          if params.hive_principal:
+            interpreter['properties']['spark.url'] += ';principal=' + params.hive_principal
+          if params.hive_transport_mode:
+            interpreter['properties']['spark.url'] += ';transportMode=' + params.hive_transport_mode
           if 'spark.splitQueries' not in interpreter['properties']:
             interpreter['properties']['spark.splitQueries'] = "true"
 
@@ -504,8 +506,10 @@ class Master(Script):
           interpreter['properties']['spark2.proxy.user.property'] = 'hive.server2.proxy.user'
           interpreter['properties']['spark2.url'] = 'jdbc:hive2://' + \
               params.spark2_thrift_server_hosts + ':' + params.spark2_hive_thrift_port + '/'
-          if params.spark_hive_principal:
-            interpreter['properties']['spark2.url'] += ';principal=' + params.spark2_hive_principal
+          if params.hive_principal:
+            interpreter['properties']['spark2.url'] += ';principal=' + params.hive_principal
+          if params.hive_transport_mode:
+            interpreter['properties']['spark2.url'] += ';transportMode=' + params.hive_transport_mode
           if 'spark2.splitQueries' not in interpreter['properties']:
             interpreter['properties']['spark2.splitQueries'] = "true"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a8ac0de/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
index e69037c..2290a7f 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.7.0/package/scripts/params.py
@@ -162,13 +162,19 @@ if 'hive_server_interactive_hosts' in master_configs and len(master_configs['hiv
 spark_thrift_server_hosts = None
 spark_hive_thrift_port = None
 spark_hive_principal = None
+hive_principal = None
+hive_transport_mode = None
+
+if 'hive-site' in config['configurations']:
+  if 'hive.server2.authentication.kerberos.principal' in config['configurations']['hive-site']:
+    hive_principal = config['configurations']['hive-site']['hive.server2.authentication.kerberos.principal']
+  if 'hive.server2.transport.mode' in config['configurations']['hive-site']:
+    hive_transport_mode = config['configurations']['hive-site']['hive.server2.transport.mode']
+
 if 'spark_thriftserver_hosts' in master_configs and len(master_configs['spark_thriftserver_hosts']) != 0:
   spark_thrift_server_hosts = str(master_configs['spark_thriftserver_hosts'][0])
   if config['configurations']['spark-hive-site-override']:
     spark_hive_thrift_port = config['configurations']['spark-hive-site-override']['hive.server2.thrift.port']
-  if config['configurations']['spark-thrift-sparkconf'] and \
-      'spark.sql.hive.hiveserver2.jdbc.url.principal' in config['configurations']['spark-thrift-sparkconf']:
-    spark_hive_principal = config['configurations']['spark-thrift-sparkconf']['spark.sql.hive.hiveserver2.jdbc.url.principal']
 
 spark2_thrift_server_hosts = None
 spark2_hive_thrift_port = None
@@ -177,9 +183,6 @@ if 'spark2_thriftserver_hosts' in master_configs and len(master_configs['spark2_
   spark2_thrift_server_hosts = str(master_configs['spark2_thriftserver_hosts'][0])
   if config['configurations']['spark2-hive-site-override']:
     spark2_hive_thrift_port = config['configurations']['spark2-hive-site-override']['hive.server2.thrift.port']
-  if config['configurations']['spark2-thrift-sparkconf'] and \
-      'spark.sql.hive.hiveserver2.jdbc.url.principal' in config['configurations']['spark2-thrift-sparkconf']:
-    spark2_hive_principal = config['configurations']['spark2-thrift-sparkconf']['spark.sql.hive.hiveserver2.jdbc.url.principal']
 
 
 # detect hbase details if installed


[10/15] ambari git commit: AMBARI-22232 : ADDENDUM Need to add a new property to support proxy users for Atlas service (Vishal Suvagia via mugdha).

Posted by rl...@apache.org.
AMBARI-22232 : ADDENDUM Need to add a new property to support proxy users for Atlas service (Vishal Suvagia via mugdha).


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: d4458daa9bf5209eb2f86409185221cdbd749b13
Parents: e219186
Author: Vishal Suvagia <vi...@yahoo.com>
Authored: Mon Oct 16 15:16:17 2017 +0530
Committer: Mugdha Varadkar <mu...@apache.org>
Committed: Mon Oct 16 15:35:35 2017 +0530

----------------------------------------------------------------------
 .../upgrades/AtlasProxyUserConfigCalculation.java  | 17 +++++++++++++++++
 .../AtlasProxyUserConfigCalculationTest.java       | 17 +++++++++++++++++
 2 files changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d4458daa/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
index 85fb200..40d64b5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculation.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.serveraction.upgrades;
 
 import org.apache.ambari.server.AmbariException;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d4458daa/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
index 3f8bca9..33ec7f3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/AtlasProxyUserConfigCalculationTest.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.serveraction.upgrades;
 
 import com.google.inject.Injector;


[09/15] ambari git commit: AMBARI-22216. Ambari Schema Upgrade Failed during Ambari Upgrade - workaround (dlysnichenko)

Posted by rl...@apache.org.
AMBARI-22216. Ambari Schema Upgrade Failed during Ambari Upgrade - workaround (dlysnichenko)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: e219186ea68a869ee0b7929dfd6c5322cf8c1e7b
Parents: df10813
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Mon Oct 16 12:13:01 2017 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Mon Oct 16 12:13:47 2017 +0300

----------------------------------------------------------------------
 .../ambari/server/upgrade/UpgradeCatalog260.java | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e219186e/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
index 866a501..71a0ff3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog260.java
@@ -81,6 +81,7 @@ public class UpgradeCatalog260 extends AbstractUpgradeCatalog {
   public static final String DESIRED_REPO_VERSION_ID_COLUMN = "desired_repo_version_id";
   public static final String REPO_STATE_COLUMN = "repo_state";
   public static final String FK_SCDS_DESIRED_STACK_ID = "FK_scds_desired_stack_id";
+  public static final String FK_SERVICECOMPONENTDESIREDSTATE_DESIRED_STACK_ID = "FK_servicecomponentdesiredstate_desired_stack_id";
   public static final String FK_SCDS_DESIRED_REPO_ID = "FK_scds_desired_repo_id";
 
   public static final String REPO_VERSION_TABLE = "repo_version";
@@ -152,6 +153,9 @@ public class UpgradeCatalog260 extends AbstractUpgradeCatalog {
   public static final String STALE_POSTGRESS_USERS_LDAP_USER_KEY = "users_ldap_user_key";
   public static final String SHORT_URL_COLUMN = "short_url";
   public static final String FK_INSTANCE_URL_ID = "FK_instance_url_id";
+  public static final String FK_SERVICEDESIREDSTATE_DESIRED_STACK_ID = "FK_servicedesiredstate_desired_stack_id";
+  public static final String FK_HOSTCOMPONENTDESIREDSTATE_DESIRED_STACK_ID = "FK_hostcomponentdesiredstate_desired_stack_id";
+  public static final String FK_HOSTCOMPONENTSTATE_CURRENT_STACK_ID = "FK_hostcomponentstate_current_stack_id";
 
 
   /**
@@ -187,6 +191,7 @@ public class UpgradeCatalog260 extends AbstractUpgradeCatalog {
   @Override
   protected void executeDDLUpdates() throws AmbariException, SQLException {
     int currentVersionID = getCurrentVersionID();
+    dropBrokenFK();
     updateServiceComponentDesiredStateTable(currentVersionID);
     updateServiceDesiredStateTable(currentVersionID);
     addSelectedCollumsToClusterconfigTable();
@@ -202,6 +207,20 @@ public class UpgradeCatalog260 extends AbstractUpgradeCatalog {
     removeStaleConstraints();
   }
 
+  /**
+   * Drop broken FK
+   * {@value #FK_SERVICECOMPONENTDESIREDSTATE_DESIRED_STACK_ID}
+   * {@value #FK_SERVICEDESIREDSTATE_DESIRED_STACK_ID}
+   * {@value #FK_HOSTCOMPONENTDESIREDSTATE_DESIRED_STACK_ID}
+   * {@value #FK_HOSTCOMPONENTSTATE_CURRENT_STACK_ID}
+   */
+  private void dropBrokenFK() throws SQLException {
+    dbAccessor.dropFKConstraint(SERVICE_COMPONENT_DESIRED_STATE_TABLE, FK_SERVICECOMPONENTDESIREDSTATE_DESIRED_STACK_ID);
+    dbAccessor.dropFKConstraint(SERVICE_DESIRED_STATE_TABLE, FK_SERVICEDESIREDSTATE_DESIRED_STACK_ID);
+    dbAccessor.dropFKConstraint(HOST_COMPONENT_DESIRED_STATE_TABLE, FK_HOSTCOMPONENTDESIREDSTATE_DESIRED_STACK_ID);
+    dbAccessor.dropFKConstraint(HOST_COMPONENT_STATE_TABLE, FK_HOSTCOMPONENTSTATE_CURRENT_STACK_ID);
+  }
+
 
   /**
    * Updates {@value #VIEWURL_TABLE} table.


[06/15] ambari git commit: AMBARI-22243. Apache Hive 2 LLAP cluster doesn't have the metastore warehouse directory. (stoader)

Posted by rl...@apache.org.
AMBARI-22243. Apache Hive 2 LLAP cluster doesn't have the metastore warehouse directory. (stoader)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 43fb59761595431b2a8832bafe1bfcb2fa85a1fa
Parents: 8c017c1
Author: Toader, Sebastian <st...@hortonworks.com>
Authored: Sat Oct 14 07:45:22 2017 +0200
Committer: Toader, Sebastian <st...@hortonworks.com>
Committed: Sun Oct 15 07:43:51 2017 +0200

----------------------------------------------------------------------
 .../0.12.0.2.0/package/scripts/hive_interactive.py  | 13 +++++++++++++
 .../2.1.0.3.0/package/scripts/hive_interactive.py   | 13 +++++++++++++
 .../python/stacks/2.5/HIVE/test_hive_server_int.py  | 16 ++++++++++++++++
 3 files changed, 42 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/43fb5976/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
index 2ed3e3a..89060be 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_interactive.py
@@ -62,6 +62,19 @@ def hive_interactive(name=None):
   import params
   MB_TO_BYTES = 1048576
 
+  # if warehouse directory is in DFS
+  if not params.whs_dir_protocol or params.whs_dir_protocol == urlparse(params.default_fs).scheme:
+    # Create Hive Metastore Warehouse Dir
+    params.HdfsResource(params.hive_apps_whs_dir,
+                        type="directory",
+                        action="create_on_execute",
+                        owner=params.hive_user,
+                        group=params.user_group,
+                        mode=params.hive_apps_whs_mode
+                        )
+  else:
+    Logger.info(format("Not creating warehouse directory '{hive_apps_whs_dir}', as the location is not in DFS."))
+
   # Create Hive User Dir
   params.HdfsResource(params.hive_hdfs_user_dir,
                       type="directory",

http://git-wip-us.apache.org/repos/asf/ambari/blob/43fb5976/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_interactive.py
index 2ed3e3a..89060be 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/hive_interactive.py
@@ -62,6 +62,19 @@ def hive_interactive(name=None):
   import params
   MB_TO_BYTES = 1048576
 
+  # if warehouse directory is in DFS
+  if not params.whs_dir_protocol or params.whs_dir_protocol == urlparse(params.default_fs).scheme:
+    # Create Hive Metastore Warehouse Dir
+    params.HdfsResource(params.hive_apps_whs_dir,
+                        type="directory",
+                        action="create_on_execute",
+                        owner=params.hive_user,
+                        group=params.user_group,
+                        mode=params.hive_apps_whs_mode
+                        )
+  else:
+    Logger.info(format("Not creating warehouse directory '{hive_apps_whs_dir}', as the location is not in DFS."))
+
   # Create Hive User Dir
   params.HdfsResource(params.hive_hdfs_user_dir,
                       type="directory",

http://git-wip-us.apache.org/repos/asf/ambari/blob/43fb5976/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
index 3dc78ab..4951c7e 100644
--- a/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
+++ b/ambari-server/src/test/python/stacks/2.5/HIVE/test_hive_server_int.py
@@ -418,6 +418,22 @@ class TestHiveServerInteractive(RMFTestCase):
 
   def assert_configure_default(self, no_tmp=False, default_fs_default=u'hdfs://c6401.ambari.apache.org:8020', with_cs_enabled=False):
 
+    self.assertResourceCalled('HdfsResource', '/apps/hive/warehouse',
+                              immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
+                              security_enabled = False,
+                              hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
+                              keytab = UnknownConfigurationMock(),
+                              kinit_path_local = '/usr/bin/kinit',
+                              user = 'hdfs',
+                              dfs_type = '',
+                              owner = 'hive',
+                              group = 'hadoop',
+                              hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
+                              type = 'directory',
+                              action = ['create_on_execute'], hdfs_resource_ignore_file='/var/lib/ambari-agent/data/.hdfs_resource_ignore', hdfs_site=self.getConfig()['configurations']['hdfs-site'], principal_name='missing_principal', default_fs=default_fs_default,
+                              mode = 0777,
+    )
+
     self.assertResourceCalled('HdfsResource', '/user/hive',
                               immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
                               security_enabled = False,