Package com.googlecode.objectify.cache
Interface MemcacheService
- All Known Implementing Classes:
SpyMemcacheService
public interface MemcacheService
The interface that all memory cache services must implement. In theory you could write a redis (or whatnot)
based implementation, but this was designed around memcached.
The implementation must handle 'null' as a value. Note that memcached doesn't handle this natively; the impl
takes care of translating it to something that can be stored.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteAll
(Collection<String> keys) getAll
(Collection<String> keys) getIdentifiables
(Collection<String> keys) For cache implementations that don't handle a cold cache for a key (eg memcached), the implementation of this method needs to hide that behavior (ie, bootstrap an initial value so we can get a CAS value).void
Values can be nullvoid
Values can be nullputIfUntouched
(Map<String, MemcacheService.CasPut> values) Values can be null
-
Method Details
-
get
- Returns:
- the value in memcache for this, or null if there was nothing there
-
getIdentifiables
For cache implementations that don't handle a cold cache for a key (eg memcached), the implementation of this method needs to hide that behavior (ie, bootstrap an initial value so we can get a CAS value). That doesn't mean the result will always be a value; the bootstrap may fail (for whatever reason) and the resulting map value for a key will be null. -
getAll
-
put
Values can be null -
putAll
Values can be null -
putIfUntouched
Values can be null- Returns:
- a set of all the keys that succeeded
-
deleteAll
-