Class: CassandraModel::CounterRecord

Inherits:
Record
  • Object
show all
Defined in:
lib/cassandra_model/counter_record.rb

Instance Attribute Summary

Attributes inherited from Record

#attributes, #execution_info, #valid

Attributes included from Scopes

#scopes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Record

#==, batch_type, before_save, before_save_callbacks, cassandra_columns, #clustering_columns, columns, composite_defaults, connection_name=, create, create_async, #delete, #delete_async, denormalized_column_map, first, first_async, #initialize, #inspect, #invalidate!, normalized_attributes, normalized_column, order_by_clause, #partition_key, #primary_key, query_for_delete, query_for_save, query_for_update, request, request_async, request_meta, restriction_attributes, #save, #save_async, select_column, select_columns, shard, shard_key, table, table=, table_name=, #update, #update_async

Methods included from Scopes

#scope

Methods included from QueryHelper

#after, #all, #before, def_query_helper, #find_by

Methods included from RecordDebug

#debug

Methods included from DisplayableAttributes

#as_json, included

Methods included from MetaColumns

included

Constructor Details

This class inherits a constructor from CassandraModel::Record

Class Method Details

.counter_columnsObject



59
60
61
# File 'lib/cassandra_model/counter_record.rb', line 59

def counter_columns
  table_data.counter_columns ||= columns - (partition_key + clustering_columns)
end

.save_in_batchObject



63
64
65
# File 'lib/cassandra_model/counter_record.rb', line 63

def save_in_batch
  table_config.batch_type = :counter
end

Instance Method Details

#increment!(options) ⇒ Object



8
9
10
# File 'lib/cassandra_model/counter_record.rb', line 8

def increment!(options)
  increment_async!(options).get
end

#increment_async!(options) ⇒ Object



4
5
6
# File 'lib/cassandra_model/counter_record.rb', line 4

def increment_async!(options)
  internal_increment_async!(options)
end