Agree with Taylor. Unless we expose higher order redis functions, it should
still be O(1).
*Time complexity:* O(N) where N is the number of keys that will be removed.
When a key to remove holds a value other than a string, the individual
complexity for this key is O(M) where M is the number of elements in the
list, set, sorted set or hash. Removing a single key that holds a string
value is O(1).


On Thu, Mar 14, 2013 at 2:21 PM, Taylor Leese <notifications@github.com>wrote:

> In src/main/java/com/stackmob/sdkapi/caching/CachingService.java:
>
> > + *
> > + * Here's a pattern illustrating basic usage of CachingService in your CustomCodeMethod's <code>execute</code> method:
> > + * <code>
> > + *     CachingService cachingService = sdkServiceProvider.getCachingService();
> > + *     String json =  null;
> > + *     try {
> > + *         json = cachingService.getString("largeQuery", CachingService.utf8Charset());
> > + *     } finally {}
> > + *     if(json == null) {
> > + *         json = executeLargeDatastoreQuery();
> > + *         //cache the result of the large query for 5 seconds
> > + *         cachingService.setString("largeQuery", json, CachingService.utf8Charset, 5000);
> > + *     }
> > + * </code>
> > + */
> > +public abstract class CachingService {
>
> "Removing a single key that holds a string value is O(1)."
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/stackmob/stackmob-customcode-sdk/pull/7/files#r3382002>
> .
>