Allon Mureinik has posted comments on this change.

Change subject: vdsbroker: improve the domain visibility cache
......................................................................


Patch Set 2:

(3 comments)

Makes sense to me (except for some nits), but I'd really like Liron's feedback 
here.

http://gerrit.ovirt.org/#/c/23370/2/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/DomainVisibility.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/DomainVisibility.java:

Line 9: 
Line 10: import org.ovirt.engine.core.compat.Guid;
Line 11: 
Line 12: 
Line 13: /* For memory optimization DomainVisibility is not currently keeping 
the vds
First line should have "/**" (not the double asterisk) so it'll be interpreted 
as Javadoc.
Line 14:  * in ACTIVE state. Effectively ACTIVE and UNKNOWN states are 
indistinguishable
Line 15:  * at the present time. The current implementation allow us to use the 
cache
Line 16:  * to manage the MovingToMaintenance domain state but it probably 
won't be
Line 17:  * enough for a future MovingToActive state (where you want to verify 
that all


Line 52:         while (domainsIterator.hasNext()) {
Line 53:             if (!domains.contains(domainsIterator.next())) {
Line 54:                 domainsIterator.remove();
Line 55:             }
Line 56:         }
IIUC, this entire block can be replaced with 
domainsVisibility.retainAll(domains)
Line 57:     }
Line 58: 
Line 59:     public synchronized void setVdsDomainStatus(Guid vdsId, Guid 
domainId, Status status) {
Line 60:         Map<Guid, Status> domainVdsStatus = 
domainsVisibility.get(domainId);


Line 76:         HashSet<Guid> vdsList = new HashSet<>();
Line 77:         Map<Guid, Status> domainVdsStatus = 
domainsVisibility.get(domainId);
Line 78: 
Line 79:         for (Entry<Guid, Status> status : domainVdsStatus.entrySet()) {
Line 80:             if (status.getValue().isProblematic())
please surround the block with {}
Line 81:                 vdsList.add(status.getKey());
Line 82:         }
Line 83: 
Line 84:         return vdsList;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id74f12d108f75924fbff28409a89bc1caff05908
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[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