cassandra-stress更新错误:UPDATE语句中的群集列不支持切片限制

时间:2018-03-23 18:31:33

标签: cassandra cassandra-stress update-statement cassandra-stress-tool

我正在努力应对cassandra压力。我希望调整我的C *集群,它正在为执行更新和删除的应用程序提供服务。

我没有找到关于cassandra-stress的大量文档来举例说明用法,所以花了很长时间才使它与插入和读取一起工作。由于我的应用程序正在执行更新和删除,因此我需要对此用法进行压力测试。

我有一张表格如下:

table: eventsrawtest
table_definition: |
  CREATE TABLE stresstest.eventsrawtest (
    my_id text,
    my_info text,
    my_date text,
    my_time timestamp,
    my_stats bigint,
    PRIMARY KEY ((my_id, my_info, my_date), my_time)
  ) WITH CLUSTERING ORDER BY (node_time DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE'

我知道这很多,但我正在尝试复制C *中用于相关应用的主要CF.

此处my_time是一个群集密钥。

我的cassandra-stress查询在yaml中如下:

queries:
  simple1:
    cql: select * from eventsrawtest where my_id = ? and my_info = ? and my_date = ?
    fields: samerow             # pick selection values from same row in partition
  range1:
    cql: select * from eventsrawtest where my_id = ? and my_info = ? and my_date = ? and my_time >= ? and my_time <= ?
    fields: multirow             # pick selection values from same row in partition
  update1:
    cql: update eventsrawtest set bytes_received = ? where my_id = ? and my_info = ? and my_date = ? and my_time = ?
    fields: samerow
  update2:
    cql: update eventsrawtest set bytes_received = ? where my_id = ? and my_info = ? and my_date = ? and my_time >= ? and my_time <= ?
    fields: multirow

当我使用这些查询运行cassandra-stress时

cassandra-stress user profile=./my-stress-test.yaml n=1000000 "ops(simple1=1,range1=1,update1=1,update2=1)" no-warmup cl=QUORUM -node 1.db,2.db,3.db -mode native cql3

我为update1和update2

收到此错误
com.datastax.driver.core.exceptions.InvalidQueryException: Slice restrictions are not supported on the clustering columns in UPDATE statements

我是C *的新手,因此我不理解错误的因素。我还没有找到一个明确的解释,为什么我收到这个错误,更不用说它的补救措施了。我在更新查询中需要my_time集群密钥,但是对my_time的有效查询只是不适用于cassandra-stress。

任何指导,帮助,指示,只是非常感谢。

0 个答案:

没有答案