Arik Hadas has posted comments on this change.

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


Patch Set 8:

(4 comments)

partial review

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 calls it 
before calling the other getInstance method.

how about delegate to the other getInstance with coco=null and in the other 
method to check that when we create AsyncTaskManager, the coco is not null?
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, this 
can reside in CommandCoordinator, no need for empty abstract class if no 
polymorphism is used
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?
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 
CommandCoordinator
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