Ravi Nori has posted comments on this change.

Change subject: [WIP] core: introduce AsyncTaskStrategy
......................................................................


Patch Set 2:

(6 comments)

http://gerrit.ovirt.org/#/c/26912/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/AsyncTaskBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/AsyncTaskBase.java:

Line 63:         return getParameters().getStoragePoolID();
Line 64:     }
Line 65: 
Line 66:     private AsyncTaskStrategy strategy;
Line 67:     private AsyncTaskStrategyType strategyType;
Why do we need both strategy and strategyType? I think this is same as Yair's 
question, just from strategy you should be able to determine the type.
Line 68: 
Line 69:     protected AsyncTaskStrategy getStrategy() {
Line 70:         return strategy;
Line 71:     }


Line 64:     }
Line 65: 
Line 66:     private AsyncTaskStrategy strategy;
Line 67:     private AsyncTaskStrategyType strategyType;
Line 68: 
Please move all declarations to the top of the class, including the declaration 
at line 32.
Line 69:     protected AsyncTaskStrategy getStrategy() {
Line 70:         return strategy;
Line 71:     }
Line 72: 


http://gerrit.ovirt.org/#/c/26912/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/SPMTaskStrategy.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/SPMTaskStrategy.java:

Line 35:         if (cachedStatusTask == null) {
Line 36:             // Set to running in order to continue polling the task in 
case SPM hasn't loaded the tasks yet..
Line 37:             returnedStatusTask = new 
AsyncTaskStatus(AsyncTaskStatusEnum.unknown);
Line 38: 
Line 39:             log.errorFormat("AsyncTaskBase::PollTask: Task '{0}' 
(Parent Command {1}, Parameters Type {2}) " +
AsyncTaskBase in log message is misleading here
Line 40:                             "was not found in VDSM, will change its 
status to unknown.",
Line 41:                     task.getVdsmTaskId(), 
task.getParameters().getDbAsyncTask().getaction_type(),
Line 42:                     task.getParameters().getClass().getName());
Line 43:         } else {


Line 49:     @Override
Line 50:     public VDSReturnValue clearTaskRemote() {
Line 51:         VDSReturnValue vdsReturnValue = null;
Line 52:         try {
Line 53:             log.infoFormat("SPMAsyncTask::clearTaskRemote: Attempting 
to clear task '{0}'", task.getVdsmTaskId());
SPMAsyncTask in log message is misleading
Line 54:             vdsReturnValue = 
task.getCommandCoordinator().clearTask(getStoragePoolID(), 
task.getVdsmTaskId());
Line 55:         }
Line 56:         catch (RuntimeException e) {
Line 57:             log.error(String.format("SPMAsyncTask::clearTaskRemote: 
Clearing task '%1$s' threw an exception.",


Line 53:             log.infoFormat("SPMAsyncTask::clearTaskRemote: Attempting 
to clear task '{0}'", task.getVdsmTaskId());
Line 54:             vdsReturnValue = 
task.getCommandCoordinator().clearTask(getStoragePoolID(), 
task.getVdsmTaskId());
Line 55:         }
Line 56:         catch (RuntimeException e) {
Line 57:             log.error(String.format("SPMAsyncTask::clearTaskRemote: 
Clearing task '%1$s' threw an exception.",
SPMAsyncTask in log message is misleading
Line 58:                     task.getVdsmTaskId()), e);
Line 59:         }
Line 60:         return vdsReturnValue;
Line 61:     }


http://gerrit.ovirt.org/#/c/26912/2/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/asynctasks/AsyncTaskStrategyType.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/asynctasks/AsyncTaskStrategyType.java:

Line 10:     public static AsyncTaskStrategyType forValue(int value) {
Line 11:         return values()[value];
Line 12:     }
Line 13: 
Line 14:     public boolean isSPMStrategy() {
> i thought that one of the reasonsof having strategy is so we would not have
+1
Line 15:         return (this == SPMTaskStrategy);
Line 16:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I460b98c3d4b38243da61433d08c16f1cde5b9e17
Gerrit-PatchSet: 2
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: Liron Ar <[email protected]>
Gerrit-Reviewer: Ravi Nori <[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