Greg Padgett has posted comments on this change. Change subject: [WIP] core: introduce AsyncTaskStrategy ......................................................................
Patch Set 2: (6 comments) Thanks for the reviews, replies in-line. 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 Thanks, not needed. This is a relic from a prior implementation I had, to avoid returning the AsyncTaskStrategy object to the caller. (Exposing the strategy at all isn't nice either... but we'll focus that discussion in other files' comments.) 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 declara I'll add a patch in the series to do this. 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 Will fix 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 will fix 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 will fix 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() { > +1 I agree, exposing the strategy is ugly. After I get the Live Merge features coded, I'll work on getting rid of this. 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 <gpadg...@redhat.com> Gerrit-Reviewer: Adam Litke <ali...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com> Gerrit-Reviewer: Greg Padgett <gpadg...@redhat.com> Gerrit-Reviewer: Liron Ar <lara...@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