Ravi Nori has posted comments on this change.

Change subject: engine : Introduction of CallBack interface
......................................................................


Patch Set 8:

(4 comments)

http://gerrit.ovirt.org/#/c/26333/8/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 77:     private static final Object LOCK = new Object();
Line 78:     private CommandCoordinator coco;
Line 79: 
Line 80:     public static AsyncTaskManager getInstance() {
Line 81:         return taskManager;
> I don't think this API is good because it might return null if someone call
AsyncTaskManager is initialized at engine startup, so adding this method as 
Yair had suggested is a convenience method.
Line 82:     }
Line 83: 
Line 84:     public static AsyncTaskManager getInstance(CommandCoordinator 
coco) {
Line 85:         if (taskManager == null) {


http://gerrit.ovirt.org/#/c/26333/8/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 31: import org.ovirt.engine.core.utils.log.Log;
Line 32: import org.ovirt.engine.core.utils.log.LogFactory;
Line 33: import org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil;
Line 34: 
Line 35: public class CommandCoordinatorImpl extends CommandCoordinator {
> do you plan to add other implementation of CommandCoordinator? otherwise, t
Hi Arik,

I think it is better to pass around the interface of CommandCoordinator rather 
than the actual implementation, at this point I am not going to create another 
instance of CoCo but I want to keep that option open.

Plus all code in bll/tasks can be moved (might happen) to another package and 
other parts of the code that use the interface Coco and dont have to change.
Line 36: 
Line 37:     private static final Log log = 
LogFactory.getLog(CommandCoordinator.class);
Line 38: 
Line 39:     CommandCoordinatorImpl() {


http://gerrit.ovirt.org/#/c/26333/8/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/SPMAsyncTask.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/SPMAsyncTask.java:

Line 22: import org.ovirt.engine.core.utils.log.Log;
Line 23: import org.ovirt.engine.core.utils.log.LogFactory;
Line 24: 
Line 25: public class SPMAsyncTask {
Line 26:     CommandCoordinator coco;
> private?
Will change
Line 27:     public SPMAsyncTask(CommandCoordinator coco, AsyncTaskParameters 
parameters) {
Line 28:         this.coco = coco;
Line 29:         setParameters(parameters);
Line 30:         setState(AsyncTaskState.Initializing);


http://gerrit.ovirt.org/#/c/26333/8/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/TaskManagerUtil.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/TaskManagerUtil.java:

Line 13: import org.ovirt.engine.core.compat.Guid;
Line 14: 
Line 15: public class TaskManagerUtil {
Line 16: 
Line 17:     public static final CommandCoordinatorImpl coco = new 
CommandCoordinatorImpl();
> s/public static final CommandCoordinatorImpl/public static final CommandCoo
I fixed it at a latter patch, but I think this is the right place to fix it

Will change
Line 18: 
Line 19:     public static void startPollingTask(Guid taskID) {
Line 20:         getAsyncTaskManager().startPollingTask(taskID);
Line 21:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8c12315c96168fd32dc05ac6de336ccdd63c9fbc
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadg...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to