Remove AllUsersName from AccountState

AccountState grew a field referencing the name of 'All-Users'. This
field was populated solely for indexing. We want to reduce account state
to the bare minimum information in a sense that it only carries fields
that relate to the account and make the entity immutable if possible.

This commit removes the field and migrates callers. It is perfectly fine
to index an account and build the REF_STATE from the default name. This
is only ever used for checking staleness of the account document where
we have the real All-Users name available for usage.

Change-Id: Idb91a15bef1427bd8026da23a345dd1601d3959d
This commit is contained in:
Patrick Hiesel
2019-07-12 09:58:20 +02:00
parent a02aa0ac5d
commit fd905ba8f0
11 changed files with 32 additions and 64 deletions

View File

@@ -20,8 +20,6 @@ import com.google.gerrit.common.Nullable;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.server.account.AccountCache;
import com.google.gerrit.server.account.AccountState;
import com.google.gerrit.server.config.AllUsersName;
import com.google.gerrit.server.config.AllUsersNameProvider;
import com.google.gerrit.server.util.time.TimeUtil;
import java.util.HashMap;
import java.util.Map;
@@ -78,6 +76,6 @@ public class FakeAccountCache implements AccountCache {
}
private static AccountState newState(Account account) {
return AccountState.forAccount(new AllUsersName(AllUsersNameProvider.DEFAULT), account);
return AccountState.forAccount(account);
}
}