2013-10-30 38 views
2

我有一個非常小的列家族,它非常瘋狂且幾乎沒有寫入過。我想爲這一列家族啓用行緩存。爲特定的列家族啓用Cassandra行緩存

我很難確定如何做到這一點。根據this文檔的評論部分,我可以「在每個CF基礎上啓用/禁用緩存」。我到底該如何完成?

謝謝!

回答

3

沒關係,我終於找到它了。

create column family my_column_family 
with key_validation_class = 'CompositeType(LongType, DateType)' 
and comparator = UTF8Type 
and caching = 'ALL' 
and column_metadata= [ 
{column_name: my_column_name_1, validation_class: BooleanType}, 
{column_name: my_column_name_2, validation_class: BooleanType} 
]; 
+0

如何更改現有CF的「緩存」設置? – Freedom

+0

ALTER TABLE [table_name] WITH caching = {'keys':'ALL','rows_per_partition':'ALL'}; 您可以設置rows_per_partition的值。 – observer