Moti Asayag has posted comments on this change.

Change subject: engine: remove the use of @LockIdNameAttribute
......................................................................


Patch Set 15:

(8 comments)

http://gerrit.ovirt.org/#/c/25944/15/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java:

Line 1687: 
Line 1688:     protected void setLock(EngineLock lock) {
Line 1689:         commandLock = lock;
Line 1690:     }
Line 1691: 
please add javadoc
Line 1692:     protected final LockProperties getLockingPropertiesSettings() {
Line 1693:         return LockProperties.create(Scope.None).setWait(false);
Line 1694:     }
Line 1695: 


Line 1699:      */
Line 1700:     protected LockProperties applyLockProperties(LockProperties 
lockProperties) {
Line 1701:         return lockProperties;
Line 1702:     }
Line 1703: 
please add javadoc
Line 1704:     protected LockProperties getLockProperties() {
Line 1705:         LockProperties lockProperties = 
_parameters.getLockProperties();
Line 1706:         if (lockProperties == null) {
Line 1707:             lockProperties = 
applyLockProperties(getLockingPropertiesSettings());


Line 1706:         if (lockProperties == null) {
Line 1707:             lockProperties = 
applyLockProperties(getLockingPropertiesSettings());
Line 1708:             _parameters.setLockProperties(lockProperties);
Line 1709:         }
Line 1710:                 return lockProperties;
please use formatter to indent this method.
Line 1711:         }
Line 1712: 
Line 1713:     protected boolean acquireLock() {
Line 1714:         LockProperties lockProperties = getLockProperties();


Line 1708:             _parameters.setLockProperties(lockProperties);
Line 1709:         }
Line 1710:                 return lockProperties;
Line 1711:         }
Line 1712: 
shouldn't this be final ? is there a case in which we'd like other commands to 
implement this logic differently ?
Line 1713:     protected boolean acquireLock() {
Line 1714:         LockProperties lockProperties = getLockProperties();
Line 1715:         boolean returnValue = true;
Line 1716:         if (!Scope.None.equals(lockProperties.getScope())) {


http://gerrit.ovirt.org/#/c/25944/15/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/LockProperties.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/LockProperties.java:

Line 1: package org.ovirt.engine.core.common.action;
Line 2: 
Line 3: import java.io.Serializable;
Line 4: 
please add javadoc to the class, to the enum and for the public methods.

This is important for anyone which intends to use the new locking and for 
conducting a proper review.
Line 5: public class LockProperties implements Serializable {
Line 6: 
Line 7:     public static enum Scope { Execution, Command, None }
Line 8:     private Scope scope = Scope.None;


Line 2: 
Line 3: import java.io.Serializable;
Line 4: 
Line 5: public class LockProperties implements Serializable {
Line 6: 
please add generated serialization id
Line 7:     public static enum Scope { Execution, Command, None }
Line 8:     private Scope scope = Scope.None;
Line 9:     private boolean wait = true;
Line 10: 


Line 3: import java.io.Serializable;
Line 4: 
Line 5: public class LockProperties implements Serializable {
Line 6: 
Line 7:     public static enum Scope { Execution, Command, None }
please explain each scope via javadoc (separation to lines will be fine and 
probably that's the way the formatter would have format this code anyway.
Line 8:     private Scope scope = Scope.None;
Line 9:     private boolean wait = true;
Line 10: 
Line 11:     private LockProperties() {}


Line 17:     public LockProperties setWait(boolean wait) {
Line 18:         this.wait = wait;
Line 19:         return this;
Line 20:     }
Line 21: 
please see the agreed convention regarding preferring withXXX instead of setXXX 
to perform the setting operation and returning this, as done in recently 
submitted CommandContext.
Line 22:     public LockProperties setScope(Scope scope) {
Line 23:         this.scope = scope;
Line 24:         return this;
Line 25:     }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie57e4f7c00ebcd6a4e9e0e61b7d26f50f2d00858
Gerrit-PatchSet: 15
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Sahina Bose <sab...@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