flushing items by prefix
pafei at citrin.ch
Thu Mar 31 00:05:01 PST 2005
-----BEGIN PGP SIGNED MESSAGE-----
We started using memcache and needed a possibility to delete entries
from the cache by a given prefix of the key. For example all entries
with a key starting with 'namespace1'.
I wrote a patch for memcache to support a new command
~ flush_prefix <keyprefix>
where <keyprefix> is the prefix of the keys to be deleted.
The command just iterates through all items and compares the stored key
with the given <keyprefix>. If it matches, the item is deleted.
I do not check any flags of the items an I do not check time stamps.
If someone with more knowledge about the internals has suggestions for
improvement, I am happy to implement it.
The code passed our test cases and I would be happy if it is included in
the current version.
The patch is against the current cvs version of today.
The patch can be downloaded from:
Citrin, Feisthammel und Partner, Phone: +41 44 940 6161
Steigstrasse 55, CH-8610 Uster, Switzerland Fax: +41 43 399 0506
http://www.citrin.ch/ email: citrin at citrin.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the memcached