Yair Zaslavsky has posted comments on this change.

Change subject: engine : Add quartz to handle AsycCommands
......................................................................


Patch Set 7:

(4 comments)

http://gerrit.ovirt.org/#/c/28160/7/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandExecutor.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandExecutor.java:

Line 30: 
Line 31: public class CommandExecutor {
Line 32: 
Line 33:     private static final ExecutorService executor = 
Executors.newFixedThreadPool(Config.<Integer>getValue(ConfigValues.CommandCoordinatorThreadPoolSize));
Line 34:     private static final String 
BACKEND_COMMAND_OBJECTS_HANDLER_JNDI_NAME =
IMHO this is not the only place we have this constant in the code, can we move 
this to some helper class?
Line 35:             
"java:global/engine/bll/Backend!org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler";
Line 36:     private static final Log log = 
LogFactory.getLog(CommandExecutor.class);
Line 37: 
Line 38:     private final CommandCoordinator coco;


Line 41:     CommandExecutor(CommandCoordinator coco) {
Line 42:         this.coco = coco;
Line 43:         SchedulerUtil scheduler = 
SchedulerUtilQuartzImpl.getInstance();
Line 44:         scheduler.scheduleAFixedDelayJob(this, "timer_Elapsed", new 
Class[]{},
Line 45:                 new Object[]{}, 
Config.<Integer>getValue(ConfigValues.AsyncCommandPollingRate),
Imho it will be nice if you add InSeconds as a suffix to the enum literal.
Line 46:                 
Config.<Integer>getValue(ConfigValues.AsyncCommandPollingRate), 
TimeUnit.SECONDS);
Line 47:     }
Line 48: 
Line 49:     @OnTimerMethodAnnotation("timer_Elapsed")


Line 46:                 
Config.<Integer>getValue(ConfigValues.AsyncCommandPollingRate), 
TimeUnit.SECONDS);
Line 47:     }
Line 48: 
Line 49:     @OnTimerMethodAnnotation("timer_Elapsed")
Line 50:     public synchronized void timer_Elapsed() {
can we have a nice name to the method?
Line 51:         for (Guid cmdId : cmdCallBackMap.keySet()) {
Line 52:             CommandCallBack callBack = cmdCallBackMap.get(cmdId);
Line 53:             CommandStatus status = coco.getCommandStatus(cmdId);
Line 54:             switch(status) {


Line 53:             CommandStatus status = coco.getCommandStatus(cmdId);
Line 54:             switch(status) {
Line 55:                 case FAILED:
Line 56:                     callBack.onFailed(cmdId);
Line 57:                     callBack.notifyCompletion();
can u elaborate why we need this besides just onFailed and onSucceeded?
Line 58:                     break;
Line 59:                 case SUCCEEDED:
Line 60:                     callBack.onSucceeded(cmdId);
Line 61:                     callBack.notifyCompletion();


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I66b1e5945884aec412ba412e39266129004d7218
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@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