summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShireesh Anjal <anjalshireesh@gmail.com>2011-12-08 07:18:46 -0800
committerShireesh Anjal <anjalshireesh@gmail.com>2011-12-08 07:18:46 -0800
commitb816816a5dc5d4ff01d0b79250c89e16d6e9cbe6 (patch)
tree9742cfcfb7816ef63a665f9ae847fabbb6735eb5
parentff226ed0a143df8e1b171162a9385f0af88c83c8 (diff)
parent94a9cbe7c4e1d7f88e673086f9d9ee961429ff25 (diff)
Merge pull request #18 from Selvasundaram/master
Fixed not to return task status as null in case the gluster command for checking migration status fails. Now an exception will be thrown in such cases.
-rw-r--r--src/org.gluster.storage.management.console/src/org/gluster/storage/management/console/dialogs/MigrateBrickWizard.java2
-rw-r--r--src/org.gluster.storage.management.gateway/src/org/gluster/storage/management/gateway/tasks/MigrateBrickTask.java12
2 files changed, 10 insertions, 4 deletions
diff --git a/src/org.gluster.storage.management.console/src/org/gluster/storage/management/console/dialogs/MigrateBrickWizard.java b/src/org.gluster.storage.management.console/src/org/gluster/storage/management/console/dialogs/MigrateBrickWizard.java
index e86b402..7baae6b 100644
--- a/src/org.gluster.storage.management.console/src/org/gluster/storage/management/console/dialogs/MigrateBrickWizard.java
+++ b/src/org.gluster.storage.management.console/src/org/gluster/storage/management/console/dialogs/MigrateBrickWizard.java
@@ -64,7 +64,7 @@ public class MigrateBrickWizard extends Wizard {
String dialogTitle = "Brick migration";
try {
- String reference = volume.getName() + "-" + sourceDir + "-" + targetDir;
+ String reference = volume.getName() + "#" + sourceDir + "#" + targetDir;
TaskInfo existingTaskInfo = GlusterDataModelManager.getInstance().getTaskByReference(reference);
if (existingTaskInfo != null && existingTaskInfo.getStatus().getCode() != Status.STATUS_CODE_SUCCESS
&& existingTaskInfo.getStatus().getCode() != Status.STATUS_CODE_FAILURE) {
diff --git a/src/org.gluster.storage.management.gateway/src/org/gluster/storage/management/gateway/tasks/MigrateBrickTask.java b/src/org.gluster.storage.management.gateway/src/org/gluster/storage/management/gateway/tasks/MigrateBrickTask.java
index 6cf4777..7e61f61 100644
--- a/src/org.gluster.storage.management.gateway/src/org/gluster/storage/management/gateway/tasks/MigrateBrickTask.java
+++ b/src/org.gluster.storage.management.gateway/src/org/gluster/storage/management/gateway/tasks/MigrateBrickTask.java
@@ -96,7 +96,7 @@ public class MigrateBrickTask extends Task {
// online server might have gone Offline. try with a new one.
startMigration(getNewOnlineServer().getName());
} else {
- throw new GlusterRuntimeException(e.getMessage());
+ throw new GlusterRuntimeException("Error while starting migration!", e);
}
}
}
@@ -105,6 +105,7 @@ public class MigrateBrickTask extends Task {
String volumeName = getTaskInfo().getReference().split("#")[0];
glusterInterface.startBrickMigration(onlineServerName, volumeName, getFromBrick(), getToBrick());
getTaskInfo().setStatus(new TaskStatus(new Status(Status.STATUS_CODE_RUNNING, "Brick Migration Started.")));
+ System.out.println(getTaskInfo().getStatus().toString());
}
@Override
@@ -193,9 +194,14 @@ public class MigrateBrickTask extends Task {
if (e instanceof ConnectionException || serverUtil.isServerOnline(getOnlineServer()) == false) {
// online server might have gone offline. try with a new one.
return checkMigrationStatus(getNewOnlineServer().getName());
- }
+ } else {
+ if(e instanceof GlusterRuntimeException) {
+ throw ((GlusterRuntimeException)e);
+ } else {
+ throw new GlusterRuntimeException("Exception while checking brick migration status!", e);
+ }
+ }
}
- return null;
}
private TaskStatus checkMigrationStatus(String serverName) {