如何在CQL3中设置单个CQL查询的一致性级别? [英] How do I set the consistency level of an individual CQL query in CQL3?
问题描述
在 CQ以前的测试版 L中,有一个我可以使用的命令设置单个CQL操作的读/写一致性。它看起来像这样:
In the earlier beta releases of CQL, there was a command I could use to set the read / write consistency of an individual CQL operation. It looked like this:
SELECT * FROM users WHERE state ='TX'USING CONSISTENCY QUORUM;
我经常使用CQL3,并且有一个用例,我需要能够执行更高一致性的读取级别比我们的应用程序的其余部分。
I use CQL3 regularly and have a use-case where I need to be able to perform a read with a higher consistency level than the rest of our application.
我浏览了 CQL3参考并没有找到任何提到任何CQL语法允许我在每个查询的基础上更改一致性设置,除非我使用cqlsh(对应用程序开发不有用)。
I looked through the CQL3 reference and didn't find any mention of any CQL syntax that allows me to change the consistency settings on a per-query basis, unless I'm using cqlsh (not useful for application development.)
我应该如何使用CQL3调整每个请求的一致性。
How am I supposed to tune the consistency on a per-request basis using CQL3?
推荐答案
Aaron,一致性级别不需要在协议级别设置 - 出于这里解释的原因: https://issues.apache.org/jira/browse/CASSANDRA-4734
Aaron, the Consistency Level is not needed to be set on the protocol level - for the reasons explained here: https://issues.apache.org/jira/browse/CASSANDRA-4734
这篇关于如何在CQL3中设置单个CQL查询的一致性级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!