You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Edward Capriolo (JIRA)" <ji...@apache.org> on 2014/02/23 20:38:19 UTC
[jira] [Commented] (CASSANDRA-6757) SliceQueryFilter access
multiple ColumnSlice but not exposed to thrift
[ https://issues.apache.org/jira/browse/CASSANDRA-6757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13909859#comment-13909859 ]
Edward Capriolo commented on CASSANDRA-6757:
--------------------------------------------
The feature works like this:
{code}
public void test_multi_slice() throws TException{
ColumnParent cp = new ColumnParent();
cp.setColumn_family("Standard1");
ByteBuffer key = ByteBuffer.wrap("multi_slice".getBytes());
for (char a = 'a'; a < 'z'; a++) {
Column c1 = new Column();
c1.setName((a+"").getBytes());
c1.setValue(new byte [0]);
c1.setTimestamp(System.nanoTime());
server.insert(key, cp, c1, ConsistencyLevel.ONE);
}
MultiRangeSliceRequest req = new MultiRangeSliceRequest();
req.setKey(key);
req.setCount(1000);
req.reversed = false;
req.setColumn_parent(cp);
ColumnSlice slice1 = new ColumnSlice();
slice1.setStart("a".getBytes());
slice1.setFinish("e".getBytes());
ColumnSlice slice2 = new ColumnSlice();
slice2.setStart("i".getBytes());
slice2.setFinish("n".getBytes());
List<ColumnSlice> slices= new ArrayList<ColumnSlice>();
slices.add(slice1);
slices.add(slice2);
req.setColumn_slices(slices);
List<ColumnOrSuperColumn> list = server.get_multi_range_slice(req);
Assert.assertEquals(11, list.size());
Assert.assertEquals( new String("a".getBytes()), new String(list.get(0).column.getName()));
Assert.assertEquals( new String("c".getBytes()), new String(list.get(2).column.getName()));
Assert.assertEquals( new String("k".getBytes()), new String(list.get(7).column.getName()));
}
{code}
> SliceQueryFilter access multiple ColumnSlice but not exposed to thrift
> ----------------------------------------------------------------------
>
> Key: CASSANDRA-6757
> URL: https://issues.apache.org/jira/browse/CASSANDRA-6757
> Project: Cassandra
> Issue Type: New Feature
> Reporter: Edward Capriolo
> Assignee: Edward Capriolo
> Attachments: Cassandra-6757.1.diff
>
>
> Thrift has getSlice() which takes a key and a predicate. SliceQueryFilter can accept multiple SliceRanges users should have access to this capability already found in Cassandra.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)