Yair Zaslavsky has posted comments on this change.
Change subject: engine : Persist all async task place holders
......................................................................
Patch Set 3: (4 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
Line 110:
Line 111: Map<Guid, CommandBase<?>> diskIdsToCommandMap = new HashMap<>();
Line 112:
Line 113: @Override
Line 114: protected void insertAsyncTaskPlaceHolders() {
Ravi, can't we have a more general method here? I think this flow is going to
repeat itself and become a pattern.
Can't we somehow have a method/groups of methods that creates the map, prepares
the command, perfroms construct command in a loop and runInTransaction?
Line 115: Guid vmSnapshotId = Guid.NewGuid();
Line 116:
Line 117: for (DiskImage diskImage : mImages) {
Line 118: CreateImageTemplateParameters createParams = new
CreateImageTemplateParameters(diskImage.getImageId(),
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
Line 1228: * @return
Line 1229: */
Line 1230: protected CommandBase<?> constructCommand(VdcActionType
actionType,
Line 1231: VdcActionParametersBase parameters,
Line 1232: boolean runAsInternal,
IMHO runAsIternal is redundant as child commands are always internal.
What do you think?
Line 1233: CommandContext context) {
Line 1234: ExecutionHandler.evaluateCorrelationId(parameters);
Line 1235: CommandBase<?> command =
CommandsFactory.CreateCommand(actionType, parameters);
Line 1236: command.setInternalExecution(runAsInternal);
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateImageTemplateCommand.java
Line 52:
ImagesHandler.getAllImageSnapshots(getDiskImage().getImageId(),
getDiskImage().getImageTemplateId()));
Line 53:
Line 54:
setDiskImage(getDiskImage().getSnapshots().get(getDiskImage().getSnapshots().size()
- 1));
Line 55: DiskImage newImage = cloneDiskImage(getDestinationImageId());
Line 56: fillVolumeInformation(newImage);
Where do we set the returned taskId from vdsm?
Not sure I understood...
Line 57:
Line 58: getReturnValue().getAsyncTaskIdList().add(taskId);
Line 59:
Line 60: VDSReturnValue vdsReturnValue = Backend
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunner.java
Line 170: command.getActionType(),
Line 171: command.isInternalExecution());
Line 172: }
Line 173:
ThreadLocalParamsContainer.setCorrelationId(command.getCorrelationId());
Line 174: command.checkCanDoAction();
Ravi, why is "checkCanDoAction" needed if the command passed validation?
Line 175: command.insertAsyncTaskPlaceHolders();
Line 176: command.executeAction();
Line 177: }
Line 178:
--
To view, visit http://gerrit.ovirt.org/14819
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2bdd4a377c3be055c48357881f731f7d1c01c3cb
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches