Class: Aerospike::BatchDirectNode
- Inherits:
-
Object
- Object
- Aerospike::BatchDirectNode
- Defined in:
- lib/aerospike/command/batch_direct_node.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#batch_namespaces ⇒ Object
Returns the value of attribute batch_namespaces.
-
#node ⇒ Object
Returns the value of attribute node.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(node, keys) ⇒ BatchDirectNode
constructor
A new instance of BatchDirectNode.
Constructor Details
#initialize(node, keys) ⇒ BatchDirectNode
Returns a new instance of BatchDirectNode.
32 33 34 35 36 |
# File 'lib/aerospike/command/batch_direct_node.rb', line 32 def initialize(node, keys) @node = node @batch_namespaces = keys.group_by(&:namespace) .map { |ns, keys_for_ns| BatchNamespace.new(ns, keys_for_ns) } end |
Instance Attribute Details
#batch_namespaces ⇒ Object
Returns the value of attribute batch_namespaces.
25 26 27 |
# File 'lib/aerospike/command/batch_direct_node.rb', line 25 def batch_namespaces @batch_namespaces end |
#node ⇒ Object
Returns the value of attribute node.
24 25 26 |
# File 'lib/aerospike/command/batch_direct_node.rb', line 24 def node @node end |
Class Method Details
.generate_list(cluster, replica_policy, keys) ⇒ Object
27 28 29 30 |
# File 'lib/aerospike/command/batch_direct_node.rb', line 27 def self.generate_list(cluster, replica_policy, keys) keys.group_by { |key| cluster.get_node_for_key(replica_policy, key) } .map { |node, keys_for_node| BatchDirectNode.new(node, keys_for_node) } end |