本文介绍了如何在cqlsh中将CONSISTENCYCY设置为SERIAL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过使用 SERIAL 一致性在Cassandra中尝试轻量级事务.但是,尝试在cqlsh中设置一致性级别会导致错误:

I am trying to experiment with lightweight transactions in Cassandra by using SERIAL consistency. However, trying to set the consistency level in cqlsh results in an error:

cqlsh:learning> CONSISTENCY SERIAL;
Improper CONSISTENCY command.

具有一致性语句已从CQL中删除,因此我不能使用它.有没有办法从cqlsh启用串行一致性?还是我必须使用驱动程序?

The WITH CONSISTENCY statement has been removed from CQL and so I cannot use that. Is there a way to enable serial consistency from cqlsh? Or do I have to do it using a driver?

推荐答案

CONSISTENCY 命令仍应在cqlsh中起作用.但是此设置的有效值是:

The CONSISTENCY command should still work in cqlsh. But valid values for this setting are:

  • 任何
  • 一个
  • 两个
  • 三个
  • QUORUM
  • 全部
  • LOCAL_QUORUM
  • EACH_QUORUM

SERIAL不在该列表中,因此您看到的错误.有一个开放的吉拉票可以解决这个问题: CASSANDRA-8051

SERIAL is not in that list, hence the error you are seeing. There is an open Jira ticket to address this: CASSANDRA-8051

这似乎是一个一致性级别,周围有一些限制,因此很难实现.一致性级别说明表示:

This appears to be a consistency level that has some restrictions around it, thus making this difficult to implement. The Consistency Level descriptions indicate that:

Java驱动程序显然具有特定的方法来设置此一致性级别:

The Java Driver apparently has a specific method to set this consistency level:

这篇关于如何在cqlsh中将CONSISTENCYCY设置为SERIAL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 08:03
查看更多