Migrate away from VoidWorks

This is one last hanging piece of work left over from last year's Java 8
migration. There's no functionality changes in this CL, just refactoring.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201947600
This commit is contained in:
mcilwain 2018-06-25 07:04:26 -07:00 committed by Ben McIlwain
parent 7d3cb3d426
commit d3364b0387
18 changed files with 349 additions and 502 deletions

View file

@ -24,7 +24,6 @@ import com.google.appengine.tools.cloudstorage.RetryParams;
import com.google.appengine.tools.mapreduce.Mapper;
import com.google.common.collect.ImmutableList;
import com.google.common.flogger.FluentLogger;
import com.googlecode.objectify.VoidWork;
import google.registry.config.RegistryConfig.Config;
import google.registry.config.RegistryConfig.ConfigModule;
import google.registry.gcs.GcsUtils;
@ -124,14 +123,12 @@ public class RdeHostImportAction implements Runnable {
// Record number of attempted map operations
getContext().incrementCounter("host imports attempted");
logger.atInfo().log("Saving host %s", xjcHost.getName());
ofy().transact(new VoidWork() {
@Override
public void vrun() {
HostResource host = XjcToHostResourceConverter.convert(xjcHost);
getImportUtils().importEppResource(host);
}
});
ofy()
.transact(
() -> {
HostResource host = XjcToHostResourceConverter.convert(xjcHost);
getImportUtils().importEppResource(host);
});
// Record number of hosts imported
getContext().incrementCounter("hosts saved");
logger.atInfo().log("Host %s was imported successfully", xjcHost.getName());