Stream-Framework icon indicating copy to clipboard operation
Stream-Framework copied to clipboard

Cassandra: feed's column family name defaults to "example"

Open semente opened this issue 9 years ago • 0 comments

Taking the example presented below, if I don't set timeline_cf_name all my Stream feed's column family names are set to "example" by default and because the naming conflict the result will be the creation of only one table in the keyspace.

class UserFeed(feeds.CassandraFeed):
    key_format = 'feed:user:%(user_id)s'
    timeline_cf_name = 'user_feed'

class TimelineFeed(feeds.CassandraFeed):
    key_format = 'feed:timeline:%(user_id)s'
    timeline_cf_name = 'timeline_feed'

That is how I'm creating these tables in Cassandra:

from cassandra.cqlengine.management import sync_table
sync_table(UserFeed.get_timeline_storage().model)
sync_table(TimelineFeed.get_timeline_storage().model)

semente avatar Jan 15 '16 17:01 semente