Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import riak
- if __name__ == '__main__':
- client = riak.RiakClient()
- bucket1 = client.bucket('test_bucket_spam')
- bucket2 = client.bucket('test_bucket')
- single_obj = bucket2.get("hello")
- if not single_obj.exists():
- single_obj = bucket2.new("hello", data={})
- for i in xrange(1,160):
- new_spam = bucket1.new("spam%s" % str(i), data={})
- new_spam.add_link(single_obj, 'single')
- new_spam.store()
- single_obj.add_link(new_spam, 'spam')
- print 'Obj has %s links' % len(single_obj.get_links())
- single_obj.store()
- # with or without this, it fails
- single_obj.reload()
- for i in xrange(161,250):
- new_spam = bucket1.new("spam%s" % str(i), data={})
- new_spam.add_link(single_obj, 'single')
- new_spam.store()
- single_obj.add_link(new_spam, 'spam')
- print 'Obj has %s links' % len(single_obj.get_links())
- single_obj.store()
Advertisement
Add Comment
Please, Sign In to add comment