2016-01-20 27 views
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:批量太大」如何爲cassandra-stress配置文件定義多個表定義和多個列規格?

回答

4

不幸的是,你不能。壓力配置文件只能包含一個table_definition,它只能在其中定義一個表。它甚至驗證了只有一個定義與table聲明匹配。您可以嘗試同時運行壓力工具的兩個實例來獲得該行爲,但這不方便,但我認爲它是唯一可用於編寫自己的基準測試(這很棘手)的解決方法。