incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1406450 - in /incubator/ambari/branches/AMBARI-666: ./ ambari-web/app/controllers/ ambari-web/app/controllers/wizard/ ambari-web/app/utils/
Date Wed, 07 Nov 2012 04:18:46 GMT
Author: yusaku
Date: Wed Nov  7 04:18:45 2012
New Revision: 1406450

URL: http://svn.apache.org/viewvc?rev=1406450&view=rev
Log:
AMBARI-948. Invoke service starts after services are installed in the wizard. (yusaku)

Modified:
    incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/db.js

Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1406450&r1=1406449&r2=1406450&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Wed Nov  7 04:18:45 2012
@@ -12,6 +12,9 @@ AMBARI-666 branch (unreleased changes)
 
   NEW FEATURES
 
+  AMBARI-948. Invoke service starts after services are installed in the
+  wizard. (yusaku)
+
   AMBARI-942. Integrate Install and Start APIs with the installer wizard.
   (Jaimin Jetly via yusaku)
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js?rev=1406450&r1=1406449&r2=1406450&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js Wed Nov 
7 04:18:45 2012
@@ -252,7 +252,9 @@ App.InstallerController = Em.Controller.
    * @param clusterStatus object with status, isCompleted, requestId, isInstallError and
isStartError field.
    */
   saveClusterStatus: function (clusterStatus) {
+    clusterStatus.name = this.get('content.cluster.name');
     this.set('content.cluster', clusterStatus);
+    console.log('called saveClusterStatus ' + JSON.stringify(clusterStatus));
     App.db.setClusterStatus(clusterStatus);
   },
 
@@ -754,4 +756,4 @@ App.InstallerController = Em.Controller.
 
 
 
-});
\ No newline at end of file
+});

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js?rev=1406450&r1=1406449&r2=1406450&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js
Wed Nov  7 04:18:45 2012
@@ -725,7 +725,7 @@ App.WizardStep8Controller = Em.Controlle
   applyCreatedConfToServices: function () {
     var services = this.get('selectedServices').mapProperty('serviceName');
     services.forEach(function (_service) {
-      var data = this.getDataForHdfs();
+      var data = this.getConfigForService(_service);
       this.applyCreatedConfToService(_service, 'PUT', data);
     }, this);
   },
@@ -733,13 +733,16 @@ App.WizardStep8Controller = Em.Controlle
   applyCreatedConfToService: function (service, httpMethod, data) {
     console.log("Inside applyCreatedConfToService");
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
-    var data = data;
     var url = '/api/clusters/' + clusterName + '/services/' + service;
+
+    debugger;
+
     $.ajax({
       type: httpMethod,
       url: url,
       async: false,
       dataType: 'text',
+      data: JSON.stringify(data),
       timeout: 5000,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
@@ -759,8 +762,13 @@ App.WizardStep8Controller = Em.Controlle
     console.log("Exiting applyCreatedConfToService");
   },
 
-  getDataForHdfs: function () {
-    return {config: {'core-site': 'version1', 'hdfs-site': 'version1'}};
+  getConfigForService: function (serviceName) {
+    switch (serviceName) {
+      case 'HDFS':
+        return {config: {'core-site': 'version1', 'hdfs-site': 'version1'}};
+      case 'MAPREDUCE':
+        return {config: {'core-site': 'version1', 'mapred-site': 'version1'}};
+    }
   }
 
 })

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js?rev=1406450&r1=1406449&r2=1406450&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js
(original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js
Wed Nov  7 04:18:45 2012
@@ -227,6 +227,7 @@ App.WizardStep9Controller = Em.Controlle
         var requestId = jsonData.href.match(/.*\/(.*)$/)[1];
         console.log('requestId is: ' + requestId);
         var clusterStatus = {
+          name: clusterName,
           status: 'INSTALLED',
           requestId: requestId,
           isStartError: false,
@@ -239,6 +240,7 @@ App.WizardStep9Controller = Em.Controlle
       error: function () {
         console.log("ERROR");
         var clusterStatus = {
+          name: clusterName,
           status: 'PENDING',
           isStartError: true,
           isCompleted: false
@@ -354,7 +356,6 @@ App.WizardStep9Controller = Em.Controlle
   // polling from ui stops only when no action has 'PENDING', 'QUEUED' or 'IN_PROGRESS' status
   finishState: function (polledData) {
     var clusterStatus = {};
-    var retVal = false;
     var requestId = this.get('content.cluster.requestId');
     if (this.get('content.cluster.status') === 'INSTALLED') {
       if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status',
'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
@@ -376,7 +377,7 @@ App.WizardStep9Controller = Em.Controlle
         }
         App.router.get('installerController').saveClusterStatus(clusterStatus);
         this.set('isStepCompleted', true);
-        retVal = true;
+        return true;
       }
     } else if (this.get('content.cluster.status') === 'PENDING') {
       if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status',
'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
@@ -390,19 +391,18 @@ App.WizardStep9Controller = Em.Controlle
           this.set('progress', '100');
           this.set('status', 'failed');
           this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData), 'failed');
+	  App.router.get('installerController').saveClusterStatus(clusterStatus);
           this.set('isStepCompleted', true);
         } else {
           clusterStatus.status = 'INSTALLED';
           this.set('progress', '34');
           App.router.get('installerController').saveInstalledHosts(this);
           this.launchStartServices();  //TODO: uncomment after the actual hookup
-
         }
-        App.router.get('installerController').saveClusterStatus(clusterStatus);
-        retVal = true;
+        return true;
       }
     }
-    return retVal;
+    return false;
   },
 
   getCompletedTasksForHost: function (host) {
@@ -601,4 +601,4 @@ App.WizardStep9Controller = Em.Controlle
     }
   }
 
-});
\ No newline at end of file
+});

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/db.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/db.js?rev=1406450&r1=1406449&r2=1406450&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/db.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/db.js Wed Nov  7 04:18:45 2012
@@ -189,7 +189,7 @@ App.db.setSoftRepo = function (softRepo)
 }
 
 App.db.setBootStatus = function (status) {
-  console.log('TRACE: Entering db:setService function');
+  console.log('TRACE: Entering db:setBootStatus function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   App.db.data[user].Installer.bootStatus = status;
@@ -274,6 +274,7 @@ App.db.setClusterStatus = function (stat
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   App.db.data[user].Installer.clusterStatus = status;
+  console.log('db.setClusterStatus called: ' + JSON.stringify(status));
   localStorage.setObject('ambari', App.db.data);
 }
 
@@ -403,7 +404,7 @@ App.db.getHosts = function () {
 }
 
 App.db.getBootStatus = function () {
-  console.log('TRACE: Entering db:setService function');
+  console.log('TRACE: Entering db:getBootStatus function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.bootStatus;
@@ -465,7 +466,7 @@ App.db.getServiceConfigProperties = func
 }
 
 App.db.getClusterStatus = function () {
-  console.log('TRACE: Entering db:setService function');
+  console.log('TRACE: Entering db:getClusterStatus function');
   App.db.data = localStorage.getObject('ambari');
   var user = App.db.data.app.loginName;
   return App.db.data[user].Installer.clusterStatus;



Mime
View raw message