开发者

To to know which key not found in Cassandra?

I am using pycassa. I am requesting some columns from a row:

cf.get(rowKey, column_start=column_start, column_finish=column_finish)

If specified row key or any of start and finish column keys do not exist, NotFoundException is raised. Is there a way to determine which key wasn't found - row key or column key (name开发者_运维百科)?


In the near future a NotFoundException will not be returned when a key exists but an empty slice is returned; that should disambiguate the result.

I've opened https://github.com/pycassa/pycassa/issues/50 to address this.

In the meantime as a workaround, upon getting a NotFoundException, you can try:

cf.get(rowKey, column_count=1)

And if a NotFoundException is not raised, you know that the key exists and the row is not empty.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜