Revert "Remove unused CurrentUser#cacheKey method"

Revert "Adjust to changes in Gerrit core"

Revert submission 283559-currentuser-remove-cache-key

Reason for revert: Causes a latency regression for some hosts
Reverted Changes:
I76bfd3ebc:Adjust to changes in Gerrit core
If7ccfd9a4:Remove unused CurrentUser#cacheKey method
I1378ad083:Remove PerThreadCache

Change-Id: Idd9eb9cb91bb531ee75aa2c2cde26a01ceb5ff0a
This commit is contained in:
Patrick Hiesel
2020-10-16 09:05:46 +00:00
parent 37e0c4671c
commit 0e9b531949
9 changed files with 43 additions and 1 deletions

View File

@@ -91,6 +91,12 @@ public abstract class CurrentUser {
*/
public abstract GroupMembership getEffectiveGroups();
/**
* Returns a unique identifier for this user that is intended to be used as a cache key. Returned
* object should to implement {@code equals()} and {@code hashCode()} for effective caching.
*/
public abstract Object getCacheKey();
/** Unique name of the user on this server, if one has been assigned. */
public Optional<String> getUserName() {
return Optional.empty();