Class: Riak::Crdt::BatchMap
Overview
A map that queues up its operations for the parent Map to send to Riak all at once.
Instance Attribute Summary collapse
-
#counters ⇒ Object
readonly
Returns the value of attribute counters.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#maps ⇒ Object
readonly
Returns the value of attribute maps.
-
#registers ⇒ Object
readonly
Returns the value of attribute registers.
-
#sets ⇒ Object
readonly
Returns the value of attribute sets.
Instance Method Summary collapse
-
#initialize(parent) ⇒ BatchMap
constructor
private
A new instance of BatchMap.
- #operate(operation) ⇒ Object private
- #operations ⇒ Object private
Constructor Details
#initialize(parent) ⇒ BatchMap
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of BatchMap.
9 10 11 12 13 14 |
# File 'lib/riak/crdt/batch_map.rb', line 9 def initialize(parent) @parent = parent @queue = [] initialize_collections end |
Instance Attribute Details
#counters ⇒ Object (readonly)
Returns the value of attribute counters.
6 7 8 |
# File 'lib/riak/crdt/batch_map.rb', line 6 def counters @counters end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
6 7 8 |
# File 'lib/riak/crdt/batch_map.rb', line 6 def flags @flags end |
#maps ⇒ Object (readonly)
Returns the value of attribute maps.
6 7 8 |
# File 'lib/riak/crdt/batch_map.rb', line 6 def maps @maps end |
#registers ⇒ Object (readonly)
Returns the value of attribute registers.
6 7 8 |
# File 'lib/riak/crdt/batch_map.rb', line 6 def registers @registers end |
#sets ⇒ Object (readonly)
Returns the value of attribute sets.
6 7 8 |
# File 'lib/riak/crdt/batch_map.rb', line 6 def sets @sets end |
Instance Method Details
#operate(operation) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/riak/crdt/batch_map.rb', line 17 def operate(operation) @queue << operation end |
#operations ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 25 26 27 28 29 |
# File 'lib/riak/crdt/batch_map.rb', line 22 def operations @queue.map do |q| Operation::Update.new.tap do |op| op.type = :map op.value = q end end end |