Yair Zaslavsky has posted comments on this change. Change subject: engine : Make Async Tasks Manager aware of child CoCo tasks ......................................................................
Patch Set 3: (5 comments) http://gerrit.ovirt.org/#/c/36824/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateSnapshotCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateSnapshotCommand.java: Line 90: VDSReturnValue vdsReturnValue = null; Line 91: Line 92: try { Line 93: VdcActionParametersBase params = new VdcActionParametersBase(); Line 94: VdcActionType parentCommand = getParameters().getParentCommand() != VdcActionType.Unknown ? Consider having a method at command base that will save some of this code in the line, as you are probably going to repeat it in many places. It's similar to the method "getParentParameters"/ Line 95: getParameters().getParentCommand() : VdcActionType.CreateAllSnapshotsFromVm; Line 96: params.setParentParameters(getParametersForTask(parentCommand, getParameters())); Line 97: params.setParentCommand(parentCommand); Line 98: CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.TestParent, http://gerrit.ovirt.org/#/c/36824/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/AsyncTaskManager.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/AsyncTaskManager.java: Line 803: } Line 804: return users; Line 805: } Line 806: Line 807: public boolean isAsyncTask(Guid cmdId) { Name of method is milsleading, should be doesCommandContainAsyncTasks Line 808: for (SPMTask task : _tasks.values()) { Line 809: if (task.getParameters().getDbAsyncTask().getCommandId().equals(cmdId)) { Line 810: return true; Line 811: } http://gerrit.ovirt.org/#/c/36824/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandAsyncTask.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandAsyncTask.java: Line 114: }); Line 115: } Line 116: } Line 117: Line 118: private boolean hasRunningChildCoCoCommands() { Why not just HasRunningChildCommands? Line 119: Guid rootCmdId = getParameters().getDbAsyncTask().getRootCommandId(); Line 120: for (CommandEntity entity : coco.getChildCmdsByParentCmdId(rootCmdId)) { Line 121: if (!hasCompleted(entity) && !coco.isAsyncTask(entity.getId())) { Line 122: return true; http://gerrit.ovirt.org/#/c/36824/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandCoordinatorImpl.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandCoordinatorImpl.java: Line 365: new SPMTaskGuidBaseVDSCommandParameters(storagePoolID, vdsmTaskID)); Line 366: } Line 367: Line 368: @Override Line 369: public boolean isAsyncTask(Guid cmdId) { Ok, now I understand the misleaidng name from before. Hmm, And still if possible i would like to get the name changed. Line 370: return AsyncTaskManager.getInstance().isAsyncTask(cmdId); Line 371: } Line 372: Line 373: private VDSReturnValue runVdsCommand(VDSCommandType commandType, VDSParametersBase parameters) { http://gerrit.ovirt.org/#/c/36824/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/interfaces/TaskHelper.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/interfaces/TaskHelper.java: Line 64: SPMTask construct(AsyncTaskCreationInfo creationInfo, AsyncTask asyncTask); Line 65: Line 66: SPMTask construct(AsyncTaskType taskType, AsyncTaskParameters asyncTaskParams, boolean duringInit); Line 67: Line 68: boolean isAsyncTask(Guid cmdId); Ah, so you did add a method to an interface, ok, so please - "doesCommandHaveAsyncTasks" Thanks! -- To view, visit http://gerrit.ovirt.org/36824 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d877309fd150280cd7ba6993b341a9044a4572f Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ravi Nori <[email protected]> Gerrit-Reviewer: Daniel Erez <[email protected]> Gerrit-Reviewer: Eli Mesika <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: Ravi Nori <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
