SlicePredicate using LexicalUUIDType

38 views
Skip to first unread message

Jim

unread,
Mar 18, 2012, 2:05:58 PM3/18/12
to Scale 7 - Libraries and systems for scalable computing
I've been trying to create a SlicePredicate for a column that has a
comparator defined as CompositeType(LexicalUUIDType,LexicalUUIDType).

So I want to obtain all the columns where the first part of the
composite name is a single UUID and where the second part is ALL of
the UUIDs for the given UUID in the first part. ( I hope I'm being
clear).

What I've been trying (and it's not working) is this:

CompositeType.Builder start = CompositeType.Builder.newBuilder(2);
start.addBytes(orgKey);
start.addBytes(Bytes.fromUuid("ffffffff-ffff-ffff-ffff-
ffffffffffff"));

CompositeType.Builder finish = CompositeType.Builder.newBuilder(2);
finish.addBytes(orgKey);
finish.addBytes(Bytes.fromUuid("00000000-0000-0000-0000-000000000000"));

SlicePredicate slice = Selector.newColumnsPredicate(start.build(),
finish.build(), false, 100);


I'm I going about this the right way? If so, can anyone point out why
this isn't working?

Thank you,
Jim

Dan Washusen

unread,
Mar 18, 2012, 8:07:50 PM3/18/12
to sca...@googlegroups.com
Hi Jim, 
There's nothing obvious that jumps out at me but I haven't used the CompositeType to create a SlicePredicate (or the LexicalUUIDType for that matter).  

Are you seeing any results, an error, unexpected results?  What happens if you flip the start and finish params?

Good good.

Regards,
-- 
Dan Washusen
Make big files fly

ali serghini

unread,
Mar 19, 2012, 2:29:40 AM3/19/12
to sca...@googlegroups.com
Hi Jim,

There is a unit test for CompositeType in the source code [https://github.com/s7/scale7-pelops/blob/master/src/test/java/org/scale7/cassandra/pelops/CompositeTypeIntegrationTest.java]. Take a look at "testSlice".

- Ali

Jim

unread,
Mar 19, 2012, 11:49:28 AM3/19/12
to Scale 7 - Libraries and systems for scalable computing
Hey Dan,

So it just returns an empty set of results. There's no error. I'll
trying flipping the values around and see what happens.

Cheers,
Jim

On Mar 18, 5:07 pm, Dan Washusen <d...@reactive.org> wrote:
> Hi Jim,
> There's nothing obvious that jumps out at me but I haven't used the CompositeType to create a SlicePredicate (or the LexicalUUIDType for that matter).
>
> Are you seeing any results, an error, unexpected results?  What happens if you flip the start and finish params?
>
> Good good.
>
> Regards,--
> Dan Washusen
> Make big files fly
> visit digitalpigeon.com (http://digitalpigeon.com)

Jim

unread,
Mar 19, 2012, 11:54:34 AM3/19/12
to Scale 7 - Libraries and systems for scalable computing
Hey Ali,

Thanks for link. I looked at the testSlice example and it looks
good. The thing is, I can get the slice to work with other types such
as UTF8Type but I can't get it to work with LexicalUUIDType.

At the moment, I'm thinking that I'll change my column comparator and
use something other than LexicalUUITType.

Cheers,
Jim

On Mar 18, 11:29 pm, ali serghini <dev.sergh...@gmail.com> wrote:
> Hi Jim,
>
> There is a unit test for CompositeType in the source code [https://github.com/s7/scale7-pelops/blob/master/src/test/java/org/sca...].
> Take a look at "testSlice".
>
> - Ali
>
>
>
>
>
>
>
> On Sun, Mar 18, 2012 at 5:07 PM, Dan Washusen <d...@reactive.org> wrote:
> >  Hi Jim,
> > There's nothing obvious that jumps out at me but I haven't used the
> > CompositeType to create a SlicePredicate (or the LexicalUUIDType for that
> > matter).
>
> > Are you seeing any results, an error, unexpected results?  What happens if
> > you flip the start and finish params?
>
> > Good good.
>
> > Regards,
> > --
> > Dan Washusen
> > *Make big files fly*
Reply all
Reply to author
Forward
0 new messages