Forráskód Böngészése

AMBARI-1941. Create a flag to toggle the support for multiple HBase Masters. (jaimin)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1468270 13f79535-47bb-0310-9956-ffa450edef68
Jaimin Jetly 12 éve
szülő
commit
58d1aa58a1

+ 3 - 0
CHANGES.txt

@@ -258,6 +258,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1941. Create a flag to toggle the support for multiple
+ HBase Masters. (jaimin)
+
  AMBARI-1940. Create a flag to toggle the support for additional database 
  support in Hive and Oozie. (jaimin)
 

+ 2 - 1
ambari-web/app/config.js

@@ -47,7 +47,8 @@ App.supports = {
   stackUpgrade: false,
   capacitySchedulerUi: false,
   startStopAllServices: false,
-  hiveOozieExtraDatabases: false
+  hiveOozieExtraDatabases: false,
+  multipleHBaseMasters: false
 };
 
 if (App.enableExperimental) {

+ 4 - 2
ambari-web/app/controllers/wizard/step5_controller.js

@@ -71,7 +71,9 @@ App.WizardStep5Controller = Em.Controller.extend({
     this.renderComponents(this.loadComponents());
 
     this.updateComponent('ZOOKEEPER_SERVER');
-    this.updateComponent('HBASE_MASTER');
+    if(App.supports.multipleHBaseMasters){
+      this.updateComponent('HBASE_MASTER');
+    }
 
     if (!this.get("selectedServicesMasters").filterProperty('isInstalled', false).length) {
       console.log('no master components to add');
@@ -216,7 +218,7 @@ App.WizardStep5Controller = Em.Controller.extend({
       if (item.display_name === "ZooKeeper") {
         componentObj.set('zId', zid++);
         componentObj.set("showRemoveControl", showRemoveControlZk);
-      } else if(item.component_name === "HBASE_MASTER"){
+      } else if(App.supports.multipleHBaseMasters && item.component_name === "HBASE_MASTER"){
         componentObj.set('zId', hid++);
         componentObj.set("showRemoveControl", showRemoveControlHb);
       }

+ 5 - 2
ambari-web/app/controllers/wizard/step6_controller.js

@@ -186,7 +186,7 @@ App.WizardStep6Controller = Em.Controller.extend({
     var headers = [];
 
     if (this.get('isMasters')) {
-      if (this.isServiceSelected('HBASE')) {
+      if (this.isServiceSelected('HBASE') && App.supports.multipleHBaseMasters) {
         headers.pushObject(Em.Object.create({
           name: 'HBASE_MASTER',
           label: self.getComponentDisplayName('HBASE_MASTER')
@@ -368,7 +368,10 @@ App.WizardStep6Controller = Em.Controller.extend({
       masterComponentHosts.forEach(function(item) {
         var host = hostsObj.findProperty('hostName', item.hostName);
         if (host) {
-          host.get('checkboxes').findProperty('title', item.display_name).set('checked', true);
+          var checkbox = host.get('checkboxes').findProperty('title', item.display_name);
+          if(checkbox){
+            checkbox.set('checked', true);
+          }
         }
       });
     }

+ 1 - 1
ambari-web/app/models/service.js

@@ -48,7 +48,7 @@ App.Service = DS.Model.extend({
   updateHealthStatus: function () {
     // console.log('model:service.healthStatus ' + this.get('serviceName'));
     var components = this.get('hostComponents').filterProperty('isMaster', true);
-    var isGreen = (this.get('serviceName') === 'HBASE' ?
+    var isGreen = (this.get('serviceName') === 'HBASE' && App.supports.multipleHBaseMasters ?
       components.someProperty('workStatus', App.HostComponentStatus.started) :
       components.everyProperty('workStatus', App.HostComponentStatus.started)) ;
 

+ 1 - 1
ambari-web/app/templates/main/dashboard/service/hbase.hbs

@@ -46,7 +46,7 @@
         <td>{{t dashboard.services.hbase.masterServer}}</td>
         <td>
             {{#if view.activeMaster}}
-              <a href="#" {{action showDetails view.activeMaster.host}}>{{t service.hbase.activeMaster}}</a>
+              <a href="#" {{action showDetails view.activeMaster.host}}>{{view.activeMasterTitle}}</a>
               {{#if view.passiveMasters.length}}
                   {{view.passiveMasterOutput}}
               {{/if}}

+ 1 - 1
ambari-web/app/utils/ajax.js

@@ -598,7 +598,7 @@ var urls = {
     }
   },
   'wizard.step9.add_host.launch_start_services': {
-    'real': '/clusters/{cluste}/host_components?(HostRoles/component_name=GANGLIA_MONITOR|HostRoles/component_name=HBASE_REGIONSERVER|HostRoles/component_name=DATANODE|HostRoles/component_name=TASKTRACKER)&(HostRoles/state=INSTALLED)',
+    'real': '/clusters/{cluster}/host_components?(HostRoles/component_name=GANGLIA_MONITOR|HostRoles/component_name=HBASE_REGIONSERVER|HostRoles/component_name=DATANODE|HostRoles/component_name=TASKTRACKER)&(HostRoles/state=INSTALLED)',
     'mock': '/data/wizard/deploy/5_hosts/poll_6.json',
     'format': function (data, opt) {
       return {

+ 17 - 2
ambari-web/app/views/main/dashboard/service/hbase.js

@@ -31,7 +31,10 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
    * Passive master components
    */
   passiveMasters: function () {
-    return this.get('masters').filterProperty('haStatus', 'passive');
+    if(App.supports.multipleHBaseMasters){
+      return this.get('masters').filterProperty('haStatus', 'passive');
+    }
+    return [];
   }.property('masters'),
   /**
    * Formatted output for passive master components
@@ -43,9 +46,21 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
    * One(!) active master component
    */
   activeMaster: function () {
-    return this.get('masters').findProperty('haStatus', 'active');
+    if(App.supports.multipleHBaseMasters){
+      return this.get('masters').findProperty('haStatus', 'active');
+    } else {
+      return this.get('masters')[0];
+    }
   }.property('masters'),
 
+  activeMasterTitle: function(){
+    if(App.supports.multipleHBaseMasters){
+      return this.t('service.hbase.activeMaster');
+    } else {
+      return this.get('activeMaster.host.publicHostName');
+    }
+  }.property('activeMaster'),
+
   masterServerHeapSummary: function () {
     var heapUsed = this.get('service').get('heapMemoryUsed');
     var heapMax = this.get('service').get('heapMemoryMax');