mirror of
https://github.com/google/nomulus.git
synced 2025-07-01 00:33:34 +02:00
Remove all vestiges of memcache
Memcache is already off but now it's not in the code anymore. This includes removing domain creation failfast, since that is actually slower now than just running the flow - all you gain is a non-transactional read over a transactional read, but the cost is that you always pay that read, which is going to drive up latency. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158183506
This commit is contained in:
parent
445faab977
commit
ae039aa0d8
37 changed files with 29 additions and 341 deletions
|
@ -63,15 +63,6 @@ public class Ofy {
|
|||
|
||||
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
||||
|
||||
/**
|
||||
* Recommended memcache expiration time, which is one hour, specified in seconds.
|
||||
*
|
||||
* <p>This value should used as a cache expiration time for any entities annotated with an
|
||||
* Objectify {@code @Cache} annotation, to put an upper bound on unlikely-but-possible divergence
|
||||
* between memcache and Datastore when a memcache write fails.
|
||||
*/
|
||||
public static final int RECOMMENDED_MEMCACHE_EXPIRATION = 3600;
|
||||
|
||||
/** Default clock for transactions that don't provide one. */
|
||||
@NonFinalForTesting
|
||||
static Clock clock = new SystemClock();
|
||||
|
@ -130,31 +121,9 @@ public class Ofy {
|
|||
checkState(inTransaction(), "Must be called in a transaction");
|
||||
}
|
||||
|
||||
/**
|
||||
* Load from Datastore, bypassing memcache even when the results might be there.
|
||||
*
|
||||
* <p>In general, this is the correct method to use for loads. Loading from memcache can, in rare
|
||||
* instances, produce a stale result (when a memcache write fails and the previous result is not
|
||||
* cleared out) and so using memcache should be avoided unless the caller can tolerate staleness
|
||||
* until the memcache expiration time and there is a specific need for very low latency that is
|
||||
* worth the extra complexity of reasoning about caching.
|
||||
*/
|
||||
/** Load from Datastore. */
|
||||
public Loader load() {
|
||||
return ofy().cache(false).load();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load from Datastore, bypassing memcache even when the results might be there.
|
||||
*
|
||||
* <p>In general, prefer {@link #load} over this method. Loading from memcache can, in rare
|
||||
* instances, produce a stale result (when a memcache write fails and the previous result is not
|
||||
* cleared out) and so using memcache should be avoided unless the caller can tolerate staleness
|
||||
* until the memcache expiration time and there is a specific need for very low latency that is
|
||||
* worth the extra complexity of reasoning about caching.
|
||||
*/
|
||||
public Loader loadWithMemcache() {
|
||||
// TODO(b/27424173): Remove this method if we determine we are ok with no memcache.
|
||||
return ofy().cache(false).load();
|
||||
return ofy().load();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue