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.
    • Method Detail

      • get

        Object get​(String key)
        Returns:
        the value in memcache for this, or null if there was nothing there
      • getIdentifiables

        Map<String,​IdentifiableValue> 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). 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.
      • put

        void put​(String key,
                 Object thing)
        Values can be null