当前位置: 首页>>代码示例>>Python>>正文


Python ColumnFamily.xget方法代码示例

本文整理汇总了Python中pycassa.columnfamily.ColumnFamily.xget方法的典型用法代码示例。如果您正苦于以下问题:Python ColumnFamily.xget方法的具体用法?Python ColumnFamily.xget怎么用?Python ColumnFamily.xget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pycassa.columnfamily.ColumnFamily的用法示例。


在下文中一共展示了ColumnFamily.xget方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: float

# 需要导入模块: from pycassa.columnfamily import ColumnFamily [as 别名]
# 或者: from pycassa.columnfamily.ColumnFamily import xget [as 别名]
        return
    dbillingInvoice = float(e1['billingInvoice']) - float(e2['billingInvoice'])
    if (abs(dbillingInvoice) > epson):
        fl.write("+billingInvoice:" + str(dbillingInvoice) + ',' + e1['billingInvoice'] + ',' + e2['billingInvoice'] + ':' + str(e1) + ',' + str(e2) + '\n')
        return
    c.write(str(e1) + '\n')

servers = ['pb036:9160', 'pb037:9160', 'pb038:9160']
pool = ConnectionPool('RSS', server_list = servers, timeout = 1, pool_size=20)
meta = ColumnFamily(pool, 'MetaData')
counter = ColumnFamily(pool, 'Counter')

oid_count = meta.get_count('rss.All')
print 'Total oids => ', oid_count

oids_gen = meta.xget('rss.All', column_reversed=True, include_timestamp=True)
oids = dict(oids_gen)
#oids = meta.get('rss.All', column_reversed=True)
#print oids

home = os.path.expanduser("~")
fi = open(home + "/rss/diff_cas.txt", "w")
fj = open(home + "/rss/diff_rss.txt", "w")
difi = open(home + "/rss/difi.txt", "w")
difl = open(home + "/rss/difl.txt", "w")

f = open(home + "/rss/good.txt", "w")

fo = open(home + "/rss/negative_rss.txt", "w")
fp = open(home + "/rss/negative_cas.txt", "w")
开发者ID:jamesliu,项目名称:etc_config,代码行数:32,代码来源:compare.py

示例2: ConnectionPool

# 需要导入模块: from pycassa.columnfamily import ColumnFamily [as 别名]
# 或者: from pycassa.columnfamily.ColumnFamily import xget [as 别名]
from pycassa.pool import ConnectionPool
from pycassa.columnfamily import ColumnFamily
import urllib2
import simplejson
import datetime
import time


pool = ConnectionPool('RSS', ['pb036:9160', 'pb037:9160'], pool_size=20)
meta = ColumnFamily(pool, 'MetaData')
countercf = ColumnFamily(pool, 'Counter')

oid_count = meta.get_count('rss.All')
print 'Total oids => ', oid_count

oids_generator = meta.xget('rss.All', column_reversed=True, include_timestamp=True)
oids = dict(oids_generator)
#oids = meta.get('rss.All', column_reversed=True)
#print oids

# 3 days ago
then = (datetime.date.today() - datetime.timedelta(3))
tt = time.mktime(then.timetuple()) * 1000 * 1000
#then.microsecond/1000


# {oid: tz, ...}
delete = {}
save = {}

tzid = 'TimeZoneCodeId'
开发者ID:jamesliu,项目名称:etc_config,代码行数:33,代码来源:purge.py


注:本文中的pycassa.columnfamily.ColumnFamily.xget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。