gerrit/gerrit-server
Edwin Kempin 3015c22f07 AccountCache#evictAll(): Remove indexing and rename it to evictAllNoReindex()
Evicting an account from the account cache by the evict(Account.Id)
method implies that the account is reindexed. Hence the expectation for
evictAll() was that it would reindex all accounts, however this was not
working, since AccountCacheimpl#evictAll was first removing all accounts
from the cache and then it iterated over the empty cache to do the
reindexing. Even if we would have saved all cached accounts in a local
variable before emptying the cache this would have only reindexed
accounts that were cached, but not all accounts. Since all caller of
evictAll() don't need reindexing of all accounts, but only dropping of
all entries from the cache, the reindexing logic is removed from
evictAll() and the method is renamed to evictAllNoReindex() to make this
clear. The single caller (besides test code) is updating the default
preferences and must evict all accounts from the cache because the
general preferences are part of the Account instances in the cache,
however non of the fields in the account index uses the preferences,
hence reindex is not needed.

Change-Id: If461ea914a15bc962486628bbc8478654d520f39
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-19 09:19:50 +02:00
..
src AccountCache#evictAll(): Remove indexing and rename it to evictAllNoReindex() 2017-06-19 09:19:50 +02:00
BUILD Bazel: Format build files with buildifier 2017-06-15 21:38:14 +02:00