capacity 100 for obj in objects inc counter_key key bucket_key capacit

1
2
3
4
5
6
7
capacity = 100
for obj in objects:
i = inc(counter_key, 1)
key = bucket_key % (i / capacity)
field = i % capacity
data = zlib.compress(json_dumps(obj, compact=True), 6)
pipe.hset(key, field, data)