The UDF API provides the ability to manage UDFs in the cluster.
Management capabilities include:
|
AS_EXTERN as_status | aerospike_udf_get (aerospike *as, as_error *err, const as_policy_info *policy, const char *filename, as_udf_type type, as_udf_file *file) |
|
AS_EXTERN as_status | aerospike_udf_list (aerospike *as, as_error *err, const as_policy_info *policy, as_udf_files *files) |
|
AS_EXTERN as_status | aerospike_udf_put (aerospike *as, as_error *err, const as_policy_info *policy, const char *filename, as_udf_type type, as_bytes *content) |
|
AS_EXTERN as_status | aerospike_udf_put_wait (aerospike *as, as_error *err, const as_policy_info *policy, const char *filename, uint32_t interval_ms) |
|
AS_EXTERN as_status | aerospike_udf_remove (aerospike *as, as_error *err, const as_policy_info *policy, const char *filename) |
|
AS_EXTERN as_status | aerospike_udf_remove_wait (aerospike *as, as_error *err, const as_policy_info *policy, const char *filename, uint32_t interval_ms) |
|
Get specified UDF file from the cluster.
}
else {
if (file.
type == AS_UDF_TYPE_UDF) {
}
}
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The policy to use for this operation. If NULL, then the default policy will be used. |
filename | The name of the UDF file. |
type | The type of UDF file. |
file | The file from the cluster. |
- Returns
- AEROSPIKE_OK if successful. Otherwise an error occurred.
List the UDF files in the cluster.
}
else {
printf(
"files[%d]:\n", files.
size);
for(
int i = 0; i < files.
size; i++) {
printf(
" - %s (%d) [%s]\n", file->
name, file->
type, file->
hash);
}
}
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The policy to use for this operation. If NULL, then the default policy will be used. |
files | The list to populate with the results from the request. |
- Returns
- AEROSPIKE_OK if successful. Otherwise an error occurred.
Put a UDF file into the cluster. This function will return before the put is completed on all nodes. Use aerospike_udf_put_wait() when need to wait for completion.
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The policy to use for this operation. If NULL, then the default policy will be used. |
filename | The name of the UDF file. |
type | The type of UDF file. |
content | The file of the UDF file. |
- Returns
- AEROSPIKE_OK if UDF put was started. Otherwise an error occurred.
Wait for asynchronous udf put to complete using given polling interval.
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The policy to use for this operation. If NULL, then the default policy will be used. |
filename | The name of the UDF file. |
interval_ms | The polling interval in milliseconds. If zero, 1000 ms is used. |
- Returns
- AEROSPIKE_OK if successful. Otherwise an error occurred.
Remove a UDF file from the cluster. This function will return before the remove is completed on all nodes. Use aerospike_udf_remove_wait() when need to wait for completion.
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The policy to use for this operation. If NULL, then the default policy will be used. |
filename | The name of the UDF file. |
- Returns
- AEROSPIKE_OK if remove was started. Otherwise an error occurred.
Wait for asynchronous udf remove to complete using given polling interval.
- Parameters
-
as | The aerospike instance to use for this operation. |
err | The as_error to be populated if an error occurs. |
policy | The policy to use for this operation. If NULL, then the default policy will be used. |
filename | The name of the UDF file. |
interval_ms | The polling interval in milliseconds. If zero, 1000 ms is used. |
- Returns
- AEROSPIKE_OK if successful. Otherwise an error occurred.