You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2013/08/13 03:28:27 UTC

git commit: AMBARI-2880. null property values generated during Hadoop 1 stack install. (srimanth)

Updated Branches:
  refs/heads/trunk f1dc8beb7 -> fa220fd31


AMBARI-2880. null property values generated during Hadoop 1 stack install. (srimanth)


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

Branch: refs/heads/trunk
Commit: fa220fd31bcd51c8aa2e17161858ad224cc323d4
Parents: f1dc8be
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Mon Aug 12 18:14:28 2013 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Mon Aug 12 18:14:50 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/app.js                                   | 3 ---
 ambari-web/app/config.js                                | 1 -
 ambari-web/app/controllers/global/cluster_controller.js | 8 ++++----
 ambari-web/app/controllers/global/update_controller.js  | 4 ++--
 ambari-web/app/utils/string_utils.js                    | 3 +++
 5 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fa220fd3/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 9df755a..53c2aa0 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -58,9 +58,6 @@ module.exports = Em.Application.create({
     return this.get('currentStackVersion').replace(/HDP(Local)?-/, '');
   }.property('currentStackVersion'),
   isHadoop2Stack: function(){
-    if(App.testHadoop2Stack && !App.alwaysGoToInstaller) {
-      return true;
-    }
     return (stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.0") === 1 ||
       stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.0") === 0)
   }.property('currentStackVersionNumber')

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fa220fd3/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 6cdc5e4..4dd1724 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -23,7 +23,6 @@ App.testModeDelayForActions = 10000;
 App.skipBootstrap = false;
 App.alwaysGoToInstaller = false;
 App.testEnableSecurity = true; // By default enable security is tested; turning it false tests disable security
-App.testHadoop2Stack = true;
 App.testNameNodeHA = true;
 App.apiPrefix = '/api/v1';
 App.defaultStackVersion = 'HDP-1.3.0';

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fa220fd3/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index 4c63bfd..68651c8 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -197,7 +197,7 @@ App.ClusterController = Em.Controller.extend({
    */
   loadAlerts:function (callback) {
     if (this.get('isNagiosInstalled')) {
-      var testUrl = App.testHadoop2Stack ? '/data/alerts/HDP2/alerts.json':'/data/alerts/alerts.json';
+      var testUrl = App.get('isHadoop2Stack') ? '/data/alerts/HDP2/alerts.json':'/data/alerts/alerts.json';
       var dataUrl = this.getUrl(testUrl, '/host_components?fields=HostRoles/nagios_alerts&HostRoles/component_name=NAGIOS_SERVER');
       var self = this;
       var ajaxOptions = {
@@ -242,7 +242,7 @@ App.ClusterController = Em.Controller.extend({
       callback();
       return false;
     }
-    var testUrl = App.testHadoop2Stack ? '/data/dashboard/HDP2/services.json':'/data/dashboard/services.json';
+    var testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/services.json':'/data/dashboard/services.json';
     var servicesUrl = this.getUrl(testUrl, '/services?fields=ServiceInfo,components/host_components/HostRoles/desired_state,components/host_components/HostRoles/state');
 
     App.HttpClient.get(servicesUrl, App.statusMapper, {
@@ -286,7 +286,7 @@ App.ClusterController = Em.Controller.extend({
       return;
     }
     var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
-    var testHostUrl =  App.testHadoop2Stack ? '/data/hosts/HDP2/hosts.json':'/data/hosts/hosts.json';
+    var testHostUrl =  App.get('isHadoop2Stack') ? '/data/hosts/HDP2/hosts.json':'/data/hosts/hosts.json';
     var hostsUrl = this.getUrl(testHostUrl, '/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/disk_info,Hosts/cpu_count,Hosts/total_mem,Hosts/host_status,Hosts/last_heartbeat_time,Hosts/os_arch,Hosts/os_type,Hosts/ip,host_components,metrics/disk,metrics/load/load_one');
     var usersUrl = App.testMode ? '/data/users/users.json' : App.apiPrefix + '/users/?fields=*';
     var racksUrl = "/data/racks/racks.json";
@@ -365,7 +365,7 @@ App.ClusterController = Em.Controller.extend({
   }.property('cluster'),
   
   updateClusterData: function () {
-    var testUrl = App.testHadoop2Stack ? '/data/clusters/HDP2/cluster.json':'/data/clusters/cluster.json';
+    var testUrl = App.get('isHadoop2Stack') ? '/data/clusters/HDP2/cluster.json':'/data/clusters/cluster.json';
     var clusterUrl = this.getUrl(testUrl, '?fields=Clusters');
     App.HttpClient.get(clusterUrl, App.clusterMapper, {
       complete:function(){}

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fa220fd3/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index 8f6e7b0..3a33019 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -45,7 +45,7 @@ App.UpdateController = Em.Controller.extend({
 
   updateHost:function(callback) {
     var self = this;
-    var testUrl =  App.testHadoop2Stack ? '/data/hosts/HDP2/hosts.json':'/data/hosts/hosts.json';
+    var testUrl =  App.get('isHadoop2Stack') ? '/data/hosts/HDP2/hosts.json':'/data/hosts/hosts.json';
       var hostsUrl = this.getUrl(testUrl, '/hosts?fields=Hosts/host_name,Hosts/public_host_name,Hosts/disk_info,Hosts/cpu_count,Hosts/total_mem,Hosts/host_status,Hosts/last_heartbeat_time,Hosts/os_arch,Hosts/os_type,Hosts/ip,host_components,metrics/disk,metrics/load/load_one');
       App.HttpClient.get(hostsUrl, App.hostsMapper, {
         complete: callback
@@ -98,7 +98,7 @@ App.UpdateController = Em.Controller.extend({
     });
     var conditionalFieldsString = conditionalFields.length > 0 ? ',' + conditionalFields.join(',') : '';
     var methodStartTs = new Date().getTime();
-    var testUrl = App.testHadoop2Stack ? '/data/dashboard/HDP2/services.json':'/data/dashboard/services.json';
+    var testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/services.json':'/data/dashboard/services.json';
     var servicesUrl = isInitialLoad ? 
       //this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles') :
       this.getUrl(testUrl, '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time'+conditionalFieldsString) :

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/fa220fd3/ambari-web/app/utils/string_utils.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/string_utils.js b/ambari-web/app/utils/string_utils.js
index 4d1b34f..85068ad 100644
--- a/ambari-web/app/utils/string_utils.js
+++ b/ambari-web/app/utils/string_utils.js
@@ -73,6 +73,9 @@ module.exports = {
     if (!(typeof first === 'string' && typeof second === 'string')) {
       return false;
     }
+    if (first === '' || second === '') {
+      return false;
+    }
     var firstNumbers = first.split('.');
     var secondNumbers = second.split('.');
     var length = 0;