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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user