Преглед изворни кода

AMBARI-3323. Reverting unnecessary commits from 3a8bd15873df5ab706f04f5e96cf2f2021af0b0c to e222d3ee827558c3be7cf8032e7622f360813676 (ababiichuk)

aBabiichuk пре 11 година
родитељ
комит
add5928168

+ 6 - 6
ambari-web/app/controllers/global/cluster_controller.js

@@ -370,18 +370,18 @@ App.ClusterController = Em.Controller.extend({
     App.ajax.send({
       name: 'ambari.service',
       sender: this,
-      success: 'loadAmbariPropertiesSuccsess',
-      error: 'loadAmbariPropertiesdError'
-    })
+      success: 'loadAmbariPropertiesSuccess',
+      error: 'loadAmbariPropertiesError'
+    });
     return this.get('ambariProperties');
   },
 
-  loadAmbariPropertiesSuccsess: function(data) {
+  loadAmbariPropertiesSuccess: function(data) {
     console.log('loading ambari properties');
-    this.set('ambariProperties',data.RootServiceComponents.properties);
+    this.set('ambariProperties', data.RootServiceComponents.properties);
   },
 
-  loadAmbariPropertiesdError: function() {
+  loadAmbariPropertiesError: function() {
     console.warn('can\'t get ambari properties');
   },
 

+ 0 - 1
ambari-web/app/controllers/installer.js

@@ -104,7 +104,6 @@ App.InstallerController = App.WizardController.extend({
     } else {
       console.log("Failed to load Services");
    }
-    App.router.get('clusterController').loadAmbariProperties();
   },
 
   stacks: [],

+ 19 - 0
ambari-web/app/controllers/wizard/step2_controller.js

@@ -350,8 +350,27 @@ App.WizardStep2Controller = Em.Controller.extend({
     return (this.get('hostsError') || this.get('sshKeyError') || this.get('sshUserError'))  ;
   }.property('hostsError', 'sshKeyError', 'sshUserError'),
 
+  setAmbariJavaHome: function(){
+    App.ajax.send({
+      name: 'ambari.service',
+      sender: this,
+      success: 'onGetAmbariJavaHomeSuccess',
+      error: 'onGetAmbariJavaHomeError'
+    });
+  },
+
+  onGetAmbariJavaHomeSuccess: function(data) {
+    this.set('content.installOptions.javaHome',data.RootServiceComponents.properties['java.home']);
+  },
+
+  onGetAmbariJavaHomeError: function() {
+    console.warn('can\'t get java.home value from server');
+    this.set('content.installOptions.javaHome',App.defaultJavaHome);
+  },
+
   saveHosts: function(){
     this.set('content.hosts', this.getHostInfo());
+    this.setAmbariJavaHome();
     App.router.send('next');
   }
 

+ 4 - 49
ambari-web/app/controllers/wizard/step7_controller.js

@@ -196,30 +196,10 @@ App.WizardStep7Controller = Em.Controller.extend({
 
   submit: function () {
     if (!this.get('isSubmitDisabled')) {
-      if(!this.isGangliaPartitionGood()){
-        this.showRddWarningPopup();
-      } else {
-        App.router.send('next');
-      }
+      App.router.send('next');
     }
-  },
-
-  showRddWarningPopup: function() {
-    var ganglia = this.get('content.masterComponentHosts').findProperty('component','GANGLIA_SERVER');
-    if(!ganglia) return false;
-    var gangliaServerHost = ganglia.hostName;
-    App.ModalPopup.show({
-      header: Em.I18n.t('installer.step7.popup.rddWarning.header').format(gangliaServerHost),
-      body: Em.I18n.t('installer.step7.popup.rddWarning.body').format(this.get('gangliaMoutDir'),gangliaServerHost,numberUtils.bytesToSize(this.get('gangliaAvailableSpace'),1,'parseFloat',1024)),
-      onPrimary: function () {
-        this.hide();
-        App.router.send('next');
-      },
-      onSecondary: function () {
-        this.hide();
-      }
-    });
-  },
+  }, 
+  
   /**
    * Provides service component name and display-name information for 
    * the current selected service. 
@@ -259,32 +239,7 @@ App.WizardStep7Controller = Em.Controller.extend({
     });
     return validComponents;
   }.property('content'),
-
-  gangliaHostDiskInfo: function(){
-    var ganglia = this.get('content.masterComponentHosts').findProperty('component','GANGLIA_SERVER');
-    if(!ganglia) return false;
-    var gangliaServerHost = ganglia.hostName;
-    var gangliaPartition = this.get('content.hosts')[gangliaServerHost].disk_info;
-    return gangliaPartition;
-  }.property('content'),
-
-  isGangliaPartitionGood: function() {
-    var gangliaDiskInfo = this.get('gangliaHostDiskInfo');
-    if(!gangliaDiskInfo) return true;
-    var miscConfigs = this.get('stepConfigs').findProperty('serviceName','MISC').get('configs');
-    var rddDir = miscConfigs.findProperty('name', 'rrdcached_base_dir').value;
-    var available = 0;
-    gangliaDiskInfo.forEach(function(diskInfo) {
-      var mount = rddDir.indexOf(diskInfo.mountpoint);
-      if(mount==0 && diskInfo.mountpoint!="/") {
-        available = diskInfo.available;
-        this.set('gangliaMoutDir',diskInfo.mountpoint);
-      }
-    },this);
-    available = (!available) ? gangliaDiskInfo.findProperty("mountpoint","/").available : available;
-    this.set('gangliaAvailableSpace',available);
-    return available > (16*1024*1024) ? true : false;
-  },
+  
 
   getAllHosts: function () {
     // Load hosts

+ 1 - 2
ambari-web/app/controllers/wizard/step8_controller.js

@@ -1365,7 +1365,6 @@ App.WizardStep8Controller = Em.Controller.extend({
     var globalSiteProperties = {};
     var globalSiteObj = this.get('globals');
     var isHCFSSelected = this.get('selectedServices').someProperty('serviceName', 'HCFS');
-    var ambariProperties = App.router.get('clusterController.ambariProperties');
     
     // screen out the HCFS-specific global config entries when they are not required
     if (!isHCFSSelected) {
@@ -1388,7 +1387,7 @@ App.WizardStep8Controller = Em.Controller.extend({
         console.log("STEP8: value of the global property is: " + _globalSiteObj.value);
       }
       if (_globalSiteObj.name == 'java64_home') {
-        globalSiteProperties['java64_home'] = ambariProperties['java.home'] ? ambariProperties['java.home'] : App.defaultJavaHome ;
+        globalSiteProperties['java64_home'] = this.get('content.installOptions.javaHome');
       }
       this._recordHostOverrideFromObj(_globalSiteObj, 'global', 'version1', this);
     }, this);

+ 0 - 2
ambari-web/app/messages.js

@@ -878,8 +878,6 @@ Em.I18n.translations = {
   'services.service.summary.RegionServersLIVE':'RegionServers Live',
   'services.service.summary.GangliaMonitorsLIVE':'Ganglia Monitors Live',
   'services.service.summary.nameNode':'NameNode Web UI',
-  'services.service.summary.nameNode.active':'Active NameNode',
-  'services.service.summary.nameNode.standby':'Standby NameNode',
   'services.service.summary.nameNodeUptime':'NameNode Uptime',
   'services.service.summary.nameNodeHeap':'NameNode Heap',
   'services.service.summary.nameNode.active':'Active NameNode',

+ 0 - 10
ambari-web/app/utils/ajax.js

@@ -572,15 +572,6 @@ var urls = {
     'mock': '',
     'type': 'GET'
   },
-  'admin.high_availability.getNnCheckPointStatus.sync': {
-    'real': '/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE',
-    'mock': '',
-    'format': function (data, opt) {
-      return {
-        async: false
-      };
-    }
-  },
   'admin.high_availability.getJnCheckPointStatus': {
     'real': '/clusters/{clusterName}/hosts/{hostName}/host_components/JOURNALNODE?fields=metrics',
     'mock': ''
@@ -767,7 +758,6 @@ var urls = {
     'mock': '',
     'format': function (data, opt) {
       return {
-        async: false,
         timeout: 10000
       };
     }

+ 20 - 3
ambari-web/app/views/main/dashboard/service/hdfs.js

@@ -218,8 +218,25 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
     return App.HostComponent.find().findProperty('componentName', 'JOURNALNODE');
   }.property(),
 
-  isSafeMode: function () {
+  safeModeStatus: function () {
     var safeMode = this.get('service.safeModeStatus');
-    return safeMode != null && safeMode.length > 0;
-  }.property('service.safeModeStatus')
+    if (safeMode == null) {
+      return Em.I18n.t("services.service.summary.notAvailable");
+    } else if (safeMode.length == 0) {
+      return Em.I18n.t("services.service.summary.safeModeStatus.notInSafeMode");
+    } else {
+      return Em.I18n.t("services.service.summary.safeModeStatus.inSafeMode");
+    }
+  }.property('service.safeModeStatus'),
+  upgradeStatus: function () {
+    var upgradeStatus = this.get('service.upgradeStatus');
+    var healthStatus = this.get('service.healthStatus');
+    if (upgradeStatus) {
+      return Em.I18n.t('services.service.summary.pendingUpgradeStatus.notPending');
+    } else if (healthStatus == 'green') {
+      return Em.I18n.t('services.service.summary.pendingUpgradeStatus.pending');
+    } else {
+      return Em.I18n.t("services.service.summary.notAvailable");
+    }
+  }.property('service.upgradeStatus', 'service.healthStatus')
 });