Class: AerospikeNative::Client

Inherits:
Object
  • Object
show all
Defined in:
ext/aerospike_native/client.c

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#newAerospikeNative::Client #new(hosts) ⇒ AerospikeNative::Client

initialize new client, use host’ => …, ‘port’ => … for each hosts element

Overloads:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'ext/aerospike_native/client.c', line 53

VALUE client_initialize(int argc, VALUE* argv, VALUE self)
{
    VALUE ary = Qnil, vSettings = Qnil;
    aerospike *ptr;
    as_config config;
    as_error err;
    long idx = 0, n = 0;

    if (argc > 2) {  // there should only be 0, 1 or 2 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 0..2)", argc);
    }

    if (argc == 1) {
        ary = argv[0];
    }

    switch (TYPE(argv[0])) {
    case T_NIL:
    case T_ARRAY:
        ary = argv[0];
        break;
    case T_HASH:
        vSettings = argv[0];
        if (argc > 1) {
            rb_raise(rb_eArgError, "wrong number of arguments (detected settings hash as first parameter)", argc);
        }
        break;
    default:
        /* raise exception */
        Check_Type(ary, T_ARRAY);
        break;
    }

    if(argc == 2) {
        switch (TYPE(argv[1])) {
        case T_NIL:
        case T_HASH:
            vSettings = argv[1];
            break;
        default:
            /* raise exception */
            Check_Type(ary, T_HASH);
            break;
        }
    }

    Data_Get_Struct(self, aerospike, ptr);

    as_config_init(&config);
    if (TYPE(vSettings) != T_NIL) {
        VALUE vLua = rb_hash_aref(vSettings, rb_str_new2("lua"));
        if (TYPE(vLua) == T_NIL) {
            vLua = rb_hash_aref(vSettings, ID2SYM( rb_intern("lua") ));
        }
        if (TYPE(vLua) == T_HASH) {
            VALUE vSystemPath = rb_hash_aref(vLua, rb_str_new2("system_path"));
            VALUE vUserPath = rb_hash_aref(vLua, rb_str_new2("user_path"));
            if (TYPE(vSystemPath) == T_NIL) {
                vSystemPath = rb_hash_aref(vLua, ID2SYM( rb_intern("system_path") ));
            }
            if (TYPE(vUserPath) == T_NIL) {
                vUserPath = rb_hash_aref(vLua, ID2SYM( rb_intern("user_path") ));
            }

            if (TYPE(vSystemPath) == T_STRING) {
                strcpy(config.lua.system_path, StringValueCStr(vSystemPath));
            }
            if (TYPE(vUserPath) == T_STRING) {
                strcpy(config.lua.user_path, StringValueCStr(vUserPath));
            }
        }
    }

    if (TYPE(ary) == T_ARRAY) {
        idx = RARRAY_LEN(ary);
        for(n = 0; n < idx; n++) {
            VALUE vHost, vPort;
            VALUE hash = rb_ary_entry(ary, n);
            vHost = rb_hash_aref(hash, rb_str_new2("host"));
            if (TYPE(vHost) == T_NIL) {
                vHost = rb_hash_aref(hash, ID2SYM( rb_intern("host") ));
            }
            vPort = rb_hash_aref(hash, rb_str_new2("port"));
            if (TYPE(vPort) == T_NIL) {
                vPort = rb_hash_aref(hash, ID2SYM( rb_intern("port") ));
            }
            as_config_add_host(&config, StringValueCStr(vHost), NUM2UINT(vPort));
        }
    }

    if (idx == 0) {
        as_config_add_host(&config, "127.0.0.1", 3000);
    }

    aerospike_init(ptr, &config);

    if ( aerospike_connect(ptr, &err) != AEROSPIKE_OK ) {
        raise_aerospike_exception(err.code, err.message);
    }
    return self;
}

Class Method Details

.set_log_level(vLevel) ⇒ Object



695
696
697
698
699
# File 'ext/aerospike_native/client.c', line 695

VALUE client_set_log_level(VALUE vSelf, VALUE vLevel)
{
    Check_Type(vLevel, T_SYMBOL);
    return rb_funcall(LoggerInstance, rb_intern("set_level"), 1, vLevel);
}

.set_logger(vNewLogger) ⇒ Object



689
690
691
692
693
# File 'ext/aerospike_native/client.c', line 689

VALUE client_set_logger(VALUE vSelf, VALUE vNewLogger)
{
    rb_iv_set(LoggerInstance, "@internal", vNewLogger);
    return LoggerInstance;
}

Instance Method Details

#batchAerospikeNative::Batch

Instantiate new batch



707
708
709
710
711
712
713
# File 'ext/aerospike_native/client.c', line 707

VALUE client_batch(VALUE vSelf)
{
    VALUE vParams[1];

    vParams[0] = vSelf;
    return rb_class_new_instance(1, vParams, BatchClass);
}

#create_index(, vSelf) ⇒ Object



566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'ext/aerospike_native/client.c', line 566

VALUE client_create_index(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vNamespace, vSet, vBinName, vIndexName;

    aerospike *ptr;
    as_error err;
    as_policy_info policy;
    as_index_task task;
    bool is_integer = true;

    if (argc > 5 || argc < 4) {  // there should only be 4 or 5 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 4..5)", argc);
    }

    vNamespace = vArgs[0];
    Check_Type(vNamespace, T_STRING);

    vSet = vArgs[1];
    Check_Type(vSet, T_STRING);

    vBinName = vArgs[2];
    Check_Type(vBinName, T_STRING);

    vIndexName = vArgs[3];
    Check_Type(vIndexName, T_STRING);

    if (argc == 5 && TYPE(vArgs[4]) != T_NIL) {
        VALUE vType = Qnil;
        SET_INFO_POLICY(policy, vArgs[4]);
        vType = rb_hash_aref(vArgs[4], rb_str_new2("type"));
        if (TYPE(vType) == T_FIXNUM) {
            switch(FIX2INT(vType)) {
            case INDEX_NUMERIC:
                is_integer = true;
                break;
            case INDEX_STRING:
                is_integer = false;
                break;
            default:
                rb_raise(rb_eArgError, "Incorrect index type");
            }
        }
    }

    Data_Get_Struct(vSelf, aerospike, ptr);

    if (is_integer) {
        if (aerospike_index_integer_create(ptr, &err, &policy, StringValueCStr(vNamespace), StringValueCStr(vSet), StringValueCStr(vBinName), StringValueCStr(vIndexName)) != AEROSPIKE_OK) {
            raise_aerospike_exception(err.code, err.message);
        }
    } else {
        if (aerospike_index_string_create(ptr, &err, &policy, StringValueCStr(vNamespace), StringValueCStr(vSet), StringValueCStr(vBinName), StringValueCStr(vIndexName)) != AEROSPIKE_OK) {
            raise_aerospike_exception(err.code, err.message);
        }
    }

    task.as = ptr;
    strcpy(task.ns, StringValueCStr(vNamespace));
    strcpy(task.name, StringValueCStr(vIndexName));
    task.done = false;
    if (aerospike_index_create_wait(&err, &task, 1000) != AEROSPIKE_OK) {
        raise_aerospike_exception(err.code, err.message);
    }

    return (task.done ? Qtrue : Qfalse);
}

#drop_index(, vSelf) ⇒ Object



640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'ext/aerospike_native/client.c', line 640

VALUE client_drop_index(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vNamespace, vIndexName;

    aerospike *ptr;
    as_error err;
    as_policy_info policy;

    if (argc > 3 || argc < 2) {  // there should only be 2 or 3 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 2..3)", argc);
    }

    vNamespace = vArgs[0];
    Check_Type(vNamespace, T_STRING);

    vIndexName = vArgs[1];
    Check_Type(vIndexName, T_STRING);

    if (argc == 3 && TYPE(vArgs[2]) != T_NIL) {
        SET_INFO_POLICY(policy, vArgs[2]);
    }

    Data_Get_Struct(vSelf, aerospike, ptr);

    if (aerospike_index_remove(ptr, &err, &policy, StringValueCStr(vNamespace), StringValueCStr(vIndexName)) != AEROSPIKE_OK) {
        raise_aerospike_exception(err.code, err.message);
    }

    return Qtrue;
}

#exists?(, vSelf) ⇒ Object



455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
# File 'ext/aerospike_native/client.c', line 455

VALUE client_exists(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vKey;

    aerospike *ptr;
    as_key* key;
    as_error err;
    as_policy_read policy;
    as_record* record = NULL;
    as_status status;

    if (argc > 2 || argc < 1) {  // there should only be 1 or 2 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..2)", argc);
    }

    vKey = vArgs[0];
    check_aerospike_key(vKey);

    if (argc == 2 && TYPE(vArgs[1]) != T_NIL) {
        SET_READ_POLICY(policy, vArgs[1]);
    }

    Data_Get_Struct(vSelf, aerospike, ptr);
    Data_Get_Struct(vKey, as_key, key);

    status = aerospike_key_exists(ptr, &err, &policy, key, &record);
    if (status != AEROSPIKE_OK && status != AEROSPIKE_ERR_RECORD_NOT_FOUND) {
        as_record_destroy(record);
        raise_aerospike_exception(err.code, err.message);
    }
    as_record_destroy(record);

    if (status == AEROSPIKE_ERR_RECORD_NOT_FOUND) {
        return Qfalse;
    }

    return Qtrue;
}

#get(, vSelf) ⇒ Object



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'ext/aerospike_native/client.c', line 248

VALUE client_get(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vKey;

    aerospike *ptr;
    as_key* key;
    as_error err;
    as_record* record = NULL;
    as_policy_read policy;

    if (argc > 2 || argc < 1) {  // there should only be 1 or 2 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..2)", argc);
    }

    vKey = vArgs[0];
    check_aerospike_key(vKey);

    as_policy_read_init(&policy);

    if (argc == 2 && TYPE(vArgs[1]) != T_NIL) {
        SET_READ_POLICY(policy, vArgs[1]);
    }

    Data_Get_Struct(vSelf, aerospike, ptr);
    Data_Get_Struct(vKey, as_key, key);

    if (aerospike_key_get(ptr, &err, &policy, key, &record) != AEROSPIKE_OK) {
        as_record_destroy(record);
        raise_aerospike_exception(err.code, err.message);
    }

    return rb_record_from_c(record, key);
}

#operate(, vSelf) ⇒ Object



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'ext/aerospike_native/client.c', line 289

VALUE client_operate(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vKey;
    VALUE vOperations;
    long idx = 0, n = 0;
    bool isset_read = false;

    aerospike *ptr;
    as_operations ops;
    as_key* key;
    as_error err;
    as_policy_operate policy;
    as_record* record = NULL;

    if (argc > 3 || argc < 2) {  // there should only be 2 or 3 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 2..3)", argc);
    }

    vKey = vArgs[0];
    check_aerospike_key(vKey);

    vOperations = vArgs[1];
    Check_Type(vOperations, T_ARRAY);
    as_policy_operate_init(&policy);

    if (argc == 3 && TYPE(vArgs[2]) != T_NIL) {
        SET_OPERATE_POLICY(policy, vArgs[2]);
    }

    idx = RARRAY_LEN(vOperations);
    if (idx == 0) {
        return Qfalse;
    }

    Data_Get_Struct(vSelf, aerospike, ptr);
    as_operations_inita(&ops, idx);

   for(n = 0; n < idx; n++) {
        VALUE operation = rb_ary_entry(vOperations, n);
        int op_type = NUM2INT( rb_iv_get(operation, "@op_type") );
        VALUE bin_name = rb_iv_get(operation, "@bin_name");
        VALUE bin_value = rb_iv_get(operation, "@bin_value");

        switch( op_type ) {
        case OPERATION_WRITE:
            switch( TYPE(bin_value) ) {
            case T_NIL: {
                as_record rec;
                as_record_inita(&rec, 1);
                as_record_set_nil(&rec, StringValueCStr( bin_name ));
                ops.binops.entries[ops.binops.size].op = AS_OPERATOR_WRITE;
                ops.binops.entries[ops.binops.size].bin = rec.bins.entries[0];
                ops.binops.size++;
                break;
            }
            case T_STRING:
                as_operations_add_write_str(&ops, StringValueCStr( bin_name ), StringValueCStr( bin_value ));
                break;
            case T_FIXNUM:
                as_operations_add_write_int64(&ops, StringValueCStr( bin_name ), NUM2LONG( bin_value ));
                break;
//            case T_ARRAY:
//            case T_HASH:
//                rb_raise(rb_eTypeError, "wrong argument type for bin value (hashes and arrays not supported yet)");
//                break;
            default: {
                VALUE vBytes = rb_funcall(bin_value, rb_intern("to_msgpack"), 0);
                int strSize = RSTRING_LEN(vBytes);
                as_operations_add_write_raw(&ops, StringValueCStr(bin_name), StringValuePtr(vBytes), strSize);
                break;
            }
            }

            break;
        case OPERATION_READ:
            isset_read = true;
            as_operations_add_read(&ops, StringValueCStr( bin_name ));
            break;
        case OPERATION_INCREMENT:
            as_operations_add_incr(&ops, StringValueCStr( bin_name ), NUM2INT( bin_value ));
            break;
        case OPERATION_APPEND:
            Check_Type(bin_value, T_STRING);
            as_operations_add_append_str(&ops, StringValueCStr( bin_name ), StringValueCStr( bin_value ));
            break;
        case OPERATION_PREPEND:
            Check_Type(bin_value, T_STRING);
            as_operations_add_prepend_str(&ops, StringValueCStr( bin_name ), StringValueCStr( bin_value ));
            break;
        case OPERATION_TOUCH:
            isset_read = true;
            as_operations_add_touch(&ops);
            break;
        default:
            rb_raise(rb_eArgError, "Incorrect operation type");
            break;
        }
    }

    Data_Get_Struct(vKey, as_key, key);

    if (isset_read) {
        if (aerospike_key_operate(ptr, &err, &policy, key, &ops, &record) != AEROSPIKE_OK) {
            as_operations_destroy(&ops);
            as_record_destroy(record);
            raise_aerospike_exception(err.code, err.message);
        }

        as_operations_destroy(&ops);

        return rb_record_from_c(record, key);
    } else {
        if (aerospike_key_operate(ptr, &err, &policy, key, &ops, NULL) != AEROSPIKE_OK) {
            as_operations_destroy(&ops);
            raise_aerospike_exception(err.code, err.message);
        }

        as_operations_destroy(&ops);
        return Qtrue;
    }
}

#put(, vSelf) ⇒ Object



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'ext/aerospike_native/client.c', line 162

VALUE client_put(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vKey;
    VALUE vBins;
    VALUE vHashKeys;

    aerospike *ptr;
    as_key* key;
    as_error err;
    as_record record;
    as_policy_write policy;

    int idx = 0, n = 0;

    if (argc > 3 || argc < 2) {  // there should only be 2 or 3 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 2..3)", argc);
    }

    vKey = vArgs[0];
    check_aerospike_key(vKey);

    vBins = vArgs[1];
    Check_Type(vBins, T_HASH);

    as_policy_write_init(&policy);

    if (argc == 3 && TYPE(vArgs[2]) != T_NIL) {
        SET_WRITE_POLICY(policy, vArgs[2]);
    }

    idx = RHASH_SIZE(vBins);
    if (idx == 0) {
        return Qfalse;
    }

    Data_Get_Struct(vSelf, aerospike, ptr);
    as_record_inita(&record, idx);
    vHashKeys = rb_hash_keys(vBins);

    for(n = 0; n < idx; n++) {
        VALUE bin_name = rb_ary_entry(vHashKeys, n);
        VALUE bin_value = rb_hash_aref(vBins, bin_name);

        Check_Type(bin_name, T_STRING);

        switch( TYPE(bin_value) ) {
        case T_NIL:
            as_record_set_nil(&record, StringValueCStr(bin_name));
            break;
        case T_STRING:
            as_record_set_str(&record, StringValueCStr(bin_name), StringValueCStr(bin_value));
            break;
        case T_FIXNUM:
            as_record_set_int64(&record, StringValueCStr(bin_name), NUM2LONG(bin_value));
            break;
//        case T_ARRAY:
//        case T_HASH:
//            rb_raise(rb_eTypeError, "wrong argument type for bin value (hashes and arrays not supported yet)");
//            break;
        default: {
            VALUE vBytes = rb_funcall(bin_value, rb_intern("to_msgpack"), 0);
            int strSize = RSTRING_LEN(vBytes);
            as_record_set_raw(&record, StringValueCStr(bin_name), StringValuePtr(vBytes), strSize);
            break;
        }
        }
     }

    Data_Get_Struct(vKey, as_key, key);

    if (aerospike_key_put(ptr, &err, &policy, key, &record) != AEROSPIKE_OK) {
        as_record_destroy(&record);
        raise_aerospike_exception(err.code, err.message);
    }

    as_record_destroy(&record);
    return Qtrue;
}

#query(namespace, set) ⇒ AerospikeNative::Query

Instantiate new query



678
679
680
681
682
683
684
685
686
687
# File 'ext/aerospike_native/client.c', line 678

VALUE client_query(VALUE vSelf, VALUE vNamespace, VALUE vSet)
{
    VALUE vParams[3];

    vParams[0] = vSelf;
    vParams[1] = vNamespace;
    vParams[2] = vSet;

    return rb_class_new_instance(3, vParams, QueryClass);
}

#remove(, vSelf) ⇒ Object



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
# File 'ext/aerospike_native/client.c', line 418

VALUE client_remove(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vKey;

    aerospike *ptr;
    as_key* key;
    as_error err;
    as_policy_remove policy;

    if (argc > 2 || argc < 1) {  // there should only be 1 or 2 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..2)", argc);
    }

    vKey = vArgs[0];
    check_aerospike_key(vKey);

    if (argc == 2 && TYPE(vArgs[2]) != T_NIL) {
        SET_REMOVE_POLICY(policy, vArgs[2]);
    }

    Data_Get_Struct(vSelf, aerospike, ptr);
    Data_Get_Struct(vKey, as_key, key);

    if (aerospike_key_remove(ptr, &err, &policy, key) != AEROSPIKE_OK) {
        raise_aerospike_exception(err.code, err.message);
    }

    return Qtrue;
}

#scan(namespace, set) ⇒ AerospikeNative::Scan

Instantiate new scan



721
722
723
724
725
726
727
728
729
730
# File 'ext/aerospike_native/client.c', line 721

VALUE client_scan(VALUE vSelf, VALUE vNamespace, VALUE vSet)
{
    VALUE vParams[3];

    vParams[0] = vSelf;
    vParams[1] = vNamespace;
    vParams[2] = vSet;

    return rb_class_new_instance(3, vParams, ScanClass);
}

#scan_info(, vSelf) ⇒ Object



739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
# File 'ext/aerospike_native/client.c', line 739

VALUE client_scan_info(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vParams[3];
    if (argc > 1) {  // there should only be 1 or 2 argument
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 1..2)", argc);
    }

    vParams[0] = vSelf;
    vParams[1] = vArgs[0];
    vParams[2] = Qnil;
    if (argc == 2) {
        vParams[2] = vArgs[1];
    }

    return rb_funcall2(ScanClass, rb_intern("info"), 3, vParams);
}

#select(, vSelf) ⇒ Object



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'ext/aerospike_native/client.c', line 501

VALUE client_select(int argc, VALUE* vArgs, VALUE vSelf)
{
    VALUE vKey;
    VALUE vArray;

    aerospike *ptr;
    as_key* key;
    as_error err;
    as_policy_read policy;
    as_record* record = NULL;
    long n = 0, idx = 0;

    if (argc > 3 || argc < 2) {  // there should only be 2 or 3 arguments
        rb_raise(rb_eArgError, "wrong number of arguments (%d for 2..3)", argc);
    }

    vKey = vArgs[0];
    check_aerospike_key(vKey);
    vArray = vArgs[1];

    Check_Type(vArray, T_ARRAY);
    idx = RARRAY_LEN(vArray);
    if (idx == 0) {
        return Qfalse;
    }

    if (argc == 3 && TYPE(vArgs[2]) != T_NIL) {
        SET_READ_POLICY(policy, vArgs[2]);
    }

    Data_Get_Struct(vSelf, aerospike, ptr);
    Data_Get_Struct(vKey, as_key, key);
    const char* bins[idx];

    for(n = 0; n < idx; n++) {
        VALUE bin_name = rb_ary_entry(vArray, n);

        Check_Type(bin_name, T_STRING);
        char* name = StringValueCStr( bin_name );
        bins[n] = malloc(strlen(name) * sizeof(char) + 1);
        memset(bins[n], '\0', strlen(name) + 1);
        strcpy(bins[n], name);
    }

    if (aerospike_key_select(ptr, &err, &policy, key, bins, &record) != AEROSPIKE_OK) {
        for(n = 0; n < idx; n++) {
            free(bins[n]);
        }
        as_record_destroy(record);
        raise_aerospike_exception(err.code, err.message);
    }
    for(n = 0; n < idx; n++) {
        free(bins[n]);
    }

    return rb_record_from_c(record, key);
}

#udfObject



756
757
758
759
760
761
762
# File 'ext/aerospike_native/client.c', line 756

VALUE client_udf(VALUE vSelf)
{
    VALUE vParams[1];
    vParams[0] = vSelf;

    return rb_class_new_instance(1, vParams, UdfClass);
}