Class SpyMemcacheService
java.lang.Object
com.googlecode.objectify.cache.spymemcached.SpyMemcacheService
- All Implemented Interfaces:
MemcacheService
Among the issues this impl needs to be concerned with is that memcached doesn't store nulls. We have to replace it
with something (in our case, an empty string).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.googlecode.objectify.cache.MemcacheService
MemcacheService.CasPut
-
Constructor Summary
Constructors -
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
-
Constructor Details
-
SpyMemcacheService
public SpyMemcacheService()
-
-
Method Details
-
get
- Specified by:
get
in interfaceMemcacheService
- Returns:
- the value in memcache for this, or null if there was nothing there
-
getIdentifiables
Description copied from interface:MemcacheService
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.- Specified by:
getIdentifiables
in interfaceMemcacheService
-
getAll
- Specified by:
getAll
in interfaceMemcacheService
-
put
Description copied from interface:MemcacheService
Values can be null- Specified by:
put
in interfaceMemcacheService
-
putIfUntouched
Description copied from interface:MemcacheService
Values can be null- Specified by:
putIfUntouched
in interfaceMemcacheService
- Returns:
- a set of all the keys that succeeded
-
putAll
Description copied from interface:MemcacheService
Values can be null- Specified by:
putAll
in interfaceMemcacheService
-
deleteAll
- Specified by:
deleteAll
in interfaceMemcacheService
-