Class: Aerospike::OperateCommand

Inherits:
ReadCommand show all
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

#policy, #record

Instance Method Summary collapse

Methods inherited from ReadCommand

#handle_udf_error, #parse_record, #parse_result

Methods inherited from Command

#execute, #set_delete, #set_exists, #set_operate, #set_read, #set_read_for_key_only, #set_read_header, #set_scan, #set_touch, #set_udf, #set_write

Constructor Details

#initialize(cluster, policy, key, operations) ⇒ OperateCommand

Returns a new instance of OperateCommand.



25
26
27
28
29
# File 'lib/aerospike/command/operate_command.rb', line 25

def initialize(cluster, policy, key, operations)
  super(cluster, policy, key, nil)

  @operations = operations
end

Instance Method Details

#get_nodeObject



31
32
33
# File 'lib/aerospike/command/operate_command.rb', line 31

def get_node
  @cluster.master_node(@partition)
end

#write_binsObject



36
37
38
# File 'lib/aerospike/command/operate_command.rb', line 36

def write_bins
  @operations.select{|op| op.op_type == Aerospike::Operation::WRITE}.map(&:bin).compact
end

#write_bufferObject



40
41
42
# File 'lib/aerospike/command/operate_command.rb', line 40

def write_buffer
  set_operate(@policy, @key, @operations)
end