Cleaning up buckets
jeremiah.peschka at gmail.com
Thu Nov 10 13:53:19 EST 2011
Jeremiah Peschka - Founder, Brent Ozar PLF, LLC
Microsoft SQL Server MVP
On Nov 10, 2011, at 10:00 AM, Stefan Gebhardt wrote:
> I just started playing around with riak.
> For the purpose of testing i uploaded 1 million random generated items(using uuid for keys) to a single bucket
> via the python API.
> Now i like to clean/remove this bucket and run the upload again. At the moment i am looking for smth. like DROP Bucket. Neither in the erlang api nor in the python api i found a function for doing so.
> Then i tried to list all keys and delete item by item but the call "list 1 million keys" never returned and ok,,, silly plan at all.
> So... My questions are:
> How can i clean up my cluster?
You can do a streaming list keys and delete all items in your bucket as they arrive.
> Why is there no function to remove a bucket?
Because bucket names are just used as a logical namespace for the key. They're actually hashed along with the key to generate an internal identifier and distribute data throughout the cluster. DELETE bucket would require listing keys on the Riak side anyway.
> Stefan Gebhardt * stefan.gebhardt at abas.de
> Software Development
> ABAS Software AG * ERP / PPS / WWS / eBusiness
> Südendstraße 42 * 76135 Karlsruhe * GERMANY
> Vorstand: Werner Strub (Vorsitzender), Peter Walser
> Vorsitzender des Aufsichtsrats: Thomas Frank
> HRB 107644 Amtsgericht Mannheim
> Tel. +49 (0) 721/9 67 23 0 * Fax +49 (0) 721/9 67 23 100
> http://www.abas.de * info at abas.de
> riak-users mailing list
> riak-users at lists.basho.com
More information about the riak-users