Class: Aerospike::TouchCommand

Inherits:
SingleCommand show all
Defined in:
lib/aerospike/command/touch_command.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Command

#execute, #set_batch_exists, #set_batch_get, #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) ⇒ TouchCommand

Returns a new instance of TouchCommand.



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

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

  @policy = policy

  self
end

Instance Method Details

#parse_resultObject



37
38
39
40
41
42
43
44
45
46
# File 'lib/aerospike/command/touch_command.rb', line 37

def parse_result
  # Read header.
  @conn.read(@data_buffer, MSG_TOTAL_HEADER_SIZE)

  result_code = @data_buffer.read(13).ord & 0xFF

  raise Aerospike::Exceptions::Aerospike.new(result_code) if result_code != 0

  empty_socket
end

#write_bufferObject



33
34
35
# File 'lib/aerospike/command/touch_command.rb', line 33

def write_buffer
  set_touch(@policy, @key)
end