本文整理汇总了Python中pycassa.columnfamily.ColumnFamily.column_validators['IntColumn5']方法的典型用法代码示例。如果您正苦于以下问题:Python ColumnFamily.column_validators['IntColumn5']方法的具体用法?Python ColumnFamily.column_validators['IntColumn5']怎么用?Python ColumnFamily.column_validators['IntColumn5']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycassa.columnfamily.ColumnFamily
的用法示例。
在下文中一共展示了ColumnFamily.column_validators['IntColumn5']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ConnectionPool
# 需要导入模块: from pycassa.columnfamily import ColumnFamily [as 别名]
# 或者: from pycassa.columnfamily.ColumnFamily import column_validators['IntColumn5'] [as 别名]
pool = ConnectionPool('Keyspace1', ['localhost:9160'])
col_fam = ColumnFamily(pool, 'Standard1')
#Writing
col_fam.insert('key3', {'Column4': 'PycassaData'})
#Reading
readData = col_fam.get('key3')
col_fam.insert('key3', {'Column5':'PycassaData2', 'Column6':'PycassaData3'})
readData = col_fam.get('key3')
from pycassa.types import *
col_fam.column_validators['IntColumn5'] = IntegerType()
col_fam.column_validators['IntColumn6'] = IntegerType()
col_fam.insert('intData', {'IntColumn5':5, 'IntColumn6':6})
print col_fam.get('intData')
# OrderedDict([('IntColumn5', 5), ('IntColumn6', 6)])
#Batch operations
col_fam.batch_insert({'key4': {'Column1': 'PycassaData4',
'Column2': 'PycassaData5',
'Column3': 'PycassaData6',
'Column4': 'PycassaData7',
'Column5': 'PycassaData8'},
'key5': {'Column7': 'PycassaData9'}})
readData = col_fam.multiget(['key3', 'key4', 'key5'])
readData = col_fam.multiget(['key3', 'key4', 'key5'], columns=['Column1', 'Column7'])