UDF stream with LDT bin


#1

Hi guys i`m trying to run a simple stream task - count all orders my customers made

I got one namespace:

namespace test_project {
    replication-factor      0
    high-water-memory-pct   90
    stop-writes-pct         98
    default-ttl             0
    storage-engine          memory
    ldt-enabled   true
}

i used custom module and adjust following settings for my large list:

ldt_settings.use_package( ldtMap, "ListLargeObject" );

after that I created few orders and inserted them

Key key = new Key("test_project", "customer", customerID);
LargeList order_list = client.getLargeList(policy, key, "orders", "orders_llist");
order_list.add(Value.getAsMap(map));

so this worked like a charm, so i created simple UDF module based on exampples:

local function one(rec)
    local llist = require('ldt/lib_llist');
    local listSize = llist.size(rec, "orders");
    return listSize;
end

local function add(a, b)
    return a + b;
end

function count_orders(stream)
    return stream : map(events) : reduce(add);
end

in my client I tried to run the count function

Statement st = new Statement();
st.setNamespace("test_project");
st.setSetName("customer");
ResultSet rs = client.queryAggregate(null, st, "my_functions", "count_orders");

but all I get is

Error Code 213: UDF: Execution Error 2 : /opt/aerospike/sys/udf/lua/ldt/lib_llist.lua:7431: 1500:LDT-Not Enabled on Namespace

I cant figure out what Im doing wrong :frowning: Anybody any ideas? Thanks!


#2

Two problems

  1. ldt-enabled true in the namespace section is missing.
  2. LDT cannot be accessed in stream today … under works …

– R


#3

Hello raj

LDT in nameset IS enabled, otherwise I wouldnt be able to do the inserts - thats why the error message puzzled me

So I guess it`s just because of 2. LDT cannot be accessed in stream today

BTW is there any date when this will be available?

Thanks


#4

mvince,

No timelines … but should pop up soon … :smile:

– R