GroupIncludeCache: Return Collection instead of Set
All callers of these methods simply iterate over the elements, they don't perform any set lookups. Returning Collection instead of Set allows us to store ImmutableLists internally, which have much less memory overhead on servers with lots of groups. Change-Id: I12e6ef0d03d9b06c112e4d1203603b23cafaf903
This commit is contained in:
@@ -16,18 +16,18 @@ package com.google.gerrit.server.account;
|
||||
|
||||
import com.google.gerrit.reviewdb.client.AccountGroup;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Collection;
|
||||
|
||||
/** Tracks group inclusions in memory for efficient access. */
|
||||
public interface GroupIncludeCache {
|
||||
/** @return groups directly a member of the passed group. */
|
||||
Set<AccountGroup.UUID> subgroupsOf(AccountGroup.UUID group);
|
||||
Collection<AccountGroup.UUID> subgroupsOf(AccountGroup.UUID group);
|
||||
|
||||
/** @return any groups the passed group belongs to. */
|
||||
Set<AccountGroup.UUID> parentGroupsOf(AccountGroup.UUID groupId);
|
||||
Collection<AccountGroup.UUID> parentGroupsOf(AccountGroup.UUID groupId);
|
||||
|
||||
/** @return set of any UUIDs that are not internal groups. */
|
||||
Set<AccountGroup.UUID> allExternalMembers();
|
||||
Collection<AccountGroup.UUID> allExternalMembers();
|
||||
|
||||
void evictSubgroupsOf(AccountGroup.UUID groupId);
|
||||
void evictParentGroupsOf(AccountGroup.UUID groupId);
|
||||
|
||||
Reference in New Issue
Block a user