Make re-save environment entities command use batching

This makes it take a lot less time to run (roughly a 10X speedup).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161666391
This commit is contained in:
mcilwain
2017-08-01 16:10:00 -04:00
committed by Ben McIlwain
parent b235565eef
commit 24587491c9
2 changed files with 20 additions and 15 deletions
@@ -55,9 +55,9 @@ public class ResaveEnvironmentEntitiesCommandTest
assertThat(ofy().load().type(CommitLogMutation.class).keys()).isEmpty();
runCommand();
// There are five entities that have been re-saved at this point (each in a separate
// transaction), so expect five manifests and five mutations.
assertThat(ofy().load().type(CommitLogManifest.class).keys()).hasSize(5);
// There are 5 entities that have been re-saved at this point (in 3 transactions, one for each
// type), so expect 3 manifests and 5 mutations.
assertThat(ofy().load().type(CommitLogManifest.class).keys()).hasSize(3);
Iterable<ImmutableObject> savedEntities =
transform(
ofy().load().type(CommitLogMutation.class).list(),