incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1442010 [23/29] - in /incubator/ambari/branches/branch-1.2: ./ ambari-agent/ ambari-agent/conf/unix/ ambari-agent/src/examples/ ambari-agent/src/main/puppet/modules/hdp-ganglia/files/ ambari-agent/src/main/puppet/modules/hdp-ganglia/manife...
Date Mon, 04 Feb 2013 02:24:02 GMT
Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step3_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step3_controller.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step3_controller.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step3_controller.js Mon Feb  4 02:23:55 2013
@@ -99,6 +99,9 @@ App.WizardStep3Controller = Em.Controlle
 
   navigateStep: function () {
     this.loadStep();
+    if(App.testMode){
+      this.getHostInfo();
+    }
     if (this.get('content.installOptions.manualInstall') !== true) {
       if (!App.db.getBootStatus()) {
         this.startBootstrap();
@@ -109,7 +112,6 @@ App.WizardStep3Controller = Em.Controlle
         this.get('bootHosts').setEach('bootStatus', 'REGISTERED');
         this.get('bootHosts').setEach('cpu', '2');
         this.get('bootHosts').setEach('memory', '2000000');
-        this.getHostInfo();
       } else {
         this.set('registrationStartedAt', null);
         this.get('bootHosts').setEach('bootStatus', 'DONE');
@@ -245,6 +247,8 @@ App.WizardStep3Controller = Em.Controlle
   },
 
   retrySelectedHosts: function () {
+    //to display all hosts
+    this.set('category', 'All');
     if (!this.get('isRetryDisabled')) {
       this.set('isRetryDisabled', true);
       var selectedHosts = this.get('bootHosts').filterProperty('bootStatus', 'FAILED');
@@ -267,6 +271,28 @@ App.WizardStep3Controller = Em.Controlle
     this.doBootstrap();
   },
 
+  isInstallInProgress: function(){
+    var bootStatuses = this.get('bootHosts').getEach('bootStatus');
+    if(bootStatuses.length &&
+      (bootStatuses.contains('REGISTERING') ||
+        bootStatuses.contains('DONE') ||
+        bootStatuses.contains('RUNNING') ||
+        bootStatuses.contains('PENDING'))){
+      return true;
+    }
+    return false;
+  }.property('bootHosts.@each.bootStatus'),
+
+  disablePreviousSteps: function(){
+    if(this.get('isInstallInProgress')){
+      App.router.get('installerController').setLowerStepsDisable(3);
+      this.set('isSubmitDisabled', true);
+    } else {
+      App.router.get('installerController.isStepDisabled').findProperty('step', 1).set('value', false);
+      App.router.get('installerController.isStepDisabled').findProperty('step', 2).set('value', false);
+    }
+  }.observes('isInstallInProgress'),
+
   doBootstrap: function () {
     if (this.get('stopBootstrap')) {
       return;
@@ -287,6 +313,26 @@ App.WizardStep3Controller = Em.Controlle
           }
           console.log("TRACE: In success function for the GET bootstrap call");
           var keepPolling = self.parseHostInfo(data.hostsStatus);
+
+          // Single host : if the only hostname is invalid (data.status == 'ERROR')
+          // Multiple hosts : if one or more hostnames are invalid
+          // following check will mark the bootStatus as 'FAILED' for the invalid hostname
+          if (data.status == 'ERROR' || data.hostsStatus.length != self.get('bootHosts').length) {
+
+            var hosts = self.get('bootHosts');
+
+            for (var i = 0; i < hosts.length; i++) {
+
+              var isValidHost = data.hostsStatus.someProperty('hostName', hosts[i].get('name'));
+              if(hosts[i].get('bootStatus') !== 'REGISTERED'){
+                if (!isValidHost) {
+                  hosts[i].set('bootStatus', 'FAILED');
+                  hosts[i].set('bootLog', 'Registration with the server failed.');
+                }
+              }
+            }
+          }
+
           if (data.hostsStatus.someProperty('status', 'DONE') || data.hostsStatus.someProperty('status', 'FAILED')) {
             // kicking off registration polls after at least one host has succeeded
             self.startRegistration();
@@ -435,7 +481,7 @@ App.WizardStep3Controller = Em.Controlle
     var self = this;
     var kbPerGb = 1024;
     var hosts = this.get('bootHosts');
-    var url = App.testMode ? '/data/wizard/bootstrap/single_host_information.json' : App.apiPrefix + '/hosts?fields=Hosts/total_mem,Hosts/cpu_count,Hosts/disk_info';
+    var url = App.testMode ? '/data/wizard/bootstrap/two_hosts_information.json' : App.apiPrefix + '/hosts?fields=Hosts/total_mem,Hosts/cpu_count,Hosts/disk_info,Hosts/last_agent_env';
     var method = 'GET';
     $.ajax({
       type: 'GET',
@@ -444,6 +490,7 @@ App.WizardStep3Controller = Em.Controlle
       timeout: App.timeout,
       success: function (data) {
         var jsonData = (App.testMode) ? data : jQuery.parseJSON(data);
+        self.parseWarnings(jsonData);
         hosts.forEach(function (_host) {
           var host = (App.testMode) ? jsonData.items[0] : jsonData.items.findProperty('Hosts.host_name', _host.name);
           if (App.skipBootstrap) {
@@ -542,6 +589,330 @@ App.WizardStep3Controller = Em.Controlle
       })
     });
   },
+  /**
+   * check warnings from server and put it in parsing
+    */
+  rerunChecks: function(){
+    var self = this;
+    var url = App.testMode ? '/data/wizard/bootstrap/two_hosts_information.json' : App.apiPrefix + '/hosts?fields=Hosts/last_agent_env';
+    var currentProgress = 0;
+    var interval = setInterval(function(){
+      self.set('checksUpdateProgress', Math.ceil((++currentProgress/60)*100))
+    }, 1000);
+    setTimeout(function(){
+      clearInterval(interval);
+      $.ajax({
+        type: 'GET',
+        url: url,
+        contentType: 'application/json',
+        timeout: App.timeout,
+        success: function (data) {
+          var jsonData = (App.testMode) ? data : jQuery.parseJSON(data);
+          self.set('checksUpdateProgress', 100);
+          self.set('checksUpdateStatus', 'SUCCESS');
+          self.parseWarnings(jsonData);
+        },
+        error: function () {
+          self.set('checksUpdateProgress', 100);
+          self.set('checksUpdateStatus', 'FAILED');
+          console.log('INFO: Getting host information(last_agent_env) from the server failed');
+        },
+        statusCode: require('data/statusCodes')
+      })
+    }, this.get('warningsTimeInterval'));
+
+  },
+  warnings: [],
+  warningsTimeInterval: 60000,
+  /**
+   * check are hosts have any warnings
+   */
+  isHostHaveWarnings: function(){
+    var isWarning = false;
+    this.get('warnings').forEach(function(warning){
+      if(!isWarning && (warning.directoriesFiles.someProperty('isWarn', true) ||
+      warning.packages.someProperty('isWarn', true) ||
+      warning.processes.someProperty('isWarn', true))){
+        isWarning = true;
+      }
+    }, this);
+    return isWarning;
+  }.property('warnings'),
+  isWarningsBoxVisible: function(){
+    return (App.testMode) ? true : !this.get('isSubmitDisabled');
+  }.property('isSubmitDisabled'),
+  checksUpdateProgress:0,
+  checksUpdateStatus: null,
+  /**
+   * filter data for warnings parse
+   * is data from host in bootStrap
+   * @param data
+   * @return {Object}
+   */
+  filterBootHosts: function(data){
+    var bootHosts = this.get('bootHosts');
+    var filteredData = {
+      href: data.href,
+      items: []
+    };
+    bootHosts.forEach(function(bootHost){
+      data.items.forEach(function(host){
+        if(host.Hosts.host_name == bootHost.get('name')){
+          filteredData.items.push(host);
+        }
+      })
+    })
+    return filteredData;
+  },
+  /**
+   * parse warnings data for each host and total
+   * @param data
+   */
+  parseWarnings: function(data){
+    data = this.filterBootHosts(data);
+    var warnings = [];
+    var totalWarnings = {
+      hostName: 'All Hosts',
+      directoriesFiles: [],
+      packages: [],
+      processes: []
+    }
+    //alphabetical sorting
+    var sortingFunc = function(a, b){
+      var a1= a.name, b1= b.name;
+      if(a1== b1) return 0;
+      return a1> b1? 1: -1;
+    }
+    data.items.forEach(function(host){
+      var warningsByHost = {
+        hostName: host.Hosts.host_name,
+        directoriesFiles: [],
+        packages: [],
+        processes: []
+      };
+
+      //render all directories and files for each host
+      host.Hosts.last_agent_env.paths.forEach(function(path){
+        var parsedPath = {
+          name: path.name,
+          isWarn: (path.type == 'not_exist') ? false : true,
+          message: (path.type == 'not_exist') ? 'OK' : 'WARN: already exists on host'
+        }
+        warningsByHost.directoriesFiles.push(parsedPath);
+        // parsing total warnings
+        if(!totalWarnings.directoriesFiles.someProperty('name', parsedPath.name)){
+          totalWarnings.directoriesFiles.push({
+            name:parsedPath.name,
+            isWarn: parsedPath.isWarn,
+            message: (parsedPath.isWarn) ? 'WARN: already exists on 1 host': 'OK',
+            warnCount: (parsedPath.isWarn) ? 1 : 0
+          })
+        } else if(parsedPath.isWarn){
+            totalWarnings.directoriesFiles.forEach(function(item, index){
+              if(item.name == parsedPath.name){
+                totalWarnings.directoriesFiles[index].isWarn = true;
+                totalWarnings.directoriesFiles[index].warnCount++;
+                totalWarnings.directoriesFiles[index].message = 'WARN: already exists on '+ totalWarnings.directoriesFiles[index].warnCount +' hosts';
+              }
+            });
+        }
+      }, this);
+
+      //render all packages for each host
+      host.Hosts.last_agent_env.rpms.forEach(function(_package){
+        var parsedPackage = {
+          name: _package.name,
+          isWarn: _package.installed,
+          message: (_package.installed) ? 'WARN: already installed on host' : 'OK'
+        }
+        warningsByHost.packages.push(parsedPackage);
+        // parsing total warnings
+        if(!totalWarnings.packages.someProperty('name', parsedPackage.name)){
+          totalWarnings.packages.push({
+            name:parsedPackage.name,
+            isWarn: parsedPackage.isWarn,
+            message: (parsedPackage.isWarn) ? 'WARN: already exists on 1 host': 'OK',
+            warnCount: (parsedPackage.isWarn) ? 1 : 0
+          })
+        } else if(parsedPackage.isWarn){
+          totalWarnings.packages.forEach(function(item, index){
+            if(item.name == parsedPackage.name){
+              totalWarnings.packages[index].isWarn = true;
+              totalWarnings.packages[index].warnCount++;
+              totalWarnings.packages[index].message = 'WARN: already exists on '+ totalWarnings.packages[index].warnCount +' hosts';
+            }
+          });
+        }
+      }, this);
+
+      // render all process for each host
+      host.Hosts.last_agent_env.javaProcs.forEach(function(process){
+          var parsedProcess = {
+            user: process.user,
+            isWarn: process.hadoop,
+            pid: process.pid,
+            command: process.command,
+            shortCommand: (process.command.substr(0, 15)+'...'),
+            message: (process.hadoop) ? 'WARN: running on host' : 'OK'
+          }
+          warningsByHost.processes.push(parsedProcess);
+          // parsing total warnings
+          if(!totalWarnings.processes.someProperty('pid', parsedProcess.name)){
+            totalWarnings.processes.push({
+              user: process.user,
+              pid: process.pid,
+              command: process.command,
+              shortCommand: (process.command.substr(0, 15)+'...'),
+              isWarn: parsedProcess.isWarn,
+              message: (parsedProcess.isWarn) ? 'WARN: running on 1 host': 'OK',
+              warnCount: (parsedProcess.isWarn) ? 1 : 0
+            })
+          } else if(parsedProcess.isWarn){
+            totalWarnings.processes.forEach(function(item, index){
+              if(item.pid == parsedProcess.pid){
+                totalWarnings.processes[index].isWarn = true;
+                totalWarnings.processes[index].warnCount++;
+                totalWarnings.processes[index].message = 'WARN: running on '+ totalWarnings.processes[index].warnCount +' hosts';
+              }
+            });
+          }
+      }, this);
+      warningsByHost.directoriesFiles.sort(sortingFunc);
+      warningsByHost.packages.sort(sortingFunc);
+      warnings.push(warningsByHost);
+    }, this);
+
+    totalWarnings.directoriesFiles.sort(sortingFunc);
+    totalWarnings.packages.sort(sortingFunc);
+    warnings.unshift(totalWarnings);
+    this.set('warnings', warnings);
+  },
+  /**
+   * open popup that contain hosts' warnings
+   * @param event
+   */
+  hostWarningsPopup: function(event){
+    var self = this;
+    App.ModalPopup.show({
+
+      header: Em.I18n.t('installer.step3.warnings.popup.header'),
+      secondary: 'Rerun Checks',
+      primary: 'Close',
+      onPrimary: function () {
+        self.set('checksUpdateStatus', null);
+        this.hide();
+      },
+      onClose: function(){
+        self.set('checksUpdateStatus', null);
+        this.hide();
+      },
+      onSecondary: function() {
+        self.rerunChecks();
+      },
+
+      footerClass: Ember.View.extend({
+        template: Ember.Handlebars.compile([
+          '<div class="update-progress pull-left">',
+          '{{#if view.isUpdateInProgress}}',
+          '<div class="progress-info active progress">',
+          '<div class="bar" {{bindAttr style="view.progressWidth"}}></div></div>',
+          '{{else}}<label {{bindAttr class="view.updateStatusClass"}}>{{view.updateStatus}}</label>',
+          '{{/if}}</div>',
+          '{{#if view.parentView.secondary}}<button type="button" class="btn btn-info" {{bindAttr disabled="view.isUpdateInProgress"}} {{action onSecondary target="view.parentView"}}><i class="icon-repeat"></i>&nbsp;{{view.parentView.secondary}}</button>{{/if}}',
+          '{{#if view.parentView.primary}}<button type="button" class="btn" {{action onPrimary target="view.parentView"}}>{{view.parentView.primary}}</button>{{/if}}'
+        ].join('')),
+        classNames: ['modal-footer', 'host-checks-update'],
+        progressWidth: function(){
+          return 'width:'+App.router.get('wizardStep3Controller.checksUpdateProgress')+'%';
+        }.property('App.router.wizardStep3Controller.checksUpdateProgress'),
+        isUpdateInProgress: function(){
+          if((App.router.get('wizardStep3Controller.checksUpdateProgress') > 0) &&
+             (App.router.get('wizardStep3Controller.checksUpdateProgress') < 100)){
+            return true;
+          }
+        }.property('App.router.wizardStep3Controller.checksUpdateProgress'),
+        updateStatusClass:function(){
+          var status = App.router.get('wizardStep3Controller.checksUpdateStatus');
+          if(status === 'SUCCESS'){
+            return 'text-success';
+          } else if(status === 'FAILED'){
+            return 'text-error';
+          } else {
+            return null;
+          }
+        }.property('App.router.wizardStep3Controller.checksUpdateStatus'),
+        updateStatus:function(){
+          var status = App.router.get('wizardStep3Controller.checksUpdateStatus');
+          if(status === 'SUCCESS'){
+            return Em.I18n.t('installer.step3.warnings.updateChecks.success');
+          } else if(status === 'FAILED'){
+            return Em.I18n.t('installer.step3.warnings.updateChecks.failed');
+          } else {
+            return null;
+          }
+        }.property('App.router.wizardStep3Controller.checksUpdateStatus')
+      }),
+
+      bodyClass: Ember.View.extend({
+        templateName: require('templates/wizard/step3_host_warnings_popup'),
+        warnings: function(){
+          return App.router.get('wizardStep3Controller.warnings');
+        }.property('App.router.wizardStep3Controller.warnings'),
+        categories: function(){
+          var categories = this.get('warnings').getEach('hostName');
+          return categories;
+        }.property('warnings'),
+        category: 'All Hosts',
+        content: function(){
+          return this.get('warnings').findProperty('hostName', this.get('category'));
+        }.property('category', 'warnings'),
+        /**
+         * generate detailed content to show it in new window
+         */
+        contentInDetails: function(){
+          var content = this.get('content');
+          var newContent = '';
+          if(content.hostName == 'All Hosts'){
+            newContent += '<h4>Warnings across all hosts</h4>';
+          } else {
+            newContent += '<h4>Warnings on ' + content.hostName + '</h4>';
+          }
+          newContent += '<div>DIRECTORIES AND FILES</div><div>';
+          content.directoriesFiles.filterProperty('isWarn', true).forEach(function(path){
+              newContent += path.name + '&nbsp;'
+          });
+          if(content.directoriesFiles.filterProperty('isWarn', true).length == 0){
+            newContent += 'No warnings';
+          }
+          newContent += '</div><br/><div>PACKAGES</div><div>';
+          content.packages.filterProperty('isWarn', true).forEach(function(_package){
+              newContent += _package.name + '&nbsp;'
+          });
+          if(content.packages.filterProperty('isWarn', true).length == 0){
+            newContent += 'No warnings';
+          }
+          newContent += '</div><br/><div>PROCESSES</div><div>';
+          content.processes.filterProperty('isWarn', true).forEach(function(process, index){
+              newContent += '(' + content.hostName + ',' + process.pid + ',' + process.user + ')';
+              newContent += (index != (content.processes.filterProperty('isWarn', true).length-1)) ? ',' : '';
+          })
+          if(content.processes.filterProperty('isWarn', true).length == 0){
+            newContent += 'No warnings';
+          }
+          return newContent;
+        }.property('content'),
+        /**
+         * open new browser tab with detailed content
+         */
+        openWarningsInDialog: function(){
+          var newWindow = window.open('', this.get('category')+' warnings');
+          var newDocument = newWindow.document;
+          newDocument.write(this.get('contentInDetails'));
+          newWindow.focus();
+        }
+      })
+    })
+  },
 
   // TODO: dummy button. Remove this after the hook up with actual REST API.
   mockBtn: function () {

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step5_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step5_controller.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step5_controller.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step5_controller.js Mon Feb  4 02:23:55 2013
@@ -161,7 +161,7 @@ App.WizardStep5Controller = Em.Controlle
           componentObj.component_name = _componentInfo.component_name;
           componentObj.display_name = _componentInfo.display_name;
           componentObj.selectedHost = savedComponent ? savedComponent.hostName : this.selectHost(_componentInfo.component_name);   // call the method that plays selectNode algorithm or fetches from server
-          componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.Component.find().someProperty('componentName', _componentInfo.component_name);
+          componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.HostComponent.find().someProperty('componentName', _componentInfo.component_name);
           componentObj.serviceId = services[index];
           componentObj.availableHosts = [];
           componentObj.isHiveCoHost = ['HIVE_METASTORE', 'WEBHCAT_SERVER'].contains(_componentInfo.component_name);

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step7_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step7_controller.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step7_controller.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step7_controller.js Mon Feb  4 02:23:55 2013
@@ -172,8 +172,7 @@ App.WizardStep7Controller = Em.Controlle
 
         console.log('pushing ' + serviceConfig.serviceName, serviceConfig);
 
-        if (this.get('selectedServiceNames').contains(serviceConfig.serviceName)) {
-          // AMBARI-1139 - Hiding MISC section // || serviceConfig.serviceName === 'MISC') {
+        if (this.get('selectedServiceNames').contains(serviceConfig.serviceName) || serviceConfig.serviceName === 'MISC') {
           serviceConfig.showConfig = true;
         }
 

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step8_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step8_controller.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step8_controller.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step8_controller.js Mon Feb  4 02:23:55 2013
@@ -30,6 +30,7 @@ App.WizardStep8Controller = Em.Controlle
   slaveComponentConfig: null,
   isSubmitDisabled: false,
   hasErrorOccurred: false,
+  servicesInstalled: false,
 
   selectedServices: function () {
     return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
@@ -40,6 +41,7 @@ App.WizardStep8Controller = Em.Controlle
     this.get('configs').clear();
     this.get('globals').clear();
     this.get('clusterInfo').clear();
+    this.set('servicesInstalled', false);
   },
 
   loadStep: function () {
@@ -754,51 +756,64 @@ App.WizardStep8Controller = Em.Controlle
 
     this.set('isSubmitDisabled', true);
 
-    if (App.testMode || !this.get('content.cluster.requestId')) {
-      // For recovery : set the cluster status
-
-      // We need to do recovery based on whether we are in Add Host or Installer wizard
-      switch (this.get('content.controllerName')) {
-        case 'installerController' :
-          App.clusterStatus.set('value', {
-            clusterName: this.get('clusterName'),
-            clusterState: 'CLUSTER_DEPLOY_PREP_2',
-            wizardControllerName: this.get('content.controllerName'),
-            localdb: App.db.data
-          });
-          break;
+    // checkpoint the cluster status on the server so that the user can resume from where they left off
+    switch (this.get('content.controllerName')) {
+      case 'installerController':
+        App.clusterStatus.setClusterStatus({
+          clusterName: this.get('clusterName'),
+          clusterState: 'CLUSTER_DEPLOY_PREP_2',
+          wizardControllerName: this.get('content.controllerName'),
+          localdb: App.db.data
+        });
+        break;
+      case 'addHostController':
+        App.clusterStatus.setClusterStatus({
+          clusterName: this.get('clusterName'),
+          clusterState: 'ADD_HOSTS_DEPLOY_PREP_2',
+          wizardControllerName: this.get('content.controllerName'),
+          localdb: App.db.data
+        });
+        break;
+      default:
+        break;
+    }
 
-        case 'addHostController' :
-          App.clusterStatus.set('value', {
-            clusterName: this.get('clusterName'),
-            clusterState: 'ADD_HOSTS_DEPLOY_PREP_2',
-            wizardControllerName: this.get('content.controllerName'),
-            localdb: App.db.data
-          });
-          break;
-        default :
-          break;
-      }
+    // delete any existing clusters to start from a clean slate
+    // before creating a new cluster in install wizard
+    // TODO: modify for multi-cluster support
+    if (this.get('content.controllerName') == 'installerController') {
+      var clusterNames = this.getExistingClusterNames();
+      this.deleteClusters(clusterNames);
+    }
+
+    this.createCluster();
+    this.createSelectedServices();
+    this.createConfigurations();
+    this.applyCreatedConfToServices();
+    this.createComponents();
+    this.registerHostsToCluster();
+    this.createAllHostComponents();
 
-      this.createCluster();
-      this.createSelectedServices();
-      //this.setAmbariUIDb();
-      this.createConfigurations();
-      this.applyCreatedConfToServices();
-      this.createComponents();
-      this.registerHostsToCluster();
-      this.createAllHostComponents();
-      //this.applyCreatedConfToSlaveGroups();
-      this.ajaxQueueFinished = function () {
-        console.log('everything is loaded')
-        App.router.send('next');
-      };
-      this.doNextAjaxCall();
-    } else {
+    this.ajaxQueueFinished = function () {
+      console.log('everything is loaded')
       App.router.send('next');
-    }
+    };
+    this.doNextAjaxCall();
+
   },
 
+  /**
+   * Used in progress bar
+   */
+  ajaxQueueLength: function() {
+    return this.get('ajaxQueue').length;
+  }.property('ajaxQueue.length'),
+
+  /**
+   * Used in progress bar
+   */
+  ajaxQueueLeft: 0,
+
   setAmbariUIDb: function () {
     var dbContent = this.get('content.slaveGroupProperties');
     var slaveComponentConfig = this.get("slaveComponentConfig");
@@ -825,6 +840,49 @@ App.WizardStep8Controller = Em.Controlle
     return this.get('content.cluster.name');
   }.property('content.cluster.name'),
 
+  // returns an array of existing cluster names.
+  // returns an empty array if there are no existing clusters.
+  getExistingClusterNames: function () {
+    var url = App.apiPrefix + '/clusters';
+
+    var clusterNames = [];
+
+    $.ajax({
+      type: 'GET',
+      url: url,
+      async: false,
+      success: function(data) {
+        var jsonData = jQuery.parseJSON(data);
+        clusterNames = jsonData.items.mapProperty('Clusters.cluster_name');
+        console.log("Got existing cluster names: " + clusterNames);
+      },
+      error: function () {
+        console.log("Failed to get existing cluster names");
+      }
+    });
+
+    return clusterNames;
+  },
+
+  deleteClusters: function (clusterNames) {
+    clusterNames.forEach(function(clusterName) {
+
+      var url = App.apiPrefix + '/clusters/' + clusterName;
+
+      $.ajax({
+        type: 'DELETE',
+        url: url,
+        async: false,
+        success: function () {
+          console.log('DELETE cluster ' + clusterName + ' succeeded');
+        },
+        error: function () {
+          console.log('DELETE cluster ' + clusterName + ' failed');
+        }
+      });
+    });
+  },
+
   /**
    *  The following create* functions are called upon submitting Step 8.
    */
@@ -1423,6 +1481,7 @@ App.WizardStep8Controller = Em.Controlle
 
     var first = queue[0];
     this.set('ajaxQueue', queue.slice(1));
+    this.set('ajaxQueueLeft', this.get('ajaxQueue').length);
 
     this.set('ajaxBusy', true);
     console.log('AJAX send ' + first.url);
@@ -1431,8 +1490,8 @@ App.WizardStep8Controller = Em.Controlle
   },
 
   /**
-   * We need to do a lot of ajax calls(about 10 or more) async in special order.
-   * To do this i generate array of ajax objects and then send requests step by step.
+   * We need to do a lot of ajax calls async in special order.
+   * To do this, generate array of ajax objects and then send requests step by step.
    * All ajax objects are stored in <code>ajaxQueue</code>
    * @param params
    */
@@ -1474,8 +1533,11 @@ App.WizardStep8Controller = Em.Controlle
       var responseText = JSON.parse(xhr.responseText);
       var controller = App.router.get(App.clusterStatus.wizardControllerName);
       controller.registerErrPopup("Error", responseText.message);
-      self.set('isSubmitDisabled', true);
       self.set('hasErrorOccurred', true);
+      // an error will break the ajax call chain and allow submission again
+      self.set('isSubmitDisabled', false);
+      self.get('ajaxQueue').clear();
+      self.set('ajaxBusy', false);
     }
     this.get('ajaxQueue').pushObject(params);
   }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step9_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step9_controller.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step9_controller.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/controllers/wizard/step9_controller.js Mon Feb  4 02:23:55 2013
@@ -29,23 +29,36 @@ App.WizardStep9Controller = Em.Controlle
     return !['STARTED','START FAILED'].contains(this.get('content.cluster.status'));
   }.property('content.cluster.status'),
 
+  // links to previous steps are enabled iff install failed in installer
+  togglePreviousSteps: function () {
+    if ('INSTALL FAILED' === this.get('content.cluster.status') && this.get('content.controllerName') == 'installerController') {
+      App.router.get('installerController').setStepsEnable();
+    } else {
+      App.router.get('installerController').setLowerStepsDisable(9);
+    }
+  }.observes('content.cluster.status', 'content.controllerName'),
+
   mockHostData: require('data/mock/step9_hosts'),
   mockDataPrefix: '/data/wizard/deploy/5_hosts',
   pollDataCounter: 0,
   polledData: [],
 
   status: function () {
-    if(this.get('progress') != '100') {
-      return 'info';
-    }
-
     if (this.hosts.someProperty('status', 'failed')) {
       return 'failed';
-    } else if (this.hosts.someProperty('status', 'warning')) {
-      return 'warning';
     }
-
-    return 'success';
+    if (this.hosts.someProperty('status', 'warning')) {
+      if (this.isStepFailed()) {
+        return 'failed';
+      } else {
+        return 'warning';
+      }
+    }
+    if(this.get('progress') == '100') {
+      this.set('isStepCompleted', true);
+      return 'success';
+    }
+    return 'info';
   }.property('hosts.@each.status', 'progress'),
 
   showRetry: function () {
@@ -80,7 +93,7 @@ App.WizardStep9Controller = Em.Controlle
       if (clusterStatus === 'INSTALL FAILED') {
         this.loadStep();
         this.loadLogData(this.get('content.cluster.requestId'));
-        this.set('content.cluster.isStepCompleted', true);
+        this.set('isStepCompleted', true);
       } else if (clusterStatus === 'START FAILED') {
         this.loadStep();
         this.loadLogData(this.get('content.cluster.requestId'));
@@ -114,15 +127,26 @@ App.WizardStep9Controller = Em.Controlle
     this.clearStep();
     this.renderHosts(this.loadHosts());
   },
+  /**
+   * reset status and message of all hosts when retry install
+   */
+  resetHostsForRetry: function(){
+    var hosts = this.get('content.hosts');
+    for (var name in hosts) {
+      hosts[name].status = "pending";
+      hosts[name].message = 'Waiting';
+    }
+    this.set('content.hosts', hosts);
+  },
 
   loadHosts: function () {
     var hostInfo = this.get('content.hosts');
     var hosts = new Ember.Set();
     for (var index in hostInfo) {
       var obj = Em.Object.create(hostInfo[index]);
-      obj.message = '';
+      obj.message = (obj.message) ? obj.message : 'Waiting';
       obj.progress = 0;
-      obj.status = 'info';
+      obj.status = (obj.status) ? obj.status : 'info';
       obj.tasks = [];
       obj.logTasks = [];
       hosts.add(obj);
@@ -279,7 +303,7 @@ App.WizardStep9Controller = Em.Controlle
         App.router.get(self.get('content.controllerName')).saveClusterStatus(clusterStatus);
 
         // We need to do recovery if there is a browser crash
-        App.clusterStatus.set('value', {
+        App.clusterStatus.setClusterStatus({
           clusterState: 'SERVICE_STARTING_3',
           localdb: App.db.data
         });
@@ -309,12 +333,13 @@ App.WizardStep9Controller = Em.Controlle
     }
   },
 
-  // marks a host's status as "warning" if at least one of the tasks is FAILED, ABORTED, or TIMEDOUT.
-  onWarningPerHost: function (actions, contentHost) {
+  // marks a host's status as "warning" if at least one of the tasks is FAILED, ABORTED, or TIMEDOUT and marks host's status as "failed" if at least one master component install task is FAILED.
+  onErrorPerHost: function (actions, contentHost) {
     if (actions.someProperty('Tasks.status', 'FAILED') || actions.someProperty('Tasks.status', 'ABORTED') || actions.someProperty('Tasks.status', 'TIMEDOUT')) {
-      console.log('step9: In warning');
       contentHost.set('status', 'warning');
-      this.set('status', 'warning');
+    }
+    if (this.get('content.cluster.status') === 'PENDING' && actions.someProperty('Tasks.status', 'FAILED')) {
+      contentHost.set('status', 'failed');
     }
   },
 
@@ -362,61 +387,24 @@ App.WizardStep9Controller = Em.Controlle
     return polledData.everyProperty('Tasks.status', 'COMPLETED');
   },
 
-  // for DATANODE, TASKTRACKER, HBASE_REGIONSERVER, and GANGLIA_MONITOR, if more than 50% fail, then it's a fatal error;
-  // otherwise, it's only a warning and installation/start can continue
-  getSuccessFactor: function (role) {
-    return ['DATANODE', 'TASKTRACKER', 'HBASE_REGIONSERVER', 'GANGLIA_MONITOR'].contains(role) ? 50 : 100;
-  },
-
-  isStepFailed: function (polledData) {
+  //return true if at least 50% of the slave host components for the particular service component fails to install
+  isStepFailed: function () {
     var failed = false;
-    polledData.forEach(function (_polledData) {
-      var successFactor = this.getSuccessFactor(_polledData.Tasks.role);
-      console.log("Step9: isStepFailed sf value: " + successFactor);
-      var actionsPerRole = polledData.filterProperty('Tasks.role', _polledData.Tasks.role);
-      var actionsFailed = actionsPerRole.filterProperty('Tasks.status', 'FAILED');
-      var actionsAborted = actionsPerRole.filterProperty('Tasks.status', 'ABORTED');
-      var actionsTimedOut = actionsPerRole.filterProperty('Tasks.status', 'TIMEDOUT');
-      if ((((actionsFailed.length + actionsAborted.length + actionsTimedOut.length) / actionsPerRole.length) * 100) > (100 - successFactor)) {
-        console.log('TRACE: Entering success factor and result is failed');
-        failed = true;
+    var polledData = this.get('polledData');
+    polledData.filterProperty('Tasks.command', 'INSTALL').mapProperty('Tasks.role').uniq().forEach(function (role) {
+      if (['DATANODE', 'TASKTRACKER', 'HBASE_REGIONSERVER', 'GANGLIA_MONITOR'].contains(role)) {
+        var actionsPerRole = polledData.filterProperty('Tasks.role', role);
+        var actionsFailed = actionsPerRole.filterProperty('Tasks.status', 'FAILED');
+        var actionsAborted = actionsPerRole.filterProperty('Tasks.status', 'ABORTED');
+        var actionsTimedOut = actionsPerRole.filterProperty('Tasks.status', 'TIMEDOUT');
+        if ((((actionsFailed.length + actionsAborted.length + actionsTimedOut.length) / actionsPerRole.length) * 100) > 50) {
+          failed = true;
+        }
       }
     }, this);
     return failed;
   },
 
-  getFailedHostsForFailedRoles: function (polledData) {
-    var hostArr = new Ember.Set();
-    polledData.forEach(function (_polledData) {
-      var successFactor = this.getSuccessFactor(_polledData.Tasks.role);
-      var actionsPerRole = polledData.filterProperty('Tasks.role', _polledData.Tasks.role);
-      var actionsFailed = actionsPerRole.filterProperty('Tasks.status', 'FAILED');
-      var actionsAborted = actionsPerRole.filterProperty('Tasks.status', 'ABORTED');
-      var actionsTimedOut = actionsPerRole.filterProperty('Tasks.status', 'TIMEDOUT');
-      if ((((actionsFailed.length + actionsAborted.length + actionsTimedOut.length) / actionsPerRole.length) * 100) > (100 - successFactor)) {
-        actionsFailed.forEach(function (_actionFailed) {
-          hostArr.add(_actionFailed.Tasks.host_name);
-        });
-        actionsAborted.forEach(function (_actionFailed) {
-          hostArr.add(_actionFailed.Tasks.host_name);
-        });
-        actionsTimedOut.forEach(function (_actionFailed) {
-          hostArr.add(_actionFailed.Tasks.host_name);
-        });
-      }
-    }, this);
-    return hostArr;
-  },
-
-  setHostsStatus: function (hostNames, status) {
-    hostNames.forEach(function (_hostName) {
-      var host = this.hosts.findProperty('name', _hostName);
-      if (host) {
-        host.set('status', status).set('progress', '100');
-      }
-    }, this);
-  },
-
   // makes a state transition
   // PENDING -> INSTALLED
   // PENDING -> INSTALL FAILED
@@ -440,16 +428,8 @@ App.WizardStep9Controller = Em.Controlle
           var serviceStartTime = new Date().getTime();
           var timeToStart = ((parseInt(serviceStartTime) - parseInt(this.get('content.cluster.installStartTime'))) / 60000).toFixed(2);
           clusterStatus.installTime = timeToStart;
-          this.set('status', 'success');
         } else {
-          if (this.isStepFailed(polledData)) {
             clusterStatus.status = 'START FAILED'; // 'START FAILED' implies to step10 that installation was successful but start failed
-            this.set('status', 'failed');
-            this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData), 'failed');
-          } else {
-            clusterStatus.status = 'START FAILED';
-            this.set('status', 'warning');
-          }
         }
         App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
         this.set('isStepCompleted', true);
@@ -464,12 +444,10 @@ App.WizardStep9Controller = Em.Controlle
           requestId: requestId,
           isCompleted: false
         }
-        if (this.isStepFailed(polledData)) {
-          console.log("In installation failure");
+        if (this.get('status') === 'failed') {
           clusterStatus.status = 'INSTALL FAILED';
           this.set('progress', '100');
-          this.set('status', 'failed');
-          this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData), 'failed');
+          this.get('hosts').setEach('progress', '100');
           App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
           this.set('isStepCompleted', true);
         } else {
@@ -481,20 +459,10 @@ App.WizardStep9Controller = Em.Controlle
         App.router.get(this.get('content.controllerName')).saveInstalledHosts(this);
         return true;
       }
-    } else if (this.get('content.cluster.status') === 'INSTALL FAILED') {
-      this.set('progress', '100');
-      this.set('status', 'failed');
-      return true;
-    } else if (this.get('content.cluster.status') === 'START FAILED') {
+    } else if (this.get('content.cluster.status') === 'INSTALL FAILED' || this.get('content.cluster.status') === 'START FAILED' || this.get('content.cluster.status') === 'STARTED') {
       this.set('progress', '100');
-      this.set('status', 'failed');
-      return true;
-    } else if (this.get('content.cluster.status') === 'STARTED') {
-      this.set('progress', '100');
-      this.set('status', 'success');
       return true;
     }
-
     return false;
   },
 
@@ -517,6 +485,8 @@ App.WizardStep9Controller = Em.Controlle
     }, this);
   },
 
+  logTasksChangesCounter: 0,
+
   // This is done at HostRole level.
   setLogTasksStatePerHost: function (tasksPerHost, host) {
     console.log('In step9 setTasksStatePerHost function.');
@@ -530,17 +500,13 @@ App.WizardStep9Controller = Em.Controlle
       host.logTasks.pushObject(_task);
       //}
     }, this);
+    this.set('logTasksChangesCounter', this.get('logTasksChangesCounter') + 1);
   },
 
   parseHostInfo: function (polledData) {
     console.log('TRACE: Entering host info function');
     var self = this;
     var totalProgress = 0;
-    /* if (this.get('content.cluster.status') === 'INSTALLED') {
-     totalProgress = 34;
-     } else {
-     totalProgress = 0;
-     }  */
     var tasksData = polledData.tasks;
     console.log("The value of tasksData is: ", tasksData);
     if (!tasksData) {
@@ -548,9 +514,9 @@ App.WizardStep9Controller = Em.Controlle
     }
     var requestId = this.get('content.cluster.requestId');
     if(polledData.Requests && polledData.Requests.id && polledData.Requests.id!=requestId){
-      // We dont want to use non-current requestId's tasks data to 
-      // determine the current install status. 
-      // Also, we dont want to keep polling if it is not the 
+      // We dont want to use non-current requestId's tasks data to
+      // determine the current install status.
+      // Also, we dont want to keep polling if it is not the
       // current requestId.
       return false;
     }
@@ -564,7 +530,7 @@ App.WizardStep9Controller = Em.Controlle
       if (actionsPerHost !== null && actionsPerHost !== undefined && actionsPerHost.length !== 0) {
         this.setLogTasksStatePerHost(actionsPerHost, _host);
         this.onSuccessPerHost(actionsPerHost, _host);     // every action should be a success
-        this.onWarningPerHost(actionsPerHost, _host);     // any action should be a failure
+        this.onErrorPerHost(actionsPerHost, _host);     // any action should be a failure
         this.onInProgressPerHost(actionsPerHost, _host);  // current running action for a host
         totalProgress += self.progressPerHost(actionsPerHost, _host);
       }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/data/config_properties.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/data/config_properties.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/data/config_properties.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/data/config_properties.js Mon Feb  4 02:23:55 2013
@@ -1279,7 +1279,7 @@ module.exports =
       "name": "mapred_system_dir",
       "displayName": "MapReduce system directories",
       "description": "",
-      "defaultValue": "",
+      "defaultValue": "/mapred/system",
       "displayType": "directories",
       "isReconfigurable": false,
       "isVisible": true,
@@ -1294,7 +1294,7 @@ module.exports =
       "displayName": "MapReduce Capacity Scheduler",
       "description": "The scheduler to use for scheduling of MapReduce jobs",
       "defaultValue": "org.apache.hadoop.mapred.CapacityTaskScheduler",
-      "displayType": "directory",
+      //"displayType": "directory",
       "isVisible": true,
       "serviceName": "MAPREDUCE"
     },

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/data/statusCodes.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/data/statusCodes.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/data/statusCodes.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/data/statusCodes.js Mon Feb  4 02:23:55 2013
@@ -44,7 +44,7 @@ module.exports = {
 		console.log("Error code 500: Internal Error on server side.");
 	},
 	501: function () {
-		console.log("Error code 501: Not implementd yet.");
+		console.log("Error code 501: Not implemented yet.");
 	},
 	502: function () {
 		console.log("Error code 502: Services temporarily overloaded.");

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/alerts_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/alerts_mapper.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/alerts_mapper.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/alerts_mapper.js Mon Feb  4 02:23:55 2013
@@ -41,33 +41,80 @@ App.alertsMapper = App.QuickDataMapper.c
     if (!this.get('model')) {
       return;
     }
-    if (json.alerts) {
+    if (json && json.items && json.items.length>0 && json.items[0].HostRoles && json.items[0].HostRoles.nagios_alerts) {
+      var alertsString = json.items[0].HostRoles.nagios_alerts;
+      var alerts = jQuery.parseJSON(alertsString).alerts;
       if (App.Alert.find().content.length > 0) {
-        this.update(json);
+        this.update(alerts);
       } else {
         var result = [];
-        json.alerts.forEach(function (item) {
-          result.push(this.parseIt(item, this.config));
+        alerts.forEach(function(item){
+          var applyConfig = jQuery.extend({}, this.config);
+          if (item.current_state && item.last_hard_state && item.current_state != item.last_hard_state) {
+            switch (item.current_state) {
+              case "0":
+                applyConfig['date'] = 'last_time_ok';
+                break;
+              case "1":
+                applyConfig['date'] = 'last_time_warning';
+                break;
+              case "2":
+                applyConfig['date'] = 'last_time_critical';
+                break;
+            }
+          }
+          result.push(this.parseIt(item, applyConfig));
         }, this);
         App.store.loadMany(this.get('model'), result);
       }
     }
   },
-  update: function(json){
+  update: function(alerts){
     var alertsList = App.Alert.find();
     var titleToAlertMap = {};
     alertsList.forEach(function(alert){
       titleToAlertMap[alert.get('serviceType') + alert.get('title') + alert.get('message')] = alert;
     });
     var newRecords = [];
-    json.alerts.forEach(function(item){
+    alerts.forEach(function(item){
       var existAlert = titleToAlertMap[item.service_type + item.service_description + item.plugin_output];
       if (existAlert == null) {
-        newRecords.push(this.parseIt(item, this.config));
+        var applyConfig = jQuery.extend({}, this.config);
+        if (item.current_state && item.last_hard_state && item.current_state != item.last_hard_state) {
+          switch (item.current_state) {
+            case "0":
+              applyConfig['date'] = 'last_time_ok';
+              break;
+            case "1":
+              applyConfig['date'] = 'last_time_warning';
+              break;
+            case "2":
+              applyConfig['date'] = 'last_time_critical';
+              break;
+          }
+        }
+        newRecords.push(this.parseIt(item, applyConfig));
       } else {
         // update record
         existAlert.set('serviceType', item.service_type);
-        existAlert.set('date', DS.attr.transforms.date.from(item.last_hard_state_change));
+        if (item.current_state && item.last_hard_state && item.current_state != item.last_hard_state) {
+          switch (item.current_state) {
+            case "0":
+              existAlert.set('date', DS.attr.transforms.date.from(item.last_time_ok));
+              break;
+            case "1":
+              existAlert.set('date', DS.attr.transforms.date.from(item.last_time_warning));
+              break;
+            case "2":
+              existAlert.set('date', DS.attr.transforms.date.from(item.last_time_critical));
+              break;
+            default:
+              existAlert.set('date', DS.attr.transforms.date.from(item.last_hard_state_change));
+              break;
+          }
+        }else{
+          existAlert.set('date', DS.attr.transforms.date.from(item.last_hard_state_change));
+        }
         existAlert.set('status', item.current_state);
         existAlert.set('message', item.plugin_output);
         existAlert.set('lastHardStateChange', item.last_hard_state_change);

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/hosts_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/hosts_mapper.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/hosts_mapper.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/hosts_mapper.js Mon Feb  4 02:23:55 2013
@@ -15,19 +15,16 @@
  * the License.
  */
 
+var App = require('app');
+
 App.hostsMapper = App.QuickDataMapper.create({
+
   model: App.Host,
-  tmp_result:[],
   config: {
     id: 'Hosts.host_name',
     host_name: 'Hosts.host_name',
     public_host_name: 'Hosts.public_host_name',
     cluster_id: 'Hosts.cluster_name',// 1
-    components_key: 'host_components',
-    components_type: 'array',
-    components: {
-      item: 'HostRoles.component_name'
-    },
     rack: 'Hosts.rack_info',
     host_components_key: 'host_components',
     host_components_type: 'array',
@@ -45,23 +42,17 @@ App.hostsMapper = App.QuickDataMapper.cr
     load_fifteen: 'metrics.load.load_fifteen',
     cpu_usage: 'cpu_usage',
     memory_usage: 'memory_usage',
-    $network_usage: 36,
-    $io_usage: 39,
     last_heart_beat_time: "Hosts.last_heartbeat_time",
     os_arch: 'Hosts.os_arch',
     os_type: 'Hosts.os_type',
     ip: 'Hosts.ip'
   },
   map: function (json) {
-    var self = this;
-    if (!this.get('model')) {
-      return;
-    }
+
     if (json.items) {
 
+      var result = [];
       json.items.forEach(function (item) {
-        var result = [];
-        self.tmp_result=[];
 
         // Disk Usage
         if (item.metrics && item.metrics.disk && item.metrics.disk.disk_total && item.metrics.disk.disk_free) {
@@ -81,48 +72,15 @@ App.hostsMapper = App.QuickDataMapper.cr
           item.memory_usage = memUsedPercent.toFixed(1);
         }
 
-        if(App.Host.find(item.Hosts.host_name).get("hostName") == item.Hosts.host_name){ // UPDATE
+        item.host_components.forEach(function (host_component) {
+          host_component.id = host_component.HostRoles.component_name + "_" + host_component.HostRoles.host_name;
+        }, this);
+        result.push(this.parseIt(item, this.config));
 
-          App.Host.find(item.Hosts.host_name).set("cpuUsage", item.cpu_usage);
-          App.Host.find(item.Hosts.host_name).set("diskUsage", item.disk_usage);
-          App.Host.find(item.Hosts.host_name).set("memoryUsage", item.memory_usage);
-
-          self.tmp_result.push(this.parseIt(item, this.config));
-
-          $.map(self.tmp_result[0], function (e,a){
-            //console.log(a, "------------------", self.tmp_result[0][a])
-            if(typeof(e) === "string" || typeof(e) === "number")
-            {
-              var modelName=self.parseName(a);
-              if(typeof(App.Host.find(self.tmp_result[0].host_name).get(modelName)) !== "undefined"){
-                App.Host.find(self.tmp_result[0].host_name).set(modelName, self.tmp_result[0][a]);
-               // console.log(modelName, "------------------", self.tmp_result[0][a])
-              }
-            }
-          })
-
-        }else{ // ADD
-
-          item.host_components.forEach(function (host_component) {
-            host_component.id = host_component.HostRoles.component_name + "_" + host_component.HostRoles.host_name;
-          }, this);
-          result.push(this.parseIt(item, this.config));
-          App.store.loadMany(this.get('model'), result);
-
-        }
       }, this);
-       //console.log(this.get('model'), result);
-
-    }
-  },
 
-  parseName:function(name){
-    var new_name = name.replace(/_\w/g,replacer);
-    function replacer(str, p1, p2, offset, s)
-    {
-     return str[1].toUpperCase();
+      App.store.loadMany(this.get('model'), result);
     }
-    return new_name;
   }
 
 });

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/jobs_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/jobs_mapper.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/jobs_mapper.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/jobs_mapper.js Mon Feb  4 02:23:55 2013
@@ -29,7 +29,13 @@ App.jobsMapper = App.QuickDataMapper.cre
       json.jobs.forEach(function (item) {
         result.push(this.parseIt(item, this.config));
       }, this);
-      App.store.loadMany(this.get('model'), result);
+
+      var r = Ember.ArrayProxy.create({"content":[]});
+      result.forEach(function(item){
+        r.content.push(App.Job2.create(item));
+      });
+
+      this.set('controller.content.jobs', r.content);
     }
   },
   config:{
@@ -38,7 +44,6 @@ App.jobsMapper = App.QuickDataMapper.cre
     job_name:'jobName',
     workflow_entity_name:'workflowEntityName',
     user_name:'userName',
-    conf_path:'confPath',
     submit_time:'submitTime',
     maps:'maps',
     reduces:'reduces',
@@ -50,6 +55,7 @@ App.jobsMapper = App.QuickDataMapper.cre
 });
 
 App.jobTimeLineMapper = App.QuickDataMapper.create({
+  model: null, //model will be set outside of mapper
   config:{
     map:'map',
     shuffle:'shuffle',
@@ -66,6 +72,7 @@ App.jobTimeLineMapper = App.QuickDataMap
 });
 
 App.jobTasksMapper = App.QuickDataMapper.create({
+  model: null, //model will be set outside of mapper
   config:{
     mapNodeLocal:'mapNodeLocal',
     mapRackLocal:'mapRackLocal',

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/runs_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/runs_mapper.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/runs_mapper.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/runs_mapper.js Mon Feb  4 02:23:55 2013
@@ -24,9 +24,17 @@ App.runsMapper = App.QuickDataMapper.cre
     if(!this.get('model')) {
       return;
     }
-    if(json && json.workflows) {
+    if(json && json.aaData) {
       var result = [];
-      json.workflows.forEach(function(item) {
+
+      var pagination_info={
+        iTotalDisplayRecords :json.iTotalDisplayRecords ,
+        iTotalRecords:json.iTotalRecords,
+        startIndex:parseInt(json.startIndex)+1,
+        endIndex:parseInt(json.endIndex)+1
+      }
+
+      json.aaData.forEach(function(item) {
         var o = this.parseIt(item, this.config);
 
         var r = '{dag: {';
@@ -47,21 +55,31 @@ App.runsMapper = App.QuickDataMapper.cre
         });
         r = r.substr(0, r.length - 1);
         r += '}}';
-        o.workflow_context = r;
+        o.workflowContext = r;
 
         result.push(o);
       }, this);
-      App.store.loadMany(this.get('model'), result);
+
+      var r = [];
+      result.forEach(function(item){
+        r.push(App.Run2.create(item));
+      });
+
+      App.router.get('mainAppsController').set('content', r);
+      App.router.get('mainAppsController').set('serverData', json.summary);
+      App.router.get('mainAppsController').set('paginationObject', pagination_info);
     }
+
+
   },
   config : {
     id: 'workflowId',
-    app_name: 'workflowName',
-    num_jobs_total: 'numJobsTotal',
-    num_jobs_completed: 'numJobsCompleted',
-    user_name:'userName',
-    start_time: 'startTime',
-    elapsed_time: 'elapsedTime',
+    appName: 'workflowName',
+    numJobsTotal: 'numJobsTotal',
+    numJobsCompleted: 'numJobsCompleted',
+    userName:'userName',
+    startTime: 'startTime',
+    elapsedTime: 'elapsedTime',
     input: 'inputBytes',
     output: 'outputBytes'
   }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/server_data_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/server_data_mapper.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/server_data_mapper.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/server_data_mapper.js Mon Feb  4 02:23:55 2013
@@ -86,6 +86,9 @@ App.QuickDataMapper = App.ServerDataMapp
               result[i].push(this.parseIt(_data[index], config[i]));
             }
           }
+          if(_type == 'array'){
+            result[i] = result[i].sort();
+          }
         }
       }
     }
@@ -108,5 +111,17 @@ App.QuickDataMapper = App.ServerDataMapp
       pathArr.splice(0, 1);
     }
     return current;
+  },
+
+  calculateState: function (json) {
+//    var stateEqual = (json.desired_status != json.work_status);
+//    if (stateEqual) {
+//      if (json.desired_status == 'STARTED' && json.work_status == 'INSTALLED') {
+//        json.work_status = 'STARTING';
+//      } else if (json.desired_status == 'INSTALLED' && json.work_status == 'STARTED') {
+//        json.work_status = 'STOPPING';
+//      }
+//    }
+    return json;
   }
 });

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/service_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/service_mapper.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/service_mapper.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/service_mapper.js Mon Feb  4 02:23:55 2013
@@ -14,7 +14,8 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-var stringUtils = require('utils/string_utils');
+
+var App = require('app');
 
 App.servicesMapper = App.QuickDataMapper.create({
   servicesSortOrder: [
@@ -47,13 +48,7 @@ App.servicesMapper = App.QuickDataMapper
     id: 'ServiceInfo.service_name',
     service_name: 'ServiceInfo.service_name',
     work_status: 'ServiceInfo.state',
-    $service_audit: [ 1, 2, 3 ],
     $alerts: [ 1, 2, 3 ],
-    components_key: 'components',
-    components_type: 'array',
-    components: {
-      item: 'ServiceComponentInfo.component_name'
-    },
     host_components: 'host_components'
   },
   hdfsConfig: {
@@ -115,28 +110,14 @@ App.servicesMapper = App.QuickDataMapper
     heap_memory_max: 'masterComponent.ServiceComponentInfo.HeapMemoryMax'
   },
 
-  model2: App.Component,
-  config2: {
-    id: 'ServiceComponentInfo.component_name',
-    component_name: 'ServiceComponentInfo.component_name',
-    service_id: 'ServiceComponentInfo.service_name',
-    // TODO - PROBLEM:
-    // below statements are a problem for multiple 
-    // host_component components. Because it randomly
-    // picks one of the hosts. Especially the host details
-    // page must be careful because, it will randomly
-    // pick a host.
-    work_status: 'host_components[0].HostRoles.state',
-    host_id: 'host_components[0].HostRoles.host_name'
-  },
-
   model3: App.HostComponent,
   config3: {
     id: 'id',
     work_status: 'HostRoles.state',
+    desired_status: 'HostRoles.desired_state',
     component_name: 'HostRoles.component_name',
     host_id: 'HostRoles.host_name',
-    service_id: 'component[0].ServiceComponentInfo.service_name'
+    $service_id: 'none' /* will be set outside of parse function */
   },
 
   map: function (json) {
@@ -150,27 +131,13 @@ App.servicesMapper = App.QuickDataMapper
         var finalConfig = jQuery.extend({}, this.config);
         var finalJson = [];
         item.host_components = [];
-//        var json = this.parseIt(item, this.config);
-//        if(App.Service.find().someProperty('id', json.id)){
-//          var fieldsToUpdate = [
-//            'work_status',
-//            'components',
-//            'host_components'
-//          ]
-//          this.updateRecord(App.Service.find().findProperty('id', json.id), json, fieldsToUpdate);
-//          return;
-//        }
-
-        if (this.get('model').find(item.ServiceInfo.service_name).get('isLoaded')) {
-          this.update(item);
-          return;
-        }
         item.components.forEach(function (component) {
           component.host_components.forEach(function (host_component) {
             host_component.id = host_component.HostRoles.component_name + "_" + host_component.HostRoles.host_name;
             item.host_components.push(host_component.id);
-          }, this)
+          }, this);
         }, this);
+        item.host_components.sort();
 
         if (item && item.ServiceInfo && item.ServiceInfo.service_name == "HDFS") {
           // Change the JSON so that it is easy to map
@@ -194,156 +161,27 @@ App.servicesMapper = App.QuickDataMapper
       result = this.sortByOrder(this.get('servicesSortOrder'), result);
       App.store.loadMany(this.get('model'), result);
 
-      // Service components
-      result = [];
-      json.items.forEach(function(item){
-        item.components.forEach(function(component){
-          result.push(this.parseIt(component, this.config2));
-        }, this)
-      }, this);
-      var newComponents = [];
-      result.forEach(function(componentJson){
-        var component = App.Component.find(componentJson.id);
-        if (component && component.get('isLoaded')) { // UPDATE
-          if (componentJson.work_status) {
-            component.set('workStatus', componentJson.work_status);
-          }
-          if (componentJson.host_id) {
-            component.set('host', App.Host.find(componentJson.host_id));
-          }
-        } else {
-          newComponents.push(componentJson);
-        }
-      });
-      if (newComponents.length > 0) {
-        App.store.loadMany(this.get('model2'), newComponents);
-      }
-
       // Host components
       result = [];
       json.items.forEach(function(item){
         item.components.forEach(function(component){
+          var service = component.ServiceComponentInfo.service_name;
           component.host_components.forEach(function(host_component){
-            result.push(this.parseIt(host_component, this.config3));
+            var comp = this.parseIt(host_component, this.config3);
+            comp.service_id = service;
+            result.push(comp);
           }, this)
         }, this)
       }, this);
-      var newHostComponents = [];
+
       result.forEach(function(hcJson){
-        hcJson.id = hcJson.component_name + '_' + hcJson.host_id;
-        var component = App.HostComponent.find(hcJson.id);
-        if (component && component.get('isLoaded')) { // UPDATE
-          if (hcJson.work_status) {
-            component.set('workStatus', hcJson.work_status);
-          }
-          if (hcJson.component_name) {
-            component.set('componentName', hcJson.component_name);
-          }
-          if (hcJson.host_id) {
-            component.set('host', App.Host.find(hcJson.host_id));
-          }
-          if (hcJson.service_id) {
-            component.set('service', App.Service.find(hcJson.service_id));
-          }
-        } else {
-          newHostComponents.push(hcJson);
-        }
-      });
-      if (newHostComponents.length > 0) {
-        App.store.loadMany(this.get('model3'), newHostComponents);
-      }
-    }
-  },
-  update: function (service) {
-    var finalJson;
-    switch (service.ServiceInfo.service_name) {
-      case 'HDFS':
-        finalJson = this.hdfsMapper(service);
-        App.HDFSService.find().map(function (e) {
-          e.set("version", finalJson.version);
-          e.set("nameNodeStartTime", finalJson.name_node_start_time);
-          e.set("jvmMemoryHeapCommitted", finalJson.jvm_memory_heap_committed);
-          e.set("jvmMemoryHeapUsed", finalJson.jvm_memory_heap_used);
-          e.set("capacityUsed", finalJson.capacity_used);
-          e.set("capacityTotal", finalJson.capacity_total);
-          e.set("dfsTotalBlocks", finalJson.dfs_total_blocks);
-          e.set("dfsCorruptBlocks", finalJson.dfs_corrupt_blocks);
-          e.set("dfsMissingBlocks", finalJson.dfs_missing_blocks);
-          e.set("dfsUnderReplicatedBlocks", finalJson.dfs_under_replicated_blocks);
-          e.set("dfsTotalFiles", finalJson.dfs_total_files);
-          e.set("upgradeStatus", finalJson.upgrade_status);
-          e.set("safeModeStatus", finalJson.safe_mode_status);
-          // Live data nodes
-          var dataNodes = e.get('liveDataNodes');
-          if (dataNodes) {
-            dataNodes.clear();
-            finalJson.live_data_nodes.forEach(function (ldn) {
-              dataNodes.pushObject(App.Host.find(ldn));
-            });
-          }
-          // Decommission data nodes
-          dataNodes = e.get('decommissionDataNodes');
-          if (dataNodes) {
-            dataNodes.clear();
-            finalJson.decommission_data_nodes.forEach(function (ldn) {
-              dataNodes.pushObject(App.Host.find(ldn));
-            });
-          }
-          // Dead data nodes
-          dataNodes = e.get('deadDataNodes');
-          if (dataNodes) {
-            dataNodes.clear();
-            finalJson.dead_data_nodes.forEach(function (ldn) {
-              dataNodes.pushObject(App.Host.find(ldn));
-            });
-          }
-        });
-        break;
-      case 'MAPREDUCE':
-        finalJson = this.mapreduceMapper(service);
-        App.MapReduceService.find().map(function (e) {
-          e.set("version", finalJson.version);
-          e.set("jobTrackerStartTime", finalJson.job_tracker_start_time);
-          e.set("jobTrackerHeapUsed", finalJson.job_tracker_heap_used);
-          e.set("jobTrackerHeapMax", finalJson.job_tracker_heap_max);
-          e.set("mapSlots", finalJson.map_slots);
-          e.set("reduceSlots", finalJson.reduce_slots);
-          e.set("jobsSubmitted", finalJson.jobs_submitted);
-          e.set("jobsCompleted", finalJson.jobs_completed);
-          e.set("mapSlotsOccupied", finalJson.map_slots_occupied);
-          e.set("mapSlotsReserved", finalJson.map_slots_reserved);
-          e.set("reduceSlotsOccupied", finalJson.reduce_slots_occupied);
-          e.set("reduceSlotsReserved", finalJson.reduce_slots_reserved);
-          e.set("mapsRunning", finalJson.maps_running);
-          e.set("mapsWaiting", finalJson.maps_waiting);
-          e.set("reducesRunning", finalJson.reduces_running);
-          e.set("reducesWaiting", finalJson.reduces_waiting);
-          e.set("trackersDecommissioned", finalJson.trackers_decommissioned);
-        })
-        break;
-      case 'HBASE':
-        finalJson = this.hbaseMapper(service);
-        App.HBaseService.find().map(function (e) {
-          e.set("version", finalJson.version);
-          e.set("masterStartTime", finalJson.master_start_time);
-          e.set("masterActiveTime", finalJson.master_active_time);
-          e.set("averageLoad", finalJson.average_load);
-          e.set("regionsInTransition", finalJson.regions_in_transition);
-          e.set("revision", finalJson.revision);
-          e.set("heapMemoryUsed", finalJson.heap_memory_used);
-          e.set("heapMemoryMax", finalJson.heap_memory_max);
-        })
-        break;
-      default:
-        this.otherMapper(service);
-    }
-  },
-  otherMapper: function (item) {
-    var result = [];
-    if (App.Service.find(item.ServiceInfo.service_name).get("serviceName") == item.ServiceInfo.service_name) {
-      //update other service
+        this.calculateState(hcJson);
+      }, this);
+
+      App.store.loadMany(this.get('model3'), result);
     }
   },
+
   hdfsMapper: function (item) {
     var result = [];
     var finalConfig = jQuery.extend({}, this.config);
@@ -475,22 +313,5 @@ App.servicesMapper = App.QuickDataMapper
     finalJson = this.parseIt(item, finalConfig);
     finalJson.quick_links = [13, 14, 15, 16, 17, 18];
     return finalJson;
-  },
-  updateRecord: function (record, json, fieldsToUpdate) {
-    for (var field in fieldsToUpdate) {
-      if (json[field] !== undefined) {
-        if(json[field] instanceof Array){
-          this.updateHasMany(record, stringUtils.underScoreToCamelCase(field), json[field]);
-        } else {
-          record.set(stringUtils.underScoreToCamelCase(field), json[field]);
-        }
-      }
-    }
-  },
-  updateHasMany: function(record, field, items ){
-    record.get(field).clear();
-    items.forEach(function (item) {
-      record.get(field).pushObject(record.get(field).type.find().findProperty('id', item));
-    });
   }
 });
\ No newline at end of file

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/status_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/status_mapper.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/status_mapper.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/mappers/status_mapper.js Mon Feb  4 02:23:55 2013
@@ -22,14 +22,10 @@ App.statusMapper = App.QuickDataMapper.c
     work_status:'ServiceInfo.state'
   },
 
-  config2:{
-    id:'ServiceComponentInfo.component_name',
-    work_status:'host_components[0].HostRoles.state'
-  },
-
   config3:{
     id:'id',
-    work_status:'HostRoles.state'
+    work_status:'HostRoles.state',
+    desired_status: 'HostRoles.desired_state'
   },
 
   map:function (json) {
@@ -37,19 +33,9 @@ App.statusMapper = App.QuickDataMapper.c
     if (json.items) {
       var result = [];
       json.items.forEach(function (item) {
-
-        item.host_components = [];
-        item.components.forEach(function (component) {
-          component.host_components.forEach(function (host_component) {
-            host_component.id = host_component.HostRoles.component_name + "_" + host_component.HostRoles.host_name;
-            item.host_components.push(host_component.id);
-          }, this)
-        }, this);
-
         result.push(this.parseIt(item, this.config));
       }, this);
 
-      //console.log(result)
       var services = App.Service.find();
       result.forEach(function(item){
         var service = services.findProperty('id', item.id);
@@ -58,39 +44,26 @@ App.statusMapper = App.QuickDataMapper.c
         }
       })
 
-      result = [];
-      json.items.forEach(function (item) {
-        item.components.forEach(function (component) {
-          result.push(this.parseIt(component, this.config2));
-        }, this)
-      }, this);
-
-      //console.log(result)
-      var components = App.Component.find();
-      result.forEach(function(item){
-        var component = components.findProperty('id', item.id);
-        if(component){
-          component.set('workStatus', item.work_status);
-        }
-      })
 
+      //host_components
       result = [];
       json.items.forEach(function (item) {
         item.components.forEach(function (component) {
           component.host_components.forEach(function (host_component) {
+            host_component.id = host_component.HostRoles.component_name + "_" + host_component.HostRoles.host_name;
             result.push(this.parseIt(host_component, this.config3));
           }, this)
         }, this)
       }, this);
 
-      //console.log(result)
       var hostComponents = App.HostComponent.find();
       result.forEach(function(item){
         var hostComponent = hostComponents.findProperty('id', item.id);
         if(hostComponent){
+          item = this.calculateState(item);
           hostComponent.set('workStatus', item.work_status);
         }
-      })
+      }, this)
     }
   }
 });

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/messages.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/messages.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/messages.js Mon Feb  4 02:23:55 2013
@@ -79,11 +79,11 @@ Em.I18n.translations = {
   'installer.step2.hostName.error.notRequired':'Host Names will be ignored if not using SSH to automatically configure hosts',
   'installer.step2.hostName.error.invalid':'Invalid Host Name(s)',
   'installer.step2.hostName.pattern.header':'Host name pattern expressions',
-  'installer.step2.sshKey':'Host Connectivity Information',
+  'installer.step2.sshKey':'Host Registration Information',
   'installer.step2.sshKey.error.required':'SSH Private Key is required',
   'installer.step2.passphrase.error.match':'Passphrases do not match',
   'installer.step2.manualInstall.label':'Do not use SSH to automatically configure hosts ',
-  'installer.step2.manualInstall.info':'By not using SSH to connect to the target hosts, you must manually install and start the ' +
+  'installer.step2.manualInstall.info':'By not using SSH to connect to the target hosts, you must manually install the ' +
     'Ambari Agent on each host in order for the wizard to perform the necessary configurations and software installs.',
   'installer.step2.advancedOption':'Advanced Options',
   'installer.step2.repoConf':'Software Repository Configuration File Path',
@@ -92,22 +92,22 @@ Em.I18n.translations = {
   'installer.step2.localRepo.label_instead':'instead of downloading software packages from the Internet',
   'installer.step2.localRepo.error.required':'Local repository file path is required',
   'installer.step2.localRepo.tooltip.title':'Local Software Repository',
-  'installer.step2.localRepo.tooltip.content': 'The install process requires access to the Internet to fetch software ' +
+  'installer.step2.localRepo.tooltip.content': 'The cluster install requires access to the Internet to fetch software ' +
     'from a remote repository. In some cases, adequate bandwidth is not available and you want to prevent downloading ' +
     'packages from the remote repository over and over again. Other times, Internet access is not available from the ' +
     'hosts in your cluster. In these situations, you must set up a version of the repository that your machines can ' +
     'access locally and this is called a <b>Local Software Repository</b>',
   'installer.step2.javaHome.label' : 'Path to 64-bit JDK',
-  'installer.step2.javaHome.label2' : 'on all hosts',
   'installer.step2.javaHome.tooltip.title' : 'JAVA_HOME',
   'installer.step2.javaHome.tooltip.content' : 'Path to 64-bit JAVA_HOME. /usr/jdk/jdk1.6.0_31 is the default used by Ambari. You can override this to a specific path that contains the JDK. <br/> Note: the path must be valid on <b>ALL</b> hosts in your cluster.',
   'installer.step2.useSsh.provide' : 'Provide your',
   'installer.step2.useSsh.provide_id_rsa' : '(id_rsa for root) and use SSH to automatically register hosts',
   'installer.step2.useSsh.tooltip.title':'SSH Private Key',
   'installer.step2.useSsh.tooltip.content':'The <b>SSH Private Key File</b> is used for the root access to the target hosts in your cluster.',
-  'installer.step2.manualInstall.tooltip.title':'Not Using SSH (Manual Install)',
-  'installer.step2.manualInstall.tooltip.content':'If you do not wish Ambari to automatically configure the target hosts via SSH,' +
-    ' you have the option of configuring them yourself.  This involves installing and starting Ambari Agent on each of your target hosts.',
+  'installer.step2.manualInstall.perform':'Perform',
+  'installer.step2.manualInstall.perform_on_hosts':'on hosts and do not use SSH',
+  'installer.step2.manualInstall.tooltip.title':'manual registration',
+  'installer.step2.manualInstall.tooltip.content':'Manually registering the Ambari Agent on each host eliminates the need for SSH and should be performed prior to continuing cluster installation.',
   'installer.step2.manualInstall.popup.header':'Before You Proceed',
   'installer.step2.manualInstall.popup.body':'You must install Ambari Agents on each host you want to manage before you proceed.',
 
@@ -121,6 +121,15 @@ Em.I18n.translations = {
   'installer.step3.hosts.retry.popup.body':'Are you sure you want to retry discovery of the selected host(s)?',
   'installer.step3.hostInformation.popup.header':'Error in retrieving host Information',
   'installer.step3.hostInformation.popup.body' : 'All bootstrapped hosts registered but unable to retrieve cpu and memory related information',
+  'installer.step3.hosts.noHosts':'No hosts to display',
+  'installer.step3.warnings.popup.header':'Host Checks',
+  'installer.step3.warnings.description':'Some warnings were encountered while performing checks against the above hosts.',
+  'installer.step3.warnings.linkText':'Click here to see the warnings.',
+  'installer.step3.noWarnings.linkText':'Click here to see the check results.',
+  'installer.step3.warnings.noWarnings':'All host checks were successful.',
+  'installer.step3.warnings.updateChecks.success':'Host Checks successfully updated',
+  'installer.step3.warnings.updateChecks.failed':'Host Checks update failed',
+
   'installer.step4.header':'Choose Services',
   'installer.step4.body':'Choose which services you want to install on your cluster.',
   'installer.step4.mapreduceCheck.popup.header':'MapReduce Needed',
@@ -166,7 +175,7 @@ Em.I18n.translations = {
   'form.password':'Password',
   'form.passwordRetype':'Retype Password',
   'form.saveSuccess':'Successfully saved.',
-  'form.saveError':'Sorry, errors occured.',
+  'form.saveError':'Sorry, errors occurred.',
 
   'form.validator.invalidIp':'Please enter valid ip address',
 
@@ -214,6 +223,7 @@ Em.I18n.translations = {
   'admin.users.delete.header':'Delete {0}',
 
   'admin.users.addButton':'Add Local User',
+  'admin.users.editButton': 'Edit Local User',
   'admin.users.delete':'delete',
   'admin.users.edit':'edit',
   'admin.users.privileges':'Admin',
@@ -222,6 +232,8 @@ Em.I18n.translations = {
   'admin.users.password':'Password',
   'admin.users.passwordRetype':'Retype Password',
   'admin.users.username':'Username',
+  'admin.users.createSuccess': 'User successfully created.',
+  'admin.users.createError': 'Error occurred while user creating.',
 
   'question.sure':'Are you sure?',
   'yes':'Yes',
@@ -272,6 +284,8 @@ Em.I18n.translations = {
   'services.service.actions.run.smoke':'Run Smoke Test',
   'services.service.actions.maintenance':'Maintenance',
   'services.service.summary.unknown':'unknown',
+  'services.service.summary.notRunning':'Not Running',
+  'services.service.summary.notAvailable':'n/a',
 
   'services.add.header':'Add Service Wizard',
 
@@ -279,6 +293,9 @@ Em.I18n.translations = {
   'hosts.host.stop.popup.header':'Confirmation',
   'hosts.host.start.popup.body':'Are you sure?',
   'hosts.host.stop.popup.body':'Are you sure?',
+  'hosts.host.healthStatus.heartBeatNotReceived':'The server has not received a heartbeat from this host for more than 3 minutes.',
+  'hosts.host.healthStatus.mastersDown':"The following master components are down:\n",
+  'hosts.host.healthStatus.slavesDown':"The following slave components are down:\n",
   'hosts.decommission.popup.body':'Are you sure?',
   'hosts.decommission.popup.header':'Confirmation',
   'hosts.delete.popup.body':'Are you sure?',
@@ -287,7 +304,6 @@ Em.I18n.translations = {
   'hosts.cant.do.popup.masterList.body':'You cannot delete this host because it is hosting following master services: {0}.',
   'hosts.cant.do.popup.workingList.body':'You cannot delete this host because following slave services are not fully stopped or decommissioned: {0}.',
   'hosts.add.header':'Add Host Wizard',
-  'hosts.add.step2.warning':'Hosts are already part of the cluster and will be ignored',
   'hosts.assignRack':'Assign Rack',
 
   'charts.horizon.chart.showText':'show',
@@ -337,7 +353,7 @@ Em.I18n.translations = {
   'dashboard.services.hdfs.nodes.uptime':'NameNode Uptime',
   'dashboard.services.hdfs.nodes.heap':'NameNode Heap',
   'dashboard.services.hdfs.nodes.heapUsed':'{0} / {1} ({2}% used)',
-  'dashboard.services.hdfs.chart.label':'Capacity (Free/Used)',
+  'dashboard.services.hdfs.chart.label':'Capacity (Used/Total)',
 
   'dashboard.services.mapreduce.summary':'{0} of {1} trackers live, {2} jobs running, {3} jobs waiting',
   'dashboard.services.mapreduce.taskTrackers':'TaskTrackers',
@@ -378,6 +394,17 @@ Em.I18n.translations = {
   'dashboard.services.hbase.masterStarted':'Master Started',
   'dashboard.services.hbase.masterActivated':'Master Activated',
 
+  'dashboard.services.hive.client': '{0} Hive Client',
+  'dashboard.services.hive.clients': '{0} Hive Clients',
+
+  'dashboard.services.oozie.client': '{0} Oozie Client',
+  'dashboard.services.oozie.clients': '{0} Oozie Clients',
+  'dashboard.services.oozie.webUi': 'Oozie Web UI',
+
+  'dashboard.services.zookeeper.prefix': '{0} of',
+  'dashboard.services.zookeeper.title': '{0} ZooKeepers',
+  'dashboard.services.zookeeper.postfix': 'running',
+
   'dashboard.services.configs.popup.stopService.header':'Stop service',
   'dashboard.services.configs.popup.stopService.body' : 'Service needs to be stopped for reconfiguration',
   'dashboard.services.configs.popup.restartService.header' : 'Restart service',
@@ -390,7 +417,14 @@ Em.I18n.translations = {
   'timeRange.presets.1year':'1yr',
 
   'apps.filters.customRunDate':'Run Date custom filter',
-  'apps.dagCharts.popup':'DAG/Charts',
+  'apps.dagCharts.popup':'Job Charts',
+  'apps.dagCharts.popup.job': 'Job',
+  'apps.dagCharts.popup.dag':'DAG',
+  'apps.dagCharts.popup.tasks':'Timeline & Tasks',
+  'apps.dagCharts.popup.tasks.timeline':'Job Timeline',
+  'apps.dagCharts.popup.tasks.tasks':'Job Tasks',
+  'apps.isRunning.popup.title':'Is running',
+  'apps.isRunning.popup.content':'Job is running now',
 
   'nagios.alerts.unavailable':'Alerts Unavailable'
 

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/models.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/models.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/models.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/models.js Mon Feb  4 02:23:55 2013
@@ -26,10 +26,8 @@ require('models/cluster_states');
 require('models/hosts');
 require('models/quick_links');
 require('models/service');
-require('models/component');
 require('models/service_config');
 require('models/service_audit');
-require('models/service_metrics');
 require('models/service/hdfs');
 require('models/service/mapreduce');
 require('models/service/hbase');
@@ -42,4 +40,8 @@ require('models/job');
 require('models/run');
 require('models/app');
 require('models/background_operation');
-require('models/host_component');
\ No newline at end of file
+require('models/host_component');
+
+require('classes/run_class');
+require('classes/job_class');
+require('classes/job_class');
\ No newline at end of file

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/models/alert.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/models/alert.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/models/alert.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/models/alert.js Mon Feb  4 02:23:55 2013
@@ -79,12 +79,23 @@ App.Alert = DS.Model.extend({
       }
       var prevSuffix = $.timeago.settings.strings.suffixAgo;
       $.timeago.settings.strings.suffixAgo = '';
-      var since = prefix + $.timeago(d);
+      var since = prefix + $.timeago(this.makeTimeAtleastMinuteAgo(d));
       $.timeago.settings.strings.suffixAgo = prevSuffix;
       return since;
     }
     return "";
   }.property('date', 'status'),
+  
+  makeTimeAtleastMinuteAgo: function(d){
+    var diff = new Date().getTime() - d.getTime();
+    if (diff < 60000) {
+      diff = 60000 - diff;
+      var newD = new Date(d.getTime() - diff );
+      //console.log("Making time more than 1 minute. New time=",newD,", Old time=",d);
+      return newD;
+    }
+    return d;
+  },
 
   /**
    * Provides more details about when this alert happened.

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/models/authentication.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/models/authentication.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/models/authentication.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/models/authentication.js Mon Feb  4 02:23:55 2013
@@ -47,7 +47,6 @@ App.Authentication.FIXTURES = [
 
 App.AuthenticationForm = App.Form.extend({
   testResult:false,
-  isObjectNew:false,
   fieldsOptions:[
     { name:"method", displayName:"", isRequired:false, displayType:"select",
       values:[
@@ -104,6 +103,6 @@ App.AuthenticationForm = App.Form.extend
   }.property('testResult'),
   testConfigurationClass:function () {
     return this.get('testResult') ? "text-success" : "text-error";
-  }.property('testConfigurationMessage'),
+  }.property('testConfigurationMessage')
 })
 ;
\ No newline at end of file



Mime
View raw message