Files
gerrit/gerrit-acceptance-framework
Edwin Kempin 5c7864b9a1 Add new API to lookup accounts by email
Looking up accounts by email is currently done via the
AccountByEmailCache. However this cache is unneeded and we can just get
external IDs by email from the ExternalIdCache and then extract the
account IDs from the external IDs. This is exactly what
AccountByEmailCacheImpl.Loader is doing. Follow-up changes adapt the
Gerrit code to use the new API and then the AccountByEmailCache is
removed.

Using the new API is implemented in a separate change because this
change can only be submitted after I repaired our inconsistent internal
accounts. In the meantime plugins (e.g. the find-owners plugin) want to
implement new functionality based on the new API. Hence we want to merge
this change which adds the new API sooner.

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). This is a disadvantage if we need to
lookup many accounts by email in a loop, because then the SHA1 of the
refs/meta/external-ids branch is read once per email. This is why the
new API includes a method to lookup accounts for several emails at once
where the SHA1 of the refs/meta/external-ids branch is read only once.
Within Gerrit core we don't have a need for this method (yet), but
plugins may want to use it.

Change-Id: I757a4d065b4697977dc77cc269cd04e44f980ad0
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-07-24 16:30:57 +02:00
..
2017-06-08 12:19:03 +00:00