注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

讲给自己听的故事

~~~写给未来的片言只语~~~

 
 
 

日志

 
 

几个Cassandra建列族的例子  

2011-09-14 00:02:32|  分类: 笔记 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
/*This file contains an example Keyspace that can be created using the
cassandra-cli command line interface as follows.

bin/cassandra-cli -host localhost --file conf/schema-sample.txt

The cassandra-cli includes online help that explains the statements below. You can
accessed the help without connecting to a running cassandra instance by starting the
client and typing "help;"
*/

create keyspace Keyspace1
    with strategy_options=[{replication_factor:1}]
    and placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy';

use Keyspace1;

create column family Standard1
    with comparator = BytesType
    and keys_cached = 10000
    and rows_cached = 1000
    and row_cache_save_period = 0
    and key_cache_save_period = 3600
    and memtable_flush_after = 59
    and memtable_throughput = 255
    and memtable_operations = 0.29;

create column family Standard2
    with comparator = UTF8Type
    and read_repair_chance = 0.1
    and keys_cached = 100
    and gc_grace = 0
    and min_compaction_threshold = 5
    and max_compaction_threshold = 31;

create column family StandardByUUID1
    with comparator = TimeUUIDType;

create column family Super1
    with column_type = Super
    and comparator = BytesType
    and subcomparator = BytesType;

create column family Super2
    with column_type = Super
    and subcomparator = UTF8Type
    and rows_cached = 10000
    and keys_cached = 50
    and comment = 'A column family with supercolumns, whose column and subcolumn names are UTF8 strings';

create column family Super3
    with column_type = Super
    and comparator = LongType
    and comment = 'A column family with supercolumns, whose column names are Longs (8 bytes)';

create column family Indexed1
    with comparator = UTF8Type
    and default_validation_class = LongType
    and column_metadata = [{
        column_name : birthdate,
        validation_class : LongType,
        index_name : birthdate_idx,
        index_type : 0}
    ];

create column family Counter1
    with default_validation_class = CounterColumnType;

create column family SuperCounter1
    with column_type = Super
    and default_validation_class = CounterColumnType;

  评论这张
 
阅读(2027)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018