Save bloom filters for premium list entries

This is the first step in the migration to remove the need to load all of
the premium list entries every time the cache expires (which causes slow-
downs). Once this is deployed, we can re-save all premium lists, creating
the bloom filters, and then the next step will be to read from them to
more efficiently determine if a label might be premium.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=147525017
This commit is contained in:
mcilwain 2017-02-14 14:56:48 -08:00 committed by Ben McIlwain
parent cdadb54acd
commit e8c5720826
8 changed files with 188 additions and 16 deletions

View file

@ -357,7 +357,7 @@ public class DatastoreHelper {
// that we can avoid writing commit logs. This would cause issues since many tests replace the
// clock in Ofy with a non-advancing FakeClock, and commit logs currently require
// monotonically increasing timestamps.
ofy().saveWithoutBackup().entity(premiumList).now();
ofy().saveWithoutBackup().entities(premiumList, premiumList.getRevision()).now();
ofy().saveWithoutBackup().entities(premiumList.getPremiumListEntries().values()).now();
return premiumList;
}