[
https://issues.apache.org/jira/browse/CASSANDRA-4091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239965#comment-13239965
]
varnitk edited comment on CASSANDRA-4091 at 3/27/12 9:29 PM:
-------------------------------------------------------------
ArrayList<ByteBuffer> keys = new ArrayList<ByteBuffer>();
keys.add(ByteBuffer.wrap("key1".getBytes("UTF-8")));
keys.add(ByteBuffer.wrap("key2".getBytes("UTF-8")));
ColumnParent parent = new ColumnParent(columnFamily);
SliceRange sliceRange = new SliceRange(ByteBuffer.wrap("".getBytes("UTF-8")),
ByteBuffer.wrap("".getBytes("UTF-8")), false, 2147483647);
SlicePredicate predicate = new SlicePredicate();
predicate.setSlice_range(sliceRange);
TTransport tr = new TFramedTransport(new TSocket("127.0.0.1", 9160));
TProtocol proto = new TBinaryProtocol(tr);
Cassandra.Client conn = new Cassandra.Client(proto);
tr.open();
conn.set_keyspace(keyspace);
Map<ByteBuffer, List<ColumnOrSuperColumn>> response = conn.multiget_slice(keys,
parent, predicate, ConsistencyLevel.ONE);
This is java equivalent of the above code which works as expected. As mentioned
in the description, the problem pertains to the erlang thrift interface only
and cannot be reproduced in Java or Python.
It cannot be a problem with my code since multiget_count works which has the
same signature as mulitget_slice only the responses differ but I always get an
empty list back.
was (Author: varnit):
ArrayList<ByteBuffer> keys = new ArrayList<ByteBuffer>();
keys.add(ByteBuffer.wrap("key1".getBytes("UTF-8")));
keys.add(ByteBuffer.wrap("key2".getBytes("UTF-8")));
ColumnParent parent = new ColumnParent(columnFamily);
SliceRange sliceRange = new SliceRange(ByteBuffer.wrap("".getBytes("UTF-8")),
ByteBuffer.wrap("".getBytes("UTF-8")), false, 2147483647);
SlicePredicate predicate = new SlicePredicate();
predicate.setSlice_range(sliceRange);
TTransport tr = new TFramedTransport(new TSocket("127.0.0.1", 9160));
TProtocol proto = new TBinaryProtocol(tr);
Cassandra.Client conn = new Cassandra.Client(proto);
tr.open();
conn.set_keyspace(keyspace);
Map<ByteBuffer, List<ColumnOrSuperColumn>> response = conn.multiget_slice(keys,
parent, predicate, ConsistencyLevel.ONE);
This is java equivalent of the above code which works as expected. As mentioned
in the description, the problem pertains to the erlang thrift interface only
and cannot be reproduced in Java or Python.
> multiget_slice thrift interface always returns empty list in erlang
> -------------------------------------------------------------------
>
> Key: CASSANDRA-4091
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4091
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.0.6, 1.0.8
> Environment: OS: tried on os x lion and fedora 16
> thrift: 0.8.0
> cassandra: tried apache cassandra 1.0.6 and datastax 1.0.8
> erlang: R14B04
> Reporter: varnitk
>
> multiget_slice doesn't work in erlang and always returns an empty list,
> however multiget_count does for the same set of keys. Sample code:
> Keys = [<<"key1">>, <<"key2">>],
> ColumnParent = #columnParent{column_family=ColumnFamily},
>
> SliceRange = #sliceRange{start="", finish="", reversed=false,
> count=2147483647},
> SlicePredicate = #slicePredicate{slice_range=SliceRange,
> column_names=undefined},
> {ok, Conn} = thrift_client_util:new(Host, Port, cassandra_thrift, [{framed,
> true}]), ok,
> {Conn2, {ok, ok}} = thrift_client:call(Conn, set_keyspace, [Keyspace]),
> {NewCon, Response} = thrift_client:call(Conn2, multiget_slice, [Keys,
> ColumnParent, SlicePredicate, 1]),
> Response: {ok, []}
> Please fix.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira