ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-16160. Ranger Tagsync status is not shown under Summary Tab when installed (akovalenko)
Date Thu, 28 Apr 2016 21:59:49 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 51480ecac -> c91f07ea8


AMBARI-16160. Ranger Tagsync status is not shown under Summary Tab when installed (akovalenko)


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

Branch: refs/heads/trunk
Commit: c91f07ea858fa692bca2ee1536434930f71ab90b
Parents: 51480ec
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Thu Apr 28 17:27:03 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Fri Apr 29 00:59:31 2016 +0300

----------------------------------------------------------------------
 .../app/mappers/components_state_mapper.js      |  5 ++++
 .../app/mappers/service_metrics_mapper.js       | 25 ++++++++++++++++---
 ambari-web/app/messages.js                      |  2 ++
 ambari-web/app/models.js                        |  1 +
 ambari-web/app/models/service.js                |  1 +
 ambari-web/app/models/service/ranger.js         | 26 ++++++++++++++++++++
 .../templates/main/service/services/ranger.hbs  | 18 ++++++++++++++
 .../app/views/main/service/services/ranger.js   |  4 +++
 8 files changed, 78 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c91f07ea/ambari-web/app/mappers/components_state_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/components_state_mapper.js b/ambari-web/app/mappers/components_state_mapper.js
index 96eb52b..eb9ebd5 100644
--- a/ambari-web/app/mappers/components_state_mapper.js
+++ b/ambari-web/app/mappers/components_state_mapper.js
@@ -90,6 +90,11 @@ App.componentsStateMapper = App.QuickDataMapper.create({
       super_visors_installed: 'INSTALLED_PATH',
       super_visors_total: 'TOTAL_PATH'
     },
+    'RANGER_TAGSYNC': {
+      ranger_tagsyncs_started: 'STARTED_PATH',
+      ranger_tagsyncs_installed: 'INSTALLED_PATH',
+      ranger_tagsyncs_total: 'TOTAL_PATH'
+    },
     'MAPREDUCE2_CLIENT': {
       map_reduce2_clients: 'INSTALLED_PATH'
     },

http://git-wip-us.apache.org/repos/asf/ambari/blob/c91f07ea/ambari-web/app/mappers/service_metrics_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js b/ambari-web/app/mappers/service_metrics_mapper.js
index 1733382..d862df7 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -133,6 +133,11 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     super_visors_installed: 'super_visors_installed',
     super_visors_total: 'super_visors_total'
   },
+  rangerConfig: {
+    ranger_tagsyncs_started: 'ranger_tagsyncs_started',
+    ranger_tagsyncs_installed: 'ranger_tagsyncs_installed',
+    ranger_tagsyncs_total: 'ranger_tagsyncs_total'
+  },
   flumeConfig: {
     flume_handlers_total: 'flume_handlers_total'
   },
@@ -299,6 +304,10 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       finalJson.rand = Math.random();
       this.mapQuickLinks(finalJson, item);
       App.store.load(App.StormService, finalJson);
+    } else if (item && item.ServiceInfo && item.ServiceInfo.service_name
== "RANGER") {
+      finalJson = this.rangerMapper(item);
+      finalJson.rand = Math.random();
+      App.store.load(App.RangerService, finalJson);
     } else {
       finalJson = this.parseIt(item, this.config);
       finalJson.rand = Math.random();
@@ -610,8 +619,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       component.host_components[activeHostComponentIndex] = component.host_components[0];
       component.host_components[0] = tmp;
     }
-  }
-  ,
+  },
 
   /**
    * Flume is different from other services, in that the important
@@ -639,8 +647,7 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       });
     });
     return finalJson;
-  }
-  ,
+  },
 
   /**
    * Storm mapper
@@ -674,5 +681,15 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     });
     item.restApiComponent = restApiMetrics;
     return this.parseIt(item, finalConfig);
+  },
+
+  /**
+   * Ranger mapper
+   */
+  rangerMapper: function (item) {
+    var finalConfig = jQuery.extend({}, this.config);
+    var rangerConfig = this.rangerConfig;
+        finalConfig = jQuery.extend({}, finalConfig, rangerConfig);
+    return this.parseIt(item, finalConfig);
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/c91f07ea/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index e195b7a..1a624d4 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2725,6 +2725,8 @@ Em.I18n.translations = {
   'dashboard.services.hbase.masterStarted':'Master Started',
   'dashboard.services.hbase.masterActivated':'Master Activated',
 
+  'dashboard.services.ranger.rangerTagsyncs':'Ranger Tagsyncs',
+
   'dashboard.services.components.started':'started',
   'dashboard.services.components.stopped':'stopped',
   'dashboard.services.components.total':'in total',

http://git-wip-us.apache.org/repos/asf/ambari/blob/c91f07ea/ambari-web/app/models.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models.js b/ambari-web/app/models.js
index 575c0b0..b877255 100644
--- a/ambari-web/app/models.js
+++ b/ambari-web/app/models.js
@@ -44,6 +44,7 @@ require('models/service/mapreduce2');
 require('models/service/hbase');
 require('models/service/flume');
 require('models/service/storm');
+require('models/service/ranger');
 require('models/alerts/alert_definition');
 require('models/alerts/alert_instance');
 require('models/alerts/alert_instance_local');

http://git-wip-us.apache.org/repos/asf/ambari/blob/c91f07ea/ambari-web/app/models/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index 34abbd2..c648e93 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -246,6 +246,7 @@ App.Service.extendedModel = {
   'YARN': 'YARNService',
   'MAPREDUCE2': 'MapReduce2Service',
   'STORM': 'StormService',
+  'RANGER': 'RangerService',
   'FLUME': 'FlumeService'
 };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c91f07ea/ambari-web/app/models/service/ranger.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/ranger.js b/ambari-web/app/models/service/ranger.js
new file mode 100644
index 0000000..b6f99e1
--- /dev/null
+++ b/ambari-web/app/models/service/ranger.js
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+var App = require('app');
+
+App.RangerService = App.Service.extend({
+  rangerTagsyncsStarted: DS.attr('number'),
+  rangerTagsyncsInstalled: DS.attr('number'),
+  rangerTagsyncsTotal: DS.attr('number')
+});
+
+App.RangerService.FIXTURES = [];

http://git-wip-us.apache.org/repos/asf/ambari/blob/c91f07ea/ambari-web/app/templates/main/service/services/ranger.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/ranger.hbs b/ambari-web/app/templates/main/service/services/ranger.hbs
index bdd8269..5c2c1f2 100644
--- a/ambari-web/app/templates/main/service/services/ranger.hbs
+++ b/ambari-web/app/templates/main/service/services/ranger.hbs
@@ -18,6 +18,24 @@
 
 {{view view.dashboardMasterComponentView}}
 
+<!-- Ranger Tagsyncs -->
+<tr {{bindAttr class=":component view.rangerTagsyncComponent.componentName"}}>
+  <td class="summary-label">
+    <a href="#" {{action filterHosts view.rangerTagsyncComponent}}>{{t dashboard.services.ranger.rangerTagsyncs}}</a>
+  </td>
+  <td class="summary-value">
+    {{#if App.router.clusterController.isServiceContentFullyLoaded}}
+      <span>
+        {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.rangerTagsyncsStarted"
totalComponentsBinding="view.service.rangerTagsyncsTotal"}}
+          {{view.liveComponents}}/{{view.totalComponents}}
+        {{/view}}
+      </span>{{t common.started}}
+    {{else}}
+      {{t common.loading.eclipses}}
+    {{/if}}
+  </td>
+</tr>
+
 {{#each item in controller.rangerPlugins}}
   {{#if item.isDisplayed}}
     <tr class="ranger-plugin">

http://git-wip-us.apache.org/repos/asf/ambari/blob/c91f07ea/ambari-web/app/views/main/service/services/ranger.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/ranger.js b/ambari-web/app/views/main/service/services/ranger.js
index 9654946..b33758b 100644
--- a/ambari-web/app/views/main/service/services/ranger.js
+++ b/ambari-web/app/views/main/service/services/ranger.js
@@ -23,6 +23,10 @@ App.MainDashboardServiceRangerView = App.MainDashboardServiceView.extend({
 
   serviceName: 'RANGER',
 
+  rangerTagsyncComponent: Em.Object.create({
+    componentName: 'RANGER_TAGSYNC'
+  }),
+
   didInsertElement: function () {
     this.set('controller.isRangerUpdateWorking', true);
     App.updater.run(this.get('controller'), 'updateRangerPluginsStatus', 'isRangerUpdateWorking',
App.bgOperationsUpdateInterval);


Mime
View raw message