Example #1
0
App.MapReduceService = App.Service.extend({
  version: DS.attr('string'),
  jobHistoryServer: function () {
    return this.get('hostComponents').findProperty('componentName', 'HISTORYSERVER');
  }.property('hostComponents'),
  jobTracker: function () {
    return this.get('hostComponents').findProperty('componentName', 'JOBTRACKER');
  }.property('hostComponents'),
  taskTrackersStarted: DS.attr('number'),
  taskTrackersInstalled: DS.attr('number'),
  taskTrackersTotal: DS.attr('number'),
  jobTrackerStartTime: DS.attr('number'),
  jobTrackerHeapUsed: DS.attr('number'),
  jobTrackerHeapMax: DS.attr('number'),
  aliveTrackers: DS.hasMany('App.HostComponent'),
  blackListTrackers: DS.hasMany('App.HostComponent'),
  grayListTrackers: DS.hasMany('App.HostComponent'),
  mapSlots: DS.attr('number'),
  reduceSlots: DS.attr('number'),
  jobsSubmitted: DS.attr('number'),
  jobsCompleted: DS.attr('number'),
  jobsRunning: DS.attr('number'),
  mapSlotsOccupied: DS.attr('number'),
  mapSlotsReserved: DS.attr('number'),
  reduceSlotsOccupied: DS.attr('number'),
  reduceSlotsReserved: DS.attr('number'),
  mapsRunning: DS.attr('number'),
  mapsWaiting: DS.attr('number'),
  reducesRunning: DS.attr('number'),
  reducesWaiting: DS.attr('number'),
  trackersDecommissioned: DS.attr('number'),
  jobTrackerCpu: DS.attr('number'),
  jobTrackerRpc: DS.attr('number')
});
 * 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.HBaseService = App.Service.extend({
  version: DS.attr('string'),
  master: DS.belongsTo('App.Host'),
  regionServers: DS.hasMany('App.Host'),
  masterStartTime: DS.attr('number'),
  masterActiveTime: DS.attr('number'),
  averageLoad: DS.attr('number'),
  regionsInTransition: DS.attr('number'),
  revision: DS.attr('string'),
  heapMemoryUsed: DS.attr('number'),
  heapMemoryMax: DS.attr('number')
});

App.HBaseService.FIXTURES = [];
App.YARNService = App.Service.extend({
  version: DS.attr('string'),
  resourceManagerNode: DS.belongsTo('App.Host'),
  nodeManagerNodes: DS.hasMany('App.Host'),
  nodeManagerLiveNodes: DS.hasMany('App.Host'),
  nodeManagersCountActive: DS.attr('number'),
  nodeManagersCountUnhealthy: DS.attr('number'),
  nodeManagersCountRebooted: DS.attr('number'),
  nodeManagersCountDecommissioned: DS.attr('number'),
  containersAllocated: DS.attr('number'),
  containersPending: DS.attr('number'),
  containersReserved: DS.attr('number'),
  appsSubmitted: DS.attr('number'),
  appsRunning: DS.attr('number'),
  appsPending: DS.attr('number'),
  appsCompleted: DS.attr('number'),
  appsKilled: DS.attr('number'),
  appsFailed: DS.attr('number'),
  yarnClientNodes: DS.hasMany('App.Host'),
  resourceManagerStartTime: DS.attr('number'),
  jvmMemoryHeapUsed: DS.attr('number'),
  jvmMemoryHeapCommitted: DS.attr('number'),
  allocatedMemory: DS.attr('number'),
  reservedMemory: DS.attr('number'),
  availableMemory: DS.attr('number'),
  queue: DS.attr('string'),
  queueFormatted: function() {
    var queue = JSON.parse(this.get('queue'));
    return objectUtils.recursiveTree(queue);
  }.property('queue'),
  queuesCount: function() {
    var queue = JSON.parse(this.get('queue'));
    return objectUtils.recursiveKeysCount(queue);
  }.property('queue'),
  allQueueNames: [],
  childQueueNames: [],
  /** 
   * Provides a flat array of queue names.
   * Example: root, root/default
   */
  queueNames: function () {
    var queueString = this.get('queue');
    var allQueueNames = [];
    var childQueueNames = [];
    if (queueString != null) {
      var queues = JSON.parse(queueString);
      var addQueues = function (queuesObj, path){
        var names = [];
        for ( var subQueue in queuesObj) {
          if (queuesObj[subQueue] instanceof Object) {
            var qFN = path=='' ? subQueue : path+'/'+subQueue;
            names.push(qFN);
            var subNames = addQueues(queuesObj[subQueue], qFN);
            names = names.concat(subNames);
            if (!subNames || subNames.length < 1) {
              childQueueNames.push(qFN);
            }
          }
        }
        return names;
      }
      allQueueNames = addQueues(queues, '');
    }
    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'),
});
var App = require('app');

App.HDFSService = App.Service.extend({
  version: DS.attr('string'),
  nameNode: DS.belongsTo('App.Host'),
  snameNode: DS.belongsTo('App.Host'),
  activeNameNode: DS.belongsTo('App.Host'),
  standbyNameNode: DS.belongsTo('App.Host'),
  standbyNameNode2: DS.belongsTo('App.Host'),
  dataNodes: DS.hasMany('App.Host'),
  journalNodes: DS.hasMany('App.Host'),
  nameNodeStartTime: DS.attr('number'),
  jvmMemoryHeapUsed: DS.attr('number'),
  jvmMemoryHeapCommitted: DS.attr('number'),
  liveDataNodes: DS.hasMany('App.Host'),
  deadDataNodes: DS.hasMany('App.Host'),
  decommissionDataNodes: DS.hasMany('App.Host'),
  capacityUsed: DS.attr('number'),
  capacityTotal: DS.attr('number'),
  capacityRemaining: DS.attr('number'),
  dfsTotalBlocks: DS.attr('number'),
  dfsCorruptBlocks: DS.attr('number'),
  dfsMissingBlocks: DS.attr('number'),
  dfsUnderReplicatedBlocks: DS.attr('number'),
  dfsTotalFiles: DS.attr('number'),
  upgradeStatus: DS.attr('boolean'),
  safeModeStatus: DS.attr('string'),
  nameNodeCpu: DS.attr('number'),
  nameNodeRpc: DS.attr('number')
});

App.HDFSService.FIXTURES = [];
Example #5
0
 * 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.FlumeService = App.Service.extend({
  version: DS.attr('string'),
  agents: DS.hasMany('App.FlumeAgent'),
  flumeHandlersTotal: DS.attr('number')
});

App.FlumeAgent = DS.Model.extend({
  /**
   * ID of a flume agent will be of the format
   * '<agent-name>-<host-name>'
   */
  id: DS.attr('string'),
  name: DS.attr('string'),
  /**
   * Status of agent. One of 'RUNNING', 'NOT_RUNNING', 'UNKNOWN'.
   */
  status: DS.attr('string'),
  host: DS.belongsTo('App.Host'),
Example #6
0
 * 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.StormService = App.Service.extend({
  version: DS.attr('string'),
  superVisorsStarted: DS.attr('number'),
  superVisorsInstalled: DS.attr('number'),
  superVisorsTotal: DS.attr('number'),
  totalTasks: DS.attr('number'),
  totalSlots: DS.attr('number'),
  usedSlots: DS.attr('number'),
  freeSlots: DS.attr('number'),
  totalExecutors: DS.attr('number'),
  topologies: DS.attr('number'),
  nimbusUptime: DS.attr('number')
});

App.StormService.FIXTURES = [];