AerospikeClientRegisterUdfString Method

Aerospike
Register UDF functions located in a code string with server. Example:
 String code = @"
 local function reducer(val1,val2)
      return val1 + val2
 end

 function sum_single_bin(stream,name)
   local function mapper(rec)
     return rec[name]
   end
   return stream : map(mapper) : reduce(reducer)
 end
";

    client.RegisterUdfString(null, code, "mysum.lua", Language.LUA);

This asynchronous server call will return before command is complete. The user can optionally wait for command completion by using the returned RegisterTask instance.

Namespace:  Aerospike.Client
Assembly:  AerospikeClient (in AerospikeClient.dll) Version: 5.1.1.0 (5.1.1)
Syntax

C#
public RegisterTask RegisterUdfString(
	Policy policy,
	string code,
	string serverPath,
	Language language
)

Parameters

policy
Type: Aerospike.ClientPolicy
generic configuration parameters, pass in null for defaults
code
Type: SystemString
code string containing user defined functions
serverPath
Type: SystemString
path to store user defined functions on the server, relative to configured script directory.
language
Type: Aerospike.ClientLanguage
language of user defined functions

Return Value

Type: RegisterTask

Implements

IAerospikeClientRegisterUdfString(Policy, String, String, Language)
Exceptions

ExceptionCondition
AerospikeExceptionif register fails
See Also

Reference