GithubHelp home page GithubHelp logo

Comments (3)

ryanking avatar ryanking commented on July 20, 2024

The cassandra 0.7 support is still experimental. You're going to have to just read the code for now.

from cassandra.

sdruon-spotuse avatar sdruon-spotuse commented on July 20, 2024

The code says that the method takes "cf_def" as argument:
add_column_family(cf_def)
What is cf_def then?

Thanks a lot in advance

Sébastien Druon

from cassandra.

kyptin avatar kyptin commented on July 20, 2024

I figured out a few things about cf_def should be. I'm posting it here in case it's helpful to someone.

I'm able to get the cf_def for a keyspace that I added through the cassandra-cli tool. First of all, here are the commands that I used to create the keyspace:

create keyspace testing;
use testing;
create column family ServerData with column_type=Standard and comparator=LongType;

Then, here's how I access the cf_def object from within Ruby code (or irb):

require 'cassandra/0.7'
connection = Cassandra.new('testing', '127.0.0.1:9160')
keyspaces = connection.send('client').describe_keyspaces
keyspace_def = keyspaces.find{|ks| ks.name=='testing'}
cf_def = keyspace_def.cf_defs.first

Then, puts cf_def.inspect prints:

<CassandraThrift::CfDef keyspace:"testing", name:"ServerData", column_type:"Standard", comparator_type:"org.apache.cassandra.db.marshal.LongType", comment:"", row_cache_size:0.0, key_cache_size:200000.0, read_repair_chance:1.0, column_metadata:[], gc_grace_seconds:864000, default_validation_class:"org.apache.cassandra.db.marshal.BytesType", id:1035, min_compaction_threshold:4, max_compaction_threshold:32, row_cache_save_period_in_seconds:0, key_cache_save_period_in_seconds:14400, memtable_flush_after_mins:1440, memtable_throughput_in_mb:364, memtable_operations_in_millions:1.70625>

I still haven't figured out how to create a CassandraThrift::CfDef instance, but at least that's a start.

from cassandra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.