examples/putget.rb
def run_single_bin_example(client)
  key = Key.new(Shared.namespace, Shared.set_name, "putgetkey")
  bin = Bin.new("", "value")

  Shared.logger.info("Single Put: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key} value=#{bin.value}")

  client.put(key, [bin], Shared.write_policy)

  Shared.logger.info("Single Get: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key}")

  record = client.get(key, [], Shared.policy)

  if record.nil?
    Shared.logger.fatal("Failed to get: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key}")
    exit
  end

  Shared.validate_bin(key, bin, record)
end
# Execute put and get on a server configured as single-bin.
Execute put and get on a server configured as single-bin.
Execute put and get on a server configured as single - bin .
def run_single_bin_example(client)
  key = Key.new(Shared.namespace, Shared.set_name, "putgetkey")
  bin = Bin.new("", "value")
  Shared.logger.info("Single Put: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key} value=#{bin.value}")
  client.put(key, [bin], Shared.write_policy)
  Shared.logger.info("Single Get: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key}")
  record = client.get(key, [], Shared.policy)
  if record.nil?
    Shared.logger.fatal("Failed to get: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key}")
    exit
  end
  Shared.validate_bin(key, bin, record)
end
def run_single_bin_example ( client ) key = Key . new ( Shared . namespace , Shared . set_name , "putgetkey" ) bin = Bin . new ( "" , "value" ) Shared . logger . info ( "Single Put: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key} value=#{bin.value}" ) client . put ( key , [ bin ] , Shared . write_policy ) Shared . logger . info ( "Single Get: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key}" ) record = client . get ( key , [ ] , Shared . policy ) if record . nil? Shared . logger . fatal ( "Failed to get: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key}" ) exit end Shared . validate_bin ( key , bin , record ) end
Execute put and get on a server configured as single-bin.
Execute put and get on a server configured as single - bin .
client