Greg Padgett has posted comments on this change.

Change subject: core: Enable Live Merge in Snapshots Overview
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.ovirt.org/#/c/32338/4/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskSnapshotsCommandCallback.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskSnapshotsCommandCallback.java:

Line 9: import org.ovirt.engine.core.compat.Guid;
Line 10: import org.ovirt.engine.core.utils.log.Log;
Line 11: import org.ovirt.engine.core.utils.log.LogFactory;
Line 12: 
Line 13: public class RemoveDiskSnapshotsCommandCallback extends 
CommandCallBack {
> How come the callback is still needed if we're using async tasks mechanism?
We need it here because if we called RemoveSnapshotSingleDiskLive with 
runCommand, it would return immediately without leaving an async task for the 
task handler framework to track--so there'd be nothing to trigger endAction/the 
next task handler/etc.

Instead, it's meant to be called via CommandExecutor, which provides the 
command status through the callbacks.  In order for 
RemoveSnapshotSingleDiskLive to be agnostic about who its caller is, a 
CommandExecutor-run command always reports status via the callbacks.  It's the 
caller's responsibility to provide a callback to bridge the CommandExecutor 
command status to the "regular" command status, as done here and in 
RemoveSnapshotCommandCallback.

(NB I agree it would be nice if the code was shorter, but I suppose this is the 
price we pay for the additional flow control provided by CoCo--especially when 
combining it with the flow control provided by task handlers.)
Line 14:     private static final Log log = 
LogFactory.getLog(RemoveDiskSnapshotsCommandCallback.class);
Line 15: 
Line 16:     @Override
Line 17:     public void doPolling(Guid cmdId, List<Guid> childCmdIds) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I30d152a70ebdeacf0410d7ad15a49e44fb564a18
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Greg Padgett <[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