Regarding expired keys in riak-bitcask
emcclanahan at basho.com
Tue May 13 18:31:18 EDT 2014
(remember to follow up on-list!)
I guess if I were trying to do that I'd structure it as: |-- 1 byte
client id --|------- 3 bytes, integer ----|
Just roll over when you get to the end, assuming that you're not
writing more than 2**24 values per client in your expiry period (in
which case you can just extend to 4 bytes or 5 or whatever). The
tricky thing there is remembering the most recently used per-client
integer when you crash, but that isn't too hard.
This is to avoid the fact that there is no way to get a list of
expired keys, other than listing all the keys in the cluster, which is
On Tue, May 13, 2014 at 10:32 AM, Venkatachalam Subramanian
<venkatsubbu44 at gmail.com> wrote:
> Thank you so much for the quick response!
> Yes, I have a case where I can use only keys 4 bytes in size and these keys
> would expire over time. So, I should be able to reuse the expired keys
> instead of constantly creating new keys.
> I guess I would create my own keys. Do you know of a way to get a list of
> the expired keys so that I can reuse them instead of plainly creating new
> I am inclined to riak-bitcask since it has the expiry option. I would have
> to implement only the reuse mechanism.
> On May 13, 2014 12:25 PM, "Evan Vigil-McClanahan" <emcclanahan at basho.com>
>> 1. The keys are meant to be unique, so there is a very, very, very low
>> probability of their reuse.
>> 2. No, sorry.
>> It's best to generate your own keys in any case, reading the code it
>> looks like the auto-generated keys are only available via HTTP.
>> On Tue, May 13, 2014 at 9:53 AM, Venkatachalam Subramanian
>> <venkatsubbu44 at gmail.com> wrote:
>> > Hello All,
>> > I'm new to Riak/Bitcask. The documentation and FAQs were very useful.
>> > I had a question about the keys that expired in riak/bitcask using
>> > 'expiry_secs'.
>> > Assuming I use the auto generated keys,
>> > 1. When a key expires, will the same key be reused at a later stage?
>> > 2. Can I change the length of the auto-generated key (say to 4 bytes) ?
>> > I really appreciate the help.
>> > Thank You.
>> > --
>> > Regards,
>> > Venkat Subramanian
>> > _______________________________________________
>> > riak-users mailing list
>> > riak-users at lists.basho.com
>> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
More information about the riak-users