Eli Mesika has posted comments on this change.
Change subject: engine: Support for gluster asynchronous tasks(WIP)
......................................................................
Patch Set 3: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterTaskManager.java
Line 68: GlusterAsyncTask task =
GlusterTaskStatusUtil.getTaskStatus(taskId);
Line 69: //get step from db for the corresponding gluster task
Line 70: List<Step> steps =
DbFacade.getInstance().getStepDao().getStepsByExternalId(taskId);
Line 71: //update status in step table
Line 72: for (Step step: steps) {
Why not using a SP that gets the external id and does all of that in one
round-trip ?
Line 73: step.setDescription(getTaskMessage(step,task));
Line 74: if (hasTaskCompleted(task)) {
Line 75: //ExecutionHandler.endTaskStep(step.getId(),
getJobCompletedStatus(task));
Line 76:
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterTaskStatusUtil.java
Line 9: public class GlusterTaskStatusUtil {
Line 10:
Line 11: public static GlusterAsyncTask getTaskStatus(Guid taskId) {
Line 12: //TODO: Call VDS command to get status. Dummy for now
Line 13: GlusterAsyncTask task = new GlusterAsyncTask();
I think that it is better to define the VDS command and write the dummy code
there
Line 14: task.setTaskId(taskId);
Line 15: task.setType(GlusterTaskType.REBALANCE);
Line 16: task.setMessage(RandomUtils.instance().nextString(40));
Line 17:
task.setStatus(GlusterTaskStatus.forValue(RandomUtils.instance().nextInt(0,
4)));
--
To view, visit http://gerrit.ovirt.org/11840
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8a56785edef091bce74e2b7b0ba9a3314f1397f1
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sahina Bose <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Shireesh Anjal <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches