namespace bids

timeless time at digg.com
Wed Feb 8 10:12:32 UTC 2006


> The basic idea to store namespace releated keys in an array, but real 
> arrays cant be useable, because get-addentry-set isnt atomic.
>
>> I don't know how to get a list of all the keys.  I tried doing
>>
>> stats slabs
>>
>>    foreach my $slab (@$slabs) {
>>        my $slab_dump = $mc->_oneline($sock, "stats cachedump
>> $slab\r\n");
>>        while($slab_dump =~ /^ITEM\s+(\S+)/mg) {
>>            $ref->{$1} = $mc->get($1);
>>        }
>>    }
>>
>> But I guess the cachedump doesn't return everything on the slab. ... If
>> someone has a way to walk all the keys, then yeah, that would pretty
>> well solve my 'fred' problem, where changes only happen every few weeks,
>> and I am ok if the process takes a few minutes to complete.
>
So what was the consensus on this? You must roll your own by storing 
cached keys in an external DB?

Is there a way to get an exhaustive list of keys? For my purposes, if 
there were a way to walk all keys, that's acceptable. I don't need a 
O(1) solution. O(N) is fine by me.

--
timeless



More information about the memcached mailing list