cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: Custom Partitioner Type
Date Mon, 13 Aug 2012 22:11:19 GMT
Yes, you need to implement the org.apache.cassandra.dht.IPartitioner interface, there are a
couple of abstract implementations you could base it on. 

> I want all even keys to go to
> node1 and odd keys to node2, is it feasible ?

I'm not endorsing the idea of doing this, but as a hack to see if the effects you could use
the BOP and format the keys as (python):

str(key % 2) + "{0:0>#10}".format(key)

So all keys are 11 digit strings, even keys start with 0 and odd with 1. 

Hope that helps. 

-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 14/08/2012, at 7:33 AM, A J <s5alye@gmail.com> wrote:

> Is it possible to use a custom Partitioner type (other than RP or BOP) ?
> Say if my rowkeys are all Integers and I want all even keys to go to
> node1 and odd keys to node2, is it feasible ? How would I go about ?
> 
> Thanks.


Mime
View raw message