Moti Asayag has posted comments on this change.

Change subject: core: query long-time locks
......................................................................


Patch Set 1: Code-Review-1

(5 comments)

https://gerrit.ovirt.org/#/c/38246/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lock/InMemoryLockManager.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lock/InMemoryLockManager.java:

Line 312:             return null;
Line 313:         }
Line 314: 
Line 315:         Set<String> messages = internalLockView.getMessages();
Line 316:         
messages.remove(VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED);
the types are incompatible...either change the Set to VdcBllMessages (way out 
of the scope of this patch) or make sure to provide the string representation 
of VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED.name()
Line 317:         if (messages.isEmpty()) {
Line 318:             // VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED should 
only be used for
Line 319:             // short locks (locks for the execute phase) so we filter 
it and if no
Line 320:             // other lock exists, the entity should be displayed as 
unlocked


Line 321:             return null;
Line 322:         }
Line 323: 
Line 324:         return new org.ovirt.engine.core.common.locks.Lock(
Line 325:                 internalLockView.getExclusive(), messages);
does the formatter break this line ?
Line 326:     }
Line 327: 
Line 328:     /**
Line 329:      * The following class represents different locks which are kept 
inside InMemoryLockManager


https://gerrit.ovirt.org/#/c/38246/1/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/locks/Lock.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/locks/Lock.java:

Line 4: import java.util.ArrayList;
Line 5: import java.util.List;
Line 6: import java.util.Set;
Line 7: 
Line 8: public class Lock implements Serializable {
This isn't the actual Lock entity, just its details/description. I'd suggest to 
name it LockView / LockDetail / LockInfo
Line 9:     private static final long serialVersionUID = -4454507217567224398L;
Line 10: 
Line 11:     private boolean exclusive;
Line 12:     private List<String> messages;


Line 8: public class Lock implements Serializable {
Line 9:     private static final long serialVersionUID = -4454507217567224398L;
Line 10: 
Line 11:     private boolean exclusive;
Line 12:     private List<String> messages;
why not Set ? Duplication is meaningless.
Line 13: 
Line 14:     public Lock() {
Line 15:     }
Line 16: 


https://gerrit.ovirt.org/#/c/38246/1/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/lock/LockManager.java
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/lock/LockManager.java:

Line 41:      * Query for lock for a given key
Line 42:      * @param key - key that the lock is mapped to
Line 43:      * @return lock for the given key, null if does not exist
Line 44:      */
Line 45:     Lock query(String key);
maybe just "getLock[Info|Details]" ?


-- 
To view, visit https://gerrit.ovirt.org/38246
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iafcab44ef52d21405eeaaeb2cda4c03864a0e8e8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skriva...@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: 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