On 3 August 2012 21:31, Data Craftsman 木匠 <database.crafts...@gmail.com> wrote: > > Nobody use Leveled Compaction with CQL 3.0 ?
I tried this, and I can't get it to work either. I'm using: [cqlsh 2.2.0 | Cassandra 1.1.2 | CQL spec 3.0.0 | Thrift protocol 19.32.0] Here's what my create table looks like: CREATE TABLE php_sessions( domain_name text, session_id text, session_data text, PRIMARY KEY (domain_name, session_id) ) WITH COMPACT STORAGE ' AND COMPACTION_STRATEGY_CLASS='LeveledCompactionStrategy'; It does create the table, but if you do DESCRIBE TABLE php_sessions it displays: CREATE TABLE php_sessions ( domain_name text, session_id text, session_data text, PRIMARY KEY (domain_name, session_id) ) WITH COMPACT STORAGE AND caching='KEYS_ONLY' AND read_repair_chance=0.100000 AND gc_grace_seconds=864000 AND min_compaction_threshold=4 AND max_compaction_threshold=32 AND replicate_on_write='true' AND compaction_strategy_class='SizeTieredCompactionStrategy' AND compression_parameters:sstable_compression='SnappyCompressor'; This table is created in a keyspace declared as follows: CREATE KEYSPACE testkeyspace WITH strategy_class = 'NetworkTopologyStrategy' AND strategy_options:dc1=3; I'd definitely like to use this new compaction type. Help! Andy > > > -Z > > On Tue, Jul 31, 2012 at 11:17 AM, Data Craftsman 木匠 > <database.crafts...@gmail.com> wrote: > > Sorry for my stupid simple question. How to create a COLUMNFAMILY with > > Leveled Compaction? > > > > There is no example in documentation: > > http://www.datastax.com/docs/1.1/configuration/storage_configuration#compaction-strategy > > > > I try it on Cassandra 1.1.0 and 1.1.2, both failed. The COLUMNFAMILY > > is still 'SizeTieredCompactionStrategy'. :( > > > > Here is my test and output: > > > > @host01:/usr/share/cassandra>cqlsh host01 --cql3 > > Connected to BookCluster at host01:9160. > > [cqlsh 2.2.0 | Cassandra 1.1.0 | CQL spec 3.0.0 | Thrift protocol 19.30.0] > > Use HELP for help. > > cqlsh> > > cqlsh> use demo; > > > > cqlsh:demo> CREATE COLUMNFAMILY book > > ... (isbn varchar, > > ... book_id bigint, > > ... price int, > > ... obj varchar, > > ... PRIMARY KEY (isbn, book_id) > > ... ) > > ... WITH compaction_strategy_class='LeveledCompactionStrategy'; > > cqlsh:demo> > > cqlsh:demo> describe COLUMNFAMILY book; > > > > CREATE COLUMNFAMILY book ( > > isbn text PRIMARY KEY > > ) WITH > > comment='' AND > > > > comparator='CompositeType(org.apache.cassandra.db.marshal.LongType,org.apache.cassandra.db.marshal.UTF8Type)' > > AND > > read_repair_chance=0.100000 AND > > gc_grace_seconds=864000 AND > > default_validation=text AND > > min_compaction_threshold=4 AND > > max_compaction_threshold=32 AND > > replicate_on_write=True AND > > compaction_strategy_class='SizeTieredCompactionStrategy' AND > > > > compression_parameters:sstable_compression='org.apache.cassandra.io.compress.SnappyCompressor'; > > > > cqlsh:demo> > > > > Thanks, > > Charlie (@mujiang) 一个 木匠 > > ======= > > Data Architect Developer > > http://mujiang.blogspot.com -- Andy Ballingall Senior Software Engineer The Foundry 6th Floor, The Communications Building, 48, Leicester Square, London, WC2H 7LT, UK Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906 Web: http://www.thefoundry.co.uk/ The Foundry Visionmongers Ltd. Registered in England and Wales No: 4642027