Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

93247: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud)
      93129: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1)
         93098: MNT-12849 "My Sites public API is not returning the expected list of sites"


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94945 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 12:14:27 +00:00
parent 4912765624
commit 744d19fdae
4 changed files with 153 additions and 7 deletions

View File

@@ -145,7 +145,11 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
super();
}
public int getZoneAuthoritySampleSize()
{
return zoneAuthoritySampleSize;
}
/**
* Sets number of authorities in a zone to pre-cache, allowing quick generation of 'first n' results and adaption of
* search technique based on hit rate.
@@ -532,7 +536,7 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
}
final PagingResults<PersonInfo> ppr = personService.getPeople(filter, true, sort, pagingRequest);
List<PersonInfo> result = ppr.getPage();
final List<String> auths = new ArrayList<String>(result.size());
@@ -911,7 +915,9 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
}, tenantService.getDomainUser(AuthenticationUtil.getSystemUserName(), currentUserDomain));
zoneAuthorityCache.put(cacheKey, zoneAuthorities);
}
int numAuthorities = zoneAuthorities.size();
// Now search each for the required authority. If the number of results is greater than or close to the size
// limit, then this will be the most efficient route
Set<String> result = new TreeSet<String>();
@@ -950,7 +956,8 @@ public class AuthorityDAOImpl implements AuthorityDAO, NodeServicePolicies.Befor
}
// If this top down search is not providing an adequate hit count then resort to a naiive unlimited search
if (processed >= maxToProcess)
// we need to compare to the actual number of authorities cached or newly fetched from the database
if (processed >= numAuthorities)
{
Set<String> unfilteredResult;
boolean filterZone;