Fix compilation errors caused by Caffeine changes (#1623)

This commit is contained in:
gbrodman 2022-05-05 11:21:10 -04:00 committed by GitHub
parent adfae285df
commit 20c3e731fd
3 changed files with 6 additions and 6 deletions

View file

@ -394,7 +394,7 @@ public abstract class EppResource extends BackupGroupRoot implements Buildable {
@Override @Override
public Map<VKey<? extends EppResource>, EppResource> loadAll( public Map<VKey<? extends EppResource>, EppResource> loadAll(
Set<? extends VKey<? extends EppResource>> keys) { Iterable<? extends VKey<? extends EppResource>> keys) {
return replicaTm().doTransactionless(() -> replicaTm().loadByKeys(keys)); return replicaTm().doTransactionless(() -> replicaTm().loadByKeys(keys));
} }
}; };

View file

@ -35,6 +35,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Multimaps; import com.google.common.collect.Multimaps;
import com.google.common.collect.Streams;
import com.googlecode.objectify.Key; import com.googlecode.objectify.Key;
import com.googlecode.objectify.annotation.Entity; import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id; import com.googlecode.objectify.annotation.Id;
@ -58,7 +59,6 @@ import java.util.Collection;
import java.util.Comparator; import java.util.Comparator;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.Set;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import org.joda.time.DateTime; import org.joda.time.DateTime;
@ -272,14 +272,14 @@ public abstract class ForeignKeyIndex<E extends EppResource> extends BackupGroup
@Override @Override
public Map<VKey<ForeignKeyIndex<?>>, Optional<ForeignKeyIndex<?>>> loadAll( public Map<VKey<ForeignKeyIndex<?>>, Optional<ForeignKeyIndex<?>>> loadAll(
Set<? extends VKey<ForeignKeyIndex<?>>> keys) { Iterable<? extends VKey<ForeignKeyIndex<?>>> keys) {
if (keys.isEmpty()) { if (!keys.iterator().hasNext()) {
return ImmutableMap.of(); return ImmutableMap.of();
} }
Class<? extends EppResource> resourceClass = Class<? extends EppResource> resourceClass =
RESOURCE_CLASS_TO_FKI_CLASS.inverse().get(keys.iterator().next().getKind()); RESOURCE_CLASS_TO_FKI_CLASS.inverse().get(keys.iterator().next().getKind());
ImmutableSet<String> foreignKeys = ImmutableSet<String> foreignKeys =
keys.stream().map(v -> v.getSqlKey().toString()).collect(toImmutableSet()); Streams.stream(keys).map(v -> v.getSqlKey().toString()).collect(toImmutableSet());
ImmutableSet<VKey<ForeignKeyIndex<?>>> typedKeys = ImmutableSet.copyOf(keys); ImmutableSet<VKey<ForeignKeyIndex<?>>> typedKeys = ImmutableSet.copyOf(keys);
ImmutableMap<String, ? extends ForeignKeyIndex<? extends EppResource>> existingFkis = ImmutableMap<String, ? extends ForeignKeyIndex<? extends EppResource>> existingFkis =
loadIndexesFromStore(resourceClass, foreignKeys, false, true); loadIndexesFromStore(resourceClass, foreignKeys, false, true);

View file

@ -277,7 +277,7 @@ public class Registry extends ImmutableObject
} }
@Override @Override
public Map<String, Optional<Registry>> loadAll(Set<? extends String> tlds) { public Map<String, Optional<Registry>> loadAll(Iterable<? extends String> tlds) {
ImmutableMap<String, VKey<Registry>> keysMap = ImmutableMap<String, VKey<Registry>> keysMap =
toMap(ImmutableSet.copyOf(tlds), Registry::createVKey); toMap(ImmutableSet.copyOf(tlds), Registry::createVKey);
Map<VKey<? extends Registry>, Registry> entities = Map<VKey<? extends Registry>, Registry> entities =