Class: Aerospike::BatchIndexExistsCommand

Inherits:
BatchIndexCommand show all
Defined in:
lib/aerospike/command/batch_index_exists_command.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from BatchIndexCommand

#batch, #bin_names, #policy, #read_attr, #results

Instance Method Summary collapse

Methods inherited from BatchIndexCommand

#write_buffer

Methods inherited from MultiCommand

#compressed?, #get_node, #parse_group, #parse_key, #parse_record, #parse_result, #read_bytes, #skip_key, #stop, #valid?

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, #write_bins

Constructor Details

#initialize(node, batch, policy, results) ⇒ BatchIndexExistsCommand

Returns a new instance of BatchIndexExistsCommand.



24
25
26
# File 'lib/aerospike/command/batch_index_exists_command.rb', line 24

def initialize(node, batch, policy, results)
  super(node, batch, policy, nil, results, INFO1_READ | INFO1_NOBINDATA)
end

Instance Method Details

#parse_row(result_code) ⇒ Object

Parse all results in the batch. Add records to shared list. If the record was not found, the bins will be nil.



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/aerospike/command/batch_index_exists_command.rb', line 30

def parse_row(result_code)
  batch_index = @data_buffer.read_int32(14)
  field_count = @data_buffer.read_int16(18)
  op_count = @data_buffer.read_int16(20)

  if op_count > 0
    raise Aerospike::Exceptions::Parse.new('Received bins that were not requested!')
  end

  skip_key(field_count)
  results[batch_index] = (result_code == 0)
end