2
# Keyspace Name
keyspace: demo1

# The CQL for creating a keyspace (optional if it already exists)
keyspace_definition: |
  CREATE KEYSPACE demo1;
# Table name
table: sample_test

# The CQL for creating a table you wish to stress (optional if it already exists)
table_definition: |
    CREATE TABLE sample_test (
        key1 blob PRIMARY KEY,
        value1 blob
    )

### Column Distribution Specifications ###

columnspec:
  - name: hash
    size: fixed(96)       #domain names are relatively short

  - name: body
    size: gaussian(100..300)    #the body of the blog post can be long
    population: uniform(1..10M)  #10M possible domains to pick from

现在如何在同一个键空间中定义另一个表?所有示例都只讨论定义一个表。我还尝试像上面一样定义另一个表定义及其列规范,但随后出现以下错误“com.datastax.driver.core.exceptions.InvalidQueryException: Batch too large”

4

2 回答 2

4

不幸的是,你不能。一个应力配置文件只能包含一个table_definition,并且只能在其中定义一个表。它甚至验证只有一个定义与table声明匹配。您可以尝试同时运行压力工具的两个实例来获得该行为,这很不方便,但我认为这是唯一可用的解决方法,而不是编写自己的基准测试(这很棘手)。

于 2016-01-20T15:19:58.267 回答
0

这个问题已经在 Cassandra 上提出了https://issues.apache.org/jira/browse/CASSANDRA-8780

它已被修复,但只会与 Cassandra 的下一个主要版本 (4.0) 一起发布。

于 2019-01-30T16:37:38.483 回答