ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-4278. Dashboard: switching dashboard to classic view produces js error. (alexantonenko)
Date Mon, 13 Jan 2014 17:53:05 GMT
Updated Branches:
  refs/heads/trunk 6c6f00122 -> e8c40593c


AMBARI-4278. Dashboard: switching dashboard to classic view produces js error. (alexantonenko)


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

Branch: refs/heads/trunk
Commit: e8c40593cecabb177a7cbad23288bdf8caab23f6
Parents: 6c6f001
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Mon Jan 13 19:48:48 2014 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Mon Jan 13 19:48:48 2014 +0200

----------------------------------------------------------------------
 .../app/controllers/main/host/add_controller.js |  2 +-
 ambari-web/app/mappers/server_data_mapper.js    | 86 ++++++++++----------
 ambari-web/app/mappers/status_mapper.js         |  2 +-
 ambari-web/app/messages.js                      |  1 +
 .../views/main/dashboard/service/mapreduce2.js  |  8 +-
 5 files changed, 53 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e8c40593/ambari-web/app/controllers/main/host/add_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/add_controller.js b/ambari-web/app/controllers/main/host/add_controller.js
index aa41b2e..81eb0bb 100644
--- a/ambari-web/app/controllers/main/host/add_controller.js
+++ b/ambari-web/app/controllers/main/host/add_controller.js
@@ -359,7 +359,7 @@ App.AddHostController = App.WizardController.extend({
     var slaveComponentHosts = this.get('content.slaveComponentHosts');
     var selectedServices = [];
     var selectedClientHosts = slaveComponentHosts.findProperty('componentName', 'CLIENT').hosts.mapProperty('hostName');
-    var componentServiceMap = App.QuickDataMapper.componentServiceMap;
+    var componentServiceMap = App.QuickDataMapper.componentServiceMap();
 
     slaveComponentHosts.forEach(function (slave) {
       if (slave.hosts.length > 0) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8c40593/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 4e522f2..5f16a86 100644
--- a/ambari-web/app/mappers/server_data_mapper.js
+++ b/ambari-web/app/mappers/server_data_mapper.js
@@ -174,46 +174,48 @@ App.QuickDataMapper = App.ServerDataMapper.extend({
   }
 });
 
-App.QuickDataMapper.componentServiceMap = {
-  'NAMENODE': 'HDFS',
-  'SECONDARY_NAMENODE': 'HDFS',
-  'DATANODE': 'HDFS',
-  'HDFS_CLIENT': 'HDFS',
-  'JOURNALNODE': 'HDFS',
-  'ZKFC': 'HDFS',
-  'JOBTRACKER': 'MAPREDUCE',
-  'TASKTRACKER': 'MAPREDUCE',
-  'MAPREDUCE_CLIENT': 'MAPREDUCE',
-  'MAPREDUCE2_CLIENT': 'MAPREDUCE2',
-  'HISTORYSERVER': App.get('isHadoop2Stack') ? 'MAPREDUCE2' : 'MAPREDUCE',
-  'TEZ_CLIENT': 'TEZ',
-  'RESOURCEMANAGER': 'YARN',
-  'YARN_CLIENT': 'YARN',
-  'NODEMANAGER': 'YARN',
-  'ZOOKEEPER_SERVER': 'ZOOKEEPER',
-  'ZOOKEEPER_CLIENT': 'ZOOKEEPER',
-  'HBASE_MASTER': 'HBASE',
-  'HBASE_REGIONSERVER': 'HBASE',
-  'HBASE_CLIENT': 'HBASE',
-  'PIG': 'PIG',
-  'SQOOP': 'SQOOP',
-  'OOZIE_SERVER': 'OOZIE',
-  'OOZIE_CLIENT': 'OOZIE',
-  'HIVE_SERVER': 'HIVE',
-  'HIVE_METASTORE': 'HIVE',
-  'HIVE_CLIENT': 'HIVE',
-  'MYSQL_SERVER': 'HIVE',
-  'HCAT': 'HCATALOG',
-  'WEBHCAT_SERVER': 'WEBHCAT',
-  'NAGIOS_SERVER': 'NAGIOS',
-  'GANGLIA_SERVER': 'GANGLIA',
-  'GANGLIA_MONITOR': 'GANGLIA',
-  'KERBEROS_SERVER': 'KERBEROS',
-  'KERBEROS_ADMIN_CLIENT': 'KERBEROS',
-  'KERBEROS_CLIENT': 'KERBEROS',
-  'HUE_SERVER': 'HUE',
-  'GLUSTERFS_CLIENT': 'GLUSTERFS',
-  'FALCON_SERVER': 'FALCON',
-  'NIMBUS': 'STORM',
-  'SUPERVISOR': 'STORM'
+App.QuickDataMapper.componentServiceMap = function () {
+  return {
+    'NAMENODE': 'HDFS',
+    'SECONDARY_NAMENODE': 'HDFS',
+    'DATANODE': 'HDFS',
+    'HDFS_CLIENT': 'HDFS',
+    'JOURNALNODE': 'HDFS',
+    'ZKFC': 'HDFS',
+    'JOBTRACKER': 'MAPREDUCE',
+    'TASKTRACKER': 'MAPREDUCE',
+    'MAPREDUCE_CLIENT': 'MAPREDUCE',
+    'MAPREDUCE2_CLIENT': 'MAPREDUCE2',
+    'HISTORYSERVER': App.get('isHadoop2Stack') ? 'MAPREDUCE2' : 'MAPREDUCE',
+    'TEZ_CLIENT': 'TEZ',
+    'RESOURCEMANAGER': 'YARN',
+    'YARN_CLIENT': 'YARN',
+    'NODEMANAGER': 'YARN',
+    'ZOOKEEPER_SERVER': 'ZOOKEEPER',
+    'ZOOKEEPER_CLIENT': 'ZOOKEEPER',
+    'HBASE_MASTER': 'HBASE',
+    'HBASE_REGIONSERVER': 'HBASE',
+    'HBASE_CLIENT': 'HBASE',
+    'PIG': 'PIG',
+    'SQOOP': 'SQOOP',
+    'OOZIE_SERVER': 'OOZIE',
+    'OOZIE_CLIENT': 'OOZIE',
+    'HIVE_SERVER': 'HIVE',
+    'HIVE_METASTORE': 'HIVE',
+    'HIVE_CLIENT': 'HIVE',
+    'MYSQL_SERVER': 'HIVE',
+    'HCAT': 'HCATALOG',
+    'WEBHCAT_SERVER': 'WEBHCAT',
+    'NAGIOS_SERVER': 'NAGIOS',
+    'GANGLIA_SERVER': 'GANGLIA',
+    'GANGLIA_MONITOR': 'GANGLIA',
+    'KERBEROS_SERVER': 'KERBEROS',
+    'KERBEROS_ADMIN_CLIENT': 'KERBEROS',
+    'KERBEROS_CLIENT': 'KERBEROS',
+    'HUE_SERVER': 'HUE',
+    'GLUSTERFS_CLIENT': 'GLUSTERFS',
+    'FALCON_SERVER': 'FALCON',
+    'NIMBUS': 'STORM',
+    'SUPERVISOR': 'STORM'
+  }
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8c40593/ambari-web/app/mappers/status_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/status_mapper.js b/ambari-web/app/mappers/status_mapper.js
index 2c37933..721fe38 100644
--- a/ambari-web/app/mappers/status_mapper.js
+++ b/ambari-web/app/mappers/status_mapper.js
@@ -29,7 +29,7 @@ App.statusMapper = App.QuickDataMapper.create({
       var hostStatuses = {};
       var addedHostComponents = [];
       var updatedHostComponents = [];
-      var componentServiceMap = App.QuickDataMapper.componentServiceMap;
+      var componentServiceMap = App.QuickDataMapper.componentServiceMap();
       var currentComponentStatuses = {};
       var currentHostStatuses = {};
       var hostComponentsOnService = {};

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8c40593/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index ea1500d..bb7b938 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1273,6 +1273,7 @@ Em.I18n.translations = {
 
   'services.mapreduce2.history.running': 'History server is running',
   'services.mapreduce2.history.stopped': 'History server is stopped',
+  'services.mapreduce2.history.unknown': 'History server status is unknown',
   'services.mapreduce2.smokeTest.requirement': 'MapReduce2 smoke test requires YARN service
be started',
 
   'services.mapReduce.config.addQueue':'Add Queue',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8c40593/ambari-web/app/views/main/dashboard/service/mapreduce2.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/mapreduce2.js b/ambari-web/app/views/main/dashboard/service/mapreduce2.js
index a6b4d9c..1b35765 100644
--- a/ambari-web/app/views/main/dashboard/service/mapreduce2.js
+++ b/ambari-web/app/views/main/dashboard/service/mapreduce2.js
@@ -23,8 +23,12 @@ App.MainDashboardServiceMapreduce2View = App.MainDashboardServiceView.extend({
 
     titleInfo: function(){
       var hs = this.get('service.hostComponents').findProperty('componentName', 'HISTORYSERVER');
-      if(hs.get('workStatus') === App.HostComponentStatus.started)
+      if (!hs) {
+        return this.t('services.mapreduce2.history.unknown');
+      } else if (hs.get('workStatus') === App.HostComponentStatus.started) {
         return this.t('services.mapreduce2.history.running');
-      return this.t('services.mapreduce2.history.stopped');
+      } else {
+        return this.t('services.mapreduce2.history.stopped');
+      }
     }.property('service')
   });
\ No newline at end of file


Mime
View raw message