查询的一致性级别

查询的一致性级别

本文介绍了如何在 CQL3 中设置单个 CQL 查询的一致性级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早期的 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 查询的一致性级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 11:11