|
@@ -46,6 +46,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
],
|
|
|
|
|
|
loadStep: function () {
|
|
|
+ console.warn('func: loadStep');
|
|
|
this.initData();
|
|
|
this.clearStep();
|
|
|
this.loadTasks();
|
|
@@ -54,12 +55,14 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
initData: function () {
|
|
|
+ console.warn('func: initData');
|
|
|
this.loadMasterComponentHosts();
|
|
|
this.loadFailedTask();
|
|
|
this.loadHdfsClientHosts();
|
|
|
},
|
|
|
|
|
|
setCommandsAndTasks: function(tmpTasks) {
|
|
|
+ console.warn('func: setCommandsAndTasks');
|
|
|
var fTask = this.get('failedTask');
|
|
|
var newCommands = [];
|
|
|
var newTasks = [];
|
|
@@ -97,6 +100,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
clearStep: function () {
|
|
|
+ console.warn('func: clearStep');
|
|
|
this.set('isSubmitDisabled', true);
|
|
|
this.set('tasks', []);
|
|
|
this.set('logs', []);
|
|
@@ -123,26 +127,33 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
onTaskStatusChange: function () {
|
|
|
+ console.warn('func: onTaskStatusChange');
|
|
|
if (!this.get('tasks').someProperty('status', 'IN_PROGRESS') && !this.get('tasks').someProperty('status', 'QUEUED') && !this.get('tasks').someProperty('status', 'FAILED')) {
|
|
|
var nextTask = this.get('tasks').findProperty('status', 'PENDING');
|
|
|
if (nextTask) {
|
|
|
+ console.warn('func: onTaskStatusChange1');
|
|
|
this.set('status', 'IN_PROGRESS');
|
|
|
- this.runTask(nextTask.get('id'));
|
|
|
this.setTaskStatus(nextTask.get('id'), 'QUEUED');
|
|
|
this.set('currentTaskId', nextTask.get('id'));
|
|
|
+ this.runTask(nextTask.get('id'));
|
|
|
} else {
|
|
|
+ console.warn('func: onTaskStatusChange2');
|
|
|
this.set('status', 'COMPLETED');
|
|
|
this.set('isSubmitDisabled', false);
|
|
|
}
|
|
|
} else if (this.get('tasks').someProperty('status', 'FAILED')) {
|
|
|
+ console.warn('func: onTaskStatusChange3');
|
|
|
this.set('status', 'FAILED');
|
|
|
this.get('tasks').findProperty('status', 'FAILED').set('showRetry', true);
|
|
|
this.get('tasks').findProperty('status', 'FAILED').set('showSkip', true);
|
|
|
}
|
|
|
+ this.get('tasks').filterProperty('status','COMPLETED').setEach('showRetry', false);
|
|
|
+ this.get('tasks').filterProperty('status','COMPLETED').setEach('showSkip', false);
|
|
|
|
|
|
var statuses = this.get('tasks').mapProperty('status');
|
|
|
var logs = this.get('tasks').mapProperty('hosts');
|
|
|
var requestIds = this.get('currentRequestIds');
|
|
|
+ console.warn('func: onTaskStatusChange4',statuses,logs,requestIds);
|
|
|
this.saveTasksStatuses(statuses);
|
|
|
this.saveRequestIds(requestIds);
|
|
|
this.saveLogs(logs);
|
|
@@ -155,6 +166,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
skipTask: function () {
|
|
|
+ console.warn('func: skipTask');
|
|
|
var task = this.get('tasks').findProperty('status', 'FAILED');
|
|
|
task.set('showRetry', false);
|
|
|
task.set('showSkip', false);
|
|
@@ -162,6 +174,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
retryTask: function () {
|
|
|
+ console.warn('func: retryTask');
|
|
|
var task = this.get('tasks').findProperty('status', 'FAILED');
|
|
|
task.set('showRetry', false);
|
|
|
task.set('showSkip', false);
|
|
@@ -169,6 +182,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
onTaskCompleted: function () {
|
|
|
+ console.warn('func: onTaskCompleted');
|
|
|
var curTaskStatus = this.getTaskStatus(this.get('currentTaskId'));
|
|
|
if (curTaskStatus != 'FAILED' && curTaskStatus != 'TIMEDOUT' && curTaskStatus != 'ABORTED') {
|
|
|
this.setTaskStatus(this.get('currentTaskId'), 'COMPLETED');
|
|
@@ -176,10 +190,12 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
getTaskStatus: function (taskId) {
|
|
|
+ console.warn('func: getTaskStatus');
|
|
|
return this.get('tasks').findProperty('id', taskId).get('status');
|
|
|
},
|
|
|
|
|
|
loadFailedTask: function(){
|
|
|
+ console.warn('func: loadFailedTask');
|
|
|
var failedTask = App.db.getHighAvailabilityWizardFailedTask();
|
|
|
this.set('failedTask', failedTask);
|
|
|
},
|
|
@@ -192,6 +208,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
stopAllServices: function(){
|
|
|
+ console.warn('func: stopAllServices');
|
|
|
App.ajax.send({
|
|
|
name: 'admin.high_availability.stop_all_services',
|
|
|
sender: this,
|
|
@@ -200,6 +217,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
});
|
|
|
},
|
|
|
restoreHBaseConfigs: function(){
|
|
|
+ console.warn('func: restoreHBaseConfigs');
|
|
|
this.loadConfigTag("hbaseSiteTag");
|
|
|
var hbaseSiteTag = this.get("content.hbaseSiteTag");
|
|
|
App.ajax.send({
|
|
@@ -214,41 +232,51 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
stopFailoverControllers: function(){
|
|
|
+ console.warn('func: stopFailoverControllers');
|
|
|
var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
|
|
|
this.stopComponent('ZKFC', hostNames);
|
|
|
},
|
|
|
deleteFailoverControllers: function(){
|
|
|
+ console.warn('func: deleteFailoverControllers');
|
|
|
var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'NAMENODE').mapProperty('hostName');
|
|
|
this.checkBeforeDelete('ZKFC', hostNames);
|
|
|
},
|
|
|
stopStandbyNameNode: function(){
|
|
|
+ console.warn('func: stopStandbyNameNode');
|
|
|
var hostName = this.get('content.masterComponentHosts').findProperty('isAddNameNode', true).hostName;;
|
|
|
this.stopComponent('NAMENODE', hostName);
|
|
|
},
|
|
|
stopNameNode: function(){
|
|
|
+ console.warn('func: stopNameNode');
|
|
|
var hostNames = this.get('content.masterComponentHosts').findProperty('isCurNameNode').hostName;
|
|
|
this.stopComponent('NAMENODE', hostNames);
|
|
|
},
|
|
|
restoreHDFSConfigs: function(){
|
|
|
+ console.warn('func: restoreHDFSConfigs');
|
|
|
this.unInstallHDFSClients();
|
|
|
},
|
|
|
enableSecondaryNameNode: function(){
|
|
|
+ console.warn('func: enableSecondaryNameNode');
|
|
|
var hostName = this.get('content.masterComponentHosts').findProperty('component', 'SECONDARY_NAMENODE').hostName;
|
|
|
this.installComponent('SECONDARY_NAMENODE', hostName, hostName.length);
|
|
|
},
|
|
|
stopJournalNodes: function(){
|
|
|
+ console.warn('func: stopJournalNodes');
|
|
|
var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
|
|
|
this.stopComponent('JOURNALNODE', hostNames);
|
|
|
},
|
|
|
deleteJournalNodes: function(){
|
|
|
+ console.warn('func: deleteJournalNodes');
|
|
|
var hostNames = this.get('content.masterComponentHosts').filterProperty('component', 'JOURNALNODE').mapProperty('hostName');
|
|
|
this.unInstallComponent('JOURNALNODE', hostNames);
|
|
|
},
|
|
|
deleteAdditionalNameNode: function(){
|
|
|
+ console.warn('func: deleteAdditionalNameNode');
|
|
|
var hostNames = this.get('content.masterComponentHosts').filterProperty('isAddNameNode', true).mapProperty('hostName');
|
|
|
this.unInstallComponent('NAMENODE', hostNames);
|
|
|
},
|
|
|
startAllServices: function(){
|
|
|
+ console.warn('func: startAllServices');
|
|
|
App.ajax.send({
|
|
|
name: 'admin.high_availability.start_all_services',
|
|
|
sender: this,
|
|
@@ -258,6 +286,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
onLoadHbaseConfigs: function (data) {
|
|
|
+ console.warn('func: onLoadHbaseConfigs');
|
|
|
var hbaseSiteProperties = data.items.findProperty('type', 'hbase-site').properties;
|
|
|
App.ajax.send({
|
|
|
name: 'admin.high_availability.save_configs',
|
|
@@ -272,6 +301,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
stopComponent: function (componentName, hostName) {
|
|
|
+ console.warn('func: stopComponent');
|
|
|
if (!(hostName instanceof Array)) {
|
|
|
hostName = [hostName];
|
|
|
}
|
|
@@ -292,6 +322,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
onDeletedHDFSClient: function () {
|
|
|
+ console.warn('func: onDeletedHDFSClient');
|
|
|
var deletedHdfsClients = this.get('deletedHdfsClients');
|
|
|
var hostName = this.get("content.hdfsClientHostNames");
|
|
|
var notDeletedHdfsClients = hostName.length - deletedHdfsClients;
|
|
@@ -316,6 +347,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
onLoadConfigs: function (data) {
|
|
|
+ console.warn('func: onLoadConfigs');
|
|
|
this.set('configsSaved', false);
|
|
|
App.ajax.send({
|
|
|
name: 'admin.high_availability.save_configs',
|
|
@@ -340,6 +372,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
onHdfsConfigsSaved: function () {
|
|
|
+ console.warn('func: onHdfsConfigsSaved');
|
|
|
if (!this.get('configsSaved')) {
|
|
|
this.set('configsSaved', true);
|
|
|
return;
|
|
@@ -348,6 +381,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
unInstallHDFSClients: function () {
|
|
|
+ console.warn('func: unInstallHDFSClients');
|
|
|
var hostName = this.get("content.hdfsClientHostNames");
|
|
|
for (var i = 0; i < hostName.length; i++) {
|
|
|
App.ajax.send({
|
|
@@ -364,6 +398,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
unInstallComponent: function (componentName, hostName) {
|
|
|
+ console.warn('func: unInstallComponent');
|
|
|
if (!(hostName instanceof Array)) {
|
|
|
hostName = [hostName];
|
|
|
}
|
|
@@ -384,6 +419,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
checkBeforeDelete: function (componentName, hostName){
|
|
|
+ console.warn('func: checkBeforeDelete');
|
|
|
this.set('hostsToPerformDel', []);
|
|
|
if (!(hostName instanceof Array)) {
|
|
|
hostName = [hostName];
|
|
@@ -405,6 +441,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
checkResult: function () {
|
|
|
+ console.warn('func: checkResult');
|
|
|
var callback = arguments[2].callback;
|
|
|
var hostName = arguments[2].hostName;
|
|
|
var componentName = arguments[2].componentName;
|
|
@@ -433,6 +470,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
deleteComponent: function (componentName, hostName) {
|
|
|
+ console.warn('func: deleteComponent');
|
|
|
if (!(hostName instanceof Array)) {
|
|
|
hostName = [hostName];
|
|
|
}
|
|
@@ -452,6 +490,7 @@ App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageControl
|
|
|
},
|
|
|
|
|
|
onDeleteComplete: function () {
|
|
|
+ console.warn('func: onDeleteComplete');
|
|
|
var leftOp = this.get('numOfDelOperations');
|
|
|
if(leftOp > 1){
|
|
|
this.set('numOfDelOperations', leftOp-1);
|