Files
gerrit/gerrit-acceptance-tests
Edwin Kempin 3f57890fb8 Remove usage of AccountByEmailCache
With change I1c24da1378 there is a new Emails class that allows looking
up accounts by email. To find accounts by email it gets external IDs by
email from the ExternalIdCache and extracts the account IDs from the
external IDs. This is exactly what AccountByEmailCacheImpl.Loader was
doing. In addition the Emails class does an index lookup to also find
accounts by preferred email (see commit message of change I1c24da1378
for an explanation of why this is needed).

Adapt all code to use the new Emails class instead of the
AccountByEmailCache.

Looking up accounts by email via the ExternalIdCache means that the SHA1
of the refs/meta/external-ids branch is read on each lookup (to verify
that the cache is up to date). To avoid reading the SHA1 of the
refs/meta/external-ids branch multiple times when looking up accounts
by email in a loop the Emails class offers a method that can lookup
accounts for several emails at once. This method is currently not used
by Gerrit core, but plugins may need it (e.g. the find-owners plugin).

When emails are changed the ExternalIdCache is automatically evicted
since it detects when the refs/meta/external-ids branch was updated,
hence manual cache eviction for this cache is not needed.

Accounts are also reindexed if the preferred email is changed so that
looking up accounts by preferred email via the account index always
returns up-to-date results.

The AccountByEmailCache is only removed in the follow-up change. This
allows Google to adapt internal code to use the new API before the
AccountByEmailCache is dropped.

Change-Id: I991d21b1acc11025a23504655b5a2c4fea795acf
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-08-08 14:17:18 +02:00
..