1

Are there any Ruby clients for Cassandra with support of counters and supercolumns?

1) gem cassandra doesn't support counters

2) gem cassandra-cql doesn't support supercolumns (cql doesn't support them)

AstroCB
  • 11,800
  • 20
  • 54
  • 68
Anton
  • 875
  • 8
  • 17

1 Answers1

3

The 'cassandra' gem does support counters, its just not well documented. Support was added in May 2011 (a1a085469). To increment a counter:

@twitter.add(:UserCounters, 'bob', 5, 'tweet_count')

Where

  • :UserCounters is the column family
  • 'bob' is the row key
  • 5 is the amount to increment the counter by
  • 'tweet_count' is the column_name
psanford
  • 5,414
  • 1
  • 22
  • 24
  • Thank you very much! I'm happy :-) – Anton Feb 16 '12 at 22:15
  • @brs - if you are happy with the answer feel free to mark it as Accepted, hint hint :) –  Feb 16 '12 at 22:24
  • I am trying to get this code working... have posted a question... can you please help: http://stackoverflow.com/questions/16396542/unable-to-use-cassandra-counter-column-with-cassandra-gem – whizcreed May 06 '13 at 11:25