ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject git commit: AMBARI-4089. HDFS/ZKFC relations in EmberData. (onechiporenko)
Date Tue, 17 Dec 2013 15:06:52 GMT
Updated Branches:
  refs/heads/trunk 6ced2a18c -> 54791d17a


AMBARI-4089. HDFS/ZKFC relations in EmberData. (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 54791d17aec04e9f5bfa01065d0ae8414e552909
Parents: 6ced2a1
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Tue Dec 17 17:03:52 2013 +0200
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Tue Dec 17 17:06:45 2013 +0200

----------------------------------------------------------------------
 ambari-web/app/app.js                                        | 3 +--
 ambari-web/app/controllers/application.js                    | 3 ---
 ambari-web/app/controllers/main/host/details.js              | 6 ++----
 ambari-web/app/controllers/main/service/item.js              | 2 +-
 .../controllers/main/service/reassign/step4_controller.js    | 8 ++++----
 .../controllers/main/service/reassign/step6_controller.js    | 2 +-
 ambari-web/app/controllers/wizard/step5_controller.js        | 2 +-
 ambari-web/app/controllers/wizard/step7_controller.js        | 2 +-
 ambari-web/app/mappers/server_data_mapper.js                 | 5 +++--
 ambari-web/app/templates/main/admin/highAvailability.hbs     | 2 +-
 ambari-web/app/views/main/admin/highAvailability_view.js     | 7 +------
 ambari-web/app/views/main/host/configs_service_menu.js       | 4 ++--
 ambari-web/app/views/main/service/reassign/step2_view.js     | 2 +-
 ambari-web/app/views/main/service/reassign/step5_view.js     | 2 +-
 14 files changed, 20 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index f7e9b0f..8078961 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -69,10 +69,9 @@ module.exports = Em.Application.create({
    * @type {Boolean}
    */
   isHaEnabled: function() {
-    if (!this.clusterStatus.get('isInstalled')) return false;
     if (!this.get('isHadoop2Stack')) return false;
     return !this.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE');
-  }.property('clusterStatus.isInstalled')
+  }.property('router.clusterController.isLoaded')
 
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/controllers/application.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/application.js b/ambari-web/app/controllers/application.js
index 7fb36bc..9c96cf5 100644
--- a/ambari-web/app/controllers/application.js
+++ b/ambari-web/app/controllers/application.js
@@ -133,9 +133,6 @@ App.ApplicationController = Em.Controller.extend({
             self.postUserPref(key, curValue);
           }
           this.hide();
-        },
-        onSecondary: function() {
-          this.hide();
         }
       })
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/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 2ef4902..a5845c5 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -546,10 +546,8 @@ App.MainHostDetailsController = Em.Controller.extend({
     });
     zks_with_port = zks_with_port.slice(0,-1);
 
-    if (App.get('isHadoop2Stack')) {
-      if (!App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE'))
{
-        configs['core-site']['ha.zookeeper.quorum'] = zks_with_port;
-      }
+    if (App.get('isHaEnabled')) {
+      configs['core-site']['ha.zookeeper.quorum'] = zks_with_port;
     }
     if (configs['hbase-site']) {
       configs['hbase-site']['hbase.zookeeper.quorum'] = zks.join(',');

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index f03e931..325e738 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -272,7 +272,7 @@ App.MainServiceItemController = Em.Controller.extend({
 
   isStopDisabled: function () {
     if(this.get('isPending')) return true;
-    if (!App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE') &&
this.get('content.serviceName') == 'HDFS' && this.get('content.hostComponents').filterProperty('componentName',
'NAMENODE').someProperty('workStatus', App.HostComponentStatus.started)) {
+    if (App.get('isHaEnabled') && this.get('content.serviceName') == 'HDFS' &&
this.get('content.hostComponents').filterProperty('componentName', 'NAMENODE').someProperty('workStatus',
App.HostComponentStatus.started)) {
       return false;
     }
     return (this.get('content.healthStatus') != 'green');

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/controllers/main/service/reassign/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step4_controller.js b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index 078b493..f113afe 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -31,7 +31,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
   hostComponents: [],
 
   loadStep: function () {
-    if (this.get('content.reassign.component_name') === 'NAMENODE' && !App.HostComponent.find().someProperty('componentName',
'SECONDARY_NAMENODE')) {
+    if (this.get('content.reassign.component_name') === 'NAMENODE' && App.get('isHaEnabled'))
{
       this.set('hostComponents', ['NAMENODE', 'ZKFC']);
     } else {
       this.set('hostComponents', [this.get('content.reassign.component_name')]);
@@ -69,7 +69,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     }
 
     if (this.get('content.hasManualSteps')) {
-      if (this.get('content.reassign.component_name') === 'NAMENODE' && !App.HostComponent.find().someProperty('componentName',
'SECONDARY_NAMENODE')) {
+      if (this.get('content.reassign.component_name') === 'NAMENODE' && App.get('isHaEnabled'))
{
         // Only for reassign NameNode with HA enabled
         this.get('tasks').splice(7, 2);
       } else {
@@ -210,7 +210,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     switch (componentName) {
       case 'NAMENODE':
         if (isHadoop2Stack) {
-          if (!App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE'))
{
+          if (App.get('isHaEnabled')) {
             var nameServices = configs['hdfs-site']['dfs.nameservices'];
             if (configs['hdfs-site']['dfs.namenode.http-address.' + nameServices + '.nn1']
=== sourceHostName + ':50070') {
               configs['hdfs-site']['dfs.namenode.http-address.' + nameServices + '.nn1']
= targetHostName + ':50070';
@@ -233,7 +233,7 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
           configs['hdfs-site']['dfs.https.address'] = targetHostName + ':50470';
           configs['core-site']['fs.default.name'] = 'hdfs://' + targetHostName + ':8020';
         }
-        if (App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE'))
{
+        if (!App.get('isHaEnabled')) {
           if (App.Service.find().someProperty('serviceName', 'HBASE')) {
             configs['hbase-site']['hbase.rootdir'] = configs['hbase-site']['hbase.rootdir'].replace(/\/\/[^\/]*/,
'//' + targetHostName);
           }

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/controllers/main/service/reassign/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step6_controller.js b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
index c5f9218..34158e7 100644
--- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
@@ -31,7 +31,7 @@ App.ReassignMasterWizardStep6Controller = App.HighAvailabilityProgressPageContro
   hostComponents: [],
 
   loadStep: function () {
-    if (this.get('content.reassign.component_name') === 'NAMENODE' && !App.HostComponent.find().someProperty('componentName',
'SECONDARY_NAMENODE')) {
+    if (this.get('content.reassign.component_name') === 'NAMENODE' && App.get('isHaEnabled'))
{
       this.set('hostComponents', ['NAMENODE', 'ZKFC']);
     } else {
       this.set('hostComponents', [this.get('content.reassign.component_name')]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/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 ff5e1d8..a86c47f 100644
--- a/ambari-web/app/controllers/wizard/step5_controller.js
+++ b/ambari-web/app/controllers/wizard/step5_controller.js
@@ -243,7 +243,7 @@ App.WizardStep5Controller = Em.Controller.extend({
 
       if (item.component_name == 'SECONDARY_NAMENODE') {
         if (self.get('isAddServiceWizard')) {
-          if (!App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE'))
{
+          if (App.get('isHaEnabled')) {
             return;
           }
         }

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/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 eff6e03..5c19af7 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -117,7 +117,7 @@ App.WizardStep7Controller = Em.Controller.extend({
       });
 
       // Remove SNameNode if HA is enabled
-      if (!App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE'))
{
+      if (App.get('isHaEnabled')) {
         configs = serviceConfigs.findProperty('serviceName', 'HDFS').configs;
         var removedConfigs = configs.filterProperty('category', 'SNameNode');
         removedConfigs.map(function(config) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/mappers/server_data_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/server_data_mapper.js b/ambari-web/app/mappers/server_data_mapper.js
index 9c59d95..c4ec922 100644
--- a/ambari-web/app/mappers/server_data_mapper.js
+++ b/ambari-web/app/mappers/server_data_mapper.js
@@ -171,7 +171,7 @@ App.QuickDataMapper = App.ServerDataMapper.extend({
 //    }
     return json;
   }
-})
+});
 
 App.QuickDataMapper.componentServiceMap = {
   'NAMENODE': 'HDFS',
@@ -179,6 +179,7 @@ App.QuickDataMapper.componentServiceMap = {
   'DATANODE': 'HDFS',
   'HDFS_CLIENT': 'HDFS',
   'JOURNALNODE': 'HDFS',
+  'ZKFC': 'HDFS',
   'JOBTRACKER': 'MAPREDUCE',
   'TASKTRACKER': 'MAPREDUCE',
   'MAPREDUCE_CLIENT': 'MAPREDUCE',
@@ -211,4 +212,4 @@ App.QuickDataMapper.componentServiceMap = {
   'KERBEROS_CLIENT': 'KERBEROS',
   'HUE_SERVER': 'HUE',
   'GLUSTERFS_CLIENT': 'GLUSTERFS'
-}
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/templates/main/admin/highAvailability.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability.hbs b/ambari-web/app/templates/main/admin/highAvailability.hbs
index a29389e..71e76af 100644
--- a/ambari-web/app/templates/main/admin/highAvailability.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability.hbs
@@ -17,7 +17,7 @@
 }}
 
 <div>
-  {{#if view.isHighAvailabilityEnabled}}
+  {{#if App.isHaEnabled}}
     {{#if App.supports.autoRollbackHA}}
       <p class="text-success">
         {{t admin.highAvailability.enabled}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/views/main/admin/highAvailability_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/highAvailability_view.js b/ambari-web/app/views/main/admin/highAvailability_view.js
index c8d4cfa..83cfa05 100644
--- a/ambari-web/app/views/main/admin/highAvailability_view.js
+++ b/ambari-web/app/views/main/admin/highAvailability_view.js
@@ -23,10 +23,5 @@ App.MainAdminHighAvailabilityView = Em.View.extend({
 
   didInsertElement: function () {
     this.get('controller').setSecurityStatus();
-  },
-
-  isHighAvailabilityEnabled: function () {
-    return !App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE');
-  }.property()
-
+  }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/views/main/host/configs_service_menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/configs_service_menu.js b/ambari-web/app/views/main/host/configs_service_menu.js
index 3c5b40e..53d6a19 100644
--- a/ambari-web/app/views/main/host/configs_service_menu.js
+++ b/ambari-web/app/views/main/host/configs_service_menu.js
@@ -27,15 +27,15 @@ App.MainHostServiceMenuView = Em.CollectionView.extend({
     if (hostComponents) {
       hostComponents.forEach(function (hc) {
         var service = hc.get('service');
+        if (service) {
         var serviceName = service.get('serviceName');
-        if (serviceName) {
           if(!['PIG', 'SQOOP', 'HCATALOG', 'GANGLIA'].contains(serviceName)){
             if (!services.findProperty('serviceName', serviceName)) {
               services.push(service);
             }
           }
         } else {
-          console.warn("serviceName not found for " + hc.get('componentName'));
+          console.warn("service not found for " + hc.get('componentName'));
         }
       });
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/views/main/service/reassign/step2_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign/step2_view.js b/ambari-web/app/views/main/service/reassign/step2_view.js
index 662330d..b276438 100644
--- a/ambari-web/app/views/main/service/reassign/step2_view.js
+++ b/ambari-web/app/views/main/service/reassign/step2_view.js
@@ -21,7 +21,7 @@ var App = require('app');
 
 App.ReassignMasterWizardStep2View = App.WizardStep5View.extend({
   body: function () {
-    if (this.get('controller.content.reassign.component_name') === 'NAMENODE' &&
!App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE')) {
+    if (this.get('controller.content.reassign.component_name') === 'NAMENODE' &&
App.get('isHaEnabled')) {
       return Em.I18n.t('services.reassign.step2.body.namenodeHA').format(this.get('controller.content.reassign.display_name'));
     }
     return Em.I18n.t('services.reassign.step2.body').format(this.get('controller.content.reassign.display_name'));

http://git-wip-us.apache.org/repos/asf/ambari/blob/54791d17/ambari-web/app/views/main/service/reassign/step5_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/reassign/step5_view.js b/ambari-web/app/views/main/service/reassign/step5_view.js
index 09981cf..cd62ccb 100644
--- a/ambari-web/app/views/main/service/reassign/step5_view.js
+++ b/ambari-web/app/views/main/service/reassign/step5_view.js
@@ -31,7 +31,7 @@ App.ReassignMasterWizardStep5View = Em.View.extend({
     var sourceHost = this.get('controller.content.reassignHosts.source');
     var targetHost = this.get('controller.content.reassignHosts.target');
     var ha = '';
-    if (this.get('controller.content.reassign.component_name') === 'NAMENODE' &&
!App.HostComponent.find().someProperty('componentName', 'SECONDARY_NAMENODE')) {
+    if (this.get('controller.content.reassign.component_name') === 'NAMENODE' &&
App.get('isHaEnabled')) {
       ha = '_ha';
       var nnStartedHost = this.get('controller.content.masterComponentHosts').filterProperty('component',
'NAMENODE').mapProperty('hostName').without(this.get('controller.content.reassignHosts.target'));
     }


Mime
View raw message