cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Nine <toddn...@apache.org>
Subject Help with migration from Thrift to CQL3 on Cassandra 2.0.10
Date Sun, 31 Aug 2014 00:59:10 GMT
Hi all,
  I'm working on transferring our thrift DAOs over to CQL.  It's going
well, except for 2 cases that both use multi get.  The use case is very
simple.  It is a narrow row, by design, with only a few columns.  When I
perform a multiget, I need to get up to 1k rows at a time.  I do not want
to turn these into a wide row using scopeId and scopeType as the row key.


On the physical level, my Column Family needs something similar to the
following format.


scopeId, scopeType, nodeId, nodeType :{ timestamp: 0x00 }


I've defined by table with the following CQL.


CREATE TABLE IF NOT EXISTS Graph_Marked_Nodes
( scopeId uuid, scopeType varchar, nodeId uuid, nodeType varchar, timestamp
bigint,
PRIMARY KEY ((scopeId , scopeType, nodeId, nodeType))
)WITH caching = 'all'


This works well for inserts deletes and single reads.  I always know the
scopeId, scopeType, nodeId, and nodeType, so I want to return the timestamp
columns.  I thought I could use the IN operation and specify the pairs of
nodeId and nodeTypes I have as input, however this doesn't work.

Can anyone give me a suggestion on how to perform a multiget when I have
several values for the nodeId and the nodeType?  This read occurs on every
read of edges so making 1k trips is not going to work from a performance
perspective.

Below is the query I've tried.

SELECT timestamp FROM  Graph_Marked_Nodes WHERE scopeId = ? AND scopeType =
? AND nodeId IN (uuid1, uuid2, uuid3) AND nodeType IN ('foo','bar')

I've found this issue, which looks like it's a solution to my problem.

https://issues.apache.org/jira/browse/CASSANDRA-6875

However, I'm not able to get the syntax in the issue description to work
either.  Any input would be appreciated!

Cassandra: 2.0.10
Datastax Driver: 2.1.0

Thanks,
Todd

Mime
View raw message