Class: Aerospike::OperateCommand
- Inherits:
-
ReadCommand
- Object
- Command
- SingleCommand
- ReadCommand
- Aerospike::OperateCommand
- Defined in:
- lib/aerospike/command/operate_command.rb
Overview
:nodoc:
Constant Summary
Constants inherited from ReadCommand
ReadCommand::BIN_NAME_ENCODING
Instance Attribute Summary
Attributes inherited from ReadCommand
Instance Method Summary collapse
- #get_node ⇒ Object
-
#initialize(cluster, key, args) ⇒ OperateCommand
constructor
A new instance of OperateCommand.
- #write_bins ⇒ Object
- #write_buffer ⇒ Object
Methods inherited from ReadCommand
#handle_udf_error, #parse_record, #parse_result
Methods inherited from Command
#execute, #set_delete, #set_exists, #set_operate, #set_query, #set_read, #set_read_for_key_only, #set_read_header, #set_scan, #set_touch, #set_udf, #set_write
Constructor Details
#initialize(cluster, key, args) ⇒ OperateCommand
Returns a new instance of OperateCommand.
23 24 25 26 27 |
# File 'lib/aerospike/command/operate_command.rb', line 23 def initialize(cluster, key, args) super(cluster, args.write_policy, key, nil) @args = args end |
Instance Method Details
#get_node ⇒ Object
29 30 31 |
# File 'lib/aerospike/command/operate_command.rb', line 29 def get_node @cluster.master_node(@partition) end |
#write_bins ⇒ Object
33 34 35 |
# File 'lib/aerospike/command/operate_command.rb', line 33 def write_bins @operations.select { |op| op.op_type == Aerospike::Operation::WRITE }.map(&:bin).compact end |
#write_buffer ⇒ Object
37 38 39 |
# File 'lib/aerospike/command/operate_command.rb', line 37 def write_buffer set_operate(@args.write_policy, @key, @args) end |