Browse Source

AMBARI-9908 add quicklinks and host config substitution for accumulo (billie)

Billie Rinaldi 10 years ago
parent
commit
434ce972e7

+ 3 - 0
ambari-web/app/controllers/main/host/details.js

@@ -949,6 +949,9 @@ App.MainHostDetailsController = Em.Controller.extend({
     if (configs['hbase-site']) {
       configs['hbase-site']['hbase.zookeeper.quorum'] = zks.join(',');
     }
+    if (configs['accumulo-site']) {
+      configs['accumulo-site']['instance.zookeeper.host'] = zksWithPort;
+    }
     if (configs['webhcat-site']) {
       configs['webhcat-site']['templeton.zookeeper.hosts'] = zksWithPort;
     }

+ 3 - 0
ambari-web/app/controllers/main/service/reassign/step4_controller.js

@@ -661,6 +661,9 @@ App.ReassignMasterWizardStep4Controller = App.HighAvailabilityProgressPageContro
     if (!App.get('isHaEnabled') && App.Service.find('HBASE').get('isLoaded')) {
       configs['hbase-site']['hbase.rootdir'] = configs['hbase-site']['hbase.rootdir'].replace(/\/\/[^\/]*/, '//' + targetHostName + ':8020');
     }
+    if (!App.get('isHaEnabled') && App.Service.find('ACCUMULO').get('isLoaded')) {
+      configs['accumulo-site']['instance.volumes'] = configs['accumulo-site']['instance.volumes'].replace(/\/\/[^\/]*/, '//' + targetHostName + ':8020');
+    }
   },
 
   /**

+ 2 - 1
ambari-web/app/mappers/service_metrics_mapper.js

@@ -359,7 +359,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       STORM: [31],
       FALCON: [32],
       RANGER: [33],
-      SPARK: [34]
+      SPARK: [34],
+      ACCUMULO: [35]
     };
     if (quickLinks[item.ServiceInfo.service_name])
       finalJson.quick_links = quickLinks[item.ServiceInfo.service_name];

+ 11 - 0
ambari-web/app/models/quick_links.js

@@ -311,5 +311,16 @@ App.QuickLinks.FIXTURES = [
     site: 'spark-defaults',
     regex: '^(\\d+)$',
     default_http_port: 18080
+  },
+  {
+    id:35,
+    label:'Accumulo Monitor UI',
+    url:'%@://%@:%@/',
+    service_id: 'ACCUMULO',
+    template:'%@://%@:%@/',
+    http_config: 'monitor.port.client',
+    site: 'accumulo-site',
+    regex: '^(\\d+)$',
+    default_http_port: 50095
   }
 ];

+ 5 - 0
ambari-web/app/models/service_config.js

@@ -316,6 +316,10 @@ App.ServiceConfigProperty = Em.Object.extend({
         var nnHost = masterComponentHostsInDB.filterProperty('component', 'NAMENODE').mapProperty('hostName');
         this.setDefaultValue(hostWithPrefix,'://' + nnHost);
         break;
+      case 'instance.volumes':
+        var nnHost = masterComponentHostsInDB.filterProperty('component', 'NAMENODE').mapProperty('hostName');
+        this.setDefaultValue(hostWithPrefix,'://' + nnHost);
+        break;
       case 'snamenode_host':
         // Secondary NameNode does not exist when NameNode HA is enabled
         var snn = masterComponentHostsInDB.findProperty('component', 'SECONDARY_NAMENODE');
@@ -556,6 +560,7 @@ App.ServiceConfigProperty = Em.Object.extend({
       case 'templeton.zookeeper.hosts':
       case 'hadoop.registry.zk.quorum':
       case 'hive.cluster.delegation.token.store.zookeeper.connectString':
+      case 'instance.zookeeper.host': // for accumulo
         var zkHosts = masterComponentHostsInDB.filterProperty('component', 'ZOOKEEPER_SERVER').mapProperty('hostName');
         var zkHostPort = zkHosts;
         var regex = "\\w*:(\\d+)";   //regex to fetch the port

+ 3 - 0
ambari-web/app/views/common/quick_view_link_view.js

@@ -268,6 +268,9 @@ App.QuickViewLinks = Em.View.extend({
       case "STORM":
         hosts[0] = this.findComponentHost(response.items, "STORM_UI_SERVER");
         break;
+      case "ACCUMULO":
+        hosts[0] = this.findComponentHost(response.items, "ACCUMULO_MONITOR");
+        break;
       default:
         var service = App.StackService.find().findProperty('serviceName', serviceName);
         if (service && service.get('hasMaster')) {

+ 6 - 2
ambari-web/test/controllers/main/service/reassign/step4_controller_test.js

@@ -729,13 +729,13 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
       App.get.restore();
       App.Service.find.restore();
     });
-    it('HA isn\'t enabled and no HBASE service', function () {
+    it('HA isn\'t enabled and no HBASE or ACCUMULO service', function () {
       isHaEnabled = false;
       var configs = {};
       controller.setSpecificNamenodeConfigs(configs, 'host1');
       expect(configs).to.eql({});
     });
-    it('HA isn\'t enabled and HBASE service', function () {
+    it('HA isn\'t enabled and HBASE and ACCUMULO service', function () {
       isHaEnabled = false;
       service = Em.Object.create({
         isLoaded: true
@@ -743,10 +743,14 @@ describe('App.ReassignMasterWizardStep4Controller', function () {
       var configs = {
         'hbase-site': {
           'hbase.rootdir': 'hdfs://localhost:8020/apps/hbase/data'
+        },
+        'accumulo-site': {
+          'instance.volumes': 'hdfs://localhost:8020/apps/accumulo/data'
         }
       };
       controller.setSpecificNamenodeConfigs(configs, 'host1');
       expect(configs['hbase-site']['hbase.rootdir']).to.equal('hdfs://host1:8020/apps/hbase/data');
+      expect(configs['accumulo-site']['instance.volumes']).to.equal('hdfs://host1:8020/apps/accumulo/data');
     });
     it('HA enabled and namenode 1', function () {
       isHaEnabled = true;