examples/putget.rb
# Execute put and get on a server configured as multi-bin.  This is the server default.
Execute put and get on a server configured as multi-bin.  This is the server default.
Execute put and get on a server configured as multi - bin . This is the server default .
def run_multi_bin_example(client)
  key = Key.new(Shared.namespace, Shared.set_name, "putgetkey")
  bin1 = Bin.new("bin1", "value1")
  bin2 = Bin.new("bin2", "value2")
  Shared.logger.info("Put: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key} bin1=#{bin1.name} value1=#{bin1.value} bin2=#{bin2.name} value2=#{bin2.value}")
  client.put(key, [bin1, bin2], Shared.write_policy)
  Shared.logger.info("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, bin1, record)
  Shared.validate_bin(key, bin2, record)
end
def run_multi_bin_example ( client ) key = Key . new ( Shared . namespace , Shared . set_name , "putgetkey" ) bin1 = Bin . new ( "bin1" , "value1" ) bin2 = Bin . new ( "bin2" , "value2" ) Shared . logger . info ( "Put: namespace=#{key.namespace} set=#{key.set_name} key=#{key.user_key} bin1=#{bin1.name} value1=#{bin1.value} bin2=#{bin2.name} value2=#{bin2.value}" ) client . put ( key , [ bin1 , bin2 ] , Shared . write_policy ) Shared . logger . info ( "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 , bin1 , record ) Shared . validate_bin ( key , bin2 , record ) end
Execute put and get on a server configured as multi-bin.
Execute put and get on a server configured as multi - bin .
client