Revert external ID cache
It make more sense to include the commit SHA-1 of the notes branch from which the external IDs have been read into the cache key. This makes it easier to implement this cache within a multimaster setup. However, obviously, we can include the commit SHA-1 of the notes branch into the cache key only after the external IDs have been migrated to NoteDb (because before this the notes branch does not exist yet). Revert the cache for now and re-add an improved version of the cache later with the change that implements the migration of the external IDs to NoteDb. This reverts the following commits: -2869caaf70: Add cache for external ids -48d5c9b9aa: Make ExternalIdCacheImpl.AllKey public -20e5507d46: ExternalIdCache: Add method to get external IDs by account ID + scheme Change-Id: I589242aad32a9c70718542ba950c0a351c594e54 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -26,7 +26,6 @@ import com.google.gerrit.reviewdb.client.AccountGroupMember;
|
||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||
import com.google.gerrit.server.account.AccountByEmailCache;
|
||||
import com.google.gerrit.server.account.AccountCache;
|
||||
import com.google.gerrit.server.account.ExternalIdCache;
|
||||
import com.google.gerrit.server.account.GroupCache;
|
||||
import com.google.gerrit.server.account.VersionedAuthorizedKeys;
|
||||
import com.google.gerrit.server.index.account.AccountIndexer;
|
||||
@@ -57,7 +56,6 @@ public class AccountCreator {
|
||||
private final AccountCache accountCache;
|
||||
private final AccountByEmailCache byEmailCache;
|
||||
private final AccountIndexer indexer;
|
||||
private final ExternalIdCache externalIdCache;
|
||||
|
||||
@Inject
|
||||
AccountCreator(SchemaFactory<ReviewDb> schema,
|
||||
@@ -66,8 +64,7 @@ public class AccountCreator {
|
||||
SshKeyCache sshKeyCache,
|
||||
AccountCache accountCache,
|
||||
AccountByEmailCache byEmailCache,
|
||||
AccountIndexer indexer,
|
||||
ExternalIdCache externalIdCache) {
|
||||
AccountIndexer indexer) {
|
||||
accounts = new HashMap<>();
|
||||
reviewDbProvider = schema;
|
||||
this.authorizedKeys = authorizedKeys;
|
||||
@@ -76,7 +73,6 @@ public class AccountCreator {
|
||||
this.accountCache = accountCache;
|
||||
this.byEmailCache = byEmailCache;
|
||||
this.indexer = indexer;
|
||||
this.externalIdCache = externalIdCache;
|
||||
}
|
||||
|
||||
public synchronized TestAccount create(String username, String email,
|
||||
@@ -94,13 +90,11 @@ public class AccountCreator {
|
||||
String httpPass = "http-pass";
|
||||
extUser.setPassword(httpPass);
|
||||
db.accountExternalIds().insert(Collections.singleton(extUser));
|
||||
externalIdCache.onCreate(extUser);
|
||||
|
||||
if (email != null) {
|
||||
AccountExternalId extMailto = new AccountExternalId(id, getEmailKey(email));
|
||||
extMailto.setEmailAddress(email);
|
||||
db.accountExternalIds().insert(Collections.singleton(extMailto));
|
||||
externalIdCache.onCreate(extMailto);
|
||||
}
|
||||
|
||||
Account a = new Account(id, TimeUtil.nowTs());
|
||||
|
||||
Reference in New Issue
Block a user