You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2017/11/28 20:40:02 UTC

[01/12] ambari git commit: AMBARI-22522 - Livy server fails to start during downgrade due to absence of 'conf' directory (jonathanhurley)

Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22457 3a0ae86bb -> ed50bc383


AMBARI-22522 - Livy server fails to start during downgrade due to absence of 'conf' directory (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: cdc1ed6d09b4a3602bd5eef7ee61cd68b7cccd84
Parents: c6825e9
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Mon Nov 27 09:03:23 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Nov 27 11:58:08 2017 -0500

----------------------------------------------------------------------
 .../stacks/BigInsights/4.0/properties/stack_packages.json      | 6 ++++++
 .../resources/stacks/HDP/2.0.6/properties/stack_packages.json  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cdc1ed6d/ambari-server/src/main/resources/stacks/BigInsights/4.0/properties/stack_packages.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.0/properties/stack_packages.json b/ambari-server/src/main/resources/stacks/BigInsights/4.0/properties/stack_packages.json
index 7a12011..4232610 100644
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.0/properties/stack_packages.json
+++ b/ambari-server/src/main/resources/stacks/BigInsights/4.0/properties/stack_packages.json
@@ -840,6 +840,12 @@
           "current_dir": "{0}/current/knox-server/conf"
         }
       ],
+      "livy": [
+        {
+          "conf_dir": "/etc/livy/conf",
+          "current_dir": "{0}/current/livy-client/conf"
+        }
+      ],
       "mahout": [
         {
           "conf_dir": "/etc/mahout/conf",

http://git-wip-us.apache.org/repos/asf/ambari/blob/cdc1ed6d/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 245449c..794d2b0 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
@@ -1069,7 +1069,7 @@
       "livy": [
         {
           "conf_dir": "/etc/livy/conf",
-          "current_dir": "{0}/current/livy"
+          "current_dir": "{0}/current/livy-client/conf"
         }
       ],
       "mahout": [


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

Posted by jo...@apache.org.
Merge branch 'branch-2.6' into branch-feature-AMBARI-22457


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: ed50bc3830e63e01961cbc03ef6d7c611c243c1c
Parents: 3a0ae86 754b1f6
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Tue Nov 28 15:39:47 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Tue Nov 28 15:39:47 2017 -0500

----------------------------------------------------------------------
 .../libraries/functions/component_version.py    |  9 +-
 .../ambari/logfeeder/filter/FilterKeyValue.java |  4 +-
 .../configsets/hadoop_logs/conf/managed-schema  |  3 +
 .../model/response/ServiceLogData.java          |  2 +
 .../ambari/logsearch/solr/SolrConstants.java    |  1 +
 .../solr/model/SolrServiceLogData.java          | 17 ++++
 .../actionmanager/ExecutionCommandWrapper.java  |  1 -
 .../internal/UpgradeResourceProvider.java       | 38 --------
 .../dispatchers/AmbariSNMPDispatcher.java       | 11 ++-
 .../2.1.0.2.0/package/scripts/params_linux.py   |  6 ++
 .../custom_actions/scripts/ru_execute_tasks.py  |  5 +-
 .../4.0/properties/stack_packages.json          |  6 ++
 .../HDFS/package/scripts/namenode_upgrade.py    |  8 +-
 .../4.0/stack-advisor/stack_advisor_25.py       |  2 +-
 .../HDP/2.0.6/properties/stack_packages.json    |  2 +-
 .../services/YARN/configuration/yarn-site.xml   |  4 +-
 .../stacks/HDP/2.5/services/stack_advisor.py    |  2 +-
 .../stacks/HDP/2.6/services/OOZIE/metainfo.xml  | 34 +++++++
 .../stacks/HDP/2.6/services/stack_advisor.py    |  3 +
 .../stacks/HDP/2.6/upgrades/config-upgrade.xml  | 14 ++-
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml | 11 ++-
 .../stacks/HDP/2.6/upgrades/upgrade-2.6.xml     |  4 +
 .../dispatchers/AmbariSNMPDispatcherTest.java   | 97 +++++++++++---------
 .../AlertNoticeDispatchServiceTest.java         | 63 ++++++++++---
 .../custom_actions/test_ru_execute_tasks.py     |  6 +-
 .../stacks/2.5/common/test_stack_advisor.py     |  2 +-
 .../stacks/2.6/common/test_stack_advisor.py     | 11 +++
 .../scripts/containers/ComponentDetailView.jsx  |  2 +-
 .../storm/src/main/resources/ui/package.json    | 20 ++--
 29 files changed, 257 insertions(+), 131 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ed50bc38/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
----------------------------------------------------------------------


[04/12] ambari git commit: AMBARI-22526. Log Feeder: handle multiple '=' (split char) in key/value filter (oleewere)

Posted by jo...@apache.org.
AMBARI-22526. Log Feeder: handle multiple '=' (split char) in key/value filter (oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 4fe795dba0a5451159c0afa8cc273b181887dd10
Parents: 812ded6
Author: Oliver Szabo <ol...@gmail.com>
Authored: Tue Nov 28 14:48:35 2017 +0100
Committer: Oliver Szabo <ol...@gmail.com>
Committed: Tue Nov 28 14:48:35 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4fe795db/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
index b04a439..237d221 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
@@ -130,14 +130,14 @@ public class FilterKeyValue extends Filter {
 
   private String[] getNameValue(String nv) {
     String splitPattern = Pattern.quote(valueSplit);
-    return nv.split(splitPattern);
+    return nv.split(splitPattern, 2);
   }
 
   private void logParseError(String inputStr) {
     errorMetric.value++;
     String logMessageKey = this.getClass().getSimpleName() + "_PARSEERROR";
     LogFeederUtil.logErrorMessageByInterval(logMessageKey, "Error parsing string. length=" + inputStr.length() + ", input=" +
-        input.getShortDescription() + ". First upto 100 characters=" + StringUtils.abbreviate(inputStr, 100), null, LOG,
+        input.getShortDescription() + ". First upto 200 characters=" + StringUtils.abbreviate(inputStr, 200), null, LOG,
         Level.ERROR);
   }
 


[05/12] ambari git commit: AMBARI-22525 - ATS start failed during patch upgrade due to CNF SparkATSPlugin (jonathanhurley)

Posted by jo...@apache.org.
AMBARI-22525 - ATS start failed during patch upgrade due to CNF SparkATSPlugin (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 2cf8cb85bffff266897e5941deaad2e92ae53447
Parents: 4fe795d
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Mon Nov 27 13:58:38 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Tue Nov 28 09:24:50 2017 -0500

----------------------------------------------------------------------
 .../libraries/functions/component_version.py          |  9 +++++----
 .../YARN/2.1.0.2.0/package/scripts/params_linux.py    |  6 ++++++
 .../BigInsights/4.0/stack-advisor/stack_advisor_25.py |  2 +-
 .../HDP/2.5/services/YARN/configuration/yarn-site.xml |  4 ++--
 .../stacks/HDP/2.5/services/stack_advisor.py          |  2 +-
 .../stacks/HDP/2.6/upgrades/config-upgrade.xml        | 14 ++++++++++++--
 .../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml       | 11 ++++++++---
 .../resources/stacks/HDP/2.6/upgrades/upgrade-2.6.xml |  4 ++++
 .../python/stacks/2.5/common/test_stack_advisor.py    |  2 +-
 9 files changed, 40 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/ambari-common/src/main/python/resource_management/libraries/functions/component_version.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/component_version.py b/ambari-common/src/main/python/resource_management/libraries/functions/component_version.py
index 169b339..fd18232 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/component_version.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/component_version.py
@@ -20,7 +20,7 @@ limitations under the License.
 
 from resource_management.libraries.script.script import Script
 
-def get_component_repository_version(service_name = None, component_name = None):
+def get_component_repository_version(service_name = None, component_name = None, default_value = None):
   """
   Gets the version associated with the specified component from the structure in the command.
   Every command should contain a mapping of service/component to the desired repository it's set
@@ -28,22 +28,23 @@ def get_component_repository_version(service_name = None, component_name = None)
 
   :service_name: the name of the service
   :component_name: the name of the component
+  :default_value: the value to return if either the service or the component are not found
   """
   config = Script.get_config()
 
   versions = _get_component_repositories(config)
   if versions is None:
-    return None
+    return default_value
 
   if service_name is None:
     service_name = config['serviceName'] if config is not None and 'serviceName' in config else None
 
   if service_name is None or service_name not in versions:
-    return None
+    return default_value
 
   component_versions = versions[service_name]
   if len(component_versions) == 0:
-    return None
+    return default_value
 
   if component_name is None:
     component_name = config["role"] if config is not None and "role" in config else None

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 4079f18..2871dc0 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -84,6 +84,12 @@ stack_supports_timeline_state_store = check_stack_feature(StackFeature.TIMELINE_
 # It cannot be used during the initial Cluser Install because the version is not yet known.
 version = default("/commandParams/version", None)
 
+# these are used to render the classpath for picking up Spark classes
+# in the event that spark is not installed, then we must default to the vesrion of YARN installed
+# since it will still load classes from its own spark version
+spark_version = component_version.get_component_repository_version("SPARK", "SPARK_CLIENT", default_value = version)
+spark2_version = component_version.get_component_repository_version("SPARK2", "SPARK2_CLIENT", default_value = version)
+
 stack_supports_ranger_kerberos = check_stack_feature(StackFeature.RANGER_KERBEROS_SUPPORT, version_for_stack_feature_checks)
 stack_supports_ranger_audit_db = check_stack_feature(StackFeature.RANGER_AUDIT_DB_SUPPORT, version_for_stack_feature_checks)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/ambari-server/src/main/resources/stacks/BigInsights/4.0/stack-advisor/stack_advisor_25.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.0/stack-advisor/stack_advisor_25.py b/ambari-server/src/main/resources/stacks/BigInsights/4.0/stack-advisor/stack_advisor_25.py
index 7e77382..ead9e83 100755
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.0/stack-advisor/stack_advisor_25.py
+++ b/ambari-server/src/main/resources/stacks/BigInsights/4.0/stack-advisor/stack_advisor_25.py
@@ -745,7 +745,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
 
     if self.__isServiceDeployed(services, "SPARK"):
       timeline_plugin_classes_values.append('org.apache.spark.deploy.history.yarn.plugin.SparkATSPlugin')
-      timeline_plugin_classpath_values.append(stack_root + "/${hdp.version}/spark/hdpLib/*")
+      timeline_plugin_classpath_values.append(stack_root + "/{{spark_version}}/spark/hdpLib/*")
 
     putYarnSiteProperty('yarn.timeline-service.entity-group-fs-store.group-id-plugin-classes', ",".join(timeline_plugin_classes_values))
     putYarnSiteProperty('yarn.timeline-service.entity-group-fs-store.group-id-plugin-classpath', ":".join(timeline_plugin_classpath_values))

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml
index b6fadcb..29833fb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/yarn-site.xml
@@ -31,13 +31,13 @@
   </property>
   <property>
     <name>yarn.nodemanager.aux-services.spark_shuffle.classpath</name>
-    <value>{{stack_root}}/${hdp.version}/spark/aux/*</value>
+    <value>{{stack_root}}/{{spark_version}}/spark/aux/*</value>
     <description>The auxiliary service classpath to use for Spark</description>
     <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>yarn.nodemanager.aux-services.spark2_shuffle.classpath</name>
-    <value>{{stack_root}}/${hdp.version}/spark2/aux/*</value>
+    <value>{{stack_root}}/{{spark2_version}}/spark2/aux/*</value>
     <description>The auxiliary service classpath to use for Spark 2</description>
     <on-ambari-upgrade add="false"/>
   </property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
index a3b8263..4187dc9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
@@ -824,7 +824,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
 
     if self.__isServiceDeployed(services, "SPARK"):
       timeline_plugin_classes_values.append('org.apache.spark.deploy.history.yarn.plugin.SparkATSPlugin')
-      timeline_plugin_classpath_values.append(stack_root + "/${hdp.version}/spark/hdpLib/*")
+      timeline_plugin_classpath_values.append(stack_root + "/{{spark_version}}/spark/hdpLib/*")
 
     putYarnSiteProperty('yarn.timeline-service.entity-group-fs-store.group-id-plugin-classes', ",".join(timeline_plugin_classes_values))
     putYarnSiteProperty('yarn.timeline-service.entity-group-fs-store.group-id-plugin-classpath', ":".join(timeline_plugin_classpath_values))

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
index 4538072..42dc124 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/upgrades/config-upgrade.xml
@@ -168,14 +168,13 @@
               if-key-state="absent" />
           </definition>
 
-
           <definition xsi:type="configure" id="hdp_2_6_yarn_app_classpath_parameterization" summary="Application Classpath Parameterization">
             <type>yarn-site</type>
             <replace key="yarn.application.classpath" find="/usr/hdp/current/hadoop-client" replace-with="{{hadoop_home}}"/>
           </definition>
-
         </changes>
       </component>
+
       <component name="NODEMANAGER">
         <changes>
           <definition xsi:type="configure" id="hdp_2_6_0_0_yarn_nodemanager_llap_mem">
@@ -185,6 +184,17 @@
           </definition>
         </changes>
       </component>
+
+      <component name="APP_TIMELINE_SERVER">
+        <changes>
+          <definition xsi:type="configure" id="hdp_2_6_yarn_spark_versioned_classpaths">
+            <type>yarn-site</type>
+            <set key="yarn.nodemanager.aux-services.spark_shuffle.classpath" value="{{stack_root}}/{{spark_version}}/spark/aux/*"/>
+            <set key="yarn.nodemanager.aux-services.spark2_shuffle.classpath" value="{{stack_root}}/{{spark2_version}}/spark2/aux/*"/>
+            <replace key="yarn.timeline-service.entity-group-fs-store.group-id-plugin-classpath" find="${hdp.version}/spark/" replace-with="{{spark_version}}/spark/"/>
+          </definition>
+        </changes>
+      </component>
     </service>
 
     <service name="KAFKA">

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/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 f3cea48..2185049 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
@@ -146,7 +146,7 @@
         <component>DRUID_OVERLORD</component>
         <component>DRUID_SUPERSET</component>
       </service>
-      
+
       <service name="RANGER">
         <component>RANGER_USERSYNC</component>
         <component>RANGER_ADMIN</component>
@@ -354,7 +354,12 @@
         <task xsi:type="configure" id="hdp_2_6_yarn_app_classpath_parameterization" supports-patch="true"/>
       </execute-stage>
 
-      <!-- YARN -->
+      <execute-stage service="YARN" component="APP_TIMELINE_SERVER" title="Spark Versioned Classpaths">
+        <task xsi:type="configure" id="hdp_2_6_yarn_spark_versioned_classpaths" supports-patch="true">
+          <summary>Updating the Spark classpath entries to use the specific version of Spark which is installed.</summary>
+        </task>
+      </execute-stage>
+
       <execute-stage service="YARN" component="NODEMANAGER" title="Apply config changes for YARN NM">
         <task xsi:type="configure" id="hdp_2_6_0_0_yarn_nodemanager_llap_mem">
           <summary>Updating YARN NodeManager config for LLAP</summary>
@@ -417,7 +422,7 @@
       <execute-stage service="TEZ" component="TEZ_CLIENT" title="Updating LD Library Classpath for Tarball" >
         <task xsi:type="configure" id="hdp_2_6_tez_tarball_ld_library" supports-patch="true"/>
       </execute-stage>
-      
+
       <!-- MapR -->
       <execute-stage service="MAPREDUCE2" component="MAPREDUCE2_CLIENT" title="Updating LD Library Classpath for Tarball">
         <task xsi:type="configure" id="hdp_2_6_mapreduce_tarball_ld_library" supports-patch="true"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/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 3bb6322..d51706a 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
@@ -690,6 +690,10 @@
 
     <service name="YARN">
       <component name="APP_TIMELINE_SERVER">
+        <pre-upgrade>
+          <task xsi:type="configure" id="hdp_2_6_yarn_spark_versioned_classpaths" supports-patch="true"/>
+        </pre-upgrade>
+        <pre-downgrade/>
         <upgrade>
           <task xsi:type="restart-task" />
         </upgrade>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2cf8cb85/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
index bb11969..8f27d79 100644
--- a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
@@ -1206,7 +1206,7 @@ class TestHDP25StackAdvisor(TestCase):
     self.assertEquals(configurations['hive-interactive-site']['properties']['hive.llap.daemon.queue.name'], 'default')
     self.assertEquals(configurations['yarn-site']['properties']['yarn.timeline-service.entity-group-fs-store.group-id-plugin-classes'],
                       'org.apache.tez.dag.history.logging.ats.TimelineCachePluginImpl,org.apache.spark.deploy.history.yarn.plugin.SparkATSPlugin')
-    self.assertEquals(configurations['yarn-site']['properties']['yarn.timeline-service.entity-group-fs-store.group-id-plugin-classpath'], '/usr/hdp/${hdp.version}/spark/hdpLib/*')
+    self.assertEquals(configurations['yarn-site']['properties']['yarn.timeline-service.entity-group-fs-store.group-id-plugin-classpath'], '/usr/hdp/{{spark_version}}/spark/hdpLib/*')
     self.assertTrue('hive-interactive-env' not in configurations)
     self.assertTrue('property_attributes' not in configurations)
 


[02/12] ambari git commit: AMBARI-22521. Log Search: Adding new dynamic field for service logs (oleewere)

Posted by jo...@apache.org.
AMBARI-22521. Log Search: Adding new dynamic field for service logs (oleewere)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 9c54948407de5281457f5fb69df445e80e07c26e
Parents: cdc1ed6
Author: Oliver Szabo <ol...@gmail.com>
Authored: Mon Nov 27 17:33:14 2017 +0100
Committer: Oliver Szabo <ol...@gmail.com>
Committed: Mon Nov 27 18:09:08 2017 +0100

----------------------------------------------------------------------
 .../configsets/hadoop_logs/conf/managed-schema     |  3 +++
 .../logsearch/model/response/ServiceLogData.java   |  2 ++
 .../ambari/logsearch/solr/SolrConstants.java       |  1 +
 .../logsearch/solr/model/SolrServiceLogData.java   | 17 +++++++++++++++++
 4 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9c549484/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema
index c6f498b..27ca78e 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema
@@ -115,6 +115,9 @@
   <dynamicField name='std_*' type="text_std_token_lower_case" multiValued="false" stored="false"/>
   <dynamicField name='key_*' type="key_lower_case" multiValued="false" stored="false"/>
   <dynamicField name="ws_*" type="text_ws" multiValued="false" omitNorms="false" stored="false"/>
+
+  <dynamicField name="sdi_*" type="text_ws" omitNorms="false" multiValued="false" stored="true"/>
+
   <copyField source="log_message" dest="key_log_message"/>
 
 </schema>

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c549484/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/ServiceLogData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/ServiceLogData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/ServiceLogData.java
index 16aed16..d4dbf61 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/ServiceLogData.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/ServiceLogData.java
@@ -60,4 +60,6 @@ public interface ServiceLogData extends CommonLogData, ComponentTypeLogData, Hos
   String getHost();
 
   void setHost(String host);
+
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c549484/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java
index 39e134a..147cfc2 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java
@@ -66,6 +66,7 @@ public class SolrConstants {
     public static final String STORED_TOKEN_DYNAMIC_FIELDS = "std_*";
     public static final String KEY_DYNAMIC_FIELDS = "key_*";
     public static final String WS_DYNAMIC_FIELDS = "ws_*";
+    public static final String SDI_DYNAMIC_FIELDS = "sdi_*";
   }
 
   public class AuditLogConstants {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c549484/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrServiceLogData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrServiceLogData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrServiceLogData.java
index c6fdba3..224ed8c 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrServiceLogData.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/model/SolrServiceLogData.java
@@ -22,6 +22,7 @@ import org.apache.ambari.logsearch.model.response.ServiceLogData;
 import org.apache.solr.client.solrj.beans.Field;
 
 import java.util.Date;
+import java.util.Map;
 
 import static org.apache.ambari.logsearch.solr.SolrConstants.ServiceLogConstants.*;
 
@@ -48,6 +49,9 @@ public class SolrServiceLogData extends SolrCommonLogData implements ServiceLogD
   @Field(HOST)
   private String host;
 
+  @Field(SDI_DYNAMIC_FIELDS)
+  private Map<String, Object> sdiDynamicFields;
+
   @Override
   public String getPath() {
     return path;
@@ -117,4 +121,17 @@ public class SolrServiceLogData extends SolrCommonLogData implements ServiceLogD
   public void setLevel(String level) {
     this.level = level;
   }
+
+  public void setSdiDynamicFields(Map<String, Object> sdiDynamicFields) {
+    this.sdiDynamicFields = sdiDynamicFields;
+  }
+
+  @Override
+  public Map<String, Object> getAllDynamicFields() {
+    Map<String, Object> dynamicFieldsMap = super.getAllDynamicFields();
+    if (sdiDynamicFields != null) {
+      dynamicFieldsMap.putAll(sdiDynamicFields);
+    }
+    return dynamicFieldsMap;
+  }
 }


[06/12] ambari git commit: AMBARI-22458 - SNMP Trap should contain sysuptime field filled (Amarnathreddy Pappu via jonathanhurley)

Posted by jo...@apache.org.
AMBARI-22458 - SNMP Trap should contain sysuptime field filled (Amarnathreddy Pappu via jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 8e35277c24cc0ffd897c1dc727b2cc528cb8148b
Parents: 2cf8cb8
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Tue Nov 28 10:29:59 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Tue Nov 28 10:29:59 2017 -0500

----------------------------------------------------------------------
 .../notifications/dispatchers/AmbariSNMPDispatcher.java  | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8e35277c/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcher.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcher.java b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcher.java
index 1eb9977..96bbe0b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcher.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcher.java
@@ -33,11 +33,15 @@ import org.snmp4j.smi.OID;
 import org.snmp4j.smi.OctetString;
 import org.snmp4j.smi.VariableBinding;
 import org.snmp4j.util.DefaultPDUFactory;
+import org.snmp4j.smi.TimeTicks;
 
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.*;
 
+import java.lang.management.RuntimeMXBean;
+import java.lang.management.ManagementFactory;
+
 /**
  * The {@link AmbariSNMPDispatcher} class is used to dispatch {@link AlertNotification} via SNMP using predefined Ambari OIDs.
  *
@@ -110,7 +114,12 @@ public class AmbariSNMPDispatcher extends SNMPDispatcher {
         }
 
         pdu.setType(snmpVersion.getTrapType());
-        // Set trap oid for PDU
+    
+        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
+        long uptimeInMillis = runtimeMXBean.getUptime();
+        pdu.add(new VariableBinding(SnmpConstants.sysUpTime, new TimeTicks(uptimeInMillis)));
+
+       // Set trap oid for PDU
         pdu.add(new VariableBinding(SnmpConstants.snmpTrapOID, new OID(AMBARI_ALERT_TRAP_OID)));
         // Set notification body and subject for PDU objects with identifiers specified in dispatch properties.
         AlertNoticeDispatchService.AlertInfo alertInfo = alertNotification.getAlertInfo();


[08/12] ambari git commit: AMBARI-22458 - SNMP Trap should contain sysuptime field filled (unit test fixes) (jonathanhurley)

Posted by jo...@apache.org.
AMBARI-22458 - SNMP Trap should contain sysuptime field filled (unit test fixes) (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 473abc324ff04b2cda50ccd26f85a6fbfd7e2f51
Parents: 3a68e51
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Tue Nov 28 12:23:31 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Tue Nov 28 12:24:03 2017 -0500

----------------------------------------------------------------------
 .../dispatchers/AmbariSNMPDispatcherTest.java   | 97 +++++++++++---------
 .../AlertNoticeDispatchServiceTest.java         | 63 ++++++++++---
 2 files changed, 106 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/473abc32/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java b/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java
index b1fee2b..4ac1681 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AmbariSNMPDispatcherTest.java
@@ -18,11 +18,32 @@
 
 package org.apache.ambari.server.notifications.dispatchers;
 
-import org.apache.ambari.server.notifications.TargetConfigurationResult;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.ambari.server.notifications.DispatchCallback;
 import org.apache.ambari.server.notifications.Notification;
 import org.apache.ambari.server.notifications.NotificationDispatcher;
 import org.apache.ambari.server.notifications.Recipient;
+import org.apache.ambari.server.notifications.TargetConfigurationResult;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
 import org.apache.ambari.server.orm.entities.AlertHistoryEntity;
 import org.apache.ambari.server.state.AlertState;
@@ -39,16 +60,6 @@ import org.snmp4j.smi.OID;
 import org.snmp4j.smi.OctetString;
 import org.snmp4j.smi.VariableBinding;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*;
-
 public class AmbariSNMPDispatcherTest {
 
     private static final int DEFAULT_SNMP_PORT = 31444;
@@ -81,7 +92,7 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = mock(AlertNotification.class);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1");
@@ -100,7 +111,7 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = mock(AlertNotification.class);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        notification.DispatchProperties = new HashMap<String, String>();
+        notification.DispatchProperties = new HashMap<>();
         dispatcher.dispatch(notification);
         verify(notification.Callback).onFailure(notification.CallbackIds);
         verify(notification.Callback, never()).onSuccess(notification.CallbackIds);
@@ -112,7 +123,7 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = getAlertNotification(true);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1");
@@ -128,12 +139,12 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = getAlertNotification(true);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1");
         notification.DispatchProperties = properties;
-        notification.Recipients = new ArrayList<Recipient>();
+        notification.Recipients = new ArrayList<>();
         dispatcher.dispatch(notification);
         verify(notification.Callback).onFailure(notification.CallbackIds);
         verify(notification.Callback, never()).onSuccess(notification.CallbackIds);
@@ -145,7 +156,7 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = mock(AlertNotification.class);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1");
@@ -163,7 +174,7 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = mock(AlertNotification.class);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv11");
@@ -181,7 +192,7 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = mock(AlertNotification.class);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1");
@@ -200,7 +211,7 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = mock(AlertNotification.class);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "3");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "4");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv2c");
@@ -218,7 +229,7 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = getAlertNotification(true);
         notification.Callback = mock(DispatchCallback.class);
         notification.CallbackIds = mock(List.class);
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "public");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
@@ -242,11 +253,11 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = getAlertNotification(true);
         PDU pdu = dispatcher.prepareTrap(notification, snmpVersion);
         assertEquals(PDU.V1TRAP, pdu.getType());
-        Map<String, VariableBinding> variableBindings = new HashMap<String, VariableBinding>();
+        Map<String, VariableBinding> variableBindings = new HashMap<>();
         for (VariableBinding variableBinding : pdu.toArray()) {
             variableBindings.put(variableBinding.getOid().toString(), variableBinding);
         }
-        assertEquals(10, variableBindings.size());
+    assertEquals(11, variableBindings.size());
         assertEquals(AmbariSNMPDispatcher.AMBARI_ALERT_TRAP_OID, variableBindings.get(SnmpConstants.snmpTrapOID.toString()).toValueString());
         assertTrue(variableBindings.get(SnmpConstants.snmpTrapOID.toString()).getVariable() instanceof OID);
         assertEquals(String.valueOf(DEFINITION_ID), variableBindings.get(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_ID_OID).toValueString());
@@ -274,11 +285,11 @@ public class AmbariSNMPDispatcherTest {
         AlertNotification notification = (AlertNotification) getAlertNotification(false);
         PDU pdu = dispatcher.prepareTrap(notification, snmpVersion);
         assertEquals(PDU.V1TRAP, pdu.getType());
-        Map<String, VariableBinding> variableBindings = new HashMap<String, VariableBinding>();
+        Map<String, VariableBinding> variableBindings = new HashMap<>();
         for (VariableBinding variableBinding : pdu.toArray()) {
             variableBindings.put(variableBinding.getOid().toString(), variableBinding);
         }
-        assertEquals(10, variableBindings.size());
+    assertEquals(11, variableBindings.size());
         assertEquals("null", variableBindings.get(AmbariSNMPDispatcher.AMBARI_ALERT_COMPONENT_NAME_OID).toValueString());
     }
 
@@ -290,12 +301,12 @@ public class AmbariSNMPDispatcherTest {
         Notification notification = getAlertNotification(true);
         PDU pdu = dispatcher.prepareTrap(notification, snmpVersion);
         assertEquals(PDU.TRAP, pdu.getType());
-        Map<String, VariableBinding> variableBindings = new HashMap<String, VariableBinding>();
+        Map<String, VariableBinding> variableBindings = new HashMap<>();
         for (VariableBinding variableBinding : pdu.toArray()) {
             variableBindings.put(variableBinding.getOid().toString(), variableBinding);
         }
 
-        assertEquals(10, variableBindings.size());
+    assertEquals(11, variableBindings.size());
         assertEquals(AmbariSNMPDispatcher.AMBARI_ALERT_TRAP_OID, variableBindings.get(SnmpConstants.snmpTrapOID.toString()).toValueString());
         assertEquals(String.valueOf(DEFINITION_ID), variableBindings.get(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_ID_OID).toValueString());
         assertEquals(DEFINITION_NAME, variableBindings.get(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_NAME_OID).toValueString());
@@ -314,7 +325,7 @@ public class AmbariSNMPDispatcherTest {
         AmbariSNMPDispatcher dispatcher = spy(new AmbariSNMPDispatcher(snmp));
         PDU trap = mock(PDU.class);
         Notification notification = new AlertNotification();
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "public");
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         notification.DispatchProperties = properties;
@@ -336,7 +347,7 @@ public class AmbariSNMPDispatcherTest {
         AmbariSNMPDispatcher dispatcher = spy(new AmbariSNMPDispatcher(snmp));
         PDU trap = mock(PDU.class);
         Notification notification = new AlertNotification();
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "public");
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         notification.DispatchProperties = properties;
@@ -358,7 +369,7 @@ public class AmbariSNMPDispatcherTest {
         AmbariSNMPDispatcher dispatcher = spy(new AmbariSNMPDispatcher(snmp));
         PDU trap = mock(PDU.class);
         Notification notification = new AlertNotification();
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");
@@ -384,7 +395,7 @@ public class AmbariSNMPDispatcherTest {
         AmbariSNMPDispatcher dispatcher = spy(new AmbariSNMPDispatcher(snmp));
         PDU trap = mock(PDU.class);
         Notification notification = new AlertNotification();
-        Map<String, String> properties = new HashMap<String, String>();
+        Map<String, String> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");
@@ -401,7 +412,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv1() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(SNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "public");
@@ -412,7 +423,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_incorrectSNMPversion() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv4");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "public");
@@ -423,7 +434,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv1_invalid_noPort() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv1");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "public");
         NotificationDispatcher dispatcher = new AmbariSNMPDispatcher(DEFAULT_SNMP_PORT);
@@ -433,7 +444,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv2c() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv2c");
         properties.put(AmbariSNMPDispatcher.COMMUNITY_PROPERTY, "public");
@@ -444,7 +455,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv2c_invalid() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv2c");
         NotificationDispatcher dispatcher = new AmbariSNMPDispatcher(DEFAULT_SNMP_PORT);
@@ -454,7 +465,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv3_incorrectSecurityLevel() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");
@@ -468,7 +479,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv3_noAuthNoPriv() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");
@@ -480,7 +491,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv3_AuthNoPriv_valid() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");
@@ -493,7 +504,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv3_AuthNoPriv_invalid() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");
@@ -505,7 +516,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv3_AuthPriv_valid() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");
@@ -519,7 +530,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv3_AuthPriv_noPassphrases() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");
@@ -531,7 +542,7 @@ public class AmbariSNMPDispatcherTest {
 
     @Test
     public void testValidateAlertValidation_SNMPv3_AuthPriv_onlyAuthPassphrase() throws Exception {
-        Map<String, Object> properties = new HashMap<String, Object>();
+        Map<String, Object> properties = new HashMap<>();
         properties.put(AmbariSNMPDispatcher.PORT_PROPERTY, "162");
         properties.put(AmbariSNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv3");
         properties.put(AmbariSNMPDispatcher.SECURITY_USERNAME_PROPERTY, "USER");

http://git-wip-us.apache.org/repos/asf/ambari/blob/473abc32/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java
index ee29762..31000a4 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/services/AlertNoticeDispatchServiceTest.java
@@ -19,11 +19,15 @@ package org.apache.ambari.server.state.services;
 
 import static org.easymock.EasyMock.createNiceMock;
 import static org.easymock.EasyMock.createStrictMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -36,27 +40,39 @@ import java.util.UUID;
 import java.util.Vector;
 import java.util.concurrent.Executor;
 
+import javax.persistence.EntityManager;
+
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.notifications.DispatchFactory;
 import org.apache.ambari.server.notifications.Notification;
 import org.apache.ambari.server.notifications.NotificationDispatcher;
 import org.apache.ambari.server.notifications.TargetConfigurationResult;
 import org.apache.ambari.server.notifications.dispatchers.AmbariSNMPDispatcher;
-import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.orm.DBAccessor;
+import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.dao.AlertDispatchDAO;
+import org.apache.ambari.server.orm.dao.AlertsDAO;
 import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
 import org.apache.ambari.server.orm.entities.AlertHistoryEntity;
 import org.apache.ambari.server.orm.entities.AlertNoticeEntity;
 import org.apache.ambari.server.orm.entities.AlertTargetEntity;
+import org.apache.ambari.server.stack.StackManagerFactory;
 import org.apache.ambari.server.state.AlertState;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.NotificationState;
 import org.apache.ambari.server.state.alert.Scope;
 import org.apache.ambari.server.state.alert.SourceType;
 import org.apache.ambari.server.state.alert.TargetType;
+import org.apache.ambari.server.state.stack.OsFamily;
 import org.easymock.EasyMock;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.easymock.PowerMock;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
 import org.snmp4j.CommandResponder;
 import org.snmp4j.CommandResponderEvent;
 import org.snmp4j.PDU;
@@ -68,6 +84,7 @@ import org.snmp4j.smi.GenericAddress;
 import org.snmp4j.smi.Integer32;
 import org.snmp4j.smi.OID;
 import org.snmp4j.smi.OctetString;
+import org.snmp4j.smi.TimeTicks;
 import org.snmp4j.smi.VariableBinding;
 import org.snmp4j.transport.DefaultUdpTransportMapping;
 
@@ -75,11 +92,12 @@ import com.google.inject.Binder;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
-import com.google.inject.util.Modules;
 
 /**
  * Tests the {@link AlertNoticeDispatchService}.
  */
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ AmbariSNMPDispatcher.class, ManagementFactory.class })
 public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
 
   final static String ALERT_NOTICE_UUID_1 = UUID.randomUUID().toString();
@@ -92,9 +110,10 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
   private DispatchFactory m_dispatchFactory = null;
   private AlertDispatchDAO m_dao = null;
   private Injector m_injector;
+  private RuntimeMXBean m_runtimeMXBean;
 
-  List<AlertDefinitionEntity> m_definitions = new ArrayList<AlertDefinitionEntity>();
-  List<AlertHistoryEntity> m_histories = new ArrayList<AlertHistoryEntity>();
+  List<AlertDefinitionEntity> m_definitions = new ArrayList<>();
+  List<AlertHistoryEntity> m_histories = new ArrayList<>();
 
   @Before
   public void before() {
@@ -103,8 +122,7 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
     m_metaInfo = createNiceMock(AmbariMetaInfo.class);
 
     // create an injector which will inject the mocks
-    m_injector = Guice.createInjector(Modules.override(
-        new InMemoryDefaultTestModule()).with(new MockModule()));
+    m_injector = Guice.createInjector(new MockModule());
 
     Assert.assertNotNull(m_injector);
 
@@ -150,7 +168,17 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
         m_histories.add(history);
       }
     }
-  }
+
+    // mock out the uptime to be a while (since most tests are not testing
+    // system uptime)
+    m_runtimeMXBean = EasyMock.createNiceMock(RuntimeMXBean.class);
+    PowerMock.mockStatic(ManagementFactory.class);
+    expect(ManagementFactory.getRuntimeMXBean()).andReturn(m_runtimeMXBean).atLeastOnce();
+    PowerMock.replay(ManagementFactory.class);
+    expect(m_runtimeMXBean.getUptime()).andReturn(360000L).atLeastOnce();
+
+    replay( m_runtimeMXBean);
+    }
 
   /**
    * Tests the parsing of the {@link AlertHistoryEntity} list into
@@ -381,7 +409,8 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
 
     List<Vector> expectedTrapVectors = new LinkedList<>();
     Vector firstVector = new Vector();
-    firstVector.add(new VariableBinding(SnmpConstants.snmpTrapOID, new OID(AmbariSNMPDispatcher.AMBARI_ALERT_TRAP_OID)));
+    firstVector.add(new VariableBinding(SnmpConstants.sysUpTime, new TimeTicks(360000L)));
+    firstVector.add(new VariableBinding(SnmpConstants.snmpTrapOID, new OID(AmbariSNMPDispatcher.AMBARI_ALERT_TRAP_OID)));    
     firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_ID_OID), new Integer32(new BigDecimal(1L).intValueExact())));
     firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_NAME_OID), new OctetString("alert-definition-1")));
     firstVector.add(new VariableBinding(new OID(AmbariSNMPDispatcher.AMBARI_ALERT_DEFINITION_HASH_OID), new OctetString("1")));
@@ -517,7 +546,7 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
     notice.setAlertHistory(history);
     notice.setNotifyState(NotificationState.PENDING);
 
-    ArrayList<AlertNoticeEntity> notices = new ArrayList<AlertNoticeEntity>();
+    ArrayList<AlertNoticeEntity> notices = new ArrayList<>();
     notices.add(notice);
 
     return notices;
@@ -575,7 +604,7 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
     notice2.setAlertHistory(history2);
     notice2.setNotifyState(NotificationState.PENDING);
 
-    ArrayList<AlertNoticeEntity> notices = new ArrayList<AlertNoticeEntity>();
+    ArrayList<AlertNoticeEntity> notices = new ArrayList<>();
     notices.add(notice1);
     notices.add(notice2);
 
@@ -637,7 +666,7 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
   private static class MockSnmpDispatcher implements
       NotificationDispatcher {
 
-    private List<Notification> m_notifications = new ArrayList<Notification>();
+    private List<Notification> m_notifications = new ArrayList<>();
 
     /**
      * {@inheritDoc}
@@ -762,9 +791,20 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
      */
     @Override
     public void configure(Binder binder) {
+      Cluster cluster = EasyMock.createNiceMock(Cluster.class);
       binder.bind(AlertDispatchDAO.class).toInstance(m_dao);
       binder.bind(DispatchFactory.class).toInstance(m_dispatchFactory);
+      binder.bind(StackManagerFactory.class).toInstance(createNiceMock(StackManagerFactory.class));
       binder.bind(AmbariMetaInfo.class).toInstance(m_metaInfo);
+      binder.bind(Clusters.class).toInstance(createNiceMock(Clusters.class));
+      binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
+      binder.bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
+      binder.bind(Cluster.class).toInstance(cluster);
+      binder.bind(AlertDefinitionDAO.class).toInstance(createNiceMock(AlertDefinitionDAO.class));
+      binder.bind(AlertsDAO.class).toInstance(createNiceMock(AlertsDAO.class));
+      binder.bind(EntityManager.class).toInstance(createNiceMock(EntityManager.class));
+
+      binder.bind(AlertNoticeDispatchService.class).toInstance(new AlertNoticeDispatchService());
 
       EasyMock.expect(m_metaInfo.getServerVersion()).andReturn("2.0.0").anyTimes();
       EasyMock.replay(m_metaInfo);
@@ -782,6 +822,7 @@ public class AlertNoticeDispatchServiceTest extends AlertNoticeDispatchService {
       receivedTrapsVectors = new LinkedList<>();
 
       CommandResponder trapPrinter = new CommandResponder() {
+        @Override
         public synchronized void processPdu(CommandResponderEvent e){
           PDU command = e.getPDU();
           if (command != null) {


[11/12] ambari git commit: AMBARI-22535 - Remove extjs From Oozie Installations By Default (jonathanhurley)

Posted by jo...@apache.org.
AMBARI-22535 - Remove extjs From Oozie Installations By Default (jonathanhurley)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 754b1f609076c6939e0013b12c5c58fa1ff1dc7f
Parents: 7bd304f
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Tue Nov 28 13:50:49 2017 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Tue Nov 28 14:27:45 2017 -0500

----------------------------------------------------------------------
 .../stacks/HDP/2.6/services/OOZIE/metainfo.xml  | 34 ++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/754b1f60/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml
index c9dfaad..6653f3b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/OOZIE/metainfo.xml
@@ -21,6 +21,40 @@
     <service>
       <name>OOZIE</name>
       <version>4.2.0</version>
+
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>any</osFamily>
+          <packages>
+            <package>
+              <name>zip</name>
+            </package>
+          </packages>
+        </osSpecific>
+        <osSpecific>
+          <osFamily>redhat5,amazon2015,redhat6,redhat7,suse11,suse12</osFamily>
+          <packages>
+            <package>
+              <name>oozie_${stack_version}</name>
+            </package>
+            <package>
+              <name>falcon_${stack_version}</name>
+            </package>
+          </packages>
+        </osSpecific>
+        <osSpecific>
+          <osFamily>debian7,ubuntu12,ubuntu14,ubuntu16</osFamily>
+          <packages>
+            <package>
+              <name>oozie-${stack_version}</name>
+            </package>
+            <package>
+              <name>falcon-${stack_version}</name>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+
       <configuration-dependencies>
         <config-type>application-properties</config-type>
       </configuration-dependencies>


[10/12] ambari git commit: AMBARI-22527 : Error while viewing topology details - Storm View (Sanket Shah via mradhakrishnan)

Posted by jo...@apache.org.
AMBARI-22527 : Error while viewing topology details - Storm View (Sanket Shah via mradhakrishnan)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 7bd304f87040c70c607fe813d7988384d7cc7663
Parents: 66efd3d
Author: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Authored: Tue Nov 28 10:34:26 2017 -0800
Committer: Madhuvanthi Radhakrishnan <mr...@hortonworks.com>
Committed: Tue Nov 28 10:36:43 2017 -0800

----------------------------------------------------------------------
 .../scripts/containers/ComponentDetailView.jsx  |  2 +-
 .../storm/src/main/resources/ui/package.json    | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7bd304f8/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx
----------------------------------------------------------------------
diff --git a/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx b/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx
index 2b3ed69..a5b356b 100644
--- a/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx
+++ b/contrib/views/storm/src/main/resources/ui/app/scripts/containers/ComponentDetailView.jsx
@@ -574,7 +574,7 @@ export default class ComponentDetailView extends Component {
               <div className="form-group">
                 <label className="col-sm-4 control-label">ID:</label>
                 <div className="col-sm-8">
-                  <p className="form-control-static" style={{'word-wrap' : 'break-word'}}>{componentDetail.id}</p>
+                  <p className="form-control-static" style={{'wordWrap' : 'break-word'}}>{componentDetail.id}</p>
                 </div>
               </div>
               <div className="form-group">

http://git-wip-us.apache.org/repos/asf/ambari/blob/7bd304f8/contrib/views/storm/src/main/resources/ui/package.json
----------------------------------------------------------------------
diff --git a/contrib/views/storm/src/main/resources/ui/package.json b/contrib/views/storm/src/main/resources/ui/package.json
index f9e029b..3b68936 100644
--- a/contrib/views/storm/src/main/resources/ui/package.json
+++ b/contrib/views/storm/src/main/resources/ui/package.json
@@ -66,22 +66,22 @@
     "postcss-loader": "^1.2.2",
     "prop-types": "^15.6.0",
     "react": "15.6.2",
-    "react-bootstrap": "^0.31.3",
-    "react-bootstrap-switch": "^3.4.5",
-    "react-breadcrumbs": "^1.3.16",
-    "react-codemirror": "^0.2.6",
-    "react-datetime": "^2.5.0",
+    "react-bootstrap": "0.31.3",
+    "react-bootstrap-switch": "3.4.5",
+    "react-breadcrumbs": "1.3.16",
+    "react-codemirror": "0.2.6",
+    "react-datetime": "2.5.0",
     "react-dom": "15.6.2",
     "react-hot-loader": "^3.0.0-beta.3",
     "react-onclickoutside": "^5.3.2",
-    "react-router": "^2.6.0",
-    "react-router-bootstrap": "^0.23.1",
-    "react-select": "^1.0.0-beta14",
-    "react-toastr": "^2.8.0",
+    "react-router": "2.6.0",
+    "react-router-bootstrap": "0.23.1",
+    "react-select": "1.0.0-rc.10",
+    "react-toastr": "2.8.0",
     "react-treebeard": "^1.1.4",
     "react-twitter-typeahead": "^1.1.12",
     "react-utils": "^1.0.0",
-    "reactable": "^0.14.0",
+    "reactable": "0.14.0",
     "require-dir": "^0.3.0",
     "run-sequence": "^1.2.2",
     "style-loader": "^0.13.1",


[09/12] ambari git commit: AMBARI-22465 Post-Upgrade Tasks Use the Wrong Repository and Hooks Folders (dgrinenko)

Posted by jo...@apache.org.
AMBARI-22465 Post-Upgrade Tasks Use the Wrong Repository and Hooks Folders (dgrinenko)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 66efd3d5cba7986535099f9d117f1333a6d87ca7
Parents: 473abc3
Author: Dmytro Grinenko <ha...@apache.org>
Authored: Tue Nov 28 16:52:40 2017 +0200
Committer: Dmytro Grinenko <ha...@apache.org>
Committed: Tue Nov 28 19:26:14 2017 +0200

----------------------------------------------------------------------
 .../actionmanager/ExecutionCommandWrapper.java  |  1 -
 .../internal/UpgradeResourceProvider.java       | 38 --------------------
 .../custom_actions/scripts/ru_execute_tasks.py  |  5 +--
 .../custom_actions/test_ru_execute_tasks.py     |  6 ++--
 4 files changed, 6 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/66efd3d5/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
index 4107370..212363b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java
@@ -46,7 +46,6 @@ import org.apache.ambari.server.state.DesiredConfig;
 import org.apache.ambari.server.state.Host;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.ServiceComponent;
-import org.apache.ambari.server.state.ServiceComponentImpl;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.StackInfo;

http://git-wip-us.apache.org/repos/asf/ambari/blob/66efd3d5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index ff326aa..5cfe4f3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -945,36 +945,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     }
   }
 
-  /**
-   * Adds the hooks and service folders based on the effective stack ID and the
-   * name of the service from the wrapper.
-   *
-   * @param wrapper
-   *          the stage wrapper to use when detemrining the service name.
-   * @param effectiveStackId
-   *          the stack ID to use when getting the hooks and service folders.
-   * @param commandParams
-   *          the params to update with the new values
-   * @throws AmbariException
-   */
-  private void applyRepositoryAssociatedParameters(StageWrapper wrapper, StackId effectiveStackId,
-      Map<String, String> commandParams) throws AmbariException {
-    if (CollectionUtils.isNotEmpty(wrapper.getTasks())
-        && wrapper.getTasks().get(0).getService() != null) {
-
-      AmbariMetaInfo ambariMetaInfo = s_metaProvider.get();
-
-      StackInfo stackInfo = ambariMetaInfo.getStack(effectiveStackId.getStackName(),
-          effectiveStackId.getStackVersion());
-
-      String serviceName = wrapper.getTasks().get(0).getService();
-      ServiceInfo serviceInfo = ambariMetaInfo.getService(effectiveStackId.getStackName(),
-          effectiveStackId.getStackVersion(), serviceName);
-
-      commandParams.put(SERVICE_PACKAGE_FOLDER, serviceInfo.getServicePackageFolder());
-      commandParams.put(HOOKS_FOLDER, stackInfo.getStackHooksFolder());
-    }
-  }
 
   /**
    * Creates an action stage using the {@link #EXECUTE_TASK_ROLE} custom action
@@ -1049,10 +1019,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     // Apply additional parameters to the command that come from the stage.
     applyAdditionalParameters(wrapper, params);
 
-    // the ru_execute_tasks invokes scripts - it needs information about where
-    // the scripts live and for that it should always use the target repository
-    // stack
-    applyRepositoryAssociatedParameters(wrapper, effectiveRepositoryVersion.getStackId(), params);
 
     // add each host to this stage
     RequestResourceFilter filter = new RequestResourceFilter(serviceName, componentName,
@@ -1200,10 +1166,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     // Apply additional parameters to the command that come from the stage.
     applyAdditionalParameters(wrapper, commandParams);
 
-    // add things like hooks and service folders based on effective repo
-    applyRepositoryAssociatedParameters(wrapper, effectiveRepositoryVersion.getStackId(),
-        commandParams);
-
     ActionExecutionContext actionContext = new ActionExecutionContext(cluster.getClusterName(),
         "SERVICE_CHECK", filters, commandParams);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/66efd3d5/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py b/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
index 4dec16f..efed150 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/ru_execute_tasks.py
@@ -100,8 +100,8 @@ class ExecuteUpgradeTasks(Script):
     version = default('/roleParams/version', None)
 
     # These 2 variables are optional
-    service_package_folder = default('/roleParams/service_package_folder', None)
-    hooks_folder = default('/roleParams/hooks_folder', None)
+    service_package_folder = default('/commandParams/service_package_folder', None)
+    hooks_folder = default('/commandParams/hooks_folder', None)
 
     tasks = json.loads(config['roleParams']['tasks'])
     if tasks:
@@ -152,5 +152,6 @@ class ExecuteUpgradeTasks(Script):
           task.command = replace_variables(task.command, host_name, version)
           shell.checked_call(task.command, logoutput=True, quiet=True)
 
+
 if __name__ == "__main__":
   ExecuteUpgradeTasks().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/66efd3d5/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py b/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
index 0d12a91..17d5e77 100644
--- a/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
+++ b/ambari-server/src/test/python/custom_actions/test_ru_execute_tasks.py
@@ -146,8 +146,8 @@ class TestRUExecuteTasks(RMFTestCase):
     with open(json_file_path, "r") as json_file:
       json_payload = json.load(json_file)
 
-    del json_payload['roleParams']['service_package_folder']
-    del json_payload['roleParams']['hooks_folder']
+    del json_payload['commandParams']['service_package_folder']
+    del json_payload['commandParams']['hooks_folder']
 
     config_dict = ConfigDictionary(json_payload)
 
@@ -166,7 +166,7 @@ class TestRUExecuteTasks(RMFTestCase):
     # Ensure that the json file was actually read.
     stack_name = default("/hostLevelParams/stack_name", None)
     stack_version = default("/hostLevelParams/stack_version", None)
-    service_package_folder = default('/roleParams/service_package_folder', None)
+    service_package_folder = default('/commandParams/service_package_folder', None)
 
     self.assertEqual(stack_name, "HDP")
     self.assertEqual(stack_version, '2.2')


[07/12] ambari git commit: AMBARI-22523. Service config changes on hdp + hdf cluster throws Consistency check failed. (mpapirkovskyy)

Posted by jo...@apache.org.
AMBARI-22523. Service config changes on hdp + hdf cluster throws Consistency check failed. (mpapirkovskyy)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 3a68e514035c0f1745f5ed713274f6d5292200a0
Parents: 8e35277
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Mon Nov 20 17:19:12 2017 +0200
Committer: Myroslav Papirkovskyi <mp...@hortonworks.com>
Committed: Tue Nov 28 18:29:50 2017 +0200

----------------------------------------------------------------------
 .../resources/stacks/HDP/2.6/services/stack_advisor.py   |  3 +++
 .../test/python/stacks/2.6/common/test_stack_advisor.py  | 11 +++++++++++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3a68e514/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 a5f54a3..0c6c2c7 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
@@ -692,6 +692,9 @@ class HDP26StackAdvisor(HDP25StackAdvisor):
         else:
             druid_broker_host_port = "localhost:8083"
 
+        druid_metadata_uri = ""
+        druid_metadata_user = ""
+        druid_metadata_type = ""
         if 'druid-common' in services['configurations']:
             druid_metadata_uri = services['configurations']['druid-common']['properties']['druid.metadata.storage.connector.connectURI']
             druid_metadata_type = services['configurations']['druid-common']['properties']['druid.metadata.storage.type']

http://git-wip-us.apache.org/repos/asf/ambari/blob/3a68e514/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 f4c5508..b112ffb 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
@@ -1949,6 +1949,17 @@ class TestHDP26StackAdvisor(TestCase):
     self.stackAdvisor.recommendHIVEConfigurations(recommendedConfigurations, clusterData, services, hosts)
     self.assertEquals(recommendedConfigurations, expected)
 
+    # case there are not druid-common configs present
+    del services['configurations']['druid-common']
+    expected['hive-interactive-site']['properties']['hive.druid.broker.address.default'] = 'c6401.ambari.apache.org:8083'
+    expected['hive-interactive-site']['properties']['hive.druid.metadata.uri'] = ''
+    expected['hive-interactive-site']['properties']['hive.druid.metadata.username'] = ''
+    expected['hive-interactive-site']['properties']['hive.druid.metadata.db.type'] = ''
+
+    recommendedConfigurations = {}
+    self.stackAdvisor.recommendHIVEConfigurations(recommendedConfigurations, clusterData, services, hosts)
+    self.assertEquals(recommendedConfigurations, expected)
+
 
   def test_recommendHBASEConfigurations(self):
     configurations = {


[03/12] ambari git commit: AMBARI-22187. Non-root ambari user causes Express Upgrade to fail during checking HDFS safe mode phase (Piyush Chavhan via aonishuk)

Posted by jo...@apache.org.
AMBARI-22187. Non-root ambari user causes Express Upgrade to fail during checking HDFS safe mode phase (Piyush Chavhan via aonishuk)


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

Branch: refs/heads/branch-feature-AMBARI-22457
Commit: 812ded6cabbc1203988d45321cb15bf4f6e3b294
Parents: 9c54948
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Nov 28 11:13:00 2017 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Nov 28 11:13:00 2017 +0200

----------------------------------------------------------------------
 .../4.0/services/HDFS/package/scripts/namenode_upgrade.py    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/812ded6c/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/package/scripts/namenode_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/package/scripts/namenode_upgrade.py b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/package/scripts/namenode_upgrade.py
index 5969fcf..f27bdd2 100755
--- a/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/package/scripts/namenode_upgrade.py
+++ b/ambari-server/src/main/resources/stacks/BigInsights/4.0/services/HDFS/package/scripts/namenode_upgrade.py
@@ -168,11 +168,11 @@ def reach_safemode_state(user, safemode_state, in_ha):
   original_state = SafeMode.UNKNOWN
 
   hostname = params.hostname
-  safemode_check = format("su - {user} -c 'hdfs dfsadmin -safemode get'")
+  safemode_check = format("hdfs dfsadmin -safemode get")
 
   grep_pattern = format("Safe mode is {safemode_state} in {hostname}") if in_ha else format("Safe mode is {safemode_state}")
-  safemode_check_with_grep = format("su - {user} -c 'hdfs dfsadmin -safemode get | grep \"{grep_pattern}\"'")
-  code, out = call(safemode_check)
+  safemode_check_with_grep = format("{safemode_check} | grep '{grep_pattern}'")
+  code, out = call(safemode_check, user=user)
   Logger.info("Command: %s\nCode: %d." % (safemode_check, code))
   if code == 0 and out is not None:
     Logger.info(out)
@@ -191,7 +191,7 @@ def reach_safemode_state(user, safemode_state, in_ha):
                 logoutput=True,
                 path=[params.hadoop_bin_dir])
 
-        code, out = call(safemode_check_with_grep)
+        code, out = call(safemode_check_with_grep, user=user)
         Logger.info("Command: %s\nCode: %d. Out: %s" % (safemode_check_with_grep, code, out))
         if code == 0:
           return (True, original_state)