You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Mark Jones <MJ...@imagehawk.com> on 2010/04/23 14:23:31 UTC

org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

How is this specified?
Is it a large hex #?
A string of bytes in hex?

http://wiki.apache.org/cassandra/StorageConfiguration doesn't say.

Re: org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

Posted by Jonathan Ellis <jb...@gmail.com>.
this is what IPartitioner does

On Mon, Apr 26, 2010 at 10:16 AM, Schubert Zhang <zs...@gmail.com> wrote:
> Hi Jonathan Ellis and Stu Hood,
>
> I think, finally, we should provide a user customizable key abstract class.
> User can define what types of key and its class, which define how to compare
> keys.
>
> Schubert
>
> On Sat, Apr 24, 2010 at 1:16 PM, Stu Hood <st...@rackspace.com> wrote:
>>
>> Your keys cannot be an encoded as binary for OPP, since Cassandra will
>> attempt to decode them as UTF-8, meaning that they may not come back in the
>> same format.
>>
>> 0.7 supports byte keys using the ByteOrderedPartitioner, and tokens are
>> specified using hex.
>>
>> -----Original Message-----
>> From: "Mark Jones" <MJ...@imagehawk.com>
>> Sent: Friday, April 23, 2010 10:55am
>> To: "user@cassandra.apache.org" <us...@cassandra.apache.org>
>> Subject: RE: org.apache.cassandra.dht.OrderPreservingPartitioner Initial
>> Token
>>
>> So if my keys are binary, is there any way to escape the keysequence in?
>>
>> I have 20 bytes (any value 0x0-0xff is possible) as the key.
>>
>> Are they compared as an array of bytes?  So that I can use truncation?
>>
>> 4 nodes, broken up by 0x00, 0x40, 0x80, 0xC0?
>>
>>
>> -----Original Message-----
>> From: Jonathan Ellis [mailto:jbellis@gmail.com]
>> Sent: Friday, April 23, 2010 10:22 AM
>> To: user@cassandra.apache.org
>> Subject: Re: org.apache.cassandra.dht.OrderPreservingPartitioner Initial
>> Token
>>
>> a normal String from the same universe as your keys.
>>
>> On Fri, Apr 23, 2010 at 7:23 AM, Mark Jones <MJ...@imagehawk.com> wrote:
>> > How is this specified?
>> >
>> > Is it a large hex #?
>> >
>> > A string of bytes in hex?
>> >
>> >
>> >
>> > http://wiki.apache.org/cassandra/StorageConfiguration doesn't say.
>>
>>
>
>

Re: org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

Posted by Schubert Zhang <zs...@gmail.com>.
Hi Jonathan Ellis and Stu Hood,

I think, finally, we should provide a user customizable key abstract class.
User can define what types of key and its class, which define how to compare
keys.

Schubert

On Sat, Apr 24, 2010 at 1:16 PM, Stu Hood <st...@rackspace.com> wrote:

> Your keys cannot be an encoded as binary for OPP, since Cassandra will
> attempt to decode them as UTF-8, meaning that they may not come back in the
> same format.
>
> 0.7 supports byte keys using the ByteOrderedPartitioner, and tokens are
> specified using hex.
>
> -----Original Message-----
> From: "Mark Jones" <MJ...@imagehawk.com>
> Sent: Friday, April 23, 2010 10:55am
> To: "user@cassandra.apache.org" <us...@cassandra.apache.org>
> Subject: RE: org.apache.cassandra.dht.OrderPreservingPartitioner Initial
> Token
>
> So if my keys are binary, is there any way to escape the keysequence in?
>
> I have 20 bytes (any value 0x0-0xff is possible) as the key.
>
> Are they compared as an array of bytes?  So that I can use truncation?
>
> 4 nodes, broken up by 0x00, 0x40, 0x80, 0xC0?
>
>
> -----Original Message-----
> From: Jonathan Ellis [mailto:jbellis@gmail.com]
> Sent: Friday, April 23, 2010 10:22 AM
> To: user@cassandra.apache.org
> Subject: Re: org.apache.cassandra.dht.OrderPreservingPartitioner Initial
> Token
>
> a normal String from the same universe as your keys.
>
> On Fri, Apr 23, 2010 at 7:23 AM, Mark Jones <MJ...@imagehawk.com> wrote:
> > How is this specified?
> >
> > Is it a large hex #?
> >
> > A string of bytes in hex?
> >
> >
> >
> > http://wiki.apache.org/cassandra/StorageConfiguration doesn't say.
>
>
>

RE: org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

Posted by Stu Hood <st...@rackspace.com>.
Your keys cannot be an encoded as binary for OPP, since Cassandra will attempt to decode them as UTF-8, meaning that they may not come back in the same format.

0.7 supports byte keys using the ByteOrderedPartitioner, and tokens are specified using hex.

-----Original Message-----
From: "Mark Jones" <MJ...@imagehawk.com>
Sent: Friday, April 23, 2010 10:55am
To: "user@cassandra.apache.org" <us...@cassandra.apache.org>
Subject: RE: org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

So if my keys are binary, is there any way to escape the keysequence in?

I have 20 bytes (any value 0x0-0xff is possible) as the key.

Are they compared as an array of bytes?  So that I can use truncation?

4 nodes, broken up by 0x00, 0x40, 0x80, 0xC0?


-----Original Message-----
From: Jonathan Ellis [mailto:jbellis@gmail.com]
Sent: Friday, April 23, 2010 10:22 AM
To: user@cassandra.apache.org
Subject: Re: org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

a normal String from the same universe as your keys.

On Fri, Apr 23, 2010 at 7:23 AM, Mark Jones <MJ...@imagehawk.com> wrote:
> How is this specified?
>
> Is it a large hex #?
>
> A string of bytes in hex?
>
>
>
> http://wiki.apache.org/cassandra/StorageConfiguration doesn't say.



RE: org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

Posted by Mark Jones <MJ...@imagehawk.com>.
So if my keys are binary, is there any way to escape the keysequence in?

I have 20 bytes (any value 0x0-0xff is possible) as the key.

Are they compared as an array of bytes?  So that I can use truncation?

4 nodes, broken up by 0x00, 0x40, 0x80, 0xC0?


-----Original Message-----
From: Jonathan Ellis [mailto:jbellis@gmail.com]
Sent: Friday, April 23, 2010 10:22 AM
To: user@cassandra.apache.org
Subject: Re: org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

a normal String from the same universe as your keys.

On Fri, Apr 23, 2010 at 7:23 AM, Mark Jones <MJ...@imagehawk.com> wrote:
> How is this specified?
>
> Is it a large hex #?
>
> A string of bytes in hex?
>
>
>
> http://wiki.apache.org/cassandra/StorageConfiguration doesn't say.

Re: org.apache.cassandra.dht.OrderPreservingPartitioner Initial Token

Posted by Jonathan Ellis <jb...@gmail.com>.
a normal String from the same universe as your keys.

On Fri, Apr 23, 2010 at 7:23 AM, Mark Jones <MJ...@imagehawk.com> wrote:
> How is this specified?
>
> Is it a large hex #?
>
> A string of bytes in hex?
>
>
>
> http://wiki.apache.org/cassandra/StorageConfiguration doesn’t say.