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_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_nodeObject



29
30
31
# File 'lib/aerospike/command/operate_command.rb', line 29

def get_node
  @cluster.master_node(@partition)
end

#write_binsObject



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_bufferObject



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

def write_buffer
  set_operate(@args.write_policy, @key, @args)
end