Yair Zaslavsky has posted comments on this change.

Change subject: core: introduce context pattern
......................................................................


Patch Set 37:

(7 comments)

http://gerrit.ovirt.org/#/c/28829/37/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java:

Line 597:         getVmStaticDAO().incrementDbGeneration(getVmTemplateId());
Line 598:         for (VdcActionParametersBase p : 
getParameters().getImagesParameters()) {
Line 599:             
Backend.getInstance().endAction(VdcActionType.CreateImageTemplate,
Line 600:                     p,
Line 601:                     
getContext().duplicate().resetCompensationContext().resetExecutionContext().resetLock());
> now I get it! sorry, I thought there was logic change request.
i will fix in next round.
Line 602:         }
Line 603:         if (reloadVmTemplateFromDB() != null) {
Line 604:             endDefaultOperations();
Line 605:         }


http://gerrit.ovirt.org/#/c/28829/37/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InternalMigrateVmCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InternalMigrateVmCommand.java:

Line 12: @NonTransactiveCommandAttribute
Line 13: public class InternalMigrateVmCommand<T extends 
InternalMigrateVmParameters> extends MigrateVmCommand<MigrateVmParameters> {
Line 14: 
Line 15:     public InternalMigrateVmCommand(T parameters, CommandContext 
cmdContext) {
Line 16:         super(new MigrateVmParameters(parameters));
> the context should be passed..
thanks, i''ll fix that in next round.
Line 17:     }
Line 18: 
Line 19:     @Override
Line 20:     protected void executeCommand() {


http://gerrit.ovirt.org/#/c/28829/37/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java:

Line 249: 
Line 250:     private void endCommandActions() {
Line 251:         getBackend().endAction(getImagesActionType(),
Line 252:                 getParameters(),
Line 253:                 
getContext().duplicate().resetCompensationContext().resetExecutionContext().resetLock());
> are you sure that we need to reset the execution-context? child commands do
correct, thanks for this!
Line 254:         setSucceeded(true);
Line 255:     }
Line 256: 
Line 257:     @Override


http://gerrit.ovirt.org/#/c/28829/37/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunner.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunner.java:

Line 63:                 if (returnValue == null) {
Line 64:                     CommandBase<?> command = isInternal ?
Line 65:                                     
CommandsFactory.createCommand(actionType, parameter, commandContext.duplicate()
Line 66:                                     .resetCompensationContext()
Line 67:                                     .resetExecutionContext()) :
> why reset the execution-context? let's say migrations are fired from within
Done
Line 68:                                     
CommandsFactory.createCommand(actionType, parameter);
Line 69: 
Line 70:                     command.setInternalExecution(isInternal);
Line 71:                     getCommands().add(command);


http://gerrit.ovirt.org/#/c/28829/37/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/PermissionsCommandBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/PermissionsCommandBase.java:

Line 23:         super(commandId);
Line 24:     }
Line 25: 
Line 26:     public PermissionsCommandBase(T parameters) {
Line 27:         super(parameters);
> this(parameters, null) ?
yes.
Line 28:     }
Line 29: 
Line 30:     public PermissionsCommandBase(T parameters, CommandContext 
commandContext) {
Line 31:         super(parameters, commandContext);


http://gerrit.ovirt.org/#/c/28829/37/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemovePermissionCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemovePermissionCommand.java:

Line 23:         super(commandId);
Line 24:     }
Line 25: 
Line 26:     public RemovePermissionCommand(T parameters) {
Line 27:         super(parameters);
> this(parameters, null)?
Done
Line 28:     }
Line 29: 
Line 30:     public RemovePermissionCommand(T parameters, CommandContext 
commandContext) {
Line 31:         super(parameters, commandContext);


http://gerrit.ovirt.org/#/c/28829/37/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/job/ExecutionHandler.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/job/ExecutionHandler.java:

Line 509:     public static CommandContext createInternalJobContext(EngineLock 
lock) {
Line 510:         ExecutionContext executionContext = new ExecutionContext();
Line 511:         executionContext.setJobRequired(true);
Line 512:         executionContext.setMonitored(true);
Line 513:         return new CommandContext(new 
EngineContext()).setExecutionContext(executionContext).setLock(lock);
> reset compensation?
Done
Line 514:     }
Line 515: 
Line 516:     /**
Line 517:      * Creates a default execution context for an inner command which 
creates VDSM tasks so the tasks will be monitored


-- 
To view, visit http://gerrit.ovirt.org/28829
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I310f5f77fff78b3232ee77fe63791425fd521516
Gerrit-PatchSet: 37
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Tal Nisan <[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

Reply via email to