Module: Cassandra::Columns

Included in:
Cassandra, Mock
Defined in:
lib/cassandra/columns.rb,
lib/cassandra/0.6/columns.rb,
lib/cassandra/0.8/columns.rb,
lib/cassandra/0.7/columns.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#_standard_counter_mutation(column_family, column_name, value) ⇒ Object


3
4
5
6
7
8
9
10
11
12
# File 'lib/cassandra/0.8/columns.rb', line 3

def _standard_counter_mutation(column_family, column_name, value)
  CassandraThrift::Mutation.new(
    :column_or_supercolumn => CassandraThrift::ColumnOrSuperColumn.new(
      :counter_column => CassandraThrift::CounterColumn.new(
        :name      => column_name_class(column_family).new(column_name).to_s,
        :value     => value
      )
    )
  )
end

#_super_counter_mutation(column_family, super_column_name, sub_column, value) ⇒ Object


14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cassandra/0.8/columns.rb', line 14

def _super_counter_mutation(column_family, super_column_name, sub_column, value)
  CassandraThrift::Mutation.new(:column_or_supercolumn =>
    CassandraThrift::ColumnOrSuperColumn.new(
      :counter_super_column => CassandraThrift::SuperColumn.new(
        :name => column_name_class(column_family).new(super_column_name).to_s,
        :columns => [CassandraThrift::CounterColumn.new(
          :name      => sub_column_name_class(column_family).new(sub_column).to_s,
          :value     => value
        )]
      )
    )
  )
end