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 2014/09/18 16:43:50 UTC

[01/34] git commit: AMBARI-7360. Deploying Ambari with custom users fails (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-alerts-dev a4e97aaa2 -> f1018b176


AMBARI-7360. Deploying Ambari with custom users fails (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: ac290e25937baf6f4ccefde823a6ef84a5288aed
Parents: 24f0b47
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 17 16:44:11 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 17 16:44:11 2014 +0300

----------------------------------------------------------------------
 .../server/api/util/StackExtensionHelper.java   |  9 +++------
 .../ambari/server/state/ConfigHelper.java       | 21 ++++++++++++--------
 .../server/state/cluster/ClusterImpl.java       |  3 +--
 .../services/HDFS/configuration/hadoop-env.xml  |  2 +-
 4 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ac290e25/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
index a63be38..3e211fe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java
@@ -749,8 +749,7 @@ public class StackExtensionHelper {
     ConfigurationXml configuration = unmarshal(ConfigurationXml.class, configFile);
     String fileName = configFile.getName();
     stackInfo.getProperties().addAll(getProperties(configuration, fileName));
-    int extIndex = fileName.indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
-    String configType = fileName.substring(0, extIndex);
+    String configType = ConfigHelper.fileNameToConfigType(fileName);
 
     addConfigType(stackInfo.getConfigTypes(), configType);
     setConfigTypeAttributes(stackInfo.getConfigTypes(), configuration, configType);
@@ -797,8 +796,7 @@ public class StackExtensionHelper {
     ConfigurationXml configuration = unmarshal(ConfigurationXml.class, configFile);
     String fileName = configFile.getName();
     serviceInfo.getProperties().addAll(getProperties(configuration, fileName));
-    int extIndex = fileName.indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
-    String configType = fileName.substring(0, extIndex);
+    String configType = ConfigHelper.fileNameToConfigType(fileName);
 
     addConfigType(serviceInfo.getConfigTypes(), configType);
     setConfigTypeAttributes(serviceInfo.getConfigTypes(), configuration, configType);
@@ -836,8 +834,7 @@ public class StackExtensionHelper {
     if (configurations != null) {
       Map<String, Map<String, Map<String, String>>> configTypes = new HashMap<String, Map<String, Map<String, String>>>();
       for (PropertyInfo configuration : configurations) {
-        int extIndex = configuration.getFilename().indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
-        String configType = configuration.getFilename().substring(0, extIndex);
+        String configType = ConfigHelper.fileNameToConfigType(configuration.getFilename());
         
         if (!configTypes.containsKey(configType)) {
           Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac290e25/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index 790c177..191549b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -78,7 +78,7 @@ public class ConfigHelper {
     staleConfigsCache = CacheBuilder.newBuilder().
       expireAfterWrite(STALE_CONFIGS_CACHE_EXPIRATION_TIME, TimeUnit.SECONDS).build();
   }
-  
+
   /**
    * Gets the desired tags for a cluster and host
    * @param cluster the cluster
@@ -428,8 +428,7 @@ public class ConfigHelper {
       
       for (PropertyInfo stackProperty : stackProperties) {
         if(stackProperty.getName().equals(propertyName)) {
-          int extIndex = stackProperty.getFilename().indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
-          String configType = stackProperty.getFilename().substring(0, extIndex);
+          String configType = fileNameToConfigType(stackProperty.getFilename());
           
           result.add(configType);
         }
@@ -447,10 +446,11 @@ public class ConfigHelper {
 
     for(Service service : cluster.getServices().values()) {
       Set<PropertyInfo> stackProperties = ambariMetaInfo.getProperties(stack.getName(), stack.getVersion(), service.getName());
-      
+
       for (PropertyInfo stackProperty : stackProperties) {
         if(stackProperty.getPropertyTypes().contains(propertyType)) {
-          result.add(stackProperty.getValue());
+          String stackPropertyConfigType = fileNameToConfigType(stackProperty.getFilename());
+          result.add(cluster.getDesiredConfigByType(stackPropertyConfigType).getProperties().get(stackProperty.getName()));
         }
       }
     }
@@ -459,7 +459,8 @@ public class ConfigHelper {
     
     for (PropertyInfo stackProperty : stackProperties) {
       if(stackProperty.getPropertyTypes().contains(propertyType)) {
-        result.add(stackProperty.getValue());
+        String stackPropertyConfigType = fileNameToConfigType(stackProperty.getFilename());
+        result.add(cluster.getDesiredConfigByType(stackPropertyConfigType).getProperties().get(stackProperty.getName()));
       }
     }
     
@@ -475,8 +476,7 @@ public class ConfigHelper {
       Set<PropertyInfo> stackProperties = ambariMetaInfo.getProperties(stack.getName(), stack.getVersion(), serviceInfo.getName());
       
       for (PropertyInfo stackProperty : stackProperties) {
-        int extIndex = stackProperty.getFilename().indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
-        String stackPropertyConfigType = stackProperty.getFilename().substring(0, extIndex);
+        String stackPropertyConfigType = fileNameToConfigType(stackProperty.getFilename());
         
         if(stackProperty.getName().equals(propertyName) && stackPropertyConfigType.equals(configType)) {
           return stackProperty.getValue();
@@ -750,5 +750,10 @@ public class ConfigHelper {
   }
 
 
+  public static String fileNameToConfigType(String filename) {
+    int extIndex = filename.indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
+    return filename.substring(0, extIndex);
+  }
+
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac290e25/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 06f46fe..8914924 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -242,8 +242,7 @@ public class ClusterImpl implements Cluster {
       //collect config types for service
       Set<PropertyInfo> properties = ambariMetaInfo.getProperties(desiredStackVersion.getStackName(), desiredStackVersion.getStackVersion(), serviceName);
       for (PropertyInfo property : properties) {
-        int extIndex = property.getFilename().indexOf(AmbariMetaInfo.SERVICE_CONFIG_FILE_NAME_POSTFIX);
-        String configType = property.getFilename().substring(0, extIndex);
+        String configType = ConfigHelper.fileNameToConfigType(property.getFilename());
         if (serviceInfo.getExcludedConfigTypes() == null ||
           !serviceInfo.getExcludedConfigTypes().contains(configType)) {
           serviceConfigTypes.put(serviceName, configType);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac290e25/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/configuration/hadoop-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/configuration/hadoop-env.xml b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/configuration/hadoop-env.xml
index 1de475e..5da6484 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/configuration/hadoop-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/configuration/hadoop-env.xml
@@ -62,12 +62,12 @@
     <description>DataNode maximum Java heap size</description>
   </property>
   <property>
-  <property>
     <name>proxyuser_group</name>
     <value>users</value>
     <property-type>GROUP</property-type>
     <description>Proxy user group.</description>
   </property>
+  <property>
     <name>hdfs_user</name>
     <value>hdfs</value>
     <property-type>USER</property-type>


[26/34] git commit: AMBARI-7382. Move Wizard: Review step doesn't show source and targer hosts. (akovalenko)

Posted by jo...@apache.org.
AMBARI-7382. Move Wizard: Review step doesn't show source and targer hosts. (akovalenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 38a18126ff070847d26f8fe913de93ea00f72bd9
Parents: 731d7b4
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Thu Sep 18 15:18:25 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Thu Sep 18 15:18:25 2014 +0300

----------------------------------------------------------------------
 .../main/service/reassign/step2_controller.js   |   1 +
 .../app/controllers/wizard/step5_controller.js  |  10 +-
 ambari-web/app/routes/reassign_master_routes.js | 124 +++++++++++--------
 3 files changed, 78 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/38a18126/ambari-web/app/controllers/main/service/reassign/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step2_controller.js b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
index f837408..7e4513a 100644
--- a/ambari-web/app/controllers/main/service/reassign/step2_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step2_controller.js
@@ -22,6 +22,7 @@ App.ReassignMasterWizardStep2Controller = App.WizardStep5Controller.extend({
 
   currentHostId: null,
   showCurrentHost: true,
+  useServerValidation: false,
 
   loadStep: function() {
     // If High Availability is enabled NameNode became a multiple component

http://git-wip-us.apache.org/repos/asf/ambari/blob/38a18126/ambari-web/app/controllers/wizard/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step5_controller.js b/ambari-web/app/controllers/wizard/step5_controller.js
index 68342c7..6fb9ab1 100644
--- a/ambari-web/app/controllers/wizard/step5_controller.js
+++ b/ambari-web/app/controllers/wizard/step5_controller.js
@@ -98,6 +98,12 @@ App.WizardStep5Controller = Em.Controller.extend(App.BlueprintMixin, {
   submitButtonClicked: false,
 
   /**
+   * Either use or not use server validation in this controller
+   * @type {bool}
+   */
+  useServerValidation: true,
+
+  /**
    * Trigger for executing host names check for components
    * Should de "triggered" when host changed for some component and when new multiple component is added/removed
    * @type {bool}
@@ -243,7 +249,7 @@ App.WizardStep5Controller = Em.Controller.extend(App.BlueprintMixin, {
       return false;
     }
 
-    if (App.get('supports.serverRecommendValidate')) {
+    if (App.get('supports.serverRecommendValidate') && this.get('useServerValidation')) {
       self.set('submitDisabled', true);
 
       // reset previous recommendations
@@ -1095,7 +1101,7 @@ App.WizardStep5Controller = Em.Controller.extend(App.BlueprintMixin, {
         self.set('submitButtonClicked', false);
       };
 
-      if (App.get('supports.serverRecommendValidate')) {
+      if (App.get('supports.serverRecommendValidate')  && this.get('useServerValidation')) {
         self.recommendAndValidate(function () {
           self.showValidationIssuesAcceptBox(goNextStepIfValid);
         });

http://git-wip-us.apache.org/repos/asf/ambari/blob/38a18126/ambari-web/app/routes/reassign_master_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/reassign_master_routes.js b/ambari-web/app/routes/reassign_master_routes.js
index f28083a..e6ef5ca 100644
--- a/ambari-web/app/routes/reassign_master_routes.js
+++ b/ambari-web/app/routes/reassign_master_routes.js
@@ -21,7 +21,7 @@ var App = require('app');
 module.exports = App.WizardRoute.extend({
   route: '/service/reassign',
 
-  leaveWizard: function (router,context) {
+  leaveWizard: function (router, context) {
     var reassignMasterController = router.get('reassignMasterController');
     App.router.get('updateController').set('isWorking', true);
     reassignMasterController.finish();
@@ -29,67 +29,73 @@ module.exports = App.WizardRoute.extend({
       clusterName: App.router.get('content.cluster.name'),
       clusterState: 'DEFAULT',
       localdb: App.db.data
-    }, {alwaysCallback: function() {context.hide(); router.transitionTo('main.index');location.reload();}});
+    }, {alwaysCallback: function () {
+      context.hide();
+      router.transitionTo('main.index');
+      location.reload();
+    }});
   },
 
   enter: function (router) {
     console.log('in /service/reassign:enter');
-    if (App.router.get('mainHostController.hostsCountMap.TOTAL') > 1) {
-      var context = this;
-      Em.run.next(function () {
-        var reassignMasterController = router.get('reassignMasterController');
-        App.router.get('updateController').set('isWorking', false);
-        var popup = App.ModalPopup.show({
-          classNames: ['full-width-modal'],
-          header: Em.I18n.t('services.reassign.header'),
-          bodyClass: App.ReassignMasterView.extend({
-            controller: reassignMasterController
-          }),
-          primary: Em.I18n.t('form.cancel'),
-          showFooter: false,
-          secondary: null,
+    var context = this;
+    var reassignMasterController = router.get('reassignMasterController');
+    reassignMasterController.dataLoading().done(function () {
+      if (App.router.get('mainHostController.hostsCountMap.TOTAL') > 1) {
+        Em.run.next(function () {
+          App.router.get('updateController').set('isWorking', false);
+          var popup = App.ModalPopup.show({
+            classNames: ['full-width-modal'],
+            header: Em.I18n.t('services.reassign.header'),
+            bodyClass: App.ReassignMasterView.extend({
+              controller: reassignMasterController
+            }),
+            primary: Em.I18n.t('form.cancel'),
+            showFooter: false,
+            secondary: null,
 
-          onPrimary: function () {
-            this.hide();
-            App.router.get('updateController').set('isWorking', true);
-            App.router.transitionTo('main.services.index');
-          },
-          onClose: function () {
-            var reassignMasterController = router.get('reassignMasterController');
-            var currStep = reassignMasterController.get('currentStep');
+            onPrimary: function () {
+              this.hide();
+              App.router.get('updateController').set('isWorking', true);
+              App.router.transitionTo('main.services.index');
+            },
+            onClose: function () {
+              var reassignMasterController = router.get('reassignMasterController');
+              var currStep = reassignMasterController.get('currentStep');
 
-            if (parseInt(currStep) > 3) {
-              var self = this;
-              App.showConfirmationPopup(function () {
-                router.get('reassignMasterWizardStep' + currStep + 'Controller').removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
-                context.leaveWizard(router, self);
-              }, Em.I18n.t('services.reassign.closePopup').format(reassignMasterController.get('content.reassign.display_name')));
-            } else {
-              context.leaveWizard(router, this);
+              if (parseInt(currStep) > 3) {
+                var self = this;
+                App.showConfirmationPopup(function () {
+                  router.get('reassignMasterWizardStep' + currStep + 'Controller').removeObserver('tasks.@each.status', this, 'onTaskStatusChange');
+                  context.leaveWizard(router, self);
+                }, Em.I18n.t('services.reassign.closePopup').format(reassignMasterController.get('content.reassign.display_name')));
+              } else {
+                context.leaveWizard(router, this);
+              }
+            },
+            didInsertElement: function () {
+              this.fitHeight();
+            }
+          });
+          reassignMasterController.set('popup', popup);
+          reassignMasterController.loadSecurityEnabled();
+          reassignMasterController.loadComponentToReassign();
+          var currentClusterStatus = App.clusterStatus.get('value');
+          if (currentClusterStatus) {
+            switch (currentClusterStatus.clusterState) {
+              case 'REASSIGN_MASTER_INSTALLING' :
+                reassignMasterController.setCurrentStep(currentClusterStatus.localdb.ReassignMaster.currentStep);
+                break;
             }
-          },
-          didInsertElement: function () {
-            this.fitHeight();
           }
+          router.transitionTo('step' + reassignMasterController.get('currentStep'));
         });
-        reassignMasterController.set('popup', popup);
-        reassignMasterController.loadSecurityEnabled();
-        reassignMasterController.loadComponentToReassign();
-        var currentClusterStatus = App.clusterStatus.get('value');
-        if (currentClusterStatus) {
-          switch (currentClusterStatus.clusterState) {
-            case 'REASSIGN_MASTER_INSTALLING' :
-              reassignMasterController.setCurrentStep(currentClusterStatus.localdb.ReassignMaster.currentStep);
-              break;
-          }
-        }
-        router.transitionTo('step' + reassignMasterController.get('currentStep'));
-      });
-    } else {
-      App.showAlertPopup(Em.I18n.t('common.error'), Em.I18n.t('services.reassign.error.fewHosts'), function () {
-        router.transitionTo('main.services.index');
-      })
-    }
+      } else {
+        App.showAlertPopup(Em.I18n.t('common.error'), Em.I18n.t('services.reassign.error.fewHosts'), function () {
+          router.transitionTo('main.services.index');
+        })
+      }
+    });
   },
 
   step1: Em.Route.extend({
@@ -215,7 +221,11 @@ module.exports = App.WizardRoute.extend({
           clusterName: router.get('reassignMasterController.content.cluster.name'),
           clusterState: 'DEFAULT',
           localdb: App.db.data
-        },{alwaysCallback: function() {controller.get('popup').hide();router.transitionTo('main.index');location.reload();}});
+        }, {alwaysCallback: function () {
+          controller.get('popup').hide();
+          router.transitionTo('main.index');
+          location.reload();
+        }});
       }
     },
 
@@ -276,7 +286,11 @@ module.exports = App.WizardRoute.extend({
           clusterName: router.get('reassignMasterController.content.cluster.name'),
           clusterState: 'DEFAULT',
           localdb: App.db.data
-        },{alwaysCallback: function() {controller.get('popup').hide();router.transitionTo('main.index');location.reload();}});
+        }, {alwaysCallback: function () {
+          controller.get('popup').hide();
+          router.transitionTo('main.index');
+          location.reload();
+        }});
       }
     },
 


[24/34] git commit: AMBARI-7284 - (Apache AMBARI-7284) Hadoop cluster alerts need updates for Hadoop 2.4 and 2.5

Posted by jo...@apache.org.
AMBARI-7284 - (Apache AMBARI-7284) Hadoop cluster alerts need updates for Hadoop 2.4 and 2.5


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

Branch: refs/heads/branch-alerts-dev
Commit: a14ca23882a76c1daa27038c8e00a20d231ce55f
Parents: 3f932cf
Author: Artem Baranchuk <ab...@hortonworks.com>
Authored: Mon Sep 15 19:50:29 2014 +0300
Committer: Artem Baranchuk <ab...@hortonworks.com>
Committed: Thu Sep 18 13:47:48 2014 +0300

----------------------------------------------------------------------
 .../services/NAGIOS/package/files/sys_logger.py | 30 +++++---
 .../test/nagios/plugins/test_sys_logger.py      | 77 ++++++++++++++++++--
 2 files changed, 91 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a14ca238/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/files/sys_logger.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/files/sys_logger.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/files/sys_logger.py
index 8f0a415..e86a8fb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/files/sys_logger.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/files/sys_logger.py
@@ -114,14 +114,24 @@ msg_ids = {'Host::Ping':'host_down',
            'GANGLIA::Ganglia Monitor process for ResourceManager':'ganglia_monitor_process',
            'GANGLIA::Ganglia Monitor process for HistoryServer':'ganglia_monitor_process',
            'HBASEMASTER::HBase Master process':'hbase_master_process',
+           'HBASE::Percent RegionServers live':'regionservers_down',
            'REGIONSERVER::RegionServer process':'regionserver_process',
            'NAGIOS::Nagios status log freshness':'nagios_process',
            'FLUME::Flume Agent process':'flume_agent_process',
            'OOZIE::Oozie Server status':'oozie_server_process',
            'HIVE-METASTORE::Hive Metastore status':'hive_metastore_process',
-           'WEBHCAT::WebHCat Server status':'webhcat_server_process',
-           'RESOURCEMANAGER::ResourceManager process':'resourcemanager_process',
-           'NODEMANAGER::NodeManager process':'nodemanager_process',
+           'WEBHCAT::WebHCat Server status':'webhcat_down',
+           'RESOURCEMANAGER::ResourceManager process':'resourcemanager_process_down',
+           'RESOURCEMANAGER::ResourceManager RPC latency':'resourcemanager_rpc_latency',
+           'RESOURCEMANAGER::ResourceManager CPU utilization':'resourcemanager_cpu_utilization',
+           'RESOURCEMANAGER::ResourceManager Web UI':'recourcemanager_ui',
+           'NODEMANAGER::NodeManager process':'nodemanager_process_down',
+           'NODEMANAGER::NodeManager health':'nodemanager_health',
+           'NODEMANAGER::Percent NodeManagers live':'nodemanagers_down',
+           'APP_TIMELINE_SERVER::App Timeline Server process':'timelineserver_process',
+           'JOBHISTORY::HistoryServer RPC latency':'historyserver_rpc_latency',
+           'JOBHISTORY::HistoryServer CPU utilization':'historyserver_cpu_utilization',
+           'JOBHISTORY::HistoryServer Web UI':'historyserver_ui',
            'JOBHISTORY::HistoryServer process':'historyserver_process'}
 
 # Determine the severity of the TVI alert based on the Nagios alert state.
@@ -142,13 +152,13 @@ def determine_severity(state, service):
 # Determine the msg id for the TVI alert from based on the service which generates the Nagios alert.
 # The msg id is used to correlate a log msg to a TVI rule.
 def determine_msg_id(service, severity):
-    if msg_ids.has_key(service):
-        msg_id = msg_ids[service]
-        if severity == 'OK':
-            msg_id = '{0}_ok'.format(msg_id)
-
-        return msg_id
-    else: return 'HADOOP_UNKNOWN_MSG'
+  for k, v in msg_ids.iteritems():
+    if(k in service):
+      msg_id = v
+      if severity == 'OK':
+        msg_id = '{0}_ok'.format(msg_id)
+      return msg_id
+  return 'HADOOP_UNKNOWN_MSG'
 
 
 # Determine the domain.  Currently the domain is always 'Hadoop'.

http://git-wip-us.apache.org/repos/asf/ambari/blob/a14ca238/contrib/addons/test/nagios/plugins/test_sys_logger.py
----------------------------------------------------------------------
diff --git a/contrib/addons/test/nagios/plugins/test_sys_logger.py b/contrib/addons/test/nagios/plugins/test_sys_logger.py
index eb7a8fe..49c5de8 100644
--- a/contrib/addons/test/nagios/plugins/test_sys_logger.py
+++ b/contrib/addons/test/nagios/plugins/test_sys_logger.py
@@ -259,6 +259,13 @@ test('Hadoop_RegionServer_Down:OK',
     'OK: Hadoop: regionservers_down_ok# SERVICE MSG',
     'HARD', '1', 'OK', 'HBASE::Percent region servers down', 'SERVICE MSG')
 
+test('HBASE_RegionServer_live',
+     'Critical: Hadoop: regionservers_down# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'HBASE::Percent RegionServers live', 'SERVICE MSG')
+test('HBASE_RegionServer_live:OK',
+     'OK: Hadoop: regionservers_down_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'HBASE::Percent RegionServers live', 'SERVICE MSG')
+
 # Hadoop_Hive_Metastore_Process_Down
 test('Hadoop_Hive_Metastore_Process_Down',
      'Critical: Hadoop: hive_metastore_process_down# SERVICE MSG',
@@ -548,26 +555,48 @@ test('Hive_Metastore_status:OK',
      'HARD', '1', 'OK', 'HIVE-METASTORE::Hive Metastore status', 'SERVICE MSG')
 
 test('WebHCat_Server_status',
-     'Critical: Hadoop: webhcat_server_process# SERVICE MSG',
+     'Critical: Hadoop: webhcat_down# SERVICE MSG',
      'HARD', '1', 'CRITICAL', 'WEBHCAT::WebHCat Server status', 'SERVICE MSG')
 test('WebHCat_Server_status:OK',
-     'OK: Hadoop: webhcat_server_process_ok# SERVICE MSG',
+     'OK: Hadoop: webhcat_down_ok# SERVICE MSG',
      'HARD', '1', 'OK', 'WEBHCAT::WebHCat Server status', 'SERVICE MSG')
 
 test('ResourceManager_process',
-     'Critical: Hadoop: resourcemanager_process# SERVICE MSG',
+     'Critical: Hadoop: resourcemanager_process_down# SERVICE MSG',
      'HARD', '1', 'CRITICAL', 'RESOURCEMANAGER::ResourceManager process', 'SERVICE MSG')
 test('ResourceManager_process:OK',
-     'OK: Hadoop: resourcemanager_process_ok# SERVICE MSG',
+     'OK: Hadoop: resourcemanager_process_down_ok# SERVICE MSG',
      'HARD', '1', 'OK', 'RESOURCEMANAGER::ResourceManager process', 'SERVICE MSG')
 
+test('AppTimeline_process',
+     'Critical: Hadoop: timelineserver_process# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'APP_TIMELINE_SERVER::App Timeline Server process', 'SERVICE MSG')
+test('AppTimeline_process:OK',
+     'OK: Hadoop: timelineserver_process_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'APP_TIMELINE_SERVER::App Timeline Server process', 'SERVICE MSG')
+
 test('NodeManager_process',
-     'Critical: Hadoop: nodemanager_process# SERVICE MSG',
+     'Critical: Hadoop: nodemanager_process_down# SERVICE MSG',
      'HARD', '1', 'CRITICAL', 'NODEMANAGER::NodeManager process', 'SERVICE MSG')
 test('NodeManager_process:OK',
-     'OK: Hadoop: nodemanager_process_ok# SERVICE MSG',
+     'OK: Hadoop: nodemanager_process_down_ok# SERVICE MSG',
      'HARD', '1', 'OK', 'NODEMANAGER::NodeManager process', 'SERVICE MSG')
 
+test('NodeManager_health',
+     'Critical: Hadoop: nodemanager_health# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'NODEMANAGER::NodeManager health', 'SERVICE MSG')
+test('NodeManager_health:OK',
+     'OK: Hadoop: nodemanager_health_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'NODEMANAGER::NodeManager health', 'SERVICE MSG')
+
+test('NodeManager_live',
+     'Critical: Hadoop: nodemanagers_down# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'NODEMANAGER::Percent NodeManagers live', 'SERVICE MSG')
+test('NodeManager_live:OK',
+     'OK: Hadoop: nodemanagers_down_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'NODEMANAGER::Percent NodeManagers live', 'SERVICE MSG')
+
+
 test('HistoryServer_process',
      'Critical: Hadoop: historyserver_process# SERVICE MSG',
      'HARD', '1', 'CRITICAL', 'JOBHISTORY::HistoryServer process', 'SERVICE MSG')
@@ -575,5 +604,41 @@ test('HistoryServer_process:OK',
      'OK: Hadoop: historyserver_process_ok# SERVICE MSG',
      'HARD', '1', 'OK', 'JOBHISTORY::HistoryServer process', 'SERVICE MSG')
 
+test('HistoryServer_RPC_latency',
+     'Critical: Hadoop: historyserver_rpc_latency# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'JOBHISTORY::HistoryServer RPC latency', 'SERVICE MSG')
+test('HistoryServer_RPC_latency:OK',
+     'OK: Hadoop: historyserver_rpc_latency_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'JOBHISTORY::HistoryServer RPC latency', 'SERVICE MSG')
+
+test('HistoryServer_CPU_utilization',
+     'Critical: Hadoop: historyserver_cpu_utilization# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'JOBHISTORY::HistoryServer CPU utilization', 'SERVICE MSG')
+test('HistoryServer_CPU_utilization:OK',
+     'OK: Hadoop: historyserver_cpu_utilization_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'JOBHISTORY::HistoryServer CPU utilization', 'SERVICE MSG')
+
+test('HistoryServer_Web_UI',
+     'Critical: Hadoop: historyserver_ui# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'JOBHISTORY::HistoryServer Web UI', 'SERVICE MSG')
+test('HistoryServer_Web_UI:OK',
+     'OK: Hadoop: historyserver_ui_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'JOBHISTORY::HistoryServer Web UI', 'SERVICE MSG')
+
+test('ResourceManager_rpc_latency',
+     'Critical: Hadoop: resourcemanager_rpc_latency# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'RESOURCEMANAGER::ResourceManager RPC latency', 'SERVICE MSG')
+test('ResourceManager_rpc_latency:OK',
+     'OK: Hadoop: resourcemanager_rpc_latency_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'RESOURCEMANAGER::ResourceManager RPC latency', 'SERVICE MSG')
+
+test('ResourceManager_cpu_utilization',
+     'Critical: Hadoop: resourcemanager_cpu_utilization# SERVICE MSG',
+     'HARD', '1', 'CRITICAL', 'RESOURCEMANAGER::ResourceManager CPU utilization', 'SERVICE MSG')
+test('ResourceManager_cpu_utilization:OK',
+     'OK: Hadoop: resourcemanager_cpu_utilization_ok# SERVICE MSG',
+     'HARD', '1', 'OK', 'RESOURCEMANAGER::ResourceManager CPU utilization', 'SERVICE MSG')
+
+
 summary()
 


[25/34] git commit: AMBARI-7381 Slider View: FE - status of alerts shows as UNKNOWN. (atkach)

Posted by jo...@apache.org.
AMBARI-7381 Slider View: FE - status of alerts shows as UNKNOWN. (atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: 731d7b4a7beca2d7a3ab810b5f83f96ee301a15c
Parents: a14ca23
Author: atkach <at...@hortonworks.com>
Authored: Thu Sep 18 14:14:03 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Thu Sep 18 14:16:26 2014 +0300

----------------------------------------------------------------------
 .../resources/ui/app/models/slider_app_alert.js | 43 +++++---------------
 .../ui/app/templates/slider_app/summary.hbs     |  2 +-
 .../ui/app/views/slider_app/summary_view.js     |  2 +-
 3 files changed, 12 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/731d7b4a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_alert.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_alert.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app_alert.js
index c8cf0bd..f62c3ab 100644
--- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app_alert.js
+++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app_alert.js
@@ -85,46 +85,23 @@ App.SliderAppAlert = DS.Model.extend({
   timeSinceAlert: function () {
     var d = this.get('date');
     var timeFormat;
+    var statusMap = Em.Object.create({
+      'OK': 'OK',
+      'WARNING': 'WARN',
+      'CRITICAL': 'CRIT',
+      'PASSIVE': 'MAINT'
+    });
+    var messageKey = statusMap.getWithDefault(this.get('status'), 'UNKNOWN');
+
     if (d) {
-      switch (this.get('status')) {
-        case "0":
-          timeFormat = Em.I18n.t('sliderApp.alerts.OK.timePrefix');
-          break;
-        case "1":
-          timeFormat = Em.I18n.t('sliderApp.alerts.WARN.timePrefix');
-          break;
-        case "2":
-          timeFormat = Em.I18n.t('sliderApp.alerts.CRIT.timePrefix');
-          break;
-        case "3":
-          timeFormat = Em.I18n.t('sliderApp.alerts.MAINT.timePrefix');
-          break;
-        default:
-          timeFormat = Em.I18n.t('sliderApp.alerts.UNKNOWN.timePrefix');
-          break;
-      }
+      timeFormat = Em.I18n.t('sliderApp.alerts.' + messageKey + '.timePrefix');
       var prevSuffix = $.timeago.settings.strings.suffixAgo;
       $.timeago.settings.strings.suffixAgo = '';
       var since = timeFormat.format($.timeago(this.makeTimeAtleastMinuteAgo(d)));
       $.timeago.settings.strings.suffixAgo = prevSuffix;
       return since;
     } else if (d == 0) {
-      switch (this.get('status')) {
-        case "0":
-          timeFormat = Em.I18n.t('sliderApp.alerts.OK.timePrefixShort');
-          break;
-        case "1":
-          timeFormat = Em.I18n.t('sliderApp.alerts.WARN.timePrefixShort');
-          break;
-        case "2":
-          timeFormat = Em.I18n.t('sliderApp.alerts.CRIT.timePrefixShort');
-          break;
-        case "3":
-          timeFormat = Em.I18n.t('sliderApp.alerts.MAINT.timePrefixShort');
-          break;
-        default:
-          timeFormat = Em.I18n.t('sliderApp.alerts.UNKNOWN.timePrefixShort');
-      }
+      timeFormat = Em.I18n.t('sliderApp.alerts.' + messageKey + '.timePrefixShort');
       return timeFormat;
     } else {
       return "";

http://git-wip-us.apache.org/repos/asf/ambari/blob/731d7b4a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
index ae056a6..2add6ec 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
@@ -90,7 +90,7 @@
                   <div class="col-md-11">
                     <div class="row">
                       <div class="col-md-7 title">{{title}}</div>
-                      <div {{bs-bind-tooltip view.tooltip}} data-placement="left" class="col-md-5 date-time">{{timeSinceAlert}}</div>
+                      <div {{bs-bind-tooltip view.tooltip}} class="col-md-5 date-time">{{timeSinceAlert}}</div>
                     </div>
                     <div class="message">{{message}}</div>
                   </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/731d7b4a/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js b/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js
index 6351f77..1709757 100644
--- a/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js
+++ b/contrib/views/slider/src/main/resources/ui/app/views/slider_app/summary_view.js
@@ -52,7 +52,7 @@ App.SliderAppSummaryView = Ember.View.extend({
       return Ember.Object.create({
         trigger: 'hover',
         content: this.get('content.timeSinceAlertDetails'),
-        placement: "right"
+        placement: "bottom"
       });
     }.property('content')
   })


[05/34] git commit: AMBARI-7333. Tez deployment changes for Champlain (aonishuk)

Posted by jo...@apache.org.
AMBARI-7333. Tez deployment changes for Champlain (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: c09edb729fce602f0943b048df7810353ecd4975
Parents: 4bcf111
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 17 18:11:06 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 17 18:11:06 2014 +0300

----------------------------------------------------------------------
 .../libraries/providers/copy_from_local.py       | 12 +++++++++---
 .../libraries/resources/copy_from_local.py       |  3 ++-
 .../HIVE/package/scripts/install_jars.py         | 19 +++++++++++++++----
 .../2.1/services/TEZ/configuration/tez-site.xml  |  2 +-
 .../python/stacks/2.0.6/HIVE/test_hive_server.py | 10 ++++++++++
 5 files changed, 37 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c09edb72/ambari-common/src/main/python/resource_management/libraries/providers/copy_from_local.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/copy_from_local.py b/ambari-common/src/main/python/resource_management/libraries/providers/copy_from_local.py
index 9031a77..79d3e35 100644
--- a/ambari-common/src/main/python/resource_management/libraries/providers/copy_from_local.py
+++ b/ambari-common/src/main/python/resource_management/libraries/providers/copy_from_local.py
@@ -27,6 +27,7 @@ class CopyFromLocalProvider(Provider):
   def action_run(self):
     path = self.resource.path
     dest_dir = self.resource.dest_dir
+    dest_file = self.resource.dest_file
     kinnit_if_needed = self.resource.kinnit_if_needed
     owner = self.resource.owner
     group = self.resource.group
@@ -34,9 +35,14 @@ class CopyFromLocalProvider(Provider):
     hdfs_usr=self.resource.hdfs_user
     hadoop_conf_path = self.resource.hadoop_conf_dir
 
-    copy_cmd = format("fs -copyFromLocal {path} {dest_dir}")
-    dest_file_name = os.path.split(path)[1]
-    dest_path = dest_dir + dest_file_name if dest_dir.endswith(os.sep) else dest_dir + os.sep + dest_file_name
+
+    if dest_file:
+      copy_cmd = format("fs -copyFromLocal {path} {dest_dir}/{dest_file}")
+      dest_path = dest_dir + dest_file if dest_dir.endswith(os.sep) else dest_dir + os.sep + dest_file
+    else:
+      dest_file_name = os.path.split(path)[1]
+      copy_cmd = format("fs -copyFromLocal {path} {dest_dir}")
+      dest_path = dest_dir + os.sep + dest_file_name
     # Need to run unless as resource user
     su_cmd = 'su - {0} -c'.format(owner)
     unless_cmd = format("{su_cmd} '{kinnit_if_needed} hadoop fs -ls {dest_path}' >/dev/null 2>&1")

http://git-wip-us.apache.org/repos/asf/ambari/blob/c09edb72/ambari-common/src/main/python/resource_management/libraries/resources/copy_from_local.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/resources/copy_from_local.py b/ambari-common/src/main/python/resource_management/libraries/resources/copy_from_local.py
index 328d9c2..eaaeab5 100644
--- a/ambari-common/src/main/python/resource_management/libraries/resources/copy_from_local.py
+++ b/ambari-common/src/main/python/resource_management/libraries/resources/copy_from_local.py
@@ -28,6 +28,7 @@ class CopyFromLocal(Resource):
 
   path = ResourceArgument(default=lambda obj: obj.name)
   dest_dir = ResourceArgument(required=True)
+  dest_file = ResourceArgument()
   owner = ResourceArgument(required=True)
   group = ResourceArgument()
   mode = ResourceArgument()
@@ -35,4 +36,4 @@ class CopyFromLocal(Resource):
   hadoop_conf_dir = ResourceArgument(default='/etc/hadoop/conf')
   hdfs_user = ResourceArgument(default='hdfs')
 
-  actions = Resource.actions + ["run"]
\ No newline at end of file
+  actions = Resource.actions + ["run"]

http://git-wip-us.apache.org/repos/asf/ambari/blob/c09edb72/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py
index 3548de7..0045fee 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py
@@ -72,6 +72,16 @@ def install_tez_jars():
                     hdfs_user=params.hdfs_user,
                     hadoop_conf_dir=params.hadoop_conf_dir
       )
+
+      CopyFromLocal(params.tez_tar_file,
+                    owner=params.tez_user,
+                    mode=0755,
+                    dest_dir=app_dir_path,
+                    dest_file="tez.tar.gz",
+                    kinnit_if_needed=kinit_if_needed,
+                    hdfs_user=params.hdfs_user,
+                    hadoop_conf_dir=params.hadoop_conf_dir
+      )
     pass
 
     if lib_dir_path:
@@ -92,10 +102,11 @@ def get_tez_hdfs_dir_paths(tez_lib_uris = None):
   if tez_lib_uris and tez_lib_uris.strip().find(hdfs_path_prefix, 0) != -1:
     dir_paths = tez_lib_uris.split(',')
     for path in dir_paths:
-      lib_dir_path = path.replace(hdfs_path_prefix, '')
-      lib_dir_path = lib_dir_path if lib_dir_path.endswith(os.sep) else lib_dir_path + os.sep
-      lib_dir_paths.append(lib_dir_path)
+      if not "tez.tar.gz" in path:
+        lib_dir_path = path.replace(hdfs_path_prefix, '')
+        lib_dir_path = lib_dir_path if lib_dir_path.endswith(os.sep) else lib_dir_path + os.sep
+        lib_dir_paths.append(lib_dir_path)
     pass
   pass
 
-  return lib_dir_paths
\ No newline at end of file
+  return lib_dir_paths

http://git-wip-us.apache.org/repos/asf/ambari/blob/c09edb72/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
index 218c508..7b34d3b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
@@ -21,7 +21,7 @@
 
   <property>
     <name>tez.lib.uris</name>
-    <value>hdfs:///apps/tez/,hdfs:///apps/tez/lib/</value>
+    <value>hdfs:///apps/tez/,hdfs:///apps/tez/lib/,hdfs:///apps/tez/tez.tar.gz</value>
     <description>The location of the Tez libraries which will be localized for DAGs</description>
   </property>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c09edb72/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index bc723ab..e0dc3d8 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -88,6 +88,16 @@ class TestHiveServer(RMFTestCase):
                               hdfs_user='hdfs'
     )
 
+    self.assertResourceCalled('CopyFromLocal', '/usr/lib/tez/tez*.tar.gz',
+                              mode=0755,
+                              owner='tez',
+                              dest_dir='/apps/tez/',
+                              dest_file='tez.tar.gz',
+                              kinnit_if_needed='',
+                              hadoop_conf_dir='/etc/hadoop/conf',
+                              hdfs_user='hdfs'
+    )
+
     self.assertResourceCalled('CopyFromLocal', '/usr/lib/tez/lib/*.jar',
                               mode=0755,
                               owner='tez',


[20/34] git commit: AMBARI-7378. Completely hide System Views from all of UI (Admin View, Ambari Web). (yusaku)

Posted by jo...@apache.org.
AMBARI-7378. Completely hide System Views from all of UI (Admin View, Ambari Web). (yusaku)


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

Branch: refs/heads/branch-alerts-dev
Commit: 7a087b1860ab80bbce5d3574e08068042b63d530
Parents: 0cec52d
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Sep 17 17:21:49 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Sep 17 17:21:49 2014 -0700

----------------------------------------------------------------------
 .../src/main/resources/ui/admin-web/app/scripts/services/View.js  | 3 ++-
 ambari-web/app/utils/ajax/ajax.js                                 | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7a087b18/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
index 960ac87..e30dcf3 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
@@ -245,7 +245,8 @@ angular.module('ambariAdminConsole')
       method: 'GET',
       url: Settings.baseUrl + '/views',
       params:{
-        'fields': fields.join(',')
+        'fields': fields.join(','),
+        'versions/ViewVersionInfo/system': false
       }
     }).success(function(data) {
       var views = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/7a087b18/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 4342195..c2a971d 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1728,7 +1728,7 @@ var urls = {
    * Get all instances of all views across versions
    */
   'views.instances': {
-    'real': '/views?fields=versions/instances/ViewInstanceInfo,versions/ViewVersionInfo/label',
+    'real': '/views?fields=versions/instances/ViewInstanceInfo,versions/ViewVersionInfo/label&versions/ViewVersionInfo/system=false',
     'mock': '/data/views/instances.json'
   },
   'host.host_component.flume.metrics': {


[29/34] git commit: AMBARI-7386 Configs: saving prop in non-default config group shows digit error briefly. (atkach)

Posted by jo...@apache.org.
AMBARI-7386 Configs: saving prop in non-default config group shows digit error briefly. (atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: fd0b582c1d663fb7d04a6474273f7112111a4c74
Parents: 21ff383
Author: atkach <at...@hortonworks.com>
Authored: Thu Sep 18 16:12:36 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Thu Sep 18 16:12:36 2014 +0300

----------------------------------------------------------------------
 .../app/controllers/main/service/info/configs.js  | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fd0b582c/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 3112d40..2267b98 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -332,7 +332,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
     version = version || this.get('currentDefaultVersion');
     //version of non-default group require properties from current version of default group to correctly display page
     var versions = (this.isVersionDefault(version)) ? [version] : [this.get('currentDefaultVersion'), version];
-    switchToGroup = this.isVersionDefault(version) ? this.get('configGroups').findProperty('isDefault') : switchToGroup;
+    switchToGroup = (this.isVersionDefault(version) && !switchToGroup) ? this.get('configGroups').findProperty('isDefault') : switchToGroup;
 
     if (self.get('dataIsLoaded') && switchToGroup) {
       this.set('selectedConfigGroup', switchToGroup);
@@ -2096,13 +2096,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
       success: 'doPUTClusterConfigurationSiteSuccessCallback',
       error: 'doPUTClusterConfigurationSiteErrorCallback'
     });
-    var heapsizeException = this.get('heapsizeException');
-    var heapsizeRegExp = this.get('heapsizeRegExp');
-    this.get('stepConfigs')[0].get('configs').forEach(function (item) {
-      if (heapsizeRegExp.test(item.get('name')) && !heapsizeException.contains(item.get('name')) && /\d+m$/.test(item.get('value'))) {
-        item.set('value', item.get('value').slice(0, item.get('value.length') - 1));
-      }
-    });
   },
 
   doPUTClusterConfigurationSiteSuccessCallback: function () {
@@ -2181,19 +2174,20 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
     var heapsizeRegExp = this.get('heapsizeRegExp');
     var siteProperties = {};
     siteObj.forEach(function (_siteObj) {
+      var value = _siteObj.value;
       if (_siteObj.isRequiredByAgent == false) return;
       if (heapsizeRegExp.test(_siteObj.name) && !heapsizeException.contains(_siteObj.name)) {
-        Em.set(_siteObj, "value",  _siteObj.value + "m");
+        value += "m";
       }
-      siteProperties[_siteObj.name] = App.config.escapeXMLCharacters(_siteObj.value);
+      siteProperties[_siteObj.name] = App.config.escapeXMLCharacters(value);
       switch (siteName) {
         case 'falcon-startup.properties':
         case 'falcon-runtime.properties':
         case 'pig-properties':
-          siteProperties[_siteObj.name] = _siteObj.value;
+          siteProperties[_siteObj.name] = value;
           break;
         default:
-          siteProperties[_siteObj.name] = this.setServerConfigValue(_siteObj.name, _siteObj.value);
+          siteProperties[_siteObj.name] = this.setServerConfigValue(_siteObj.name, value);
       }
     }, this);
     var result = {"type": siteName, "tag": tagName, "properties": siteProperties};


[28/34] git commit: AMBARI-7383. cannot start HS2 (aonishuk)

Posted by jo...@apache.org.
AMBARI-7383. cannot start HS2 (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 21ff383056dd9fa3c84fb952135b37126693aa53
Parents: 19bf2a6
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Sep 18 16:01:54 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Sep 18 16:01:54 2014 +0300

----------------------------------------------------------------------
 .../HIVE/package/scripts/install_jars.py        | 29 +++++++-------------
 .../services/HIVE/package/scripts/params.py     |  8 ++++++
 .../2.1/services/TEZ/configuration/tez-site.xml |  2 +-
 .../services/TEZ/configuration/tez-site.xml     | 29 ++++++++++++++++++++
 .../2.2/services/TEZ/configuration/tez-site.xml | 29 ++++++++++++++++++++
 .../stacks/2.0.6/HIVE/test_hive_server.py       | 13 ++-------
 6 files changed, 79 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/21ff3830/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py
index 0045fee..f09794c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/install_jars.py
@@ -64,25 +64,16 @@ def install_tez_jars():
     pass
 
     if app_dir_path:
-      CopyFromLocal(params.tez_local_api_jars,
-                    mode=0755,
-                    owner=params.tez_user,
-                    dest_dir=app_dir_path,
-                    kinnit_if_needed=kinit_if_needed,
-                    hdfs_user=params.hdfs_user,
-                    hadoop_conf_dir=params.hadoop_conf_dir
-      )
-
-      CopyFromLocal(params.tez_tar_file,
-                    owner=params.tez_user,
-                    mode=0755,
-                    dest_dir=app_dir_path,
-                    dest_file="tez.tar.gz",
-                    kinnit_if_needed=kinit_if_needed,
-                    hdfs_user=params.hdfs_user,
-                    hadoop_conf_dir=params.hadoop_conf_dir
-      )
-    pass
+      for scr_file, dest_file in params.app_dir_files.iteritems():
+        CopyFromLocal(scr_file,
+                      mode=0755,
+                      owner=params.tez_user,
+                      dest_dir=app_dir_path,
+                      dest_file=dest_file,
+                      kinnit_if_needed=kinit_if_needed,
+                      hdfs_user=params.hdfs_user,
+                      hadoop_conf_dir=params.hadoop_conf_dir
+        )
 
     if lib_dir_path:
       CopyFromLocal(params.tez_local_lib_jars,

http://git-wip-us.apache.org/repos/asf/ambari/blob/21ff3830/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
index ab86ff7..82cf9db 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
@@ -269,6 +269,14 @@ webhcat_hdfs_user_mode = 0755
 #for create_hdfs_directory
 security_param = "true" if security_enabled else "false"
 
+if str(hdp_stack_version).startswith('2.0') or str(hdp_stack_version).startswith('2.1'):
+  app_dir_files = {tez_local_api_jars:None}
+else:
+  app_dir_files = {
+              tez_local_api_jars:None,
+              tez_tar_file:"tez.tar.gz"
+  }
+
 import functools
 #create partial functions with common arguments for every HdfsDirectory call
 #to create hdfs directory we need to call params.HdfsDirectory in code

http://git-wip-us.apache.org/repos/asf/ambari/blob/21ff3830/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
index 7b34d3b..218c508 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/TEZ/configuration/tez-site.xml
@@ -21,7 +21,7 @@
 
   <property>
     <name>tez.lib.uris</name>
-    <value>hdfs:///apps/tez/,hdfs:///apps/tez/lib/,hdfs:///apps/tez/tez.tar.gz</value>
+    <value>hdfs:///apps/tez/,hdfs:///apps/tez/lib/</value>
     <description>The location of the Tez libraries which will be localized for DAGs</description>
   </property>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/21ff3830/ambari-server/src/main/resources/stacks/HDP/2.2.1/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2.1/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2.1/services/TEZ/configuration/tez-site.xml
new file mode 100644
index 0000000..dfedb6b
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2.1/services/TEZ/configuration/tez-site.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+
+<configuration supports_final="true">
+
+  <property>
+    <name>tez.lib.uris</name>
+    <value>hdfs:///apps/tez/,hdfs:///apps/tez/lib/,hdfs:///apps/tez/tez.tar.gz</value>
+    <description>The location of the Tez libraries which will be localized for DAGs</description>
+  </property>
+
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/21ff3830/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
new file mode 100644
index 0000000..dfedb6b
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+
+<configuration supports_final="true">
+
+  <property>
+    <name>tez.lib.uris</name>
+    <value>hdfs:///apps/tez/,hdfs:///apps/tez/lib/,hdfs:///apps/tez/tez.tar.gz</value>
+    <description>The location of the Tez libraries which will be localized for DAGs</description>
+  </property>
+
+</configuration>
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/21ff3830/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index e0dc3d8..3c5ec85 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -85,17 +85,8 @@ class TestHiveServer(RMFTestCase):
                               dest_dir='/apps/tez/',
                               kinnit_if_needed='',
                               hadoop_conf_dir='/etc/hadoop/conf',
-                              hdfs_user='hdfs'
-    )
-
-    self.assertResourceCalled('CopyFromLocal', '/usr/lib/tez/tez*.tar.gz',
-                              mode=0755,
-                              owner='tez',
-                              dest_dir='/apps/tez/',
-                              dest_file='tez.tar.gz',
-                              kinnit_if_needed='',
-                              hadoop_conf_dir='/etc/hadoop/conf',
-                              hdfs_user='hdfs'
+                              hdfs_user='hdfs',
+                              dest_file=None
     )
 
     self.assertResourceCalled('CopyFromLocal', '/usr/lib/tez/lib/*.jar',


[34/34] git commit: Merge branch 'trunk' into branch-alerts-dev

Posted by jo...@apache.org.
Merge branch 'trunk' into branch-alerts-dev

Conflicts:
	ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java


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

Branch: refs/heads/branch-alerts-dev
Commit: f1018b176a64451c2d62fcd3e2f5238e4587ab02
Parents: a4e97aa 5fc5828
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Sep 18 10:43:23 2014 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Sep 18 10:43:23 2014 -0400

----------------------------------------------------------------------
 .../ui/admin-web/app/scripts/services/View.js   |  19 +--
 .../resources/ui/admin-web/app/styles/main.css  |  87 ++++++++++
 .../app/views/ambariViews/listTable.html        |  19 ++-
 ambari-admin/src/main/resources/view.xml        |   1 +
 .../resource_management/TestCopyFromLocal.py    |   8 +-
 .../ambari/groovy/client/AmbariClient.groovy    |   7 +-
 .../libraries/providers/copy_from_local.py      |  12 +-
 .../libraries/resources/copy_from_local.py      |   3 +-
 .../server/api/util/StackExtensionHelper.java   |   9 +-
 .../internal/ClientConfigResourceProvider.java  |  35 +++-
 .../server/orm/entities/AlertNoticeEntity.java  |  51 ++++--
 .../ambari/server/state/ConfigHelper.java       |  21 ++-
 .../server/state/cluster/ClusterImpl.java       |   3 +-
 .../server/upgrade/UpgradeCatalog161.java       |   1 -
 .../server/upgrade/UpgradeCatalog170.java       |  28 +++-
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   7 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   7 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |   7 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql     |   7 +-
 .../services/HDFS/configuration/hadoop-env.xml  |   2 +-
 .../GANGLIA/configuration/ganglia-env.xml       |   5 +
 .../GANGLIA/package/scripts/ganglia_monitor.py  |   4 +-
 .../services/GANGLIA/package/scripts/params.py  |  24 +--
 .../HIVE/package/scripts/install_jars.py        |  28 ++--
 .../services/HIVE/package/scripts/params.py     |  11 +-
 .../services/NAGIOS/package/files/sys_logger.py |  30 ++--
 .../stacks/HDP/2.2.1/role_command_order.json    |   2 +-
 .../services/TEZ/configuration/tez-site.xml     |  29 ++++
 .../stacks/HDP/2.2/role_command_order.json      |   3 +-
 .../SLIDER/configuration/slider-client.xml      |  56 +++++++
 .../SLIDER/configuration/slider-log4j.xml       |  89 ++++++++++
 .../stacks/HDP/2.2/services/SLIDER/metainfo.xml |  72 ++++++++
 .../SLIDER/package/files/hbaseSmokeVerify.sh    |  34 ++++
 .../services/SLIDER/package/scripts/__init__.py |  19 +++
 .../services/SLIDER/package/scripts/params.py   |  45 +++++
 .../SLIDER/package/scripts/service_check.py     |  45 +++++
 .../services/SLIDER/package/scripts/slider.py   |  68 ++++++++
 .../SLIDER/package/scripts/slider_client.py     |  43 +++++
 .../SLIDER/package/templates/slider-wrapper.j2  |  42 +++++
 .../2.2/services/TEZ/configuration/tez-site.xml |  29 ++++
 .../ClientConfigResourceProviderTest.java       |  24 ++-
 .../server/orm/dao/AlertDefinitionDAOTest.java  |   1 +
 .../server/upgrade/UpgradeCatalog161Test.java   |   4 -
 .../server/upgrade/UpgradeCatalog170Test.java   | 114 ++++++++++---
 .../stacks/2.0.6/HIVE/test_hive_server.py       |   3 +-
 .../stacks/2.2/SLIDER/test_slider_client.py     | 109 +++++++++++++
 .../test/python/stacks/2.2/configs/default.json | 115 +++++++++++++
 .../test/python/stacks/2.2/configs/secured.json |  79 +++++++++
 ambari-shell/ambari-groovy-shell/pom.xml        |  11 ++
 .../ambari/shell/commands/ConfigCommands.java   | 163 +++++++++++++++++++
 .../shell/completion/AbstractCompletion.java    |  34 ++++
 .../ambari/shell/completion/Blueprint.java      |   9 +-
 .../ambari/shell/completion/ConfigType.java     |  29 ++++
 .../apache/ambari/shell/completion/Host.java    |   9 +-
 .../apache/ambari/shell/completion/Service.java |  12 +-
 .../configuration/ConverterConfiguration.java   |   6 +
 .../shell/converter/AbstractConverter.java      |  63 +++++++
 .../shell/converter/BlueprintConverter.java     |  21 +--
 .../shell/converter/ConfigTypeConverter.java    |  45 +++++
 .../ambari/shell/converter/HostConverter.java   |  21 +--
 .../shell/converter/ServiceConverter.java       |  24 +--
 .../shell/commands/ConfigCommandsTest.java      |  98 +++++++++++
 .../src/test/resources/core-site.xml            |  13 ++
 ambari-web/app/controllers/application.js       |   8 +-
 ambari-web/app/controllers/main.js              |   1 -
 .../resourceManager/wizard_controller.js        |   1 -
 ambari-web/app/controllers/main/host/details.js |   9 +-
 .../controllers/main/service/info/configs.js    |  42 +++--
 .../main/service/reassign/step2_controller.js   |   1 +
 .../app/controllers/main/views_controller.js    |   6 +-
 .../app/controllers/wizard/step5_controller.js  |  10 +-
 .../app/controllers/wizard/step7_controller.js  |   5 +
 ambari-web/app/messages.js                      |   3 +-
 ambari-web/app/mixins/common/serverValidator.js |   1 +
 ambari-web/app/models/service_config_version.js |   2 +-
 ambari-web/app/routes/installer.js              |   1 +
 ambari-web/app/routes/main.js                   |   1 -
 ambari-web/app/routes/reassign_master_routes.js | 124 +++++++-------
 .../app/routes/rm_high_availability_routes.js   |  12 +-
 ambari-web/app/styles/application.less          |  22 ++-
 ambari-web/app/templates/application.hbs        |  27 ++-
 .../common/configs/config_history_flow.hbs      |  36 +---
 .../configs/config_recommendation_popup.hbs     |  40 ++++-
 .../common/configs/service_version_box.hbs      |  53 ++++++
 .../app/templates/common/custom_date_popup.hbs  |  39 +++++
 ambari-web/app/templates/main/host/summary.hbs  |   8 +
 .../wizard/step6/step6_issues_popup.hbs         |  44 ++---
 ambari-web/app/utils/ajax/ajax.js               |   2 +-
 ambari-web/app/utils/config.js                  |   2 +-
 ambari-web/app/views.js                         |   1 +
 .../views/common/configs/config_history_flow.js |  22 +++
 .../app/views/common/select_custom_date_view.js |  36 ++++
 ambari-web/app/views/main/host/summary.js       |  11 ++
 .../test/nagios/plugins/test_sys_logger.py      |  77 ++++++++-
 .../apache/ambari/view/slider/AlertField.java   |  62 +++++++
 .../apache/ambari/view/slider/AlertState.java   |  40 +++++
 .../apache/ambari/view/slider/SliderApp.java    |   9 +
 .../ambari/view/slider/SliderAppsAlerts.java    | 126 ++++++++++++++
 .../slider/SliderAppsViewControllerImpl.java    |  24 ++-
 .../rest/client/SliderAppMasterClient.java      |  38 +++--
 .../assets/data/resource/service_configs.json   |   2 +-
 .../createAppWizard/step1_controller.js         |   2 +-
 .../resources/ui/app/models/slider_app_alert.js |  43 ++---
 .../ui/app/templates/slider_app/summary.hbs     |   2 +-
 .../ui/app/views/slider_app/summary_view.js     |   2 +-
 105 files changed, 2565 insertions(+), 451 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f1018b17/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1018b17/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1018b17/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1018b17/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1018b17/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1018b17/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1018b17/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1018b17/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------


[07/34] git commit: AMBARI-7366 On switching config group config version stays the same. (atkach)

Posted by jo...@apache.org.
AMBARI-7366 On switching config group config version stays the same. (atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: 760d9894d3939dfd4b4d343ddbbeef05f48f9208
Parents: 892f423
Author: atkach <at...@hortonworks.com>
Authored: Wed Sep 17 18:27:55 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Wed Sep 17 18:27:55 2014 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    | 21 +++++++++++++++-----
 ambari-web/app/models/service_config_version.js |  2 +-
 2 files changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/760d9894/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 32343ff..3112d40 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -324,17 +324,18 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
    * get selected service config version
    * In case selected version is undefined then take currentDefaultVersion
    * @param version
+   * @param switchToGroup
    */
-  loadSelectedVersion: function (version) {
+  loadSelectedVersion: function (version, switchToGroup) {
     var self = this;
     this.set('versionLoaded', false);
     version = version || this.get('currentDefaultVersion');
     //version of non-default group require properties from current version of default group to correctly display page
     var versions = (this.isVersionDefault(version)) ? [version] : [this.get('currentDefaultVersion'), version];
+    switchToGroup = this.isVersionDefault(version) ? this.get('configGroups').findProperty('isDefault') : switchToGroup;
 
-    //if version from default group selected then switch to default group
-    if (self.get('dataIsLoaded') && this.isVersionDefault(version)) {
-      this.set('selectedConfigGroup', this.get('configGroups').findProperty('isDefault'));
+    if (self.get('dataIsLoaded') && switchToGroup) {
+      this.set('selectedConfigGroup', switchToGroup);
     }
 
     App.ajax.send({
@@ -2708,7 +2709,17 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
     }
     //clean when switch config group
     this.loadedGroupToOverrideSiteToTagMap = {};
-    this.set('selectedConfigGroup', event.context);
+    if (App.supports.configHistory) {
+      var configGroupVersions = App.ServiceConfigVersion.find().filterProperty('groupId', event.context.get('id'));
+      //check whether config group has config versions
+      if (configGroupVersions.length > 0) {
+        this.loadSelectedVersion(configGroupVersions.findProperty('isCurrent').get('version'), event.context);
+      } else {
+        this.loadSelectedVersion(null, event.context);
+      }
+    } else {
+      this.set('selectedConfigGroup', event.context);
+    }
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/760d9894/ambari-web/app/models/service_config_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config_version.js b/ambari-web/app/models/service_config_version.js
index 4a65ac2..61703ad 100644
--- a/ambari-web/app/models/service_config_version.js
+++ b/ambari-web/app/models/service_config_version.js
@@ -27,7 +27,7 @@ App.ServiceConfigVersion = DS.Model.extend({
     return App.format.role(this.get('serviceName'));
   }.property('serviceName'),
   groupName: DS.attr('string'),
-  groupId: DS.attr('string'),
+  groupId: DS.attr('number'),
   version: DS.attr('number'),
   createTime: DS.attr('number'),
   author: DS.attr('string'),


[22/34] git commit: AMBARI-7374. Slider View: BE - Provide alerts in view API. Correcting component counts

Posted by jo...@apache.org.
AMBARI-7374. Slider View: BE - Provide alerts in view API. Correcting component counts


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

Branch: refs/heads/branch-alerts-dev
Commit: 0058924443bee9cb4b55afade3bfa08196765308
Parents: c7651de
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Sep 17 21:00:46 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Sep 17 21:00:46 2014 -0700

----------------------------------------------------------------------
 .../ambari/view/slider/SliderAppsAlerts.java    | 30 ++++++++++++--------
 .../slider/SliderAppsViewControllerImpl.java    |  8 ++++++
 .../assets/data/resource/service_configs.json   |  2 +-
 .../createAppWizard/step1_controller.js         |  2 +-
 .../ui/app/templates/slider_app/summary.hbs     |  2 +-
 5 files changed, 29 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/00589244/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java
index 957c6e8..4eb54d5 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java
@@ -66,8 +66,23 @@ public class SliderAppsAlerts {
     HashMap<AlertField,Object> alertItem = new HashMap<AlertField, Object>();
     Date date = Calendar.getInstance().getTime();
 
-
-    AlertState state = getComponentState(component);
+    int totalContainerCount = component.getInstanceCount();
+    int activeContainerCount = component.getActiveContainers() != null ? component
+        .getActiveContainers().size() : 0;
+    AlertState state = AlertState.UNKNOWN;
+    String message = String.format("%s out of %s active", activeContainerCount,
+        totalContainerCount);
+    if (totalContainerCount == activeContainerCount || totalContainerCount < 1) {
+      // Everything OK
+      state = AlertState.OK;
+    } else {
+      float fraction = (float) activeContainerCount / (float) totalContainerCount;
+      if (fraction <= 0.2) { // less than or equal to 20%
+        state = AlertState.WARNING;
+      } else {
+        state = AlertState.CRITICAL;
+      }
+    }
     alertItem.put(AlertField.description, String.format("%s component",component.getComponentName()));
     alertItem.put(AlertField.host_name, getComponentHostName(component));
     alertItem.put(AlertField.last_status, state);
@@ -78,7 +93,7 @@ public class SliderAppsAlerts {
     alertItem.put(AlertField.component_name, component.getComponentName());
     alertItem.put(AlertField.status, state);
     alertItem.put(AlertField.status_time, new java.sql.Timestamp(date.getTime()));
-    alertItem.put(AlertField.output, state);
+    alertItem.put(AlertField.output, message);
     alertItem.put(AlertField.actual_status, state);
     return alertItem;
   }
@@ -108,13 +123,4 @@ public class SliderAppsAlerts {
     }
     return null;
   }
-
-  private AlertState getComponentState(SliderAppComponent component){
-    if (component.getInstanceCount() == component.getActiveContainers().size()){
-      return AlertState.OK;
-    }
-    return AlertState.CRITICAL;
-  }
-
-
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/00589244/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
index 027f824..ef11cfa 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
@@ -319,9 +319,17 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
                               containerId, containerDataMap);
                         }
                       }
+                      // Set total instances count from statistics
                       appComponent.setInstanceCount(appComponent
                           .getActiveContainers().size()
                           + appComponent.getCompletedContainers().size());
+                      if (description.statistics != null
+                          && description.statistics.containsKey(componentEntry.getKey())) {
+                        Map<String, Integer> statisticsMap = description.statistics.get(componentEntry.getKey());
+                        if (statisticsMap.containsKey("containers.desired")) {
+                          appComponent.setInstanceCount(statisticsMap.get("containers.desired"));
+                        }
+                      }
                     }
                   }
                   app.setAlerts(sliderAlerts.generateComponentsAlerts(componentTypeMap, app.getType()));

http://git-wip-us.apache.org/repos/asf/ambari/blob/00589244/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json b/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json
index f255bec..24c1a31 100644
--- a/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json
+++ b/contrib/views/slider/src/main/resources/ui/app/assets/data/resource/service_configs.json
@@ -19,7 +19,7 @@
             "rrdcached_flush_timeout" : "7200",
             "gmond_user" : "nobody",
             "ganglia_runtime_dir" : "/var/run/ganglia/hdp",
-            "ganglia_custom_clusters": "'HBaseCluster1','7000','AccumuloCluster1','7001','HBaseCluster2','7002'"
+            "additional_clusters": "'HBaseCluster1','7000','AccumuloCluster1','7001','HBaseCluster2','7002'"
           },
           "properties_attributes" : { }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/00589244/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
index 9ffc432..8583443 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
@@ -141,7 +141,7 @@ App.CreateAppWizardStep1Controller = Ember.Controller.extend({
     var gangliaCustomClusters = [];
 
     if (data.items[0]) {
-      var prop = Em.get(data.items[0].configurations[0].properties, 'ganglia_custom_clusters');
+      var prop = Em.get(data.items[0].configurations[0].properties, 'additional_clusters');
       if (prop) {
         //parse CSV string with cluster names and ports
         prop.replace(/\'/g, "").split(',').forEach(function(item, index){

http://git-wip-us.apache.org/repos/asf/ambari/blob/00589244/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
index 68d47b4..ae056a6 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
@@ -90,7 +90,7 @@
                   <div class="col-md-11">
                     <div class="row">
                       <div class="col-md-7 title">{{title}}</div>
-                      <div {{bs-bind-tooltip view.tooltip}} data-placement="right" class="col-md-5 date-time">{{timeSinceAlert}}</div>
+                      <div {{bs-bind-tooltip view.tooltip}} data-placement="left" class="col-md-5 date-time">{{timeSinceAlert}}</div>
                     </div>
                     <div class="message">{{message}}</div>
                   </div>


[08/34] git commit: AMBARI-7364. Oozie start fails with "oozie_admin_port was not found", after ambari upgrade from 1.6.0 to 1.7.0.(vbrodetskyi)

Posted by jo...@apache.org.
AMBARI-7364. Oozie start fails with "oozie_admin_port was not found", after ambari upgrade from 1.6.0 to 1.7.0.(vbrodetskyi)


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

Branch: refs/heads/branch-alerts-dev
Commit: 6952fa4482cc999a437e6b498ec1d1a2a893ff21
Parents: 760d989
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Wed Sep 17 18:39:50 2014 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Wed Sep 17 18:39:50 2014 +0300

----------------------------------------------------------------------
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java | 1 -
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java | 2 ++
 .../org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java  | 4 ----
 .../org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java  | 4 ++++
 4 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6952fa44/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
index 62b4e35..a4bb2b2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
@@ -289,7 +289,6 @@ public class UpgradeCatalog161 extends AbstractUpgradeCatalog {
   protected void addMissingConfigs() throws AmbariException {
     updateConfigurationProperties("hbase-site", Collections.singletonMap("hbase.regionserver.info.port", "60030"), false, false);
     updateConfigurationProperties("hbase-site", Collections.singletonMap("hbase.master.info.port", "60010"), false, false);
-    updateConfigurationProperties("oozie-env", Collections.singletonMap("oozie_admin_port", "11001"), false, false);
     updateConfigurationProperties("hive-site", Collections.singletonMap("hive.heapsize", "1024"), false, false);
     updateConfigurationProperties("pig-properties", Collections.singletonMap("pig-content", "\n# Licensed to the Apache " +
             "Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# " +

http://git-wip-us.apache.org/repos/asf/ambari/blob/6952fa44/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index e58b6d3..1c9608c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -945,6 +945,8 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
     updateConfigurationProperties("hadoop-env",
             Collections.singletonMap("hadoop_root_logger", "INFO,RFA"), false,
             false);
+
+    updateConfigurationProperties("oozie-env", Collections.singletonMap("oozie_admin_port", "11001"), false, false);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/6952fa44/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
index 1d12ea0..4315e2c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
@@ -147,10 +147,6 @@ public class UpgradeCatalog161Test {
         Collections.singletonMap("hbase.master.info.port", "60010"), false, false);
     expectLastCall();
     
-    upgradeCatalog.updateConfigurationProperties("oozie-env",
-        Collections.singletonMap("oozie_admin_port", "11001"), false, false);
-    expectLastCall();
-    
     upgradeCatalog.updateConfigurationProperties("hive-site",
         Collections.singletonMap("hive.heapsize", "1024"), false, false);
     expectLastCall();

http://git-wip-us.apache.org/repos/asf/ambari/blob/6952fa44/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index 138b4b1..dcf308c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -416,6 +416,10 @@ public class UpgradeCatalog170Test {
             Collections.singletonMap("hadoop_root_logger", "INFO,RFA"), false, false);
     expectLastCall();
 
+    upgradeCatalog.updateConfigurationProperties("oozie-env",
+            Collections.singletonMap("oozie_admin_port", "11001"), false, false);
+    expectLastCall();
+
     expect(dbAccessor.executeSelect("SELECT role_name, user_id FROM user_roles")).andReturn(userRolesResultSet).once();
     expect(entityManager.getTransaction()).andReturn(trans).anyTimes();
     expect(entityManager.getCriteriaBuilder()).andReturn(cb).anyTimes();


[12/34] git commit: AMBARI-7369. Clients in INIT or INSTALL FAILED state should have an menu action for installation (Denys Buzhor via alexantonenko)

Posted by jo...@apache.org.
AMBARI-7369. Clients in INIT or INSTALL FAILED state should have an menu action for installation (Denys Buzhor via alexantonenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 1f4d315ce2c9be2e3077fb4c264b1a10e1cc11d8
Parents: b4e1aed
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed Sep 17 19:45:40 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Sep 17 19:45:40 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js |  9 ++++++++-
 ambari-web/app/messages.js                      |  1 +
 ambari-web/app/templates/main/host/summary.hbs  |  8 ++++++++
 ambari-web/app/views/main/host/summary.js       | 11 +++++++++++
 4 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1f4d315c/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index a9b7d76..39d9086 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -1592,6 +1592,13 @@ App.MainHostDetailsController = Em.Controller.extend({
       componentName: event.context.get('componentName'),
       displayName: event.context.get('displayName')
     });
-  }
+  },
 
+  reinstallClients: function(event) {
+    var clientsToInstall = event.context.filter(function(component) {
+      return ['INIT', 'INSTALL_FAILED'].contains(component.get('workStatus'));
+    });
+    if (!clientsToInstall.length) return;
+    this.sendComponentCommand(clientsToInstall, Em.I18n.t('host.host.details.installClients'), 'INSTALLED');
+  }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f4d315c/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index d1f7afd..5c330b4 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1695,6 +1695,7 @@ Em.I18n.translations = {
   'hosts.host.details.restartAllComponents':'Restart All Components',
   'hosts.host.details.refreshConfigs':'Refresh configs',
   'hosts.host.details.for.postfix':'{0} for host',
+  'host.host.details.installClients': 'Install clients',
 
   'host.host.componentFilter.master':'Master Components',
   'host.host.componentFilter.slave':'Slave Components',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f4d315c/ambari-web/app/templates/main/host/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/summary.hbs b/ambari-web/app/templates/main/host/summary.hbs
index df2a02f..1c363ee 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -72,6 +72,9 @@
                   <div class="span7">
                     {{#each component in view.clients}}
                       {{component.displayName}}
+                      {{#if component.isInstallFailed}}
+                        <span class="health-status-installed icon-warning-sign"></span>
+                      {{/if}}
                       {{#if component.staleConfigs}}
                         <span class="text-warning icon-refresh"></span>
                       {{/if}}
@@ -97,6 +100,11 @@
                           {{t hosts.host.details.refreshConfigs}}
                         </a>
                       </li>
+                      <li>
+                        <a href="javscript:void(null)" {{bindAttr class="view.areClientsInstallFailed::disabled" }} data-toggle="modal" {{action reinstallClients view.clients target="controller"}}>
+                          {{t host.host.details.installClients}}
+                        </a>
+                      </li>
                     </ul>
                   </div>
                 {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f4d315c/ambari-web/app/views/main/host/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js
index 90ce1e7..e67be32 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -182,11 +182,22 @@ App.MainHostSummaryView = Em.View.extend({
           clients[clients.length - 1].set('isLast', false);
         }
         component.set('isLast', true);
+        if (['INSTALL_FAILED', 'INIT'].contains(component.get('workStatus'))) {
+          component.set('isInstallFailed', true);
+        }
         clients.push(component);
       }
     }, this);
     return clients;
   }.property('content.hostComponents.length'),
+  /**
+   * Check if some clients not installed or started
+   *
+   * @type {bool}
+   **/
+  areClientsInstallFailed: function() {
+    return this.get('clients').someProperty('isInstallFailed', true);
+  }.property('clients.@each.workStatus'),
 
   /**
    * Check if some clients have stale configs


[11/34] git commit: AMBARI-7367 Config History filter by date custom throws JS. (ababiichuk)

Posted by jo...@apache.org.
AMBARI-7367 Config History filter by date custom throws JS. (ababiichuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: b4e1aed4a7e3b67e48eb330e518786c3a24a07d8
Parents: 117b455
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Sep 17 19:26:46 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Sep 17 19:26:46 2014 +0300

----------------------------------------------------------------------
 .../app/templates/common/custom_date_popup.hbs  | 39 ++++++++++++++++++++
 ambari-web/app/views.js                         |  1 +
 .../app/views/common/select_custom_date_view.js | 36 ++++++++++++++++++
 3 files changed, 76 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b4e1aed4/ambari-web/app/templates/common/custom_date_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/custom_date_popup.hbs b/ambari-web/app/templates/common/custom_date_popup.hbs
new file mode 100644
index 0000000..04c4560
--- /dev/null
+++ b/ambari-web/app/templates/common/custom_date_popup.hbs
@@ -0,0 +1,39 @@
+{{!
+* 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.
+}}
+
+<div class="jobs-custom-dates">
+  <div>
+    <label>{{t jobs.customDateFilter.startTime}}</label>
+    {{view Ember.TextField valueBinding="controller.customDateFormFields.startDate" class="input-small datepicker"}}
+    {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="controller.customDateFormFields.hoursForStart" class="input-mini"}}
+    {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="controller.customDateFormFields.minutesForStart" class="input-mini"}}
+    {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="controller.customDateFormFields.middayPeriodForStart" class="input-mini"}}
+    <span class="help-inline">{{controller.filterObject.errorMessages.startDate}}</span>
+  </div>
+  <div>
+
+  </div>
+  <div>
+    <label>{{t jobs.customDateFilter.endTime}}</label>
+    {{view Ember.TextField valueBinding="controller.customDateFormFields.endDate" class="input-small datepicker"}}
+    {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="controller.customDateFormFields.hoursForEnd" class="input-mini"}}
+    {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="controller.customDateFormFields.minutesForEnd" class="input-mini"}}
+    {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="controller.customDateFormFields.middayPeriodForEnd" class="input-mini"}}
+    <span class="help-inline">{{controller.filterObject.errorMessages.endDate}}</span>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b4e1aed4/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index baaee39..12b2683 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -26,6 +26,7 @@ require('views/common/chart/linear');
 require('views/common/chart/linear_time');
 require('views/common/modal_popup');
 require('views/common/rolling_restart_view');
+require('views/common/select_custom_date_view');
 require('views/common/metric');
 require('views/common/time_range');
 require('views/common/form/field');

http://git-wip-us.apache.org/repos/asf/ambari/blob/b4e1aed4/ambari-web/app/views/common/select_custom_date_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/select_custom_date_view.js b/ambari-web/app/views/common/select_custom_date_view.js
new file mode 100644
index 0000000..55da7fd
--- /dev/null
+++ b/ambari-web/app/views/common/select_custom_date_view.js
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+
+App.JobsCustomDatesSelectView = Em.View.extend({
+
+  name: 'jobsCustomDatesSelectView',
+
+  templateName: require('templates/common/custom_date_popup'),
+
+  middayPeriodOptions: [Em.I18n.t('jobs.table.custom.date.am'), Em.I18n.t('jobs.table.custom.date.pm')],
+
+  hourOptions: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
+
+  minuteOptions: ['00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55'],
+
+  didInsertElement: function () {
+    $('.datepicker').datepicker({
+      format: 'mm/dd/yyyy'
+    });
+  }
+});


[17/34] git commit: AMBARI-7350. Add SLIDER service to the stacks

Posted by jo...@apache.org.
AMBARI-7350. Add SLIDER service to the stacks


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

Branch: refs/heads/branch-alerts-dev
Commit: dcc03bc735f1258ba5503847b38d11ef8c725ecd
Parents: 2a5759c
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Sep 17 15:59:44 2014 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Wed Sep 17 15:59:44 2014 -0700

----------------------------------------------------------------------
 .../SLIDER/configuration/slider-client.xml      |  56 +++++++++
 .../SLIDER/configuration/slider-log4j.xml       |  89 ++++++++++++++
 .../stacks/HDP/2.2/services/SLIDER/metainfo.xml |  72 ++++++++++++
 .../SLIDER/package/files/hbaseSmokeVerify.sh    |  34 ++++++
 .../services/SLIDER/package/scripts/__init__.py |  19 +++
 .../services/SLIDER/package/scripts/params.py   |  45 ++++++++
 .../SLIDER/package/scripts/service_check.py     |  45 ++++++++
 .../services/SLIDER/package/scripts/slider.py   |  68 +++++++++++
 .../SLIDER/package/scripts/slider_client.py     |  43 +++++++
 .../SLIDER/package/templates/slider-wrapper.j2  |  42 +++++++
 .../stacks/2.2/SLIDER/test_slider_client.py     | 109 ++++++++++++++++++
 .../test/python/stacks/2.2/configs/default.json | 115 +++++++++++++++++++
 .../test/python/stacks/2.2/configs/secured.json |  79 +++++++++++++
 13 files changed, 816 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
new file mode 100644
index 0000000..7d55760
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-client.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration supports_final="true">
+  <property>
+    <name>slider.yarn.queue</name>
+    <value>default</value>
+    <description>YARN queue for the Application Master</description>
+  </property>
+  <property>
+    <name>slider.zookeeper.quorum</name>
+    <value>localhost:2181</value>
+    <description>ZK quorum</description>
+  </property>
+  <!--<property>
+    <name>yarn.resourcemanager.address</name>
+    <value>localhost:8050</value>
+    <description>The address of the applications manager interface in the RM.</description>
+  </property>
+  <property>
+    <name>yarn.resourcemanager.scheduler.address</name>
+    <value>localhost:8030</value>
+    <description>The address of the scheduler interface.</description>
+  </property>
+  <property>
+    <name>yarn.application.classpath</name>
+    <value>
+      /etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*
+    </value>
+    <description>Default application classpath.</description>
+  </property>
+  <property>
+    <name>fs.defaultFS</name>
+    <value>hdfs://localhost:8020</value>
+    <description>The name of the default file system.  Either the
+      literal string "local" or a host:port for NDFS.</description>
+  </property>-->
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-log4j.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-log4j.xml
new file mode 100644
index 0000000..709867c
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/configuration/slider-log4j.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<configuration supports_final="false">
+
+  <property>
+    <name>content</name>
+    <description>Custom log4j.properties</description>
+    <value>
+# 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.
+
+
+# Define some default values that can be overridden by system properties
+log4j.rootLogger=INFO,stdout
+log4j.threshhold=ALL
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# log layout skips stack-trace creation operations by avoiding line numbers and method
+log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} - %m%n
+
+# debug edition is much more expensive
+#log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n
+
+
+log4j.appender.subprocess=org.apache.log4j.ConsoleAppender
+log4j.appender.subprocess.layout=org.apache.log4j.PatternLayout
+log4j.appender.subprocess.layout.ConversionPattern=[%c{1}]: %m%n
+#log4j.logger.org.apache.slider.yarn.appmaster.SliderAppMasterer.master=INFO,subprocess
+
+# for debugging Slider
+#log4j.logger.org.apache.slider=DEBUG
+#log4j.logger.org.apache.slider=DEBUG
+
+# uncomment to debug service lifecycle issues
+#log4j.logger.org.apache.hadoop.yarn.service.launcher=DEBUG
+#log4j.logger.org.apache.hadoop.yarn.service=DEBUG
+
+# uncomment for YARN operations
+#log4j.logger.org.apache.hadoop.yarn.client=DEBUG
+
+# uncomment this to debug security problems
+#log4j.logger.org.apache.hadoop.security=DEBUG
+
+#crank back on some noise
+log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR
+log4j.logger.org.apache.hadoop.hdfs=WARN
+
+
+log4j.logger.org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor=WARN
+log4j.logger.org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl=WARN
+log4j.logger.org.apache.zookeeper=WARN
+    </value>
+  </property>
+
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
new file mode 100644
index 0000000..22f5efe
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml
@@ -0,0 +1,72 @@
+<?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>SLIDER</name>
+      <displayName>Slider</displayName>
+      <comment>Apache Slider is a YARN application to deploy existing distributed applications on YARN, monitor them and make them larger or smaller as desired -even while the application is running.</comment>
+      <version>0.51.0</version>
+      <components>
+        <component>
+          <name>SLIDER</name>
+          <displayName>Slider</displayName>
+          <category>CLIENT</category>
+          <cardinality>0+</cardinality>
+          <commandScript>
+            <script>scripts/slider_client.py</script>
+            <scriptType>PYTHON</scriptType>
+            <timeout>600</timeout>
+          </commandScript>
+        </component>
+      </components>
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>any</osFamily>
+          <packages>
+            <package>
+              <name>slider</name>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+
+      <commandScript>
+        <script>scripts/service_check.py</script>
+        <scriptType>PYTHON</scriptType>
+        <timeout>300</timeout>
+      </commandScript>
+
+      <requiredServices>
+        <service>YARN</service>
+        <service>HDFS</service>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
+
+      <configuration-dependencies>
+        <config-type>slider-log4j</config-type>
+        <config-type>slider-client</config-type>
+        <config-type>hdfs-site</config-type>
+        <config-type>yarn-site</config-type>
+        <config-type>core-site</config-type>
+      </configuration-dependencies>
+
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/files/hbaseSmokeVerify.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/files/hbaseSmokeVerify.sh b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/files/hbaseSmokeVerify.sh
new file mode 100644
index 0000000..5c320c0
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/files/hbaseSmokeVerify.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+#
+#
+# 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.
+#
+#
+conf_dir=$1
+data=$2
+hbase_cmd=$3
+echo "scan 'ambarismoketest'" | $hbase_cmd --config $conf_dir shell > /tmp/hbase_chk_verify
+cat /tmp/hbase_chk_verify
+echo "Looking for $data"
+grep -q $data /tmp/hbase_chk_verify
+if [ "$?" -ne 0 ]
+then
+  exit 1
+fi
+
+grep -q '1 row(s)' /tmp/hbase_chk_verify

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/__init__.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/__init__.py
new file mode 100644
index 0000000..5561e10
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/__init__.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py
new file mode 100644
index 0000000..af6939c
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/params.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management import *
+
+# server configurations
+config = Script.get_config()
+
+#RPM versioning support
+rpm_version = default("/configurations/hadoop-env/rpm_version", None)
+
+#hadoop params
+if rpm_version is not None:
+  slider_conf_dir = format('/usr/lib/{rpm_version}/slider/conf')
+  slider_bin_dir = format('/usr/lib/{rpm_version}/slider/bin')
+else:
+  slider_conf_dir = "/usr/lib/slider/conf"
+  slider_bin_dir = "/usr/lib/slider/bin"
+
+smokeuser = config['configurations']['cluster-env']['smokeuser']
+user_group = config['configurations']['cluster-env']['user_group']
+security_enabled = config['configurations']['cluster-env']['security_enabled']
+smokeuser_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
+kinit_path_local = functions.get_kinit_path(["/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
+
+java64_home = config['hostLevelParams']['java_home']
+log4j_props = config['configurations']['slider-log4j']['content']
+slider_cmd = format("{slider_bin_dir}/slider-wrapper")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/service_check.py
new file mode 100644
index 0000000..bb54dc8
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/service_check.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management import *
+
+
+class SliderServiceCheck(Script):
+  def service_check(self, env):
+    import params
+
+    env.set_params(params)
+
+    smokeuser_kinit_cmd = format(
+      "{kinit_path_local} -kt {smokeuser_keytab} {smokeuser};") if params.security_enabled else ""
+
+    servicecheckcmd = format("{smokeuser_kinit_cmd} {slider_cmd} list")
+
+    Execute(servicecheckcmd,
+            tries=3,
+            try_sleep=5,
+            user=params.smokeuser,
+            logoutput=True
+    )
+
+
+if __name__ == "__main__":
+  SliderServiceCheck().execute()
+  

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py
new file mode 100644
index 0000000..d9d0693
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider.py
@@ -0,0 +1,68 @@
+"""
+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.
+
+Ambari Agent
+
+"""
+import os
+
+from resource_management import *
+
+
+def slider():
+  import params
+
+  Directory(params.slider_conf_dir
+  )
+
+  XmlConfig("slider-client.xml",
+            conf_dir=params.slider_conf_dir,
+            configurations=params.config['configurations']['slider-client']
+  )
+
+  XmlConfig("core-site.xml",
+            conf_dir=params.slider_conf_dir,
+            configurations=params.config['configurations']['core-site'],
+            configuration_attributes=params.config['configuration_attributes']['core-site']
+  )
+
+  XmlConfig("hdfs-site.xml",
+            conf_dir=params.slider_conf_dir,
+            configurations=params.config['configurations']['hdfs-site'],
+            configuration_attributes=params.config['configuration_attributes']['hdfs-site']
+  )
+
+  XmlConfig("yarn-site.xml",
+            conf_dir=params.slider_conf_dir,
+            configurations=params.config['configurations']['yarn-site'],
+            configuration_attributes=params.config['configuration_attributes']['yarn-site']
+  )
+
+  File(format("{slider_bin_dir}/slider-wrapper"),
+       mode=0755,
+       content=Template('slider-wrapper.j2')
+  )
+
+  if (params.log4j_props != None):
+    File(format("{params.slider_conf_dir}/log4j.properties"),
+         mode=0644,
+         content=params.log4j_props
+    )
+  elif (os.path.exists(format("{params.slider_conf_dir}/log4j.properties"))):
+    File(format("{params.slider_conf_dir}/log4j.properties"),
+         mode=0644
+    )

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider_client.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider_client.py
new file mode 100644
index 0000000..cb22a99
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/scripts/slider_client.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management import *
+
+from slider import slider
+
+
+class SliderClient(Script):
+  def install(self, env):
+    self.install_packages(env)
+    self.configure(env)
+
+  def configure(self, env):
+    import params
+
+    env.set_params(params)
+
+    slider()
+
+  def status(self, env):
+    raise ClientComponentHasNoStatus()
+
+
+if __name__ == "__main__":
+  SliderClient().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-wrapper.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-wrapper.j2 b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-wrapper.j2
new file mode 100644
index 0000000..ba0b013
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/SLIDER/package/templates/slider-wrapper.j2
@@ -0,0 +1,42 @@
+{#
+# 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.
+#}
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#/*
+# * Licensed to the Apache Software Foundation (ASF) under one
+# * or more contributor license agreements.  See the NOTICE file
+# * distributed with this work for additional information
+# * regarding copyright ownership.  The ASF licenses this file
+# * to you under the Apache License, Version 2.0 (the
+# * "License"); you may not use this file except in compliance
+# * with the License.  You may obtain a copy of the License at
+# *
+# *     http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# */
+import slider
+import os, sys
+
+if __name__ == '__main__':
+  os.environ["JAVA_HOME"] = "{{java64_home}}"
+  slider.main()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
new file mode 100644
index 0000000..c33c938
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.2/SLIDER/test_slider_client.py
@@ -0,0 +1,109 @@
+#!/usr/bin/env python
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+from stacks.utils.RMFTestCase import *
+
+
+class TestSliderClient(RMFTestCase):
+  def test_configure_default(self):
+    self.maxDiff = None
+    self.executeScript("2.2/services/SLIDER/package/scripts/slider_client.py",
+                       classname="SliderClient",
+                       command="configure",
+                       config_file="default.json"
+    )
+
+    self.assertResourceCalled('Directory', '/usr/lib/slider/conf'
+    )
+
+    self.assertResourceCalled('XmlConfig',
+                              'slider-client.xml',
+                              conf_dir='/usr/lib/slider/conf',
+                              configurations=self.getConfig()['configurations']['slider-client']
+    )
+
+    self.assertResourceCalled('XmlConfig',
+                              'core-site.xml',
+                              conf_dir='/usr/lib/slider/conf',
+                              configurations=self.getConfig()['configurations']['core-site'],
+                              configuration_attributes=self.getConfig()['configuration_attributes']['core-site']
+    )
+
+    self.assertResourceCalled('XmlConfig',
+                              'hdfs-site.xml',
+                              conf_dir='/usr/lib/slider/conf',
+                              configurations=self.getConfig()['configurations']['hdfs-site'],
+                              configuration_attributes=self.getConfig()['configuration_attributes']['hdfs-site']
+    )
+
+    self.assertResourceCalled('XmlConfig',
+                              'yarn-site.xml',
+                              conf_dir='/usr/lib/slider/conf',
+                              configurations=self.getConfig()['configurations']['yarn-site'],
+                              configuration_attributes=self.getConfig()['configuration_attributes']['yarn-site']
+    )
+
+    self.assertResourceCalled('File',
+                              '/usr/lib/slider/bin/slider-wrapper',
+                              content=Template('slider-wrapper.j2'),
+                              mode=0755
+    )
+
+    self.assertResourceCalled('File',
+                              '/usr/lib/slider/conf/log4j.properties',
+                              mode=0644,
+                              content='log4jproperties\nline2'
+    )
+
+    self.assertNoMoreResources()
+
+
+  def test_svc_check_secured(self):
+    self.maxDiff = None
+    self.executeScript("2.2/services/SLIDER/package/scripts/service_check.py",
+                       classname="SliderServiceCheck",
+                       command="service_check",
+                       config_file="secured.json"
+    )
+
+    self.assertResourceCalled('Execute',
+                              '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /usr/lib/slider/bin/slider-wrapper list',
+                              logoutput=True,
+                              tries=3,
+                              user='ambari-qa',
+                              try_sleep=5,
+    )
+    self.assertNoMoreResources()
+
+  def test_svc_check_default(self):
+    self.maxDiff = None
+    self.executeScript("2.2/services/SLIDER/package/scripts/service_check.py",
+                       classname="SliderServiceCheck",
+                       command="service_check",
+                       config_file="default.json"
+    )
+
+    self.assertResourceCalled('Execute', ' /usr/lib/slider/bin/slider-wrapper list',
+                              logoutput=True,
+                              tries=3,
+                              user='ambari-qa',
+                              try_sleep=5,
+    )
+    self.assertNoMoreResources()
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/test/python/stacks/2.2/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/default.json b/ambari-server/src/test/python/stacks/2.2/configs/default.json
new file mode 100644
index 0000000..07c4c32
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.2/configs/default.json
@@ -0,0 +1,115 @@
+{
+    "roleCommand": "SERVICE_CHECK",
+    "clusterName": "c1",
+    "hostname": "c6401.ambari.apache.org",
+    "hostLevelParams": {
+        "jdk_location": "http://c6401.ambari.apache.org:8080/resources/",
+        "ambari_db_rca_password": "mapred",
+        "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca",
+        "jce_name": "UnlimitedJCEPolicyJDK7.zip",
+        "stack_version": "2.1",
+        "stack_name": "HDP",
+        "ambari_db_rca_driver": "org.postgresql.Driver",
+        "jdk_name": "jdk-7u45-linux-x64.tar.gz",
+        "ambari_db_rca_username": "mapred",
+        "java_home": "/usr/jdk64/jdk1.7.0_45",
+        "db_name": "ambari"
+    },
+    "commandType": "EXECUTION_COMMAND",
+    "roleParams": {},
+    "serviceName": "SLIDER",
+    "role": "SLIDER",
+    "commandParams": {
+        "command_timeout": "300",
+        "service_package_folder": "OOZIE",
+        "script_type": "PYTHON",
+        "script": "scripts/service_check.py",
+        "excluded_hosts": "host1,host2"
+    },
+    "taskId": 152,
+    "public_hostname": "c6401.ambari.apache.org",
+    "configurations": {
+        "slider-client": {
+            "slider.zookeeper.quorum": "c6401.ambari.apache.org:2181",
+            "slider.yarn.queue": "default"
+        },
+        "core-site": {
+            "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+        },
+        "hdfs-site": {
+            "a": "b"
+        },
+        "yarn-site": {
+            "yarn.application.classpath": "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*",
+            "yarn.resourcemanager.address": "c6401.ambari.apache.org:8050",
+            "yarn.resourcemanager.scheduler.address": "c6401.ambari.apache.org:8030"
+        },
+        "cluster-env": {
+            "security_enabled": "false",
+            "ignore_groupsusers_create": "false",
+            "smokeuser": "ambari-qa",
+            "kerberos_domain": "EXAMPLE.COM",
+            "user_group": "hadoop"
+        },
+        "slider-log4j": {
+            "content": "log4jproperties\nline2"
+        }
+    },
+    "configuration_attributes": {
+        "yarn-site": {
+            "final": {
+                "yarn.nodemanager.disk-health-checker.min-healthy-disks": "true",
+                "yarn.nodemanager.container-executor.class": "true",
+                "yarn.nodemanager.local-dirs": "true"
+            }
+        },
+        "hdfs-site": {
+            "final": {
+                "dfs.web.ugi": "true",
+                "dfs.support.append": "true",
+                "dfs.cluster.administrators": "true"
+            }
+        },
+        "core-site": {
+            "final": {
+                "hadoop.proxyuser.hive.groups": "true",
+                "webinterface.private.actions": "true",
+                "hadoop.proxyuser.oozie.hosts": "true"
+            }
+        }
+    },
+    "configurationTags": {
+        "slider-client": {
+            "tag": "version1"
+        },
+        "slider-log4j": {
+            "tag": "version1"
+        },
+        "core-site": {
+            "tag": "version1"
+        },
+        "hdfs-site": {
+            "tag": "version1"
+        },
+        "yarn-site": {
+            "tag": "version1"
+        }
+    },
+    "commandId": "7-1",
+    "clusterHostInfo": {
+        "ambari_server_host": [
+            "c6401.ambari.apache.org"
+        ],
+        "all_ping_ports": [
+            "8670",
+            "8670"
+        ],
+        "rm_host": [
+            "c6402.ambari.apache.org"
+        ],
+        "all_hosts": [
+            "c6401.ambari.apache.org",
+            "c6402.ambari.apache.org"
+        ]
+    }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc03bc7/ambari-server/src/test/python/stacks/2.2/configs/secured.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/configs/secured.json b/ambari-server/src/test/python/stacks/2.2/configs/secured.json
new file mode 100644
index 0000000..d7818bc
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.2/configs/secured.json
@@ -0,0 +1,79 @@
+{
+    "roleCommand": "SERVICE_CHECK",
+    "clusterName": "c1",
+    "hostname": "c6401.ambari.apache.org",
+    "hostLevelParams": {
+        "jdk_location": "http://c6401.ambari.apache.org:8080/resources/",
+        "ambari_db_rca_password": "mapred",
+        "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca",
+        "jce_name": "UnlimitedJCEPolicyJDK7.zip",
+        "stack_version": "2.1",
+        "stack_name": "HDP",
+        "ambari_db_rca_driver": "org.postgresql.Driver",
+        "jdk_name": "jdk-7u45-linux-x64.tar.gz",
+        "ambari_db_rca_username": "mapred",
+        "java_home": "/usr/jdk64/jdk1.7.0_45",
+        "db_name": "ambari"
+    },
+    "commandType": "EXECUTION_COMMAND",
+    "roleParams": {},
+    "serviceName": "SLIDER",
+    "role": "SLIDER",
+    "commandParams": {
+        "command_timeout": "300",
+        "service_package_folder": "OOZIE",
+        "script_type": "PYTHON",
+        "script": "scripts/service_check.py",
+        "excluded_hosts": "host1,host2"
+    },
+    "taskId": 152,
+    "public_hostname": "c6401.ambari.apache.org",
+    "configurations": {
+        "slider-client": {
+            "slider.zookeeper.quorum": "c6401.ambari.apache.org:2181",
+            "yarn.application.classpath": "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*",
+            "yarn.resourcemanager.address": "c6401.ambari.apache.org:8050",
+            "yarn.resourcemanager.scheduler.address": "c6401.ambari.apache.org:8030",
+            "slider.yarn.queue": "default",
+            "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+        },
+        "cluster-env": {
+            "security_enabled": "true",
+            "ignore_groupsusers_create": "false",
+            "smokeuser": "ambari-qa",
+            "kerberos_domain": "EXAMPLE.COM",
+            "user_group": "hadoop",
+            "smokeuser_keytab": "/etc/security/keytabs/smokeuser.headless.keytab",
+            "kinit_path_local": "/usr/bin"
+        },
+        "slider-log4j": {
+            "content": "log4jproperties\nline2"
+        }
+    },
+    "configuration_attributes": {},
+    "configurationTags": {
+        "slider-client": {
+            "tag": "version1"
+        },
+        "slider-log4j": {
+            "tag": "version1"
+        }
+    },
+    "commandId": "7-1",
+    "clusterHostInfo": {
+        "ambari_server_host": [
+            "c6401.ambari.apache.org"
+        ],
+        "all_ping_ports": [
+            "8670",
+            "8670"
+        ],
+        "rm_host": [
+            "c6402.ambari.apache.org"
+        ],
+        "all_hosts": [
+            "c6401.ambari.apache.org",
+            "c6402.ambari.apache.org"
+        ]
+    }
+}


[16/34] git commit: AMBARI-7374. Slider View: BE - Provide alerts in view API

Posted by jo...@apache.org.
AMBARI-7374. Slider View: BE - Provide alerts in view API


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

Branch: refs/heads/branch-alerts-dev
Commit: 2a5759c5d39fbb70db2b4549bb6cee49601c86d9
Parents: 372514d
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Sep 17 15:01:59 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Sep 17 15:01:59 2014 -0700

----------------------------------------------------------------------
 .../apache/ambari/view/slider/AlertField.java   |  62 ++++++++++
 .../apache/ambari/view/slider/AlertState.java   |  40 +++++++
 .../apache/ambari/view/slider/SliderApp.java    |   9 ++
 .../ambari/view/slider/SliderAppsAlerts.java    | 120 +++++++++++++++++++
 .../slider/SliderAppsViewControllerImpl.java    |   9 +-
 .../rest/client/SliderAppMasterClient.java      |  38 +++---
 6 files changed, 257 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5759c5/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/AlertField.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/AlertField.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/AlertField.java
new file mode 100644
index 0000000..40fd97f
--- /dev/null
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/AlertField.java
@@ -0,0 +1,62 @@
+/**
+ * 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.view.slider;
+
+public enum AlertField {
+  /**
+   * Description of a service
+   */
+  description,
+  /**
+   * Host name where to which service belongs
+   */
+  host_name,
+  /**
+   * Last status
+   */
+  last_status,
+  /**
+   * Time when last status was checked
+   */
+  last_status_time,
+  /**
+   * Service
+   */
+  service_name,
+  /**
+   * Component name
+   */
+  component_name,
+  /**
+   * Same, as actual_status and last_status
+   */
+  status,
+  /**
+   * Time when status was checked
+   */
+  status_time,
+  /**
+   * Not yet used, for future purpose
+   */
+  output,
+  /**
+   * Same, as status and last_status
+   */
+  actual_status
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5759c5/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/AlertState.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/AlertState.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/AlertState.java
new file mode 100644
index 0000000..d239394
--- /dev/null
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/AlertState.java
@@ -0,0 +1,40 @@
+/**
+ * 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.view.slider;
+
+
+public enum AlertState {
+  /**
+   * Alert does not need to be distributed.  Normal Operation.
+   */
+  OK,
+  /**
+   * Alert indicates there may be an issue.  The component may be operating
+   * normally but may be in danger of becoming <code>CRITICAL</code>.
+   */
+  WARNING,
+  /**
+   * Indicates there is a critical situation that needs to be addressed.
+   */
+  CRITICAL,
+  /**
+   * The state of the alert is not known.
+   */
+  UNKNOWN
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5759c5/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderApp.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderApp.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderApp.java
index 9d748fa..6276299 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderApp.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderApp.java
@@ -39,6 +39,7 @@ public class SliderApp {
   private Map<String, Map<String, String>> configs;
   private Map<String, SliderAppComponent> components;
   private Map<String, Object> metrics;
+  private Map<String, Object> alerts;
 
   public String getName() {
     return name;
@@ -167,4 +168,12 @@ public class SliderApp {
   public void setAppVersion(String appVersion) {
     this.appVersion = appVersion;
   }
+
+  public Map<String, Object> getAlerts() {
+    return alerts;
+  }
+
+  public void setAlerts(Map<String, Object> alerts) {
+    this.alerts = alerts;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5759c5/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java
new file mode 100644
index 0000000..957c6e8
--- /dev/null
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsAlerts.java
@@ -0,0 +1,120 @@
+/**
+ * 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.view.slider;
+
+import com.google.inject.Singleton;
+import org.apache.log4j.Logger;
+
+import java.lang.Exception;
+import java.util.*;
+
+@Singleton
+public class SliderAppsAlerts {
+  private static final Logger logger = Logger
+     .getLogger(SliderAppsAlerts.class);
+
+  public Map<String, Object> generateComponentsAlerts(Map<String, SliderAppComponent> components, String service){
+     HashMap<String, Object> result = new HashMap<String, Object>();
+     Set<Map<AlertField,Object>> details = buildAlertsDetails(components, service);
+
+    result.put("detail", details);
+    result.put("summary", buildAlertsSummary(details));
+
+    return result;
+  }
+
+  private Map<AlertState,Integer> buildAlertsSummary(Set<Map<AlertField,Object>> details){
+    Map<AlertState,Integer> result = new HashMap<AlertState, Integer>();
+
+    // Initial filling of map with available states
+    for (AlertState state:AlertState.values()){
+      result.put(state, 0);
+    }
+
+    for(Map<AlertField,Object> item:details){
+      AlertState state = (AlertState)item.get(AlertField.status);
+      result.put(state,result.get(state)+1);
+    }
+    return result;
+  }
+
+  private Set<Map<AlertField,Object>> buildAlertsDetails(Map<String, SliderAppComponent> components, String service){
+    HashSet<Map<AlertField,Object>> resultList = new HashSet<Map<AlertField, Object>>();
+    for (String componentKey:components.keySet()){
+      resultList.add(buildComponentAlert(components.get(componentKey), service));
+    }
+    return  resultList;
+  }
+
+  private Map<AlertField,Object> buildComponentAlert(SliderAppComponent component, String service){
+    HashMap<AlertField,Object> alertItem = new HashMap<AlertField, Object>();
+    Date date = Calendar.getInstance().getTime();
+
+
+    AlertState state = getComponentState(component);
+    alertItem.put(AlertField.description, String.format("%s component",component.getComponentName()));
+    alertItem.put(AlertField.host_name, getComponentHostName(component));
+    alertItem.put(AlertField.last_status, state);
+
+    alertItem.put(AlertField.last_status_time, new java.sql.Timestamp(date.getTime()));
+
+    alertItem.put(AlertField.service_name, service.toUpperCase());
+    alertItem.put(AlertField.component_name, component.getComponentName());
+    alertItem.put(AlertField.status, state);
+    alertItem.put(AlertField.status_time, new java.sql.Timestamp(date.getTime()));
+    alertItem.put(AlertField.output, state);
+    alertItem.put(AlertField.actual_status, state);
+    return alertItem;
+  }
+
+  @SuppressWarnings("unchecked")
+  private String getComponentHostName(SliderAppComponent component){
+    Map<String,Map<String,String>> containers = null;
+
+    if (component.getActiveContainers().size() > 0){
+      containers = component.getActiveContainers();
+    }
+
+    if (component.getCompletedContainers().size() > 0 && containers == null) {
+      containers =component.getCompletedContainers();
+    }
+
+
+    if (containers != null){
+      try {
+        // try to obtain host name from any first available container
+        return ((Map<String,String>)containers.values().toArray()[0]).get("host");
+      } catch (Exception e){
+        if (logger.isDebugEnabled()){
+          logger.warn("Couldn't obtain host name for the component", e);
+        }
+      }
+    }
+    return null;
+  }
+
+  private AlertState getComponentState(SliderAppComponent component){
+    if (component.getInstanceCount() == component.getActiveContainers().size()){
+      return AlertState.OK;
+    }
+    return AlertState.CRITICAL;
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5759c5/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
index 5d6c368..3626cbe 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
@@ -89,6 +89,8 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
   private ViewContext viewContext;
   private List<SliderAppType> appTypes;
   private Integer createAppCounter = -1;
+  @Inject
+  private SliderAppsAlerts sliderAlerts;
 
   private String getAppsFolderPath() {
     return viewContext.getAmbariProperty("resources.dir") + "/apps";
@@ -229,17 +231,17 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
             if (appMasterData == null) {
               appMasterData = sliderAppClient.getAppMasterData();
             }
-            if ("urls".equals(property.toLowerCase())) {
+            if (appMasterData!=null && "urls".equals(property.toLowerCase())) {
               if (quickLinks.isEmpty()) {
                 quickLinks = sliderAppClient
                     .getQuickLinks(appMasterData.publisherUrl);
               }
               app.setUrls(quickLinks);
-            } else if ("configs".equals(property.toLowerCase())) {
+            } else if (appMasterData!=null && "configs".equals(property.toLowerCase())) {
               Map<String, Map<String, String>> configs = sliderAppClient
                   .getConfigs(appMasterData.publisherUrl);
               app.setConfigs(configs);
-            } else if ("jmx".equals(property.toLowerCase())) {
+            } else if (appMasterData!=null && "jmx".equals(property.toLowerCase())) {
               if (quickLinks.isEmpty()) {
                 quickLinks = sliderAppClient
                     .getQuickLinks(appMasterData.publisherUrl);
@@ -323,6 +325,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
                           + appComponent.getCompletedContainers().size());
                     }
                   }
+                  app.setAlerts(sliderAlerts.generateComponentsAlerts(componentTypeMap, app.getType()));
                   app.setComponents(componentTypeMap);
                 }
               } catch (UnknownApplicationInstanceException e) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2a5759c5/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppMasterClient.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppMasterClient.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppMasterClient.java
index d77c1c7..ab6289c 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppMasterClient.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/rest/client/SliderAppMasterClient.java
@@ -48,26 +48,28 @@ public class SliderAppMasterClient extends BaseHttpClient {
   public SliderAppMasterData getAppMasterData() {
     try {
       String html = doGet("");
-      int from = html.lastIndexOf("<ul>");
-      int to = html.lastIndexOf("</ul>");
-      if (from < to && from > -1) {
-        SliderAppMasterData data = new SliderAppMasterData();
-        String content = html.substring(from, to);
-        content = content.replaceAll("<[^>]*>", "\r\n");
-        String[] splits = content.split("\r\n");
-        for (int i = 0; i < splits.length; i++) {
-          String split = splits[i].trim();
-          if ("Registry Web Service".equals(split)) {
-            data.registryUrl = splits[i + 1].trim();
-          } else if ("Application Master Web UI".equals(split)) {
-            data.uiUrl = splits[i + 1].trim();
-          } else if ("Management REST API".equals(split)) {
-            data.managementUrl = splits[i + 1].trim();
-          } else if ("Publisher Service".equals(split)) {
-            data.publisherUrl = splits[i + 1].trim();
+      if (html != null) {
+        int from = html.lastIndexOf("<ul>");
+        int to = html.lastIndexOf("</ul>");
+        if (from < to && from > -1) {
+          SliderAppMasterData data = new SliderAppMasterData();
+          String content = html.substring(from, to);
+          content = content.replaceAll("<[^>]*>", "\r\n");
+          String[] splits = content.split("\r\n");
+          for (int i = 0; i < splits.length; i++) {
+            String split = splits[i].trim();
+            if ("Registry Web Service".equals(split)) {
+              data.registryUrl = splits[i + 1].trim();
+            } else if ("Application Master Web UI".equals(split)) {
+              data.uiUrl = splits[i + 1].trim();
+            } else if ("Management REST API".equals(split)) {
+              data.managementUrl = splits[i + 1].trim();
+            } else if ("Publisher Service".equals(split)) {
+              data.publisherUrl = splits[i + 1].trim();
+            }
           }
+          return data;
         }
-        return data;
       }
     } catch (HttpException e) {
       logger.warn("Unable to determine Ambari clusters", e);


[33/34] git commit: AMBARI-7389 - Alerts: Add UUID Column for AlertNotice (jonathanhurley)

Posted by jo...@apache.org.
AMBARI-7389 - Alerts: Add UUID Column for AlertNotice (jonathanhurley)


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

Branch: refs/heads/branch-alerts-dev
Commit: 5fc58284f1f286c5b5eaa8d5d40ac240ec0f8aa3
Parents: bf0f4a9
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Sep 18 10:21:17 2014 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Sep 18 10:42:39 2014 -0400

----------------------------------------------------------------------
 .../server/orm/entities/AlertNoticeEntity.java  |  51 +++++++--
 .../server/upgrade/UpgradeCatalog170.java       |  96 +++++++++++++---
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   1 +
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   1 +
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |   1 +
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql     |   1 +
 .../server/orm/dao/AlertDefinitionDAOTest.java  |   9 +-
 .../server/upgrade/UpgradeCatalog170Test.java   | 110 +++++++++++++++----
 8 files changed, 215 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc58284/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertNoticeEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertNoticeEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertNoticeEntity.java
index af541cd..c9470ce 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertNoticeEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/AlertNoticeEntity.java
@@ -17,6 +17,7 @@
  */
 package org.apache.ambari.server.orm.entities;
 
+import javax.persistence.Basic;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.EnumType;
@@ -38,7 +39,7 @@ import org.apache.ambari.server.state.NotificationState;
  * notification to an {@link AlertTargetEntity}. There are three
  * {@link NotificationState}s that a single notice can exist in. These instances
  * are persisted indefinitely for historical reference.
- * 
+ *
  */
 @Entity
 @Table(name = "alert_notice")
@@ -57,6 +58,10 @@ public class AlertNoticeEntity {
   @Column(name = "notify_state", nullable = false, length = 255)
   private NotificationState notifyState;
 
+  @Basic
+  @Column(nullable = false, length = 64)
+  private String uuid;
+
   /**
    * Bi-directional many-to-one association to {@link AlertHistoryEntity}.
    */
@@ -79,7 +84,7 @@ public class AlertNoticeEntity {
 
   /**
    * Gets the unique ID for this alert notice.
-   * 
+   *
    * @return the ID (never {@code null}).
    */
   public Long getNotificationId() {
@@ -88,7 +93,7 @@ public class AlertNoticeEntity {
 
   /**
    * Sets the unique ID for this alert notice.
-   * 
+   *
    * @param notificationId
    *          the ID (not {@code null}).
    */
@@ -100,7 +105,7 @@ public class AlertNoticeEntity {
    * Gets the notification state for this alert notice. Alert notices are
    * pending until they are processed, after which they will either be
    * successful or failed.
-   * 
+   *
    * @return the notification state (never {@code null}).
    */
   public NotificationState getNotifyState() {
@@ -109,7 +114,7 @@ public class AlertNoticeEntity {
 
   /**
    * Sets the notification state for this alert notice.
-   * 
+   *
    * @param notifyState
    *          the notification state (not {@code null}).
    */
@@ -118,8 +123,27 @@ public class AlertNoticeEntity {
   }
 
   /**
+   * Gets the unique ID for this alert notice.
+   *
+   * @return the unique ID (never {@code null}).
+   */
+  public String getUuid() {
+    return uuid;
+  }
+
+  /**
+   * Sets the unique ID for this alert notice.
+   *
+   * @param uuid
+   *          the unique ID (not {@code null}).
+   */
+  public void setUuid(String uuid) {
+    this.uuid = uuid;
+  }
+
+  /**
    * Gets the associated alert history entry for this alert notice.
-   * 
+   *
    * @return the historical event that traiggered this notice's creation (never
    *         {@code null}).
    */
@@ -129,7 +153,7 @@ public class AlertNoticeEntity {
 
   /**
    * Sets the associated alert history entry for this alert notice.
-   * 
+   *
    * @param alertHistory
    *          the historical event that traiggered this notice's creation (not
    *          {@code null}).
@@ -140,7 +164,7 @@ public class AlertNoticeEntity {
 
   /**
    * Gets the intended audience for the notification.
-   * 
+   *
    * @return the recipient of this notification (never {@code null}).
    */
   public AlertTargetEntity getAlertTarget() {
@@ -149,7 +173,7 @@ public class AlertNoticeEntity {
 
   /**
    * Sets the intended audience for the notification.
-   * 
+   *
    * @param alertTarget
    *          the recipient of this notification (not {@code null}).
    */
@@ -162,17 +186,20 @@ public class AlertNoticeEntity {
    */
   @Override
   public boolean equals(Object object) {
-    if (this == object)
+    if (this == object) {
       return true;
+    }
 
-    if (object == null || getClass() != object.getClass())
+    if (object == null || getClass() != object.getClass()) {
       return false;
+    }
 
     AlertNoticeEntity that = (AlertNoticeEntity) object;
 
     if (notificationId != null ? !notificationId.equals(that.notificationId)
-        : that.notificationId != null)
+        : that.notificationId != null) {
       return false;
+    }
 
     return true;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc58284/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index 1c9608c..7eb1116 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -18,30 +18,87 @@
 
 package org.apache.ambari.server.upgrade;
 
-import com.google.common.reflect.TypeToken;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
+import java.lang.reflect.Type;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Expression;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
-import org.apache.ambari.server.orm.dao.*;
-import org.apache.ambari.server.orm.entities.*;
-import org.apache.ambari.server.state.*;
+import org.apache.ambari.server.orm.dao.ClusterDAO;
+import org.apache.ambari.server.orm.dao.ClusterServiceDAO;
+import org.apache.ambari.server.orm.dao.ConfigGroupConfigMappingDAO;
+import org.apache.ambari.server.orm.dao.DaoUtils;
+import org.apache.ambari.server.orm.dao.HostComponentDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.HostComponentStateDAO;
+import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
+import org.apache.ambari.server.orm.dao.KeyValueDAO;
+import org.apache.ambari.server.orm.dao.PermissionDAO;
+import org.apache.ambari.server.orm.dao.PrincipalDAO;
+import org.apache.ambari.server.orm.dao.PrincipalTypeDAO;
+import org.apache.ambari.server.orm.dao.PrivilegeDAO;
+import org.apache.ambari.server.orm.dao.ResourceDAO;
+import org.apache.ambari.server.orm.dao.ResourceTypeDAO;
+import org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.ServiceDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.UserDAO;
+import org.apache.ambari.server.orm.dao.ViewDAO;
+import org.apache.ambari.server.orm.dao.ViewInstanceDAO;
+import org.apache.ambari.server.orm.entities.ClusterConfigEntity;
+import org.apache.ambari.server.orm.entities.ClusterEntity;
+import org.apache.ambari.server.orm.entities.ClusterServiceEntity;
+import org.apache.ambari.server.orm.entities.ClusterServiceEntityPK;
+import org.apache.ambari.server.orm.entities.ConfigGroupConfigMappingEntity;
+import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.HostComponentStateEntity;
+import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
+import org.apache.ambari.server.orm.entities.HostRoleCommandEntity_;
+import org.apache.ambari.server.orm.entities.KeyValueEntity;
+import org.apache.ambari.server.orm.entities.PermissionEntity;
+import org.apache.ambari.server.orm.entities.PrincipalEntity;
+import org.apache.ambari.server.orm.entities.PrincipalTypeEntity;
+import org.apache.ambari.server.orm.entities.PrivilegeEntity;
+import org.apache.ambari.server.orm.entities.ResourceEntity;
+import org.apache.ambari.server.orm.entities.ResourceTypeEntity;
+import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntityPK;
+import org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.ServiceDesiredStateEntityPK;
+import org.apache.ambari.server.orm.entities.UserEntity;
+import org.apache.ambari.server.orm.entities.ViewEntity;
+import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.utils.StageUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import javax.persistence.criteria.*;
-import java.lang.reflect.Type;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.*;
-import java.util.Map.Entry;
+import com.google.common.reflect.TypeToken;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
 
 /**
  * Upgrade catalog for version 1.7.0.
@@ -610,8 +667,9 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
       pkHCATInHcatalog.setServiceName(serviceNameToBeDeleted);
       ServiceComponentDesiredStateEntity serviceComponentDesiredStateEntityToDelete = serviceComponentDesiredStateDAO.findByPK(pkHCATInHcatalog);
 
-      if (serviceComponentDesiredStateEntityToDelete == null)
+      if (serviceComponentDesiredStateEntityToDelete == null) {
         continue;
+      }
 
       ServiceDesiredStateEntityPK serviceDesiredStateEntityPK = new ServiceDesiredStateEntityPK();
       serviceDesiredStateEntityPK.setClusterId(clusterEntity.getClusterId());
@@ -902,6 +960,7 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
     columns.add(new DBColumnInfo("target_id", Long.class, null, null, false));
     columns.add(new DBColumnInfo("history_id", Long.class, null, null, false));
     columns.add(new DBColumnInfo("notify_state", String.class, 255, null, false));
+    columns.add(new DBColumnInfo("uuid", String.class, 64, null, false));
     dbAccessor.createTable(ALERT_TABLE_NOTICE, columns, "notification_id");
 
     dbAccessor.addFKConstraint(ALERT_TABLE_NOTICE, "fk_alert_notice_target_id",
@@ -910,6 +969,9 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
     dbAccessor.addFKConstraint(ALERT_TABLE_NOTICE, "fk_alert_notice_hist_id",
         "history_id", ALERT_TABLE_HISTORY, "alert_id", false);
 
+    dbAccessor.executeQuery("ALTER TABLE " + ALERT_TABLE_NOTICE
+        + " ADD CONSTRAINT uni_alert_notice_uuid UNIQUE (uuid)", false);
+
     // Indexes
     dbAccessor.createIndex("idx_alert_history_def_id", ALERT_TABLE_HISTORY,
         "alert_definition_id");

http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc58284/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index a259870..70796c1 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -236,6 +236,7 @@ CREATE TABLE alert_notice (
   target_id BIGINT NOT NULL,
   history_id BIGINT NOT NULL,
   notify_state VARCHAR(255) NOT NULL,
+  uuid VARCHAR(64) NOT NULL UNIQUE,
   PRIMARY KEY (notification_id),
   FOREIGN KEY (target_id) REFERENCES alert_target(target_id),  
   FOREIGN KEY (history_id) REFERENCES alert_history(alert_id)

http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc58284/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index a3b70e5..f9c87b0 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -227,6 +227,7 @@ CREATE TABLE alert_notice (
   target_id NUMBER(19) NOT NULL,
   history_id NUMBER(19) NOT NULL,
   notify_state VARCHAR2(255) NOT NULL,
+  uuid VARCHAR2(64) NOT NULL UNIQUE,
   PRIMARY KEY (notification_id),
   FOREIGN KEY (target_id) REFERENCES alert_target(target_id),  
   FOREIGN KEY (history_id) REFERENCES alert_history(alert_id)

http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc58284/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 8e14c83..1aa7307 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -259,6 +259,7 @@ CREATE TABLE alert_notice (
   target_id BIGINT NOT NULL,
   history_id BIGINT NOT NULL,
   notify_state VARCHAR(255) NOT NULL,
+  uuid VARCHAR(64) NOT NULL UNIQUE,
   PRIMARY KEY (notification_id),
   FOREIGN KEY (target_id) REFERENCES alert_target(target_id),  
   FOREIGN KEY (history_id) REFERENCES alert_history(alert_id)

http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc58284/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
index c8be992..c504bcc 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
@@ -323,6 +323,7 @@ CREATE TABLE ambari.alert_notice (
   target_id BIGINT NOT NULL,
   history_id BIGINT NOT NULL,
   notify_state VARCHAR(255) NOT NULL,
+  uuid VARCHAR(64) NOT NULL UNIQUE,
   PRIMARY KEY (notification_id),
   FOREIGN KEY (target_id) REFERENCES ambari.alert_target(target_id),  
   FOREIGN KEY (history_id) REFERENCES ambari.alert_history(alert_id)

http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc58284/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
index f2ddcd7..563e076 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/AlertDefinitionDAOTest.java
@@ -65,7 +65,7 @@ public class AlertDefinitionDAOTest {
   OrmTestHelper helper;
 
   /**
-   * 
+   *
    */
   @Before
   public void setup() {
@@ -100,7 +100,7 @@ public class AlertDefinitionDAOTest {
   }
 
   /**
-   * 
+   *
    */
   @Test
   public void testFindByName() {
@@ -114,7 +114,7 @@ public class AlertDefinitionDAOTest {
   }
 
   /**
-   * 
+   *
    */
   @Test
   public void testFindAll() {
@@ -124,7 +124,7 @@ public class AlertDefinitionDAOTest {
   }
 
   /**
-   * 
+   *
    */
   @Test
   public void findById() {
@@ -190,6 +190,7 @@ public class AlertDefinitionDAOTest {
     notice.setAlertHistory(history);
     notice.setAlertTarget(helper.createAlertTarget());
     notice.setNotifyState(NotificationState.PENDING);
+    notice.setUuid(UUID.randomUUID().toString());
     dispatchDao.create(notice);
 
     group = dispatchDao.findGroupById(group.getGroupId());

http://git-wip-us.apache.org/repos/asf/ambari/blob/5fc58284/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index dcf308c..6732455 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -18,39 +18,105 @@
 
 package org.apache.ambari.server.upgrade;
 
-import com.google.inject.*;
-import com.google.inject.persist.PersistService;
-import com.google.inject.persist.Transactional;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNull;
+import static junit.framework.Assert.assertTrue;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createMockBuilder;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.createStrictMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Order;
+import javax.persistence.criteria.Path;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.persistence.metamodel.SingularAttribute;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.DBAccessor;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
-import org.apache.ambari.server.orm.dao.*;
-import org.apache.ambari.server.orm.entities.*;
-import org.apache.ambari.server.state.*;
+import org.apache.ambari.server.orm.dao.ClusterDAO;
+import org.apache.ambari.server.orm.dao.ClusterServiceDAO;
+import org.apache.ambari.server.orm.dao.ConfigGroupConfigMappingDAO;
+import org.apache.ambari.server.orm.dao.HostComponentDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.HostDAO;
+import org.apache.ambari.server.orm.dao.KeyValueDAO;
+import org.apache.ambari.server.orm.dao.PermissionDAO;
+import org.apache.ambari.server.orm.dao.PrincipalDAO;
+import org.apache.ambari.server.orm.dao.PrincipalTypeDAO;
+import org.apache.ambari.server.orm.dao.PrivilegeDAO;
+import org.apache.ambari.server.orm.dao.ResourceDAO;
+import org.apache.ambari.server.orm.dao.ResourceTypeDAO;
+import org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.UserDAO;
+import org.apache.ambari.server.orm.dao.ViewDAO;
+import org.apache.ambari.server.orm.dao.ViewInstanceDAO;
+import org.apache.ambari.server.orm.entities.ClusterConfigEntity;
+import org.apache.ambari.server.orm.entities.ClusterEntity;
+import org.apache.ambari.server.orm.entities.ClusterServiceEntity;
+import org.apache.ambari.server.orm.entities.ConfigGroupConfigMappingEntity;
+import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.HostComponentStateEntity;
+import org.apache.ambari.server.orm.entities.HostEntity;
+import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
+import org.apache.ambari.server.orm.entities.KeyValueEntity;
+import org.apache.ambari.server.orm.entities.PrivilegeEntity;
+import org.apache.ambari.server.orm.entities.ResourceEntity;
+import org.apache.ambari.server.orm.entities.ResourceTypeEntity;
+import org.apache.ambari.server.orm.entities.ServiceComponentDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.ServiceDesiredStateEntity;
+import org.apache.ambari.server.orm.entities.UserEntity;
+import org.apache.ambari.server.orm.entities.ViewEntity;
+import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.ambari.server.state.ConfigHelper;
+import org.apache.ambari.server.state.HostComponentAdminState;
+import org.apache.ambari.server.state.StackId;
 import org.easymock.Capture;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import javax.persistence.EntityManager;
-import javax.persistence.EntityTransaction;
-import javax.persistence.TypedQuery;
-import javax.persistence.criteria.*;
-import javax.persistence.metamodel.SingularAttribute;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.*;
-
-import static junit.framework.Assert.*;
-import static org.easymock.EasyMock.*;
+import com.google.inject.Binder;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+import com.google.inject.Provider;
+import com.google.inject.persist.PersistService;
+import com.google.inject.persist.Transactional;
 
 /**
  * UpgradeCatalog170 unit tests.
@@ -311,7 +377,7 @@ public class UpgradeCatalog170Test {
     assertEquals(5, alertTargetCapture.getValue().size());
     assertEquals(2, alertGroupTargetCapture.getValue().size());
     assertEquals(2, alertGroupingCapture.getValue().size());
-    assertEquals(4, alertNoticeCapture.getValue().size());
+    assertEquals(5, alertNoticeCapture.getValue().size());
     assertEquals(2, serviceConfigCapture.getValue().size());
     assertEquals(2, serviceConfigMappingCapture.getValue().size());
   }


[14/34] git commit: AMBARI-7370 yarn.admin.acl property showing up in compare but it's not set in versions. (atkach)

Posted by jo...@apache.org.
AMBARI-7370 yarn.admin.acl property showing up in compare but it's not set in versions. (atkach)


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

Branch: refs/heads/branch-alerts-dev
Commit: 9efa63da0eab71c7d1aefbe95fcd4e21ac742762
Parents: f3345be
Author: atkach <at...@hortonworks.com>
Authored: Wed Sep 17 20:06:24 2014 +0300
Committer: atkach <at...@hortonworks.com>
Committed: Wed Sep 17 20:06:24 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/utils/config.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9efa63da/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index f49c5aa..8226811 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -364,7 +364,7 @@ App.config = Em.Object.create({
           // in case when config is absent on server and defined UI config is required
           // by server, this config should be ignored
           var serverProperty = properties[serviceConfigObj.get('name')];
-          if (!serverProperty && serviceConfigObj.get('isRequiredByAgent')) {
+          if (Em.isNone(serverProperty) && serviceConfigObj.get('isRequiredByAgent')) {
             continue;
           }
         }


[09/34] git commit: AMBARI-7333. Tez deployment changes for Champlain (aonishuk)

Posted by jo...@apache.org.
AMBARI-7333. Tez deployment changes for Champlain (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 0449d22238aedc5c6fe5489b40e58d01f0a9caf1
Parents: 6952fa4
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 17 18:49:09 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 17 18:49:09 2014 +0300

----------------------------------------------------------------------
 .../stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0449d222/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
index fd8945f..ab86ff7 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/params.py
@@ -222,7 +222,8 @@ if System.get_instance().os_family == "ubuntu":
   mysql_configname = '/etc/mysql/my.cnf'
 else:
   mysql_configname = '/etc/my.cnf'
-  
+
+tez_tar_file = "/usr/lib/tez/tez*.tar.gz"
 
 # Hive security
 hive_authorization_enabled = config['configurations']['hive-site']['hive.security.authorization.enabled']


[27/34] git commit: AMBARI-7384 Broken dashboard loaded when there's no cluster installed. (Max Shepel via ababiichuk)

Posted by jo...@apache.org.
AMBARI-7384 Broken dashboard loaded when there's no cluster installed. (Max Shepel via ababiichuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 19bf2a6a8f81e6a336cbf2617326065c36dc9dbd
Parents: 38a1812
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Sep 18 15:53:08 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Sep 18 15:53:08 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/application.js |  8 ++++----
 ambari-web/app/routes/installer.js        |  1 +
 ambari-web/app/templates/application.hbs  | 27 +++++++++++---------------
 3 files changed, 16 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/19bf2a6a/ambari-web/app/controllers/application.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/application.js b/ambari-web/app/controllers/application.js
index ed5e3c8..8706fff 100644
--- a/ambari-web/app/controllers/application.js
+++ b/ambari-web/app/controllers/application.js
@@ -23,10 +23,6 @@ App.ApplicationController = Em.Controller.extend(App.UserPref, {
 
   name: 'applicationController',
 
-  clusterExists: function() {
-    return !Em.isNone(App.router.get('clusterController.clusterName'));
-  }.property('App.router.clusterController.clusterName'),
-
   clusterName: function () {
     return (App.router.get('clusterController.clusterName') || 'My Cluster');
   }.property('App.router.clusterController.clusterName'),
@@ -47,6 +43,10 @@ App.ApplicationController = Em.Controller.extend(App.UserPref, {
     return App.router.get('clusterController.isLoaded') && App.router.get('loggedIn');
   }.property('App.router.clusterController.isLoaded','App.router.loggedIn'),
 
+  isExistingClusterDataLoaded: function () {
+    return !Em.isNone(App.router.get('clusterController.clusterName')) && this.get('isClusterDataLoaded');
+  }.property('App.router.clusterController.clusterName', 'isClusterDataLoaded'),
+
   init: function(){
     this._super();
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/19bf2a6a/ambari-web/app/routes/installer.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js
index a414ff4..2a081ea 100644
--- a/ambari-web/app/routes/installer.js
+++ b/ambari-web/app/routes/installer.js
@@ -439,6 +439,7 @@ module.exports = Em.Route.extend({
       controller.setClusterProvisioningState('INSTALLED', function () {
         // We need to do recovery based on whether we are in Add Host or Installer wizard
         controller.saveClusterState('DEFAULT');
+        App.router.set('clusterController.isLoaded', false);
         router.transitionTo('main.dashboard.index');
       });
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/19bf2a6a/ambari-web/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/application.hbs b/ambari-web/app/templates/application.hbs
index 6401500..3e1b303 100644
--- a/ambari-web/app/templates/application.hbs
+++ b/ambari-web/app/templates/application.hbs
@@ -21,29 +21,24 @@
     <div class="navbar navbar-static-top">
       <div class="navbar-inner">
         <div class="container main-container">
-          {{#if isClusterDataLoaded}}
+          {{#if isExistingClusterDataLoaded}}
             <a {{translateAttr href="topnav.logo.href"}} class="logo"><img src="/img/logo-white.png" alt="Apache Ambari" title="Apache Ambari"></a>
             <a class="brand" {{translateAttr href="topnav.logo.href"}} title="Apache Ambari">{{t app.name}}</a>
+            <a class="brand cluster-name" href="javascript:void(null);" {{bindAttr title="clusterName"}}>
+              <span {{action "showPopup" target="App.router.backgroundOperationsController"}} >{{clusterDisplayName}} </span>
+              {{#with App.router.backgroundOperationsController}}
+                {{#if allOperationsCount}}
+                  <i class="icon-caret-left ops-count"></i><span class="label operations-count" {{action "showPopup" target="App.router.backgroundOperationsController"}}> {{allOperationsCount}} {{t ops}}</span>
+                {{else}}
+                  <i class="icon-caret-left"></i><span class="label" {{action "showPopup" target="App.router.backgroundOperationsController"}}>{{allOperationsCount}} {{t ops}}</span>
+                {{/if}}
+              {{/with}}
+            </a>
           {{else}}
             <a class="logo"><img src="/img/logo-white.png" alt="Apache Ambari" title="Apache Ambari"></a>
             <a class="brand" title="Apache Ambari">{{t app.name}}</a>
           {{/if}}
 
-          {{#if isClusterDataLoaded}}
-            {{#if clusterExists}}
-              <a class="brand cluster-name" href="javascript:void(null);" {{bindAttr title="clusterName"}}>
-                <span {{action "showPopup" target="App.router.backgroundOperationsController"}} >{{clusterDisplayName}} </span>
-                  {{#with App.router.backgroundOperationsController}}
-                    {{#if allOperationsCount}}
-                        <i class="icon-caret-left ops-count"></i><span class="label operations-count" {{action "showPopup" target="App.router.backgroundOperationsController"}}> {{allOperationsCount}} {{t ops}}</span>
-                    {{else}}
-                        <i class="icon-caret-left"></i><span class="label" {{action "showPopup" target="App.router.backgroundOperationsController"}}>{{allOperationsCount}} {{t ops}}</span>
-                    {{/if}}
-                  {{/with}}
-              </a>
-            {{/if}}
-          {{/if}}
-
           {{#if App.router.loggedIn}}
             <div class="top-nav-user btn-group">
               <button class="btn dropdown-toggle"  data-toggle="dropdown">


[15/34] git commit: AMBARI-7371. Admin View : Set true in view.xml. (jaimin)

Posted by jo...@apache.org.
AMBARI-7371. Admin View : Set <system>true</system> in view.xml. (jaimin)


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

Branch: refs/heads/branch-alerts-dev
Commit: 372514d904d935a8220dfbdc261c1825c1431ead
Parents: 9efa63d
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Sep 17 13:57:18 2014 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Sep 17 13:57:18 2014 -0700

----------------------------------------------------------------------
 ambari-admin/src/main/resources/view.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/372514d9/ambari-admin/src/main/resources/view.xml
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/view.xml b/ambari-admin/src/main/resources/view.xml
index c618a8a..9bb4d8e 100644
--- a/ambari-admin/src/main/resources/view.xml
+++ b/ambari-admin/src/main/resources/view.xml
@@ -18,6 +18,7 @@ limitations under the License. Kerberos, LDAP, Custom. Binary/Htt
   <name>ADMIN_VIEW</name>
   <label>Ambari Admin View</label>
   <version>1.0.0</version>
+  <system>true</system>
   <instance>
     <name>INSTANCE</name>
     <visible>false</visible>


[04/34] git commit: AMBARI-7363 Recommendations: ui changes for usability. (ababiichuk)

Posted by jo...@apache.org.
AMBARI-7363 Recommendations: ui changes for usability. (ababiichuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 4bcf111f1f8539df666fbe3d9c41609547d4e5b3
Parents: c46d491
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Sep 17 17:33:03 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Sep 17 17:56:20 2014 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    |  5 +++
 .../app/controllers/wizard/step7_controller.js  |  5 +++
 ambari-web/app/messages.js                      |  3 +-
 ambari-web/app/mixins/common/serverValidator.js |  1 +
 ambari-web/app/styles/application.less          |  5 +++
 .../configs/config_recommendation_popup.hbs     | 35 ++++++++++++++--
 .../wizard/step6/step6_issues_popup.hbs         | 44 ++++++++++----------
 7 files changed, 73 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4bcf111f/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 4411667..32343ff 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -146,6 +146,11 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
       attributeName: 'isValid',
       attributeValue: false,
       caption: 'common.combobox.dropdown.issues'
+    },
+    {
+      attributeName: 'warn',
+      attributeValue: true,
+      caption: 'common.combobox.dropdown.warnings'
     }
   ],
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4bcf111f/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index 8afc87d..55c83ff 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -220,6 +220,11 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
       attributeName: 'isValid',
       attributeValue: false,
       caption: 'common.combobox.dropdown.issues'
+    },
+    {
+      attributeName: 'warn',
+      attributeValue: true,
+      caption: 'common.combobox.dropdown.warnings'
     }
   ],
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4bcf111f/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 7379220..d1f7afd 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -658,7 +658,7 @@ Em.I18n.translations = {
   'installer.step7.popup.validation.request.failed.body': 'Config validaition failed.',
   'installer.step7.popup.validation.warning.header': 'Configurations',
   'installer.step7.popup.validation.warning.body': 'Some service configurations are not configured properly. We recommend you review and change the highlighted configuration values. Are you sure you want to proceed without correcting configurations?',
-
+  'installer.step7.popup.validation.warning.errorDescription': ' value is less than the recommended default of ',
   'installer.step7.oozie.database.new': 'New Derby Database',
   'installer.step7.hive.database.new': 'New MySQL Database',
 
@@ -2263,6 +2263,7 @@ Em.I18n.translations = {
   'common.combobox.dropdown.final': 'Final properties',
   'common.combobox.dropdown.changed': 'Changed properties',
   'common.combobox.dropdown.issues': 'Show property issues',
+  'common.combobox.dropdown.warnings': 'Show property warnings',
 
   'quick.links.error.label': 'Hostname is undefined',
   'quick.links.publicHostName': '{0} ({1})',

http://git-wip-us.apache.org/repos/asf/ambari/blob/4bcf111f/ambari-web/app/mixins/common/serverValidator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/serverValidator.js b/ambari-web/app/mixins/common/serverValidator.js
index bea7bd7..8d551f8 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -274,6 +274,7 @@ App.ServerValidatorMixin = Em.Mixin.create({
       // Motivation: for server-side validation warnings and EVEN errors allow user to continue wizard
       return App.ModalPopup.show({
         header: Em. I18n.t('installer.step7.popup.validation.warning.header'),
+        classNames: ['sixty-percent-width-modal'],
         primary: Em.I18n.t('common.proceedAnyway'),
         onPrimary: function () {
           this.hide();

http://git-wip-us.apache.org/repos/asf/ambari/blob/4bcf111f/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 7a4138c..8385916 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -2203,6 +2203,11 @@ width:100%;
   overflow-y: auto;
 }
 
+.limited-height-2 {
+  max-height: 250px;
+  overflow-y: auto;
+}
+
 .task-detail-info {
   .task-detail-log-info {
     max-height: 340px;

http://git-wip-us.apache.org/repos/asf/ambari/blob/4bcf111f/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs b/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
index 1f47d6e..4efc312 100644
--- a/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
+++ b/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
@@ -17,12 +17,41 @@
 }}
 
 <p>{{t installer.step7.popup.validation.warning.body}}</p>
-<div class="alert alert-warning">
+<div id="config-validation-warnings" class="limited-height-2">
+  <table class="table no-borders">
+    <thead>
+    <tr>
+      <th>
+        {{t common.service}}
+      </th>
+      <th>
+        {{t common.property}}
+      </th>
+      <th>
+        {{t common.description}}
+      </th>
+    </tr>
+    </thead>
+    <tbody>
     {{#each service in stepConfigs}}
       {{#each property in service.configs}}
         {{#if property.warn}}
-          <strong>{{property.displayName}}</strong>: {{property.warnMessage}}<br />
+          <tr>
+            <td>
+              {{property.serviceName}}
+            </td>
+            <td>
+              {{property.displayName}}
+            </td>
+            <td>
+              <strong>{{property.description}}:</strong><br/>
+              <strong>{{property.value}}</strong>{{t installer.step7.popup.validation.warning.errorDescription}}
+              <strong>{{property.defaultValue}}</strong>
+            </td>
+          </tr>
         {{/if}}
       {{/each}}
     {{/each}}
-</div>
+    </tbody>
+  </table>
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4bcf111f/ambari-web/app/templates/wizard/step6/step6_issues_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step6/step6_issues_popup.hbs b/ambari-web/app/templates/wizard/step6/step6_issues_popup.hbs
index 12adf0c..447ff50 100644
--- a/ambari-web/app/templates/wizard/step6/step6_issues_popup.hbs
+++ b/ambari-web/app/templates/wizard/step6/step6_issues_popup.hbs
@@ -17,25 +17,27 @@
 }}
 
 <p>{{t installer.step6.validationSlavesAndClients.popup.body}}</p>
-{{#if anyGeneralErrors}}
-  <div class="alert alert-error">
-    <ul>
-      {{#if errorMessage}}
-        <li>{{errorMessage}}</li>
-      {{/if}}
-      {{#each msg in controller.generalErrorMessages}}
-        <li>{{msg}}</li>
-      {{/each}}
-    </ul>
-  </div>
-{{/if}}
+<div class="limited-height-2">
+  {{#if anyGeneralErrors}}
+    <div class="alert alert-error">
+      <ul>
+        {{#if errorMessage}}
+          <li>{{errorMessage}}</li>
+        {{/if}}
+        {{#each msg in controller.generalErrorMessages}}
+          <li>{{msg}}</li>
+        {{/each}}
+      </ul>
+    </div>
+  {{/if}}
 
-{{#if anyGeneralWarnings}}
-  <div class="alert alert-warning">
-    <ul>
-      {{#each msg in controller.generalWarningMessages}}
-        <li>{{msg}}</li>
-      {{/each}}
-    </ul>
-  </div>
-{{/if}}
+  {{#if anyGeneralWarnings}}
+    <div class="alert alert-warning">
+      <ul>
+        {{#each msg in controller.generalWarningMessages}}
+          <li>{{msg}}</li>
+        {{/each}}
+      </ul>
+    </div>
+  {{/if}}
+</div>


[03/34] git commit: AMBARI-7254 - Slider View: Slider view not initializing due to long parameter description

Posted by jo...@apache.org.
AMBARI-7254 - Slider View: Slider view not initializing due to long parameter description


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

Branch: refs/heads/branch-alerts-dev
Commit: c46d4916abc8775d6ad8c6446a6d640005458ac6
Parents: d6a4a68
Author: tbeerbower <tb...@hortonworks.com>
Authored: Wed Sep 17 10:41:20 2014 -0400
Committer: tbeerbower <tb...@hortonworks.com>
Committed: Wed Sep 17 10:41:20 2014 -0400

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog170.java       | 22 +++++++++++++++-----
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |  6 +++---
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  6 +++---
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |  6 +++---
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql     |  6 +++---
 5 files changed, 29 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c46d4916/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index a08d794..e58b6d3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -197,14 +197,16 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
       String.class, 255, null, true));
     dbAccessor.addColumn("viewmain", new DBColumnInfo("system_view",
         Character.class, 1, null, true));
+    dbAccessor.addColumn("viewmain", new DBColumnInfo("resource_type_id",
+        Integer.class, 1, 1, false));
+    dbAccessor.addColumn("viewmain", new DBColumnInfo("description",
+        String.class, 2048, null, true));
     dbAccessor.addColumn("viewparameter", new DBColumnInfo("masked",
       Character.class, 1, null, true));
     dbAccessor.addColumn("users", new DBColumnInfo("active",
       Integer.class, 1, 1, false));
     dbAccessor.addColumn("users", new DBColumnInfo("principal_id",
         Long.class, 1, 1, false));
-    dbAccessor.addColumn("viewmain", new DBColumnInfo("resource_type_id",
-        Integer.class, 1, 1, false));
     dbAccessor.addColumn("viewinstance", new DBColumnInfo("resource_id",
         Long.class, 1, 1, false));
     dbAccessor.addColumn("viewinstance", new DBColumnInfo("xml_driven",
@@ -223,9 +225,6 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
     dbAccessor.addColumn("host_role_command", new DBColumnInfo("error_log",
         String.class, 255, null, true));
 
-    dbAccessor.addColumn("viewmain", new DBColumnInfo("description",
-        String.class, 255, null, true));
-
     addAlertingFrameworkDDL();
 
     // Exclusive requests changes
@@ -288,6 +287,19 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
       }
     }
 
+    // alter view tables description columns size
+    if (dbType.equals(Configuration.ORACLE_DB_NAME) ||
+        dbType.equals(Configuration.MYSQL_DB_NAME)) {
+      dbAccessor.executeQuery("ALTER TABLE viewinstance MODIFY description VARCHAR(2048)");
+      dbAccessor.executeQuery("ALTER TABLE viewparameter MODIFY description VARCHAR(2048)");
+    } else if (Configuration.POSTGRES_DB_NAME.equals(dbType)) {
+      dbAccessor.executeQuery("ALTER TABLE viewinstance ALTER COLUMN description TYPE VARCHAR(2048)");
+      dbAccessor.executeQuery("ALTER TABLE viewparameter ALTER COLUMN description TYPE VARCHAR(2048)");
+    } else if (dbType.equals(Configuration.DERBY_DB_NAME)) {
+      dbAccessor.executeQuery("ALTER TABLE viewinstance ALTER COLUMN description SET DATA TYPE VARCHAR(2048)");
+      dbAccessor.executeQuery("ALTER TABLE viewparameter ALTER COLUMN description SET DATA TYPE VARCHAR(2048)");
+    }
+
     //upgrade unit test workaround
     if (Configuration.DERBY_DB_NAME.equals(dbType)) {
       dbAccessor.executeQuery("ALTER TABLE clusterconfig ALTER COLUMN config_id DEFAULT 0");

http://git-wip-us.apache.org/repos/asf/ambari/blob/c46d4916/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index fee90c9..a259870 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -65,11 +65,11 @@ CREATE TABLE hostgroup (blueprint_name VARCHAR(255) NOT NULL, name VARCHAR(255)
 CREATE TABLE hostgroup_component (blueprint_name VARCHAR(255) NOT NULL, hostgroup_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(blueprint_name, hostgroup_name, name));
 CREATE TABLE blueprint_configuration (blueprint_name VARCHAR(255) NOT NULL, type_name VARCHAR(255) NOT NULL, config_data VARCHAR(32000) NOT NULL, config_attributes VARCHAR(32000), PRIMARY KEY(blueprint_name, type_name));
 CREATE TABLE hostgroup_configuration (blueprint_name VARCHAR(255) NOT NULL, hostgroup_name VARCHAR(255) NOT NULL, type_name VARCHAR(255) NOT NULL, config_data TEXT NOT NULL, config_attributes TEXT, PRIMARY KEY(blueprint_name, hostgroup_name, type_name));
-CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
+CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(2048), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
 CREATE TABLE viewinstancedata (view_instance_id BIGINT, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, user_name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(VIEW_INSTANCE_ID, NAME, USER_NAME));
-CREATE TABLE viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
+CREATE TABLE viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(2048), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
 CREATE TABLE viewinstanceproperty (view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_name, view_instance_name, name));
-CREATE TABLE viewparameter (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255), required CHAR(1), masked CHAR(1), PRIMARY KEY(view_name, name));
+CREATE TABLE viewparameter (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(2048), required CHAR(1), masked CHAR(1), PRIMARY KEY(view_name, name));
 CREATE TABLE viewresource (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, plural_name VARCHAR(255), id_property VARCHAR(255), subResource_names VARCHAR(255), provider VARCHAR(255), service VARCHAR(255), resource VARCHAR(255), PRIMARY KEY(view_name, name));
 CREATE TABLE viewentity (id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, class_name VARCHAR(255) NOT NULL, id_property VARCHAR(255), PRIMARY KEY(id));
 CREATE TABLE adminresourcetype (resource_type_id INTEGER NOT NULL, resource_type_name VARCHAR(255) NOT NULL, PRIMARY KEY(resource_type_id));

http://git-wip-us.apache.org/repos/asf/ambari/blob/c46d4916/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index f68a718..a3b70e5 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -56,11 +56,11 @@ CREATE TABLE hostgroup (blueprint_name VARCHAR2(255) NOT NULL, name VARCHAR2(255
 CREATE TABLE hostgroup_component (blueprint_name VARCHAR2(255) NOT NULL, hostgroup_name VARCHAR2(255) NOT NULL, name VARCHAR2(255) NOT NULL, PRIMARY KEY(blueprint_name, hostgroup_name, name));
 CREATE TABLE blueprint_configuration (blueprint_name VARCHAR2(255) NOT NULL, type_name VARCHAR2(255) NOT NULL, config_data CLOB NOT NULL, config_attributes CLOB, PRIMARY KEY(blueprint_name, type_name));
 CREATE TABLE hostgroup_configuration (blueprint_name VARCHAR2(255) NOT NULL, hostgroup_name VARCHAR2(255) NOT NULL, type_name VARCHAR2(255) NOT NULL, config_data CLOB NOT NULL, config_attributes CLOB, PRIMARY KEY(blueprint_name, hostgroup_name, type_name));
-CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id NUMBER(10) NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view NUMBER(1) DEFAULT 0 NOT NULL, PRIMARY KEY(view_name));
+CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(2048), version VARCHAR(255), resource_type_id NUMBER(10) NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view NUMBER(1) DEFAULT 0 NOT NULL, PRIMARY KEY(view_name));
 CREATE TABLE viewinstancedata (view_instance_id NUMBER(19), view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, user_name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_instance_id, name, user_name));
-CREATE TABLE viewinstance (view_instance_id NUMBER(19), resource_id NUMBER(19) NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
+CREATE TABLE viewinstance (view_instance_id NUMBER(19), resource_id NUMBER(19) NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(2048), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
 CREATE TABLE viewinstanceproperty (view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_name, view_instance_name, name));
-CREATE TABLE viewparameter (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255), required CHAR(1), masked CHAR(1), PRIMARY KEY(view_name, name));
+CREATE TABLE viewparameter (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(2048), required CHAR(1), masked CHAR(1), PRIMARY KEY(view_name, name));
 CREATE TABLE viewresource (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, plural_name VARCHAR(255), id_property VARCHAR(255), subResource_names VARCHAR(255), provider VARCHAR(255), service VARCHAR(255), "resource" VARCHAR(255), PRIMARY KEY(view_name, name));
 CREATE TABLE viewentity (id NUMBER(19) NOT NULL, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, class_name VARCHAR(255) NOT NULL, id_property VARCHAR(255), PRIMARY KEY(id));
 CREATE TABLE adminresourcetype (resource_type_id NUMBER(10) NOT NULL, resource_type_name VARCHAR(255) NOT NULL, PRIMARY KEY(resource_type_id));

http://git-wip-us.apache.org/repos/asf/ambari/blob/c46d4916/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 1a2a63e..8e14c83 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -91,11 +91,11 @@ CREATE TABLE hostgroup_component (blueprint_name VARCHAR(255) NOT NULL, hostgrou
 CREATE TABLE blueprint_configuration (blueprint_name varchar(255) NOT NULL, type_name varchar(255) NOT NULL, config_data varchar(32000) NOT NULL , config_attributes varchar(32000), PRIMARY KEY(blueprint_name, type_name));
 CREATE TABLE hostgroup_configuration (blueprint_name VARCHAR(255) NOT NULL, hostgroup_name VARCHAR(255) NOT NULL, type_name VARCHAR(255) NOT NULL, config_data TEXT NOT NULL, config_attributes varchar(32000), PRIMARY KEY(blueprint_name, hostgroup_name, type_name));
 
-CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
+CREATE TABLE viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(2048), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
 CREATE TABLE viewinstancedata (view_instance_id BIGINT, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, user_name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_instance_id, name, user_name));
-CREATE TABLE viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
+CREATE TABLE viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(2048), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
 CREATE TABLE viewinstanceproperty (view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_name, view_instance_name, name));
-CREATE TABLE viewparameter (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255), required CHAR(1), masked CHAR(1), PRIMARY KEY(view_name, name));
+CREATE TABLE viewparameter (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(2048), required CHAR(1), masked CHAR(1), PRIMARY KEY(view_name, name));
 CREATE TABLE viewresource (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, plural_name VARCHAR(255), id_property VARCHAR(255), subResource_names VARCHAR(255), provider VARCHAR(255), service VARCHAR(255), resource VARCHAR(255), PRIMARY KEY(view_name, name));
 CREATE TABLE viewentity (id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, class_name VARCHAR(255) NOT NULL, id_property VARCHAR(255), PRIMARY KEY(id));
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c46d4916/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
index f284580..c8be992 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
@@ -141,11 +141,11 @@ GRANT ALL PRIVILEGES ON TABLE ambari.hostgroup_component TO :username;
 GRANT ALL PRIVILEGES ON TABLE ambari.blueprint_configuration TO :username;
 GRANT ALL PRIVILEGES ON TABLE ambari.hostgroup_configuration TO :username;
 
-CREATE TABLE ambari.viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
+CREATE TABLE ambari.viewmain (view_name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(2048), version VARCHAR(255), resource_type_id INTEGER NOT NULL, icon VARCHAR(255), icon64 VARCHAR(255), archive VARCHAR(255), mask VARCHAR(255), system_view SMALLINT NOT NULL DEFAULT 0, PRIMARY KEY(view_name));
 CREATE TABLE ambari.viewinstancedata (view_instance_id BIGINT, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, user_name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_instance_id, name, user_name));
-CREATE TABLE ambari.viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(255), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
+CREATE TABLE ambari.viewinstance (view_instance_id BIGINT, resource_id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, label VARCHAR(255), description VARCHAR(2048), visible CHAR(1), icon VARCHAR(255), icon64 VARCHAR(255), xml_driven CHAR(1), PRIMARY KEY(view_instance_id));
 CREATE TABLE ambari.viewinstanceproperty (view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value VARCHAR(2000) NOT NULL, PRIMARY KEY(view_name, view_instance_name, name));
-CREATE TABLE ambari.viewparameter (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255), required CHAR(1), masked CHAR(1), PRIMARY KEY(view_name, name));
+CREATE TABLE ambari.viewparameter (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(2048), required CHAR(1), masked CHAR(1), PRIMARY KEY(view_name, name));
 CREATE TABLE ambari.viewresource (view_name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, plural_name VARCHAR(255), id_property VARCHAR(255), subResource_names VARCHAR(255), provider VARCHAR(255), service VARCHAR(255), resource VARCHAR(255), PRIMARY KEY(view_name, name));
 CREATE TABLE ambari.viewentity (id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, class_name VARCHAR(255) NOT NULL, id_property VARCHAR(255), PRIMARY KEY(id));
 GRANT ALL PRIVILEGES ON TABLE ambari.viewmain TO :username;


[06/34] git commit: AMBARI-7365. Resource Manager HA wizard appears after closing and page refresh. (akovalenko)

Posted by jo...@apache.org.
AMBARI-7365. Resource Manager HA wizard appears after closing and page refresh. (akovalenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: 892f423c8266ddaf205cc74d8996dd2a378928d2
Parents: c09edb7
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Wed Sep 17 18:12:03 2014 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Wed Sep 17 18:13:47 2014 +0300

----------------------------------------------------------------------
 .../resourceManager/wizard_controller.js                |  1 -
 ambari-web/app/routes/rm_high_availability_routes.js    | 12 ++++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/892f423c/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js
index 697bd13..c5a3e9e 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/wizard_controller.js
@@ -44,7 +44,6 @@ App.RMHighAvailabilityWizardController = App.WizardController.extend({
     this._super(currentStep, completed);
     App.clusterStatus.setClusterStatus({
       clusterName: this.get('content.cluster.name'),
-      clusterState: 'RM_HIGH_AVAILABILITY_DEPLOY',
       wizardControllerName: 'rMHighAvailabilityWizardController',
       localdb: App.db.data
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/892f423c/ambari-web/app/routes/rm_high_availability_routes.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/rm_high_availability_routes.js b/ambari-web/app/routes/rm_high_availability_routes.js
index a7a83dd..1739a4f 100644
--- a/ambari-web/app/routes/rm_high_availability_routes.js
+++ b/ambari-web/app/routes/rm_high_availability_routes.js
@@ -22,8 +22,12 @@ module.exports = App.WizardRoute.extend({
   route: '/highAvailability/ResourceManager/enable',
 
   enter: function (router,transition) {
+    var rMHighAvailabilityWizardController = router.get('rMHighAvailabilityWizardController');
+    rMHighAvailabilityWizardController.dataLoading().done(function () {
+      //Set YARN as current service
+      App.router.set('mainServiceItemController.content', App.Service.find().findProperty('serviceName', 'YARN'));
+    });
     Em.run.next(function () {
-      var rMHighAvailabilityWizardController = router.get('rMHighAvailabilityWizardController');
       App.router.get('updateController').set('isWorking', false);
       var popup = App.ModalPopup.show({
         classNames: ['full-width-modal'],
@@ -50,7 +54,7 @@ module.exports = App.WizardRoute.extend({
                 localdb: App.db.data
               }, {alwaysCallback: function () {
                 self.hide();
-                router.route('/main/services/YARN/summary');
+                router.transitionTo('main.services.index');
                 location.reload();
               }});
             }, Em.I18n.t('admin.rm_highAvailability.closePopup'));
@@ -58,7 +62,7 @@ module.exports = App.WizardRoute.extend({
             this.hide();
             rMHighAvailabilityWizardController.setCurrentStep('1');
             router.get('updateController').set('isWorking', true);
-            router.route('/main/services/YARN/summary');
+            router.transitionTo('main.services.index');
           }
         },
         didInsertElement: function () {
@@ -181,7 +185,7 @@ module.exports = App.WizardRoute.extend({
         localdb: App.db.data
       }, {alwaysCallback: function () {
         controller.get('popup').hide();
-        router.route('/main/services/YARN/summary');
+        router.transitionTo('main.services.index');
         location.reload();
       }});
     }


[19/34] git commit: AMBARI-7376. Admin View: need to show "deploying" when view is still extracting. (yusaku)

Posted by jo...@apache.org.
AMBARI-7376. Admin View: need to show "deploying" when view is still extracting. (yusaku)


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

Branch: refs/heads/branch-alerts-dev
Commit: 0cec52d5f0bd9ce83af62f7050d7ec1d8a7bd74e
Parents: 856ac44
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Sep 17 16:40:52 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Sep 17 16:40:52 2014 -0700

----------------------------------------------------------------------
 .../ui/admin-web/app/scripts/services/View.js   | 16 ++--
 .../resources/ui/admin-web/app/styles/main.css  | 87 ++++++++++++++++++++
 .../app/views/ambariViews/listTable.html        | 19 ++++-
 3 files changed, 111 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0cec52d5/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
index 8f3b376..960ac87 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/View.js
@@ -55,9 +55,13 @@ angular.module('ambariAdminConsole')
     self.view_name = item.ViewInfo.view_name;
     self.versions = '';
     self.instances = [];
+    self.canCreateInstance = false;
     var versions = {};
     angular.forEach(item.versions, function(version) {
-      versions[version.ViewVersionInfo.version] = version.instances.length;
+      versions[version.ViewVersionInfo.version] = {count: version.instances.length, status: version.ViewVersionInfo.status};
+      if(version.ViewVersionInfo.status === 'DEPLOYED'){ // if atelast one version is deployed
+        self.canCreateInstance = true;
+      }
       
       angular.forEach(version.instances, function(instance) {
         instance.label = instance.ViewInstanceInfo.label || version.ViewVersionInfo.label || instance.ViewInstanceInfo.view_name;
@@ -65,14 +69,8 @@ angular.module('ambariAdminConsole')
 
       self.instances = self.instances.concat(version.instances);
     });
+    self.versions = versions;
 
-    for(var ver in versions){
-      if(versions.hasOwnProperty(ver)){
-        self.versions += (self.versions ? ', ' : '') + ver +' ('+versions[ver]+')';
-      }
-    }
-
-    // self.isOpened = !self.instances.length;
     self.versionsList = item.versions;
   }
 
@@ -145,7 +143,7 @@ angular.module('ambariAdminConsole')
 
     $http({
       method: 'GET',
-      url: Settings.baseUrl + '/views/'+viewName
+      url: Settings.baseUrl + '/views/'+viewName + '?versions/ViewVersionInfo/status=DEPLOYED'
     }).success(function(data) {
       var versions = [];
       angular.forEach(data.versions, function(version) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0cec52d5/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index 9b41f63..d6237db 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -1011,3 +1011,90 @@ button.btn.btn-xs{
   -o-transition: none!important;
   transition: none!important;
 }
+
+
+.viewstatus{
+  display: inline-block;
+}
+.viewstatus.pending{
+  width: 12px;
+  height: 12px;
+  border: 2px solid black;
+  border-radius: 50%;
+  vertical-align: middle;
+  position: relative;
+  border-radius: 50%;
+}
+
+.viewstatus.pending:before, .viewstatus.pending:after{
+  content: '';
+  position: absolute;
+  left: 4px;
+  top: 3px;
+  width: 5px;
+  height: 2px;
+  background: black;
+}
+.viewstatus.pending:after{
+  top: -3px;
+  left: 3px;
+  width: 2px;
+  height: 2px;
+  border-radius: 100%;
+}
+.viewstatus.pending:before{
+  -webkit-transform-origin: 0% 50%;
+  -moz-transform-origin: 0% 50%;
+  -ms-transform-origin: 0% 50%;
+  -o-transform-origin: 0% 50%;
+  transform-origin: 0% 50%;
+
+  animation: rotate 2.0s infinite linear;
+  -webkit-animation: rotate 2.0s infinite linear;
+}
+
+@-webkit-keyframes rotate { 100% { -webkit-transform: rotate(360deg) }}
+@keyframes rotate { 100% { transform: rotate(360deg); -webkit-transform: rotate(360deg) }}
+
+
+.viewstatus.deploying{
+  width: 17px;
+  height: 12px;
+  text-align: center;
+  vertical-align: middle;
+}
+.viewstatus.deploying > div{
+  background: black;
+  height: 100%;
+  width: 3px;
+  display: inline-block;
+  -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
+  animation: stretchdelay 1.2s infinite ease-in-out;
+}
+.viewstatus.deploying .rect2 {
+  -webkit-animation-delay: -1.1s;
+  animation-delay: -1.1s;
+}
+.viewstatus.deploying .rect3 {
+  -webkit-animation-delay: -1.0s;
+  animation-delay: -1.0s;
+}
+
+@-webkit-keyframes stretchdelay {
+  0%, 40%, 100% { -webkit-transform: scaleY(0.4) }  
+  20% { -webkit-transform: scaleY(1.0) }
+}
+
+@keyframes stretchdelay {
+  0%, 40%, 100% { 
+    transform: scaleY(0.4);
+    -webkit-transform: scaleY(0.4);
+  }  20% { 
+    transform: scaleY(1.0);
+    -webkit-transform: scaleY(1.0);
+  }
+}
+
+accordion .panel-group .panel{
+  overflow: visible;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/0cec52d5/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
index e27c5e5..d2ab32a 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
@@ -45,7 +45,22 @@
             <i class="glyphicon glyphicon-chevron-right" ng-class="{'opened': view.isOpened}"></i>
             {{view.view_name}}
           </div>
-          <div class="col-sm-3">{{view.versions}}</div>
+          <div class="col-sm-3">
+            <span ng-repeat="(version, vData) in view.versions">
+              {{version}}
+                <span ng-switch="vData.status">
+                  <span ng-switch-when="PENDING" class="viewstatus pending" ng-switch-when="true" tooltip="Pending..."></span>
+                  <div class="viewstatus deploying" ng-switch-when="DEPLOYING" tooltip="Deploying...">
+                    <div class="rect1"></div>
+                    <div class="rect2"></div>
+                    <div class="rect3"></div>
+                  </div>
+                  <span ng-switch-when="DEPLOYED">({{vData.count}})</span>
+                  <span ng-switch-when="ERROR" tooltip="Error deploying. Check Ambari Server log."><i class="fa fa-exclamation-triangle"></i></span>
+                </span>
+              {{$last ? '' : ', '}}
+            </span>
+          </div>
           <div class="col-sm-6">{{view.description}}</div>
         </div>
       </accordion-heading>
@@ -65,7 +80,7 @@
           <tr>
             <td class="col-sm-3"></td>
             <td class="col-sm-3">
-              <a class="btn btn-default createisntance-btn" href="#/views/{{view.view_name}}/versions/{{view.versionsList[view.versionsList.length-1].ViewVersionInfo.version}}/new"><span class="glyphicon glyphicon-plus" ></span> Create Instance</a>
+              <a class="btn btn-default createisntance-btn {{view.canCreateInstance ? '' : 'disabled'}}" href="#/views/{{view.view_name}}/versions/{{view.versionsList[view.versionsList.length-1].ViewVersionInfo.version}}/new"><span class="glyphicon glyphicon-plus" ></span> Create Instance</a>
             </td>
             <td class="col-sm-3"></td>
             <td class="col-sm-3">


[10/34] git commit: AMBARI-7333. Tez deployment changes for Champlain (aonishuk)

Posted by jo...@apache.org.
AMBARI-7333. Tez deployment changes for Champlain (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 117b4558c347a80ac4d26db295f12c37237a3b8b
Parents: 0449d22
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Sep 17 18:55:23 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Sep 17 18:55:23 2014 +0300

----------------------------------------------------------------------
 .../src/test/python/resource_management/TestCopyFromLocal.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/117b4558/ambari-agent/src/test/python/resource_management/TestCopyFromLocal.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestCopyFromLocal.py b/ambari-agent/src/test/python/resource_management/TestCopyFromLocal.py
index 90397ae..6862db3 100644
--- a/ambari-agent/src/test/python/resource_management/TestCopyFromLocal.py
+++ b/ambari-agent/src/test/python/resource_management/TestCopyFromLocal.py
@@ -36,9 +36,9 @@ class TestCopyFromLocal(TestCase):
       call_arg_list = execute_hadoop_mock.call_args_list
       self.assertEqual('fs -copyFromLocal /user/testdir/*.files /apps/test/',
                        call_arg_list[0][0][0].command)
-      self.assertEquals({'not_if': "su - user1 -c ' hadoop fs -ls /apps/test/*.files' >/dev/null 2>&1", 'user': 'user1', 'conf_dir': '/etc/hadoop/conf'},
+      self.assertEquals({'not_if': "su - user1 -c ' hadoop fs -ls /apps/test//*.files' >/dev/null 2>&1", 'user': 'user1', 'conf_dir': '/etc/hadoop/conf'},
                         call_arg_list[0][0][0].arguments)
-      self.assertEquals('fs -chown user1 /apps/test/*.files', call_arg_list[1][0][0].command)
+      self.assertEquals('fs -chown user1 /apps/test//*.files', call_arg_list[1][0][0].command)
       self.assertEquals({'user': 'hdfs', 'conf_dir': '/etc/hadoop/conf'}, call_arg_list[1][0][0].arguments)
 
 
@@ -57,9 +57,9 @@ class TestCopyFromLocal(TestCase):
       call_arg_list = execute_hadoop_mock.call_args_list
       self.assertEqual('fs -copyFromLocal /user/testdir/*.files /apps/test/',
                        call_arg_list[0][0][0].command)
-      self.assertEquals({'not_if': "su - user1 -c ' hadoop fs -ls /apps/test/*.files' >/dev/null 2>&1", 'user': 'user1', 'conf_dir': '/etc/hadoop/conf'},
+      self.assertEquals({'not_if': "su - user1 -c ' hadoop fs -ls /apps/test//*.files' >/dev/null 2>&1", 'user': 'user1', 'conf_dir': '/etc/hadoop/conf'},
                         call_arg_list[0][0][0].arguments)
-      self.assertEquals('fs -chown user1:hdfs /apps/test/*.files', call_arg_list[1][0][0].command)
+      self.assertEquals('fs -chown user1:hdfs /apps/test//*.files', call_arg_list[1][0][0].command)
       self.assertEquals({'user': 'hdfs', 'conf_dir': '/etc/hadoop/conf'}, call_arg_list[1][0][0].arguments)
 
 


[32/34] git commit: AMBARI-7379. Add ability for Ganglia to create arbitrary clusters for metrics collection

Posted by jo...@apache.org.
AMBARI-7379. Add ability for Ganglia to create arbitrary clusters for metrics collection


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

Branch: refs/heads/branch-alerts-dev
Commit: bf0f4a9e41ff58883f43cf6297e161c8bc6539c9
Parents: 4c69d63
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Sep 17 20:09:34 2014 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Thu Sep 18 07:19:15 2014 -0700

----------------------------------------------------------------------
 .../GANGLIA/configuration/ganglia-env.xml       |  5 ++++
 .../GANGLIA/package/scripts/ganglia_monitor.py  |  4 ++--
 .../services/GANGLIA/package/scripts/params.py  | 24 ++++++++++++--------
 .../stacks/HDP/2.2/role_command_order.json      |  1 +
 4 files changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bf0f4a9e/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/configuration/ganglia-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/configuration/ganglia-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/configuration/ganglia-env.xml
index e42baa5..3328acf 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/configuration/ganglia-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/configuration/ganglia-env.xml
@@ -68,5 +68,10 @@
     <value>4</value>
     <description>(-t) Specifies the number of threads used for writing RRD files. The default is 4. Increasing this number will allow rrdcached to have more simultaneous I/O requests into the kernel. This may allow the kernel to re-order disk writes, resulting in better disk throughput.</description>
   </property>
+  <property>
+    <name>additional_clusters</name>
+    <value> </value>
+    <description>Add additional desired Ganglia metrics cluster in the form "name1:port1,name2:port2". Ensure that the names and ports are unique across all cluster and ports are available on ganglia server host. Ambari has reserved ports 8667-8669 within its own pool.</description>
+  </property>
 
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/bf0f4a9e/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
index 96cfdda..ede1a0b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
@@ -110,12 +110,12 @@ class GangliaMonitor(Script):
 
     for gmond_app in params.gmond_apps:
       generate_daemon("gmond",
-                      name=gmond_app,
+                      name=gmond_app[0],
                       role="server",
                       owner="root",
                       group=params.user_group)
       generate_daemon("gmond",
-                      name = gmond_app,
+                      name = gmond_app[0],
                       role = "monitor",
                       owner = "root",
                       group = params.user_group)

http://git-wip-us.apache.org/repos/asf/ambari/blob/bf0f4a9e/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
index e155122..bf36b93 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/params.py
@@ -31,11 +31,15 @@ ganglia_shell_cmds_dir = "/usr/libexec/hdp/ganglia"
 gmetad_user = config['configurations']['ganglia-env']["gmetad_user"]
 gmond_user = config['configurations']['ganglia-env']["gmond_user"]
 
-gmond_app_str = default("/configurations/hadoop-env/enabled_app_servers", None)
-gmond_apps = [] if gmond_app_str is None else gmond_app_str.split(',')
-gmond_apps = [x.strip() for x in gmond_apps]
-gmond_allowed_apps = ["Application1", "Application2", "Application3"]
-gmond_apps = set(gmond_apps) & set(gmond_allowed_apps)
+gmond_add_clusters_str = default("/configurations/ganglia-env/additional_clusters", None)
+if gmond_add_clusters_str and gmond_add_clusters_str.isspace():
+  gmond_add_clusters_str = None
+
+gmond_app_strs = [] if gmond_add_clusters_str is None else gmond_add_clusters_str.split(',')
+gmond_apps = []
+for x in gmond_app_strs:
+  a,b = x.strip().split(':')
+  gmond_apps.append((a.strip(),b.strip()))
 
 if System.get_instance().os_family == "ubuntu":
   gmond_service_name = "ganglia-monitor"
@@ -116,9 +120,9 @@ ganglia_cluster_names = {
   "hs_host": [("HDPHistoryServer", 8666)],
   "nimbus_hosts": [("HDPNimbus", 8649)],
   "supervisor_hosts": [("HDPSupervisor", 8650)],
-  "Application1": [("Application1", 8667)],
-  "Application2": [("Application2", 8668)],
-  "Application3": [("Application3", 8669)]
+  "ReservedPort1": [("ReservedPort1", 8667)],
+  "ReservedPort2": [("ReservedPort2", 8668)],
+  "ReservedPort3": [("ReservedPort3", 8669)]
 }
 
 ganglia_clusters = []
@@ -129,10 +133,10 @@ for key in ganglia_cluster_names:
   if not len(hosts) == 0:
     for x in ganglia_cluster_names[key]:
       ganglia_clusters.append(x)
+
 if len(gmond_apps) > 0:
   for gmond_app in gmond_apps:
-    for x in ganglia_cluster_names[gmond_app]:
-      ganglia_clusters.append(x)
+    ganglia_clusters.append(gmond_app)
 
 ganglia_apache_config_file = "/etc/apache2/conf.d/ganglia.conf"
 ganglia_web_path="/var/www/html/ganglia"

http://git-wip-us.apache.org/repos/asf/ambari/blob/bf0f4a9e/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
index 4144361..f8eb4c7 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
@@ -39,6 +39,7 @@
         "DRPC_SERVER-START"],
     "FLUME_SERVICE_CHECK-SERVICE_CHECK": ["FLUME_HANDLER-START"],
     "FALCON_SERVICE_CHECK-SERVICE_CHECK": ["FALCON_SERVER-START"],
+    "SLIDER_SERVICE_CHECK-SERVICE_CHECK" : ["NODEMANAGER-START", "RESOURCEMANAGER-START"],
     "ZOOKEEPER_SERVER-STOP" : ["HBASE_MASTER-STOP", "HBASE_REGIONSERVER-STOP"],
     "HBASE_MASTER-STOP": ["HBASE_REGIONSERVER-STOP"],
     "NIMBUS-STOP" : ["SUPERVISOR-STOP", "STORM_UI_SERVER-STOP", "DRPC_SERVER-STOP"]


[30/34] git commit: AMBARI-7387. on 2.2.* Stack hive service check fails, because webhcat is not yet started (aonishuk)

Posted by jo...@apache.org.
AMBARI-7387. on 2.2.* Stack hive service check fails, because webhcat is not yet started (aonishuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 8b682da4b80ea7ae1ca1913c979e4f3983ded807
Parents: fd0b582
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Sep 18 16:46:25 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Sep 18 16:46:25 2014 +0300

----------------------------------------------------------------------
 .../src/main/resources/stacks/HDP/2.2.1/role_command_order.json    | 2 +-
 .../src/main/resources/stacks/HDP/2.2/role_command_order.json      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8b682da4/ambari-server/src/main/resources/stacks/HDP/2.2.1/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2.1/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.2.1/role_command_order.json
index b97a31a..06eb527 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2.1/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2.1/role_command_order.json
@@ -28,7 +28,7 @@
     "OOZIE_SERVICE_CHECK-SERVICE_CHECK": ["OOZIE_SERVER-START"],
     "WEBHCAT_SERVICE_CHECK-SERVICE_CHECK": ["WEBHCAT_SERVER-START"],
     "HBASE_SERVICE_CHECK-SERVICE_CHECK": ["HBASE_MASTER-START", "HBASE_REGIONSERVER-START"],
-    "HIVE_SERVICE_CHECK-SERVICE_CHECK": ["HIVE_SERVER-START", "HIVE_METASTORE-START"],
+    "HIVE_SERVICE_CHECK-SERVICE_CHECK": ["HIVE_SERVER-START", "HIVE_METASTORE-START", "WEBHCAT_SERVER-START"],
     "HCAT_SERVICE_CHECK-SERVICE_CHECK": ["HIVE_SERVER-START"],
     "PIG_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START", "RESOURCEMANAGER-START"],
     "SQOOP_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START", "RESOURCEMANAGER-START"],

http://git-wip-us.apache.org/repos/asf/ambari/blob/8b682da4/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
index a6f3e07..4144361 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/role_command_order.json
@@ -29,7 +29,7 @@
     "OOZIE_SERVICE_CHECK-SERVICE_CHECK": ["OOZIE_SERVER-START"],
     "WEBHCAT_SERVICE_CHECK-SERVICE_CHECK": ["WEBHCAT_SERVER-START"],
     "HBASE_SERVICE_CHECK-SERVICE_CHECK": ["HBASE_MASTER-START", "HBASE_REGIONSERVER-START"],
-    "HIVE_SERVICE_CHECK-SERVICE_CHECK": ["HIVE_SERVER-START", "HIVE_METASTORE-START"],
+    "HIVE_SERVICE_CHECK-SERVICE_CHECK": ["HIVE_SERVER-START", "HIVE_METASTORE-START", "WEBHCAT_SERVER-START"],
     "HCAT_SERVICE_CHECK-SERVICE_CHECK": ["HIVE_SERVER-START"],
     "PIG_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START", "RESOURCEMANAGER-START"],
     "SQOOP_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START", "RESOURCEMANAGER-START"],


[31/34] git commit: AMBARI-7388 Configs: no hover on SCV when viewing non-current version. (ababiichuk)

Posted by jo...@apache.org.
AMBARI-7388 Configs: no hover on SCV when viewing non-current version. (ababiichuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 4c69d631e9c90805405b17da97c787725325bdef
Parents: 8b682da
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Sep 18 17:09:17 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Sep 18 17:09:17 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/styles/application.less          |  2 +-
 .../common/configs/config_history_flow.hbs      | 36 +------------
 .../common/configs/service_version_box.hbs      | 53 ++++++++++++++++++++
 .../views/common/configs/config_history_flow.js | 22 ++++++++
 4 files changed, 77 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4c69d631/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 235dbc1..0420804 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -4996,7 +4996,7 @@ ul.inline li {
     margin: 5px 0;
     .flow-element {
       width: 18.5%;
-      height: 100%;
+      height: 58px;
       .version-box {
         position: relative;
         height: 90%;

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c69d631/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index efc452f..6904615 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -22,41 +22,7 @@
     <div {{bindAttr class=":icon-chevron-box :pull-left view.showLeftArrow::hide"}} {{action shiftBack target="view"}} data-toggle="arrow-tooltip"
       {{translateAttr data-original-title="services.service.config.configHistory.leftArrow.tooltip"}}><i class="icon-chevron-left icon-3x"></i></div>
     {{#each serviceVersion in view.visibleServiceVersion}}
-      <div {{bindAttr class=":flow-element :pull-left serviceVersion.first:first"}}>
-        <div class="arrow-box pull-left"><i class="icon-arrow-right icon-3x"></i></div>
-        <div class="version-box">
-          <div {{bindAttr class=":version-info :box :pull-right serviceVersion.isDisplayed:displayed serviceVersion.isDisabled:grayedOut"}} {{action switchVersion serviceVersion target="view"}}>
-            <div class="top-label">
-              <span class="label label-info">{{serviceVersion.versionText}}</span>
-              <span class="author pull-right">{{serviceVersion.author}}</span>
-            </div>
-            <div class="content">{{serviceVersion.timeSinceCreated}}</div>
-            {{#if serviceVersion.isCurrent}}
-              <div class="current-label">
-                <span class="label label-success">
-                  {{t common.current}}
-                  <i {{bindAttr class=":icon-refresh :restart-required-service serviceVersion.isRestartRequired::hidden"}}></i>
-                </span>
-              </div>
-            {{/if}}
-          </div>
-
-          <div class="version-popover">
-            <div class="content"> <strong>{{serviceVersion.displayName}}</strong> <span class="label label-info">{{serviceVersion.versionText}}</span> &nbsp;
-              <strong>{{t services.service.config.configHistory.configGroup}}:{{serviceVersion.configGroupName}}</strong>
-              <div class="date">{{serviceVersion.createdDate}}</div>
-              <div class="notes">{{serviceVersion.notes}}</div>
-            </div>
-            <div class="version-operations-buttons">
-                <button {{bindAttr disabled="serviceVersion.disabledActionAttr.view" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.view"}} {{action switchVersion serviceVersion target="view"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
-                {{#if App.isManager}}
-                    <button {{bindAttr disabled="serviceVersion.disabledActionAttr.compare" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.compare"}} {{action compare serviceVersion target="view"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
-                    <button {{bindAttr disabled="serviceVersion.disabledActionAttr.revert" class=":btn serviceVersion.isCurrent:not-allowed-cursor" title="serviceVersion.disabledActionMessages.revert"}} {{action revert serviceVersion target="view"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
-                {{/if}}
-            </div>
-          </div>
-        </div>
-      </div>
+      {{view view.serviceVersionBox serviceVersionBinding=serviceVersion}}
     {{/each}}
     <div {{bindAttr class=":icon-chevron-box :pull-right view.showRightArrow::hide"}} {{action shiftForward target="view"}} data-toggle="arrow-tooltip"
       {{translateAttr data-original-title="services.service.config.configHistory.rightArrow.tooltip"}}><i class="icon-chevron-right icon-3x"></i></div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c69d631/ambari-web/app/templates/common/configs/service_version_box.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_version_box.hbs b/ambari-web/app/templates/common/configs/service_version_box.hbs
new file mode 100644
index 0000000..debda80
--- /dev/null
+++ b/ambari-web/app/templates/common/configs/service_version_box.hbs
@@ -0,0 +1,53 @@
+{{!
+* 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.
+}}
+
+<div {{bindAttr class=":flow-element :pull-left serviceVersion.first:first"}}>
+  <div class="arrow-box pull-left"><i class="icon-arrow-right icon-3x"></i></div>
+  <div class="version-box">
+    <div {{bindAttr class=":version-info :box :pull-right serviceVersion.isDisplayed:displayed serviceVersion.isDisabled:grayedOut"}} {{action switchVersion serviceVersion target="view.parentView"}}>
+      <div class="top-label">
+        <span class="label label-info">{{serviceVersion.versionText}}</span>
+        <span class="author pull-right">{{serviceVersion.author}}</span>
+      </div>
+      <div class="content">{{serviceVersion.timeSinceCreated}}</div>
+      {{#if serviceVersion.isCurrent}}
+        <div class="current-label">
+                <span class="label label-success">
+                  {{t common.current}}
+                  <i {{bindAttr class=":icon-refresh :restart-required-service serviceVersion.isRestartRequired::hidden"}}></i>
+                </span>
+        </div>
+      {{/if}}
+    </div>
+
+    <div class="version-popover">
+      <div class="content"> <strong>{{serviceVersion.displayName}}</strong> <span class="label label-info">{{serviceVersion.versionText}}</span> &nbsp;
+        <strong>{{t services.service.config.configHistory.configGroup}}:{{serviceVersion.configGroupName}}</strong>
+        <div class="date">{{serviceVersion.createdDate}}</div>
+        <div class="notes">{{serviceVersion.notes}}</div>
+      </div>
+      <div class="version-operations-buttons">
+        <button {{bindAttr disabled="serviceVersion.disabledActionAttr.view" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.view"}} {{action switchVersion serviceVersion target="view.parentView"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
+        {{#if App.isManager}}
+          <button {{bindAttr disabled="serviceVersion.disabledActionAttr.compare" class=":btn serviceVersion.isDisplayed:not-allowed-cursor" title="serviceVersion.disabledActionMessages.compare"}} {{action compare serviceVersion target="view.parentView"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
+          <button {{bindAttr disabled="serviceVersion.disabledActionAttr.revert" class=":btn serviceVersion.isCurrent:not-allowed-cursor" title="serviceVersion.disabledActionMessages.revert"}} {{action revert serviceVersion target="view.parentView"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
+        {{/if}}
+      </div>
+    </div>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4c69d631/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index a9c36f4..228df57 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -155,6 +155,28 @@ App.ConfigHistoryFlowView = Em.View.extend({
     });
   },
 
+  serviceVersionBox: Em.View.extend({
+    templateName: require('templates/common/configs/service_version_box'),
+    didInsertElement: function () {
+      $('.version-box').hoverIntent(function() {
+        var self = this;
+        setTimeout(function() {
+          if ($(self).is(':hover')) {
+            $(self).find('.version-popover').fadeIn(200);
+          }
+        }, 700);
+      }, function() {
+        $(this).find('.version-popover').hide();
+      });
+      App.tooltip(this.$('[data-toggle=tooltip]'),{
+        placement: 'bottom'
+      });
+      App.tooltip(this.$('[data-toggle=arrow-tooltip]'),{
+        placement: 'top'
+      });
+    }
+  }),
+
   willInsertElement: function () {
     var serviceVersions = this.get('serviceVersions');
     var startIndex = 0;


[02/34] git commit: AMBARI-7318. ClusterHostInfo host indexes should be hostnames in download client configs (dlysnichenko)

Posted by jo...@apache.org.
AMBARI-7318. ClusterHostInfo host indexes should be hostnames in download client configs (dlysnichenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: d6a4a68d0fbf0d076b201e4b4d635330dab530b8
Parents: ac290e2
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Wed Sep 17 16:54:31 2014 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Wed Sep 17 16:54:31 2014 +0300

----------------------------------------------------------------------
 .../internal/ClientConfigResourceProvider.java  | 35 ++++++++++++++++++--
 .../ClientConfigResourceProviderTest.java       | 24 ++++++++++----
 2 files changed, 49 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6a4a68d/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index 366b5e1..34f4d6f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -18,7 +18,6 @@
 package org.apache.ambari.server.controller.internal;
 
 import com.google.gson.Gson;
-import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
 import com.google.inject.assistedinject.AssistedInject;
 import com.google.inject.persist.Transactional;
@@ -213,6 +212,7 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
       clusterHostInfo = StageUtils.getClusterHostInfo(managementController.getClusters().getHostsForCluster(cluster.getClusterName()), cluster);
       serviceInfo = managementController.getAmbariMetaInfo().getServiceInfo(stackId.getStackName(),
               stackId.getStackVersion(), serviceName);
+      clusterHostInfo = substituteHostIndexes(clusterHostInfo);
       osFamily = clusters.getHost(hostName).getOsFamily();
 
       TreeMap<String, String> hostLevelParams = new TreeMap<String, String>();
@@ -248,11 +248,11 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
       }
       String packageList = gson.toJson(packages);
       hostLevelParams.put(PACKAGE_LIST, packageList);
-      
+
       Set<String> userSet = configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.USER, cluster);
       String userList = gson.toJson(userSet);
       hostLevelParams.put(USER_LIST, userList);
-      
+
       Set<String> groupSet = configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.GROUP, cluster);
       String groupList = gson.toJson(groupSet);
       hostLevelParams.put(GROUP_LIST, groupList);
@@ -324,6 +324,35 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
     return resources;
   }
 
+  private static Map<String, Set<String>> substituteHostIndexes(Map<String, Set<String>> clusterHostInfo) throws SystemException {
+    Set<String> keysToSkip = new HashSet<String>(Arrays.asList("all_hosts", "all_ping_ports",
+            "ambari_server_host"));
+    String[] allHosts = {};
+    if (clusterHostInfo.get("all_hosts") != null) {
+      allHosts = clusterHostInfo.get("all_hosts").toArray(new String[clusterHostInfo.get("all_hosts").size()]);
+    }
+    Set<String> keys = clusterHostInfo.keySet();
+    for (String key : keys) {
+      if (keysToSkip.contains(key)) {
+        continue;
+      }
+      Set<String> hosts = new HashSet<String>();
+      Set<String> currentHostsIndexes = clusterHostInfo.get(key);
+      if (currentHostsIndexes == null) {
+        continue;
+      }
+      for (String hostIndex : currentHostsIndexes) {
+        try {
+          hosts.add(allHosts[Integer.parseInt(hostIndex)]);
+        } catch (ArrayIndexOutOfBoundsException ex) {
+          throw new SystemException("Failed to fill cluster host info  ", ex);
+        }
+      }
+      clusterHostInfo.put(key, hosts);
+    }
+    return clusterHostInfo;
+  }
+
   @Override
   public RequestStatus updateResources(final Request request, Predicate predicate)
           throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6a4a68d/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
index 214bf10..916e0de 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
@@ -26,6 +26,7 @@ import org.apache.ambari.server.controller.utilities.PredicateBuilder;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.state.*;
 import org.apache.ambari.server.state.PropertyInfo;
+import org.apache.ambari.server.utils.StageUtils;
 import org.easymock.EasyMock;
 import org.junit.Assert;
 import org.junit.Test;
@@ -36,6 +37,7 @@ import org.powermock.modules.junit4.PowerMockRunner;
 
 import java.io.File;
 import java.io.PrintWriter;
+import java.lang.reflect.Method;
 import java.util.*;
 
 import static org.easymock.EasyMock.*;
@@ -44,7 +46,7 @@ import static org.easymock.EasyMock.*;
  * TaskResourceProvider tests.
  */
 @RunWith(PowerMockRunner.class)
-@PrepareForTest( {ClientConfigResourceProvider.class} )
+@PrepareForTest( {ClientConfigResourceProvider.class, StageUtils.class} )
 public class ClientConfigResourceProviderTest {
   @Test
   public void testCreateResources() throws Exception {
@@ -218,17 +220,29 @@ public class ClientConfigResourceProviderTest {
     expect(clusterConfig.getType()).andReturn(Configuration.HIVE_CONFIG_TAG).anyTimes();
     expect(configHelper.getEffectiveConfigAttributes(cluster, configTags)).andReturn(attributes);
     expect(configuration.getProperty("server.tmp.dir")).andReturn(Configuration.SERVER_TMP_DIR_DEFAULT);
-    //!!!!
     Map<String,String> props = new HashMap<String, String>();
     props.put(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY, "pass");
     props.put("key","value");
     expect(clusterConfig.getProperties()).andReturn(props);
     expect(configHelper.getEffectiveDesiredTags(cluster, hostName)).andReturn(allConfigTags);
-    //!!!!
     expect(cluster.getClusterName()).andReturn(clusterName);
     expect(managementController.getHostComponents((Set<ServiceComponentHostRequest>) anyObject())).andReturn(responses).anyTimes();
     expect(cluster.getCurrentStackVersion()).andReturn(stackId);
 
+    PowerMock.mockStaticPartial(StageUtils.class, "getClusterHostInfo");
+    Map<String, Set<String>> clusterHostInfo = new HashMap<String, Set<String>>();
+    Set<String> all_hosts = new HashSet<String>(Arrays.asList("Host100","Host101","Host102"));
+    Set<String> some_hosts = new HashSet<String>(Arrays.asList("0","2"));
+    Set<String> clusterHostTypes = new HashSet<String>(Arrays.asList("nm_hosts", "hs_host",
+            "namenode_host", "rm_host", "snamenode_host", "slave_hosts", "zookeeper_hosts"));
+    for (String hostTypes: clusterHostTypes) {
+      clusterHostInfo.put(hostTypes,some_hosts);
+    }
+    Map<String, Host> stringHostMap = new HashMap<String, Host>();
+    stringHostMap.put(hostName, host);
+    clusterHostInfo.put("all_hosts",all_hosts);
+    expect(StageUtils.getClusterHostInfo(stringHostMap,cluster)).andReturn(clusterHostInfo);
+
     expect(stackId.getStackName()).andReturn(stackName).anyTimes();
     expect(stackId.getStackVersion()).andReturn(stackVersion).anyTimes();
 
@@ -242,10 +256,6 @@ public class ClientConfigResourceProviderTest {
     expect(ambariMetaInfo.getStackRoot()).andReturn(new File(stackRoot));
     expect(cluster.getAllConfigs()).andReturn(clusterConfigs);
     expect(clusters.getHostsForCluster(clusterName)).andReturn(hosts);
-    expect(cluster.getServices()).andReturn(services);
-    expect(service.getServiceComponents()).andReturn(serviceComponentMap);
-    expect(serviceComponent.getName()).andReturn(componentName);
-    expect(serviceComponent.getServiceComponentHosts()).andReturn(serviceComponentHosts);
     expect(clusters.getHost(hostName)).andReturn(host);
 
     HashMap<String, String> rcaParams = new HashMap<String, String>();


[23/34] git commit: AMBARI-7363 Recommendations: ui changes for usability 2. (ababiichuk)

Posted by jo...@apache.org.
AMBARI-7363 Recommendations: ui changes for usability 2. (ababiichuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 3f932cfeefb780530a05d3c328418635836a9b0b
Parents: 0058924
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Sep 18 12:39:59 2014 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Sep 18 12:39:59 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/messages.js                           |  1 -
 ambari-web/app/styles/application.less               | 15 +++++++++++++++
 .../common/configs/config_recommendation_popup.hbs   | 13 +++++++++----
 3 files changed, 24 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3f932cfe/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 5c330b4..1052d9b 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -658,7 +658,6 @@ Em.I18n.translations = {
   'installer.step7.popup.validation.request.failed.body': 'Config validaition failed.',
   'installer.step7.popup.validation.warning.header': 'Configurations',
   'installer.step7.popup.validation.warning.body': 'Some service configurations are not configured properly. We recommend you review and change the highlighted configuration values. Are you sure you want to proceed without correcting configurations?',
-  'installer.step7.popup.validation.warning.errorDescription': ' value is less than the recommended default of ',
   'installer.step7.oozie.database.new': 'New Derby Database',
   'installer.step7.hive.database.new': 'New MySQL Database',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f932cfe/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 8385916..235dbc1 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -7005,3 +7005,18 @@ i.icon-asterisks {
 .table td.no-borders { border-top: none; }
 .table td.error { background-color: #f2dede; }
 .table td.warning { background-color: #fcf8e3; }
+
+#config-validation-warnings {
+  table {
+    tbody{
+      tr {
+        background:#fcf8e3;
+        border:1px solid #c09853;
+        border-right:none;
+        td {
+          min-width: 150px;
+        }
+      }
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/3f932cfe/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs b/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
index 4efc312..0a3e231 100644
--- a/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
+++ b/ambari-web/app/templates/common/configs/config_recommendation_popup.hbs
@@ -28,6 +28,9 @@
         {{t common.property}}
       </th>
       <th>
+        {{t common.value}}
+      </th>
+      <th>
         {{t common.description}}
       </th>
     </tr>
@@ -41,12 +44,14 @@
               {{property.serviceName}}
             </td>
             <td>
-              {{property.displayName}}
+              {{property.name}}
+            </td>
+            <td>
+              {{property.value}}
             </td>
             <td>
-              <strong>{{property.description}}:</strong><br/>
-              <strong>{{property.value}}</strong>{{t installer.step7.popup.validation.warning.errorDescription}}
-              <strong>{{property.defaultValue}}</strong>
+              {{property.description}}<br/>
+              <strong>{{property.warnMessage}}</strong>
             </td>
           </tr>
         {{/if}}


[18/34] git commit: AMBARI-7375. Views list not loaded into menu after first login. (yusaku)

Posted by jo...@apache.org.
AMBARI-7375. Views list not loaded into menu after first login. (yusaku)


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

Branch: refs/heads/branch-alerts-dev
Commit: 856ac44f8074527f44df79d43e6335479ae712c1
Parents: dcc03bc
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Sep 17 16:30:28 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Sep 17 16:34:02 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main.js                  | 1 -
 ambari-web/app/controllers/main/views_controller.js | 6 +++++-
 ambari-web/app/routes/main.js                       | 1 -
 3 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/856ac44f/ambari-web/app/controllers/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main.js b/ambari-web/app/controllers/main.js
index b5d83c4..55db450 100644
--- a/ambari-web/app/controllers/main.js
+++ b/ambari-web/app/controllers/main.js
@@ -44,7 +44,6 @@ App.MainController = Em.Controller.extend({
    */
   initialize: function(){
     App.router.get('clusterController').loadClusterData();
-    App.router.get('mainViewsController').loadAmbariViews();
   },
 
   dataLoading: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/856ac44f/ambari-web/app/controllers/main/views_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/views_controller.js b/ambari-web/app/controllers/main/views_controller.js
index b3b36fe..fb1dce7 100644
--- a/ambari-web/app/controllers/main/views_controller.js
+++ b/ambari-web/app/controllers/main/views_controller.js
@@ -25,6 +25,10 @@ App.MainViewsController = Em.Controller.extend({
 
   ambariViews: [],
 
+  init: function () {
+    this.loadAmbariViews();
+  },
+
   dataLoading: function () {
     var viewsController = this;
     var dfd = $.Deferred();
@@ -103,7 +107,7 @@ App.MainViewsController = Em.Controller.extend({
 
   setView: function(event) {
     if(event.context){
-      App.router.transitionTo('views.viewDetails', event.context);
+      App.router.transitionTo('main.views.viewDetails', event.context);
     }
   }
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/856ac44f/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index d6521bd..44e64b9 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -39,7 +39,6 @@ module.exports = Em.Route.extend({
             }
             else {
               App.router.get('clusterController').set('isLoaded', true);
-              App.router.get('mainViewsController').loadAmbariViews();
             }
           }
         });


[13/34] git commit: AMBARI-6040. Modify configuration with Ambari Shell. (Janos Matyas and Krisztian Horvath via yusaku)

Posted by jo...@apache.org.
AMBARI-6040. Modify configuration with Ambari Shell. (Janos Matyas and Krisztian Horvath via yusaku)


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

Branch: refs/heads/branch-alerts-dev
Commit: f3345be0b99b40f6811745808f51f924a10740e2
Parents: 1f4d315
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Sep 17 09:59:48 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Sep 17 10:00:36 2014 -0700

----------------------------------------------------------------------
 .../ambari/groovy/client/AmbariClient.groovy    |   7 +-
 ambari-shell/ambari-groovy-shell/pom.xml        |  11 ++
 .../ambari/shell/commands/ConfigCommands.java   | 163 +++++++++++++++++++
 .../shell/completion/AbstractCompletion.java    |  34 ++++
 .../ambari/shell/completion/Blueprint.java      |   9 +-
 .../ambari/shell/completion/ConfigType.java     |  29 ++++
 .../apache/ambari/shell/completion/Host.java    |   9 +-
 .../apache/ambari/shell/completion/Service.java |  12 +-
 .../configuration/ConverterConfiguration.java   |   6 +
 .../shell/converter/AbstractConverter.java      |  63 +++++++
 .../shell/converter/BlueprintConverter.java     |  21 +--
 .../shell/converter/ConfigTypeConverter.java    |  45 +++++
 .../ambari/shell/converter/HostConverter.java   |  21 +--
 .../shell/converter/ServiceConverter.java       |  24 +--
 .../shell/commands/ConfigCommandsTest.java      |  98 +++++++++++
 .../src/test/resources/core-site.xml            |  13 ++
 16 files changed, 490 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-client/groovy-client/src/main/groovy/org/apache/ambari/groovy/client/AmbariClient.groovy
----------------------------------------------------------------------
diff --git a/ambari-client/groovy-client/src/main/groovy/org/apache/ambari/groovy/client/AmbariClient.groovy b/ambari-client/groovy-client/src/main/groovy/org/apache/ambari/groovy/client/AmbariClient.groovy
index f0ca650..6d94c5d 100644
--- a/ambari-client/groovy-client/src/main/groovy/org/apache/ambari/groovy/client/AmbariClient.groovy
+++ b/ambari-client/groovy-client/src/main/groovy/org/apache/ambari/groovy/client/AmbariClient.groovy
@@ -443,7 +443,7 @@ class AmbariClient {
 
   /**
    * Adds a blueprint with the desired configurations.
-   * 
+   *
    * @param json blueprint to be added
    * @param configurations blueprint will be extended with these configurations
    * @return the extended blueprint as json
@@ -752,11 +752,12 @@ class AmbariClient {
    *
    * @return a Map with entries of format <servicename, Map<property, value>>
    */
-  def Map<String, Map<String, String>> getServiceConfigMap() {
+  def Map<String, Map<String, String>> getServiceConfigMap(String type = "") {
     def Map<String, Integer> serviceToTags = new HashMap<>()
 
     //get services and last versions configurations
-    Map<String, ?> configsResourceRequestMap = getResourceRequestMap("clusters/${getClusterName()}/configurations", [:])
+    def path = "clusters/${getClusterName()}/configurations"
+    Map<String, ?> configsResourceRequestMap = getResourceRequestMap(path, type ? ["type": type] : [:])
     def rawConfigs = getSlurpedResource(configsResourceRequestMap)
 
     rawConfigs?.items.collect { object ->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/pom.xml b/ambari-shell/ambari-groovy-shell/pom.xml
index a1acf8b..ed4d0b6 100644
--- a/ambari-shell/ambari-groovy-shell/pom.xml
+++ b/ambari-shell/ambari-groovy-shell/pom.xml
@@ -71,6 +71,16 @@
       <groupId>org.codehaus.jackson</groupId>
       <artifactId>jackson-mapper-asl</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-common</artifactId>
+      <version>2.4.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpclient</artifactId>
+      <version>4.2.5</version>
+    </dependency>
   </dependencies>
   <build>
     <plugins>
@@ -87,6 +97,7 @@
             <exclude>src/test/resources/2columns</exclude>
             <exclude>src/test/resources/3columns</exclude>
             <exclude>src/test/resources/testBlueprint.json</exclude>
+            <exclude>src/test/resources/core-site.xml</exclude>
           </excludes>
         </configuration>
         <executions>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/commands/ConfigCommands.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/commands/ConfigCommands.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/commands/ConfigCommands.java
new file mode 100644
index 0000000..bf6a0ae
--- /dev/null
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/commands/ConfigCommands.java
@@ -0,0 +1,163 @@
+/**
+ * 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.shell.commands;
+
+import static org.apache.ambari.shell.support.TableRenderer.renderSingleMap;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.ambari.groovy.client.AmbariClient;
+import org.apache.ambari.shell.completion.ConfigType;
+import org.apache.ambari.shell.model.AmbariContext;
+import org.apache.hadoop.conf.Configuration;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliAvailabilityIndicator;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+import org.springframework.stereotype.Component;
+
+/**
+ * Configuration related commands used in the shell.
+ *
+ * @see org.apache.ambari.groovy.client.AmbariClient
+ */
+@Component
+public class ConfigCommands implements CommandMarker {
+
+  private AmbariClient client;
+  private AmbariContext context;
+
+  @Autowired
+  public ConfigCommands(AmbariClient client, AmbariContext context) {
+    this.client = client;
+    this.context = context;
+  }
+
+  /**
+   * Checks whether the configuration show command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("configuration show")
+  public boolean isConfigShowCommandAvailable() {
+    return context.isConnectedToCluster();
+  }
+
+  /**
+   * Prints the desired configuration.
+   */
+  @CliCommand(value = "configuration show", help = "Prints the desired configuration")
+  public String showConfig(@CliOption(key = "type", mandatory = true, help = "Type of the configuration") ConfigType configType) {
+    String configTypeName = configType.getName();
+    Map<String, Map<String, String>> configMap = client.getServiceConfigMap(configTypeName);
+    return renderSingleMap(configMap.get(configTypeName), "KEY", "VALUE");
+  }
+
+  /**
+   * Checks whether the configuration set command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("configuration set")
+  public boolean isConfigSetCommandAvailable() {
+    return context.isConnectedToCluster();
+  }
+
+  /**
+   * Sets the desired configuration.
+   */
+  @CliCommand(value = "configuration set", help = "Sets the desired configuration")
+  public String setConfig(@CliOption(key = "type", mandatory = true, help = "Type of the configuration") ConfigType configType,
+    @CliOption(key = "url", help = "URL of the config") String url,
+    @CliOption(key = "file", help = "File of the config") File file) throws IOException {
+    Configuration configuration = new Configuration(false);
+    if (file == null) {
+      configuration.addResource(new URL(url));
+    } else {
+      configuration.addResource(new FileInputStream(file));
+    }
+    Map<String, String> config = new HashMap<String, String>();
+    Iterator<Map.Entry<String, String>> iterator = configuration.iterator();
+    while (iterator.hasNext()) {
+      Map.Entry<String, String> entry = iterator.next();
+      config.put(entry.getKey(), entry.getValue());
+    }
+    client.modifyConfiguration(configType.getName(), config);
+    return "Restart is required!\n" + renderSingleMap(config, "KEY", "VALUE");
+  }
+
+  /**
+   * Checks whether the configuration modify command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("configuration modify")
+  public boolean isConfigModifyCommandAvailable() {
+    return context.isConnectedToCluster();
+  }
+
+  /**
+   * Modify the desired configuration.
+   */
+  @CliCommand(value = "configuration modify", help = "Modify the desired configuration")
+  public String modifyConfig(@CliOption(key = "type", mandatory = true, help = "Type of the configuration") ConfigType configType,
+    @CliOption(key = "key", mandatory = true, help = "Key of the config") String key,
+    @CliOption(key = "value", mandatory = true, help = "Value of the config") String value) {
+    String configTypeName = configType.getName();
+    Map<String, String> config = client.getServiceConfigMap(configTypeName).get(configTypeName);
+    config.put(key, value);
+    client.modifyConfiguration(configTypeName, config);
+    return "Restart is required!\n" + renderSingleMap(config, "KEY", "VALUE");
+  }
+
+  /**
+   * Checks whether the configuration modify command is available or not.
+   *
+   * @return true if available false otherwise
+   */
+  @CliAvailabilityIndicator("configuration download")
+  public boolean isConfigDownloadCommandAvailable() {
+    return context.isConnectedToCluster();
+  }
+
+  /**
+   * Modify the desired configuration.
+   */
+  @CliCommand(value = "configuration download", help = "Downloads the desired configuration")
+  public String downloadConfig(@CliOption(key = "type", mandatory = true, help = "Type of the configuration") ConfigType configType) throws IOException {
+    String configTypeName = configType.getName();
+    Map<String, String> config = client.getServiceConfigMap(configTypeName).get(configTypeName);
+    Configuration configuration = new Configuration(false);
+    for (String key : config.keySet()) {
+      configuration.set(key, config.get(key));
+    }
+    File file = new File(configTypeName);
+    FileWriter writer = new FileWriter(file);
+    configuration.writeXml(writer);
+    return "Configuration saved to: " + file.getAbsolutePath();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/AbstractCompletion.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/AbstractCompletion.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/AbstractCompletion.java
new file mode 100644
index 0000000..8a8ba71
--- /dev/null
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/AbstractCompletion.java
@@ -0,0 +1,34 @@
+/**
+ * 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.shell.completion;
+
+/**
+ * Base class for completions.
+ */
+public abstract class AbstractCompletion {
+
+  private final String name;
+
+  protected AbstractCompletion(String name) {
+    this.name = name;
+  }
+
+  public String getName() {
+    return name;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Blueprint.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Blueprint.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Blueprint.java
index 4eec7b1..4027e01 100644
--- a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Blueprint.java
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Blueprint.java
@@ -20,15 +20,10 @@ package org.apache.ambari.shell.completion;
 /**
  * Wrapper class for TAB completion to blueprint names.
  */
-public class Blueprint {
-
-  private final String name;
+public class Blueprint extends AbstractCompletion {
 
   public Blueprint(String name) {
-    this.name = name;
+    super(name);
   }
 
-  public String getName() {
-    return name;
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/ConfigType.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/ConfigType.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/ConfigType.java
new file mode 100644
index 0000000..515feea
--- /dev/null
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/ConfigType.java
@@ -0,0 +1,29 @@
+/**
+ * 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.shell.completion;
+
+/**
+ * Wrapper class for TAB completion to config names.
+ */
+public class ConfigType extends AbstractCompletion {
+
+  public ConfigType(String name) {
+    super(name);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Host.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Host.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Host.java
index f64e97b..16b0464 100644
--- a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Host.java
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Host.java
@@ -20,15 +20,10 @@ package org.apache.ambari.shell.completion;
 /**
  * Wrapper class for TAB completion to host names.
  */
-public class Host {
-
-  private final String name;
+public class Host extends AbstractCompletion {
 
   public Host(String name) {
-    this.name = name;
+    super(name);
   }
 
-  public String getName() {
-    return name;
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Service.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Service.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Service.java
index bbbf37c..8270bb3 100644
--- a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Service.java
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/completion/Service.java
@@ -17,15 +17,13 @@
  */
 package org.apache.ambari.shell.completion;
 
-public class Service {
-
-  private final String name;
+/**
+ * Wrapper class for TAB completion to service names.
+ */
+public class Service extends AbstractCompletion {
 
   public Service(String name) {
-    this.name = name;
+    super(name);
   }
 
-  public String getName() {
-    return name;
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/configuration/ConverterConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/configuration/ConverterConfiguration.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/configuration/ConverterConfiguration.java
index c19aced..47a7208 100644
--- a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/configuration/ConverterConfiguration.java
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/configuration/ConverterConfiguration.java
@@ -19,6 +19,7 @@ package org.apache.ambari.shell.configuration;
 
 import org.apache.ambari.groovy.client.AmbariClient;
 import org.apache.ambari.shell.converter.BlueprintConverter;
+import org.apache.ambari.shell.converter.ConfigTypeConverter;
 import org.apache.ambari.shell.converter.HostConverter;
 import org.apache.ambari.shell.converter.ServiceConverter;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -145,4 +146,9 @@ public class ConverterConfiguration {
   Converter serviceConverter() {
     return new ServiceConverter(client);
   }
+
+  @Bean
+  Converter configConverter() {
+    return new ConfigTypeConverter(client);
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/AbstractConverter.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/AbstractConverter.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/AbstractConverter.java
new file mode 100644
index 0000000..da75e33
--- /dev/null
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/AbstractConverter.java
@@ -0,0 +1,63 @@
+/**
+ * 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.shell.converter;
+
+import java.lang.reflect.Constructor;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.ambari.groovy.client.AmbariClient;
+import org.apache.ambari.shell.completion.AbstractCompletion;
+import org.springframework.shell.core.Completion;
+import org.springframework.shell.core.Converter;
+
+/**
+ * Base class of completion converters.
+ *
+ * @param <T> completion class type
+ */
+public abstract class AbstractConverter<T extends AbstractCompletion> implements Converter<T> {
+
+  private AmbariClient client;
+
+  protected AbstractConverter(AmbariClient client) {
+    this.client = client;
+  }
+
+  @Override
+  public T convertFromText(String value, Class<?> clazz, String optionContext) {
+    try {
+      Constructor<?> constructor = clazz.getDeclaredConstructor(String.class);
+      return (T) constructor.newInstance(value);
+    } catch (Exception e) {
+      return null;
+    }
+  }
+
+  public boolean getAllPossibleValues(List<Completion> completions, Collection<String> values) {
+    for (String value : values) {
+      completions.add(new Completion(value));
+    }
+    return true;
+  }
+
+  public AmbariClient getClient() {
+    return client;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/BlueprintConverter.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/BlueprintConverter.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/BlueprintConverter.java
index 7984e7f..f1fa8a6 100644
--- a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/BlueprintConverter.java
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/BlueprintConverter.java
@@ -18,41 +18,28 @@
 package org.apache.ambari.shell.converter;
 
 import java.util.List;
-import java.util.Set;
 
 import org.apache.ambari.groovy.client.AmbariClient;
 import org.apache.ambari.shell.completion.Blueprint;
 import org.springframework.shell.core.Completion;
-import org.springframework.shell.core.Converter;
 import org.springframework.shell.core.MethodTarget;
 
 /**
  * Converter used to complete blueprint names.
  */
-public class BlueprintConverter implements Converter<Blueprint> {
-
-  private AmbariClient client;
+public class BlueprintConverter extends AbstractConverter<Blueprint> {
 
   public BlueprintConverter(AmbariClient client) {
-    this.client = client;
+    super(client);
   }
 
   @Override
-  public boolean supports(Class<?> type, String optionContext) {
+  public boolean supports(Class<?> type, String s) {
     return Blueprint.class.isAssignableFrom(type);
   }
 
   @Override
-  public Blueprint convertFromText(String value, Class<?> targetType, String optionContext) {
-    return new Blueprint(value);
-  }
-
-  @Override
   public boolean getAllPossibleValues(List<Completion> completions, Class<?> targetType, String existingData, String optionContext, MethodTarget target) {
-    Set<String> blueprints = client.getBlueprintsMap().keySet();
-    for (String blueprint : blueprints) {
-      completions.add(new Completion(blueprint));
-    }
-    return true;
+    return getAllPossibleValues(completions, getClient().getBlueprintsMap().keySet());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ConfigTypeConverter.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ConfigTypeConverter.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ConfigTypeConverter.java
new file mode 100644
index 0000000..a87cdfc
--- /dev/null
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ConfigTypeConverter.java
@@ -0,0 +1,45 @@
+/**
+ * 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.shell.converter;
+
+import java.util.List;
+
+import org.apache.ambari.groovy.client.AmbariClient;
+import org.apache.ambari.shell.completion.ConfigType;
+import org.springframework.shell.core.Completion;
+import org.springframework.shell.core.MethodTarget;
+
+/**
+ * Converter used to complete config names.
+ */
+public class ConfigTypeConverter extends AbstractConverter<ConfigType> {
+
+  public ConfigTypeConverter(AmbariClient client) {
+    super(client);
+  }
+
+  @Override
+  public boolean supports(Class<?> type, String s) {
+    return ConfigType.class.isAssignableFrom(type);
+  }
+
+  @Override
+  public boolean getAllPossibleValues(List<Completion> completions, Class<?> aClass, String s, String s2, MethodTarget methodTarget) {
+    return getAllPossibleValues(completions, getClient().getServiceConfigMap().keySet());
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/HostConverter.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/HostConverter.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/HostConverter.java
index 39aa6e9..2e523f2 100644
--- a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/HostConverter.java
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/HostConverter.java
@@ -18,41 +18,28 @@
 package org.apache.ambari.shell.converter;
 
 import java.util.List;
-import java.util.Set;
 
 import org.apache.ambari.groovy.client.AmbariClient;
 import org.apache.ambari.shell.completion.Host;
 import org.springframework.shell.core.Completion;
-import org.springframework.shell.core.Converter;
 import org.springframework.shell.core.MethodTarget;
 
 /**
  * Converter used to complete host names.
  */
-public class HostConverter implements Converter<Host> {
-
-  private AmbariClient client;
+public class HostConverter extends AbstractConverter<Host> {
 
   public HostConverter(AmbariClient client) {
-    this.client = client;
+    super(client);
   }
 
   @Override
-  public boolean supports(Class<?> type, String optionContext) {
+  public boolean supports(Class<?> type, String s) {
     return Host.class.isAssignableFrom(type);
   }
 
   @Override
-  public Host convertFromText(String value, Class<?> targetType, String optionContext) {
-    return new Host(value);
-  }
-
-  @Override
   public boolean getAllPossibleValues(List<Completion> completions, Class<?> targetType, String existingData, String optionContext, MethodTarget target) {
-    Set<String> hosts = client.getHostNames().keySet();
-    for (String host : hosts) {
-      completions.add(new Completion(host));
-    }
-    return true;
+    return getAllPossibleValues(completions, getClient().getHostNames().keySet());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ServiceConverter.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ServiceConverter.java b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ServiceConverter.java
index e7f9d2c..539055a 100644
--- a/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ServiceConverter.java
+++ b/ambari-shell/ambari-groovy-shell/src/main/java/org/apache/ambari/shell/converter/ServiceConverter.java
@@ -18,38 +18,28 @@
 package org.apache.ambari.shell.converter;
 
 import java.util.List;
-import java.util.Set;
 
 import org.apache.ambari.groovy.client.AmbariClient;
 import org.apache.ambari.shell.completion.Service;
 import org.springframework.shell.core.Completion;
-import org.springframework.shell.core.Converter;
 import org.springframework.shell.core.MethodTarget;
 
-public class ServiceConverter implements Converter<Service> {
-
-  private AmbariClient client;
+/**
+ * Converter used to complete service names.
+ */
+public class ServiceConverter extends AbstractConverter<Service> {
 
   public ServiceConverter(AmbariClient client) {
-    this.client = client;
+    super(client);
   }
 
   @Override
-  public boolean supports(Class<?> type, String optionContext) {
+  public boolean supports(Class<?> type, String s) {
     return Service.class.isAssignableFrom(type);
   }
 
   @Override
-  public Service convertFromText(String value, Class<?> targetType, String optionContext) {
-    return new Service(value);
-  }
-
-  @Override
   public boolean getAllPossibleValues(List<Completion> completions, Class<?> targetType, String existingData, String optionContext, MethodTarget target) {
-    Set<String> services = client.getServicesMap().keySet();
-    for (String service : services) {
-      completions.add(new Completion(service));
-    }
-    return true;
+    return getAllPossibleValues(completions, getClient().getServicesMap().keySet());
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/test/java/org/apache/ambari/shell/commands/ConfigCommandsTest.java
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/test/java/org/apache/ambari/shell/commands/ConfigCommandsTest.java b/ambari-shell/ambari-groovy-shell/src/test/java/org/apache/ambari/shell/commands/ConfigCommandsTest.java
new file mode 100644
index 0000000..a992acf
--- /dev/null
+++ b/ambari-shell/ambari-groovy-shell/src/test/java/org/apache/ambari/shell/commands/ConfigCommandsTest.java
@@ -0,0 +1,98 @@
+/**
+ * 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.shell.commands;
+
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.ambari.groovy.client.AmbariClient;
+import org.apache.ambari.shell.completion.ConfigType;
+import org.apache.ambari.shell.model.AmbariContext;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ConfigCommandsTest {
+
+  private static final String CORE_SITE = "core-site";
+
+  @InjectMocks
+  private ConfigCommands configCommands;
+
+  @Mock
+  private AmbariClient client;
+  @Mock
+  private AmbariContext context;
+
+  @Test
+  public void testShowConfig() {
+    ConfigType configType = mock(ConfigType.class);
+    Map<String, Map<String, String>> mockResult = mock(Map.class);
+    when(configType.getName()).thenReturn(CORE_SITE);
+    when(client.getServiceConfigMap(anyString())).thenReturn(mockResult);
+    when(mockResult.get(CORE_SITE)).thenReturn(new HashMap<String, String>());
+
+    configCommands.showConfig(configType);
+
+    verify(client).getServiceConfigMap(CORE_SITE);
+  }
+
+  @Test
+  public void testSetConfigForFile() throws IOException {
+    ConfigType configType = mock(ConfigType.class);
+    File file = new File("src/test/resources/core-site.xml");
+    when(configType.getName()).thenReturn(CORE_SITE);
+
+    configCommands.setConfig(configType, "", file);
+
+    Map<String, String> config = new HashMap<String, String>();
+    config.put("fs.trash.interval", "350");
+    config.put("ipc.client.connection.maxidletime", "30000");
+    verify(client).modifyConfiguration(CORE_SITE, config);
+  }
+
+  @Test
+  public void testModifyConfig() throws IOException {
+    ConfigType configType = mock(ConfigType.class);
+    Map<String, Map<String, String>> mockResult = mock(Map.class);
+    Map<String, String> config = new HashMap<String, String>();
+    config.put("fs.trash.interval", "350");
+    config.put("ipc.client.connection.maxidletime", "30000");
+    when(configType.getName()).thenReturn(CORE_SITE);
+    when(mockResult.get(CORE_SITE)).thenReturn(config);
+    when(client.getServiceConfigMap(CORE_SITE)).thenReturn(mockResult);
+
+    configCommands.modifyConfig(configType, "fs.trash.interval", "510");
+
+    Map<String, String> config2 = new HashMap<String, String>();
+    config2.put("fs.trash.interval", "510");
+    config2.put("ipc.client.connection.maxidletime", "30000");
+    verify(client).modifyConfiguration(CORE_SITE, config2);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f3345be0/ambari-shell/ambari-groovy-shell/src/test/resources/core-site.xml
----------------------------------------------------------------------
diff --git a/ambari-shell/ambari-groovy-shell/src/test/resources/core-site.xml b/ambari-shell/ambari-groovy-shell/src/test/resources/core-site.xml
new file mode 100644
index 0000000..b38a3ce
--- /dev/null
+++ b/ambari-shell/ambari-groovy-shell/src/test/resources/core-site.xml
@@ -0,0 +1,13 @@
+<configuration>
+
+  <property>
+    <name>fs.trash.interval</name>
+    <value>350</value>
+  </property>
+
+  <property>
+    <name>ipc.client.connection.maxidletime</name>
+    <value>30000</value>
+  </property>
+
+</configuration>
\ No newline at end of file


[21/34] git commit: AMBARI-7377. Slider View: Add support for custom users to login into Ambari and submit application as themselves (srimanth)

Posted by jo...@apache.org.
AMBARI-7377. Slider View: Add support for custom users to login into Ambari and submit application as themselves (srimanth)


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

Branch: refs/heads/branch-alerts-dev
Commit: c7651de83d16e2d9de16ca99399aaa9ad3c595cd
Parents: 7a087b1
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Wed Sep 17 17:08:47 2014 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Wed Sep 17 17:37:39 2014 -0700

----------------------------------------------------------------------
 .../ambari/view/slider/SliderAppsViewControllerImpl.java      | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c7651de8/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
index 3626cbe..027f824 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
@@ -133,7 +133,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
     ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
     Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
     try {
-      T value = UserGroupInformation.getBestUGI(null, "yarn").doAs(
+      T value = UserGroupInformation.getBestUGI(null, viewContext.getUsername()).doAs(
           new PrivilegedExceptionAction<T>() {
             @Override
             public T run() throws Exception {
@@ -274,7 +274,6 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
               app.setConfigs(configs);
             } else if ("components".equals(property.toLowerCase())) {
               try {
-                System.setProperty(SliderKeys.HADOOP_USER_NAME, "yarn");
                 ClusterDescription description = sliderClient
                     .getClusterDescription(yarnApp.getName());
                 if (description != null && description.status != null
@@ -368,7 +367,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
     SliderClient client = new SliderClient() {
       @Override
       public String getUsername() throws IOException {
-        return "yarn";
+        return viewContext.getUsername();
       }
 
       @Override
@@ -377,7 +376,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
         // Override the default FS client to the calling user
         try {
           FileSystem fs = FileSystem.get(FileSystem.getDefaultUri(getConfig()),
-              getConfig(), "yarn");
+              getConfig(), viewContext.getUsername());
           SliderFileSystem fileSystem = new SliderFileSystem(fs, getConfig());
           Field fsField = SliderClient.class
               .getDeclaredField("sliderFileSystem");