I am new to both Thrift and Erlang but need to uses Thrift to get an Erlang 
application to write to Cassandra. The relevant method from cassandra.thrift 
is: 
void insert(1:required binary key, 
2:required ColumnParent column_parent, 
3:required Column column, 
4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) 
throws (1:InvalidRequestException ire, 2:UnavailableException ue, 
3:TimedOutException te), 

The full cassandra.thrift can be found at: 
https://svn.apache.org/repos/asf/cassandra/tags/cassandra-0.8.0/interface/cassandra.thrift
 

I am trying to run the following command via the erl cli: 
{C30,R30} =thrift_client:call( C29, 'insert', [ "keyz", ColPar1, Col4, 6]).). 

Where C29 is a #tclient returned by a previous call, ColPar1 is a 
#columnParent, and Col4 is a #column. The call throws a badarg exception of: 
** exception error: bad argument 
in function iolist_size/1 
called as iolist_size([[[[[[[[[[[[[[[[[[[[[[[[[[[],<<128,...>>],<<0,0,...>>], 
<<"insert">>], 
<<0,0,0,0>>], 
<<"\v">>], 
<<0,1>>], 
<<0,0,0,4>>], 
<<"keyz">>], 
<<"\f">>], 
<<0,2>>], 
<<"\v">>], 
<<0,3>>], 
<<0,0,0,10>>], 
<<"ipdr_usage">>], 
<<"\v">>], 
<<0,4>>], 
<<0,0,0,5>>], 
<<"suppy">>], 
<<0>>], 
<<"\f">>], 
<<0,3>>], 
{{struct,[{1,string},{2,string},{3,i64}]}, 
#column{name = <<"haha">>,value = <<"0_0">>, 
timestamp = 1235234234234234234,ttl = undefined}}], 
<<"\b">>], 
<<0,4>>], 
<<0,0,0,6>>], 
<<0>>]) 
in call from thrift_framed_transport:flush/1 
in call from thrift_transport:flush/1 
in call from thrift_binary_protocol:flush_transport/1 
in call from thrift_protocol:flush_transport/1 
in call from thrift_client:send_function_call/3 
in call from thrift_client:call/3 

Any idea about what I may be doing wrong? Is there any information that I 
forgot to include? 

Thanks in advance, 

Konstantin 

Reply via email to