Martin Peřina has posted comments on this change. Change subject: restapi: Host Power-Management Refactor (#977674) - WIP ......................................................................
Patch Set 34: (6 comments) http://gerrit.ovirt.org/#/c/27578/34/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddFenceAgentCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddFenceAgentCommand.java: Line 26: } Line 27: Line 28: @Override Line 29: protected boolean canDoAction() { Line 30: if (getParameters() == null || getParameters().getAgent() == null || getParameters().getAgent().getIp() == null Could you please reformat to one condition per line staring with || operator? Line 31: || getParameters().getAgent().getOrder() == null || getParameters().getAgent().getHostId() == null Line 32: || getParameters().getAgent().getPassword() == null || getParameters().getAgent().getType() == null Line 33: || getParameters().getAgent().getUser() == null) { Line 34: return failCanDoAction(VdcBllMessages.VDS_ADD_FENCE_AGENT_MANDATORY_PARAMETERS_MISSING); http://gerrit.ovirt.org/#/c/27578/34/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProxyHostLocator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProxyHostLocator.java: Line 18: import org.slf4j.Logger; Line 19: import org.slf4j.LoggerFactory; Line 20: import org.ovirt.engine.core.utils.pm.VdsFenceOptions; Line 21: Line 22: public class ProxyHostLocator { Could you please rename it to FenceProxyLocator? So it would clearly say what type of proxy it locates Line 23: Line 24: private static final Logger log = LoggerFactory.getLogger(ProxyHostLocator.class); Line 25: Line 26: private final VDS _vds; Line 134: if (fencingPolicy != null) { Line 135: supported = Line 136: supported Line 137: && vds.getSupportedClusterVersionsSet() Line 138: .contains(FencingPolicyHelper.getMinimalSupportedVersion(fencingPolicy)); Once again: please don't remove minVersionSupportingFencingPol (originally in FenceExecutor), so we will not need to compute minimal supported version on each proxy test Line 139: } Line 140: return supported; Line 141: } Line 142: http://gerrit.ovirt.org/#/c/27578/34/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/FenceAgent.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/FenceAgent.java: Line 16: Line 17: private static final long serialVersionUID = -5910560758520427911L; Line 18: private Guid id; Line 19: private Guid hostId; Line 20: private Integer order; 1. order should always be specified (even when only 1 fence agent exists) 2. We could make code more readable (for example using operator comparison for primitive int instead of equals/compareTo for class) Once again: why not use primitive int? Line 21: Line 22: @EditableField Line 23: private HashMap<String, String> optionsMap; Line 24: http://gerrit.ovirt.org/#/c/27578/34/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/VDSReturnValue.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/vdscommands/VDSReturnValue.java: Line 5: Line 6: public class VDSReturnValue { Line 7: Line 8: private boolean succeeded; Line 9: private String exceptionString = ""; Please initialize instance variables only inside constructors Line 10: private Object returnValue; Line 11: private RuntimeException exceptionObject; Line 12: private AsyncTaskCreationInfo creationInfo; Line 13: private VDSError vdsError; http://gerrit.ovirt.org/#/c/27578/34/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java: Line 31: /** Line 32: * <code>VdsDAODbFacadeImpl</code> provides an implementation of {@code VdsDAO} that uses previously written code from Line 33: * {@code DbFacade}. Line 34: */ Line 35: public class VdsDAODbFacadeImpl extends BaseDAODbFacade implements VdsDAO { Is there any resolution to my comment for #18 (instead of adding another join to VDS fetching use subsequent db call to fetch fence agents for previously fetched VDSs)? Line 36: Line 37: @Override Line 38: public VDS get(Guid id) { Line 39: return get(id, null, false); -- To view, visit http://gerrit.ovirt.org/27578 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id0b384347a52db8b0aa6ae684fad40a5491dd2f7 Gerrit-PatchSet: 34 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ori Liel <ol...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com> Gerrit-Reviewer: Martin Peřina <mper...@redhat.com> Gerrit-Reviewer: Ori Liel <ol...@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