Alon Bar-Lev has posted comments on this change.

Change subject: aaa: Optimizing fetchPrincipalIdsRecursively
......................................................................


Patch Set 7:

(4 comments)

http://gerrit.ovirt.org/#/c/29880/7/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java
File 
backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java:

Line 7
Line 8
Line 9
Line 10
Line 11
we should move this to uutils


Line 62:         }
Line 63:         while (!idsToFetchPerNamespace.isEmpty()) {
Line 64:             List<ExtMap> groups = new ArrayList<>();
Line 65:             for (String namespaceOfIdsToFetch: 
idsToFetchPerNamespace.keySet()) {
Line 66:                 groups.addAll(findGroupRecordsByIds(extension, 
namespace, new 
ArrayList<String>(idsToFetchPerNamespace.get(namespaceOfIdsToFetch)), true, 
false));
why don't you use Map.Entry?
Line 67:             }
Line 68:             idsToFetchPerNamespace.clear();
Line 69:             for (ExtMap group : groups) {
Line 70:                 groupsCache.put(group.<String> get(GroupRecord.ID), 
group);


Line 82:         return principals;
Line 83:     }
Line 84: 
Line 85:     private static void addIdToFetch(Map<String, Set<String>> 
idsToFetchPerNamespace, ExtMap memberOf) {
Line 86:         
MultiValueMapUtils.addToMapOfSets(memberOf.<String>get(PrincipalRecord.NAMESPACE),
 memberOf.<String> get(GroupRecord.ID), idsToFetchPerNamespace);
GroupRecord.NAMESPACE
Line 87:     }
Line 88: 
Line 89:     private static void constructGroupsMembershipTree(ExtMap entity, 
ExtKey key, Map<String, ExtMap> groupsCache) {
Line 90:         List<ExtMap> groups = new ArrayList<>();


Line 89:     private static void constructGroupsMembershipTree(ExtMap entity, 
ExtKey key, Map<String, ExtMap> groupsCache) {
Line 90:         List<ExtMap> groups = new ArrayList<>();
Line 91:         for (ExtMap memberOf : entity.get(key, Collections.<ExtMap> 
emptyList())) {
Line 92:             constructGroupsMembershipTree(memberOf, 
GroupRecord.GROUPS, groupsCache);
Line 93:             groups.add(groupsCache.get(memberOf.get(GroupRecord.ID)));
what do you do with groups? why is it declared outside of the scope of the loop?
Line 94:         }
Line 95:     }
Line 96: 
Line 97:     public static List<ExtMap> queryPrincipalRecords(


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I095bb91810e25d345fcd053cbd51d1d25a4b494d
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@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