Try it as the integer modulo 1000 (<bigint> % 1000) -1 = ringnum
On Sep 3, 2013, at 2:25 AM, indrajith m <[email protected]> wrote: > Hi, > > I am working on consistent hashing am getting the problem while generating > the consistent Id in consistent circle am following these method > > My consistent circle lower limit is->0 and upper limit is 999 > > So my consistent node id should be in between 0 and 999 > > Here I am taking the Node IP and port number (192.168.9.23:11211) > > Then Converting IP details to Hash code based on the hashing algorithm so am > getting one integer like (8695869568) ten digit number > > From that hash code am taking the last three digit like 568. And assign to > consistent circle based the clock wise > > Am getting the problem suppose I have two server node like > 192.168.9.23:11211, 192.168.9.24:11212 > > And after converting to hash code am getting the consortium id like this > > 8695869568 for node1 (192.168.9.23:11211) > > 8695869569 for node 2(192.168.9.24:11212) > > Here if am taking the last three digit it will come like 568,569 so it is > very nearest number. > > How I can equally distribute the node in consistent circle I don’t want two > nodes staying in nearest range of number. > > The main important point is my hash code should not change when adding a new > node or removing the node > > > i have added the graphical representation of consistent algorithm below am > getting the out put like this > > i need my consistent circle like this > > > > if any one know the appropriate formula for allocating the nodes in circle > please help me > > currently am getting the allocation of id like this in consistent circle > > > > > > > > -- > > --- > You received this message because you are subscribed to the Google Groups > "memcached" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups "memcached" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
