想知道 Cassandra 中没有找到哪个键?
我正在使用 pycassa。我正在请求行中的某些列:
cf.get(rowKey, column_start=column_start, column_finish=column_finish)
如果指定的行键或任何开始和结束列键不存在,则会引发 NotFoundException。 有没有办法确定哪个键未找到 - 行键或列键(名称)?
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)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不久的将来,当键存在但返回空切片时,将不会返回NotFoundException;这应该可以消除结果的歧义。
我已经打开 https://github.com/pycassa/pycassa/issues/50来解决这个问题。
同时,作为一种解决方法,在收到 NotFoundException 时,您可以尝试:
如果未引发 NotFoundException,则您知道该键存在并且该行不为空。
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:
And if a NotFoundException is not raised, you know that the key exists and the row is not empty.