Cache domains, contacts, and hosts in WHOIS queries

This should prevent having issues with hot key paths on entities that
experience a heavy WHOIS volume (e.g. contacts that registrars reuse on
many domains).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191506124
This commit is contained in:
mcilwain 2018-04-03 15:05:00 -07:00 committed by Ben McIlwain
parent cfd83ad4dc
commit 07d38340f3
9 changed files with 184 additions and 34 deletions

View file

@ -15,7 +15,6 @@
package google.registry.model;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.model.EppResource.CACHE_LOADER;
import static google.registry.testing.DatastoreHelper.persistActiveContact;
import static google.registry.testing.DatastoreHelper.persistActiveHost;
import static google.registry.testing.DatastoreHelper.persistResource;
@ -64,7 +63,6 @@ public class EppResourceTest extends EntityTestCase {
}
private static void setNonZeroCachingInterval() {
EppResource.cacheEppResources =
CacheBuilder.newBuilder().expireAfterWrite(1L, DAYS).build(CACHE_LOADER);
EppResource.setCacheForTest(CacheBuilder.newBuilder().expireAfterWrite(1L, DAYS));
}
}