|
@@ -24,7 +24,6 @@ App.YARNService = App.Service.extend({
|
|
|
nodeManagerNodes: DS.hasMany('App.Host'),
|
|
|
nodeManagerLiveNodes: DS.hasMany('App.Host'),
|
|
|
nodeManagersCountActive: DS.attr('number'),
|
|
|
- nodeManagersCountLost: DS.attr('number'),
|
|
|
nodeManagersCountUnhealthy: DS.attr('number'),
|
|
|
nodeManagersCountRebooted: DS.attr('number'),
|
|
|
nodeManagersCountDecommissioned: DS.attr('number'),
|
|
@@ -85,6 +84,21 @@ App.YARNService = App.Service.extend({
|
|
|
this.set('allQueueNames', allQueueNames);
|
|
|
this.set('childQueueNames', childQueueNames);
|
|
|
}.observes('queue'),
|
|
|
+ /**
|
|
|
+ * ResourceManager's lost count is not accurate once RM is rebooted. Since
|
|
|
+ * Ambari knows the total number of nodes and the counts of nodes in other
|
|
|
+ * states, we calculate the lost count.
|
|
|
+ */
|
|
|
+ nodeManagersCountLost: function () {
|
|
|
+ var allNMs = this.get('nodeManagerNodes');
|
|
|
+ var totalCount = allNMs != null ? allNMs.get('length') : 0;
|
|
|
+ var activeCount = this.get('nodeManagersCountActive');
|
|
|
+ var rebootedCount = this.get('nodeManagersCountRebooted');
|
|
|
+ var unhealthyCount = this.get('nodeManagersCountUnhealthy');
|
|
|
+ var decomCount = this.get('nodeManagersCountDecommissioned');
|
|
|
+ var nonLostHostsCount = activeCount + rebootedCount + decomCount + unhealthyCount;
|
|
|
+ return totalCount >= nonLostHostsCount ? totalCount - nonLostHostsCount : 0;
|
|
|
+ }.property('nodeManagerNodes', 'nodeManagersCountActive', 'nodeManagersCountRebooted', 'nodeManagersCountUnhealthy', 'nodeManagersCountDecommissioned'),
|
|
|
});
|
|
|
|
|
|
App.YARNService.FIXTURES = [];
|