Created
October 16, 2014 20:21
-
-
Save tgruben/7b76a3e4757909ea5038 to your computer and use it in GitHub Desktop.
go issue ported to python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cassandra.cluster import Cluster | |
cluster = Cluster() | |
session = cluster.connect('hotbox') | |
stmt = session.prepare('INSERT INTO bitmap2 ( bitmap_id, block) VALUES (?,?);') | |
session.execute('truncate bitmap2') | |
out = open("/tmp/cass_py","w") | |
for ids in range(32): | |
val=0 | |
for i in range(0,64): | |
b = 1 << i | |
val |=b | |
if i==63: | |
val=-1 | |
out.write( "%d %d\n"%(ids,val)) | |
session.execute(stmt,(ids,val)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment