Skip to content

Instantly share code, notes, and snippets.

@babo
Created March 30, 2012 09:36
Show Gist options
  • Save babo/2250347 to your computer and use it in GitHub Desktop.
Save babo/2250347 to your computer and use it in GitHub Desktop.
import riak
def f(n=100):
client = riak.client.RiakClient()
b = client.bucket('ize')
for i in xrange(n):
try:
k = b.new_binary(str(i), str(i))
x = k.store(w=3, dw=1)
print x
except Exception as e:
print i, e
def g(n=100):
client = riak.client.RiakClient(port=7098)
b = client.bucket('ize')
for i in xrange(n):
try:
k = b.get_binary(str(i))
print k.exists()
except Exception as e:
print i, e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment