|
@@ -249,71 +249,74 @@ App.ClusterController = Em.Controller.extend({
|
|
|
|
|
|
/**
|
|
|
* Order of loading:
|
|
|
- * 1. request for service components supported by stack
|
|
|
- * 2. load stack components to model
|
|
|
- * 3. request for services
|
|
|
- * 4. put services in cache
|
|
|
- * 5. request for hosts and host-components (single call)
|
|
|
- * 6. request for service metrics
|
|
|
- * 7. load host-components to model
|
|
|
- * 8. load hosts to model
|
|
|
- * 9. load services from cache with metrics to model
|
|
|
- * 10. update stale_configs of host-components (depends on App.supports.hostOverrides)
|
|
|
- * 11. load root service (Ambari)
|
|
|
- * 12. load alert definitions to model
|
|
|
- * 13. load unhealthy alert instances
|
|
|
- * 14. load security status
|
|
|
+ * 1. load all created service components
|
|
|
+ * 2. request for service components supported by stack
|
|
|
+ * 3. load stack components to model
|
|
|
+ * 4. request for services
|
|
|
+ * 5. put services in cache
|
|
|
+ * 6. request for hosts and host-components (single call)
|
|
|
+ * 7. request for service metrics
|
|
|
+ * 8. load host-components to model
|
|
|
+ * 9. load hosts to model
|
|
|
+ * 10. load services from cache with metrics to model
|
|
|
+ * 11. update stale_configs of host-components (depends on App.supports.hostOverrides)
|
|
|
+ * 12. load root service (Ambari)
|
|
|
+ * 13. load alert definitions to model
|
|
|
+ * 14. load unhealthy alert instances
|
|
|
+ * 15. load security status
|
|
|
*/
|
|
|
- self.loadStackServiceComponents(function (data) {
|
|
|
- data.items.forEach(function (service) {
|
|
|
- service.StackServices.is_selected = true;
|
|
|
- service.StackServices.is_installed = false;
|
|
|
- }, self);
|
|
|
- App.stackServiceMapper.mapStackServices(data);
|
|
|
- App.config.setPreDefinedServiceConfigs(true);
|
|
|
- var updater = App.router.get('updateController');
|
|
|
- self.updateLoadStatus('stackComponents');
|
|
|
- updater.updateServices(function () {
|
|
|
- self.updateLoadStatus('services');
|
|
|
- //force clear filters for hosts page to load all data
|
|
|
- App.db.setFilterConditions('mainHostController', null);
|
|
|
-
|
|
|
- updater.updateHost(function () {
|
|
|
- self.updateLoadStatus('hosts');
|
|
|
- });
|
|
|
+ self.loadServiceComponents(function () {
|
|
|
+ self.loadStackServiceComponents(function (data) {
|
|
|
+ data.items.forEach(function (service) {
|
|
|
+ service.StackServices.is_selected = true;
|
|
|
+ service.StackServices.is_installed = false;
|
|
|
+ }, self);
|
|
|
+ App.stackServiceMapper.mapStackServices(data);
|
|
|
+ App.config.setPreDefinedServiceConfigs(true);
|
|
|
+ var updater = App.router.get('updateController');
|
|
|
+ self.updateLoadStatus('stackComponents');
|
|
|
+ updater.updateServices(function () {
|
|
|
+ self.updateLoadStatus('services');
|
|
|
+ //force clear filters for hosts page to load all data
|
|
|
+ App.db.setFilterConditions('mainHostController', null);
|
|
|
+
|
|
|
+ updater.updateHost(function () {
|
|
|
+ self.updateLoadStatus('hosts');
|
|
|
+ });
|
|
|
|
|
|
- updater.updateServiceMetric(function () {
|
|
|
- App.config.loadConfigsFromStack(App.Service.find().mapProperty('serviceName')).complete(function() {
|
|
|
- updater.updateComponentConfig(function () {
|
|
|
- self.updateLoadStatus('componentConfigs');
|
|
|
- });
|
|
|
+ updater.updateServiceMetric(function () {
|
|
|
+ App.config.loadConfigsFromStack(App.Service.find().mapProperty('serviceName')).complete(function () {
|
|
|
+ updater.updateComponentConfig(function () {
|
|
|
+ self.updateLoadStatus('componentConfigs');
|
|
|
+ });
|
|
|
|
|
|
- updater.updateComponentsState(function () {
|
|
|
- self.updateLoadStatus('componentsState');
|
|
|
- });
|
|
|
- self.updateLoadStatus('serviceMetrics');
|
|
|
-
|
|
|
- updater.updateAlertGroups(function () {
|
|
|
- updater.updateAlertDefinitions(function() {
|
|
|
- updater.updateAlertDefinitionSummary(function () {
|
|
|
- updater.updateUnhealthyAlertInstances(function () {
|
|
|
- self.updateLoadStatus('alertGroups');
|
|
|
- self.updateLoadStatus('alertDefinitions');
|
|
|
- self.updateLoadStatus('alertInstancesUnhealthy');
|
|
|
+ updater.updateComponentsState(function () {
|
|
|
+ self.updateLoadStatus('componentsState');
|
|
|
+ });
|
|
|
+ self.updateLoadStatus('serviceMetrics');
|
|
|
+
|
|
|
+ updater.updateAlertGroups(function () {
|
|
|
+ updater.updateAlertDefinitions(function () {
|
|
|
+ updater.updateAlertDefinitionSummary(function () {
|
|
|
+ updater.updateUnhealthyAlertInstances(function () {
|
|
|
+ self.updateLoadStatus('alertGroups');
|
|
|
+ self.updateLoadStatus('alertDefinitions');
|
|
|
+ self.updateLoadStatus('alertInstancesUnhealthy');
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
- });
|
|
|
- self.loadRootService().done(function (data) {
|
|
|
- App.rootServiceMapper.map(data);
|
|
|
- self.updateLoadStatus('rootService');
|
|
|
- });
|
|
|
- // load security status
|
|
|
- App.router.get('mainAdminKerberosController').getSecurityStatus().always(function() {
|
|
|
- self.updateLoadStatus('securityStatus');
|
|
|
+ self.loadRootService().done(function (data) {
|
|
|
+ App.rootServiceMapper.map(data);
|
|
|
+ self.updateLoadStatus('rootService');
|
|
|
+ });
|
|
|
+ // load security status
|
|
|
+ App.router.get('mainAdminKerberosController').getSecurityStatus().always(function () {
|
|
|
+ self.updateLoadStatus('securityStatus');
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
},
|
|
@@ -361,6 +364,36 @@ App.ClusterController = Em.Controller.extend({
|
|
|
}, callback)
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * Load data about created service components
|
|
|
+ * @param callback
|
|
|
+ */
|
|
|
+ loadServiceComponents: function (callback) {
|
|
|
+ App.ajax.send({
|
|
|
+ name: 'service.components.load',
|
|
|
+ sender: this,
|
|
|
+ data: {
|
|
|
+ callback: callback
|
|
|
+ },
|
|
|
+ success: 'loadStackServiceComponentsSuccess'
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Callback for load service components request
|
|
|
+ * @param data
|
|
|
+ * @param request
|
|
|
+ * @param params
|
|
|
+ */
|
|
|
+ loadStackServiceComponentsSuccess: function (data, request, params) {
|
|
|
+ var serviceComponents = [];
|
|
|
+ data.items.forEach(function (service) {
|
|
|
+ serviceComponents = serviceComponents.concat(service.components.mapProperty('ServiceComponentInfo.component_name'));
|
|
|
+ });
|
|
|
+ App.serviceComponents = serviceComponents;
|
|
|
+ params.callback();
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param callback
|