|
From: Yonik S. <yo...@ap...> - 2008-03-18 23:43:08
|
On Tue, Mar 18, 2008 at 7:32 PM, Ning Li <nin...@gm...> wrote: > On Tue, Mar 18, 2008 at 2:57 PM, Yonik Seeley <yo...@ap...> wrote: > > If one wants each user in an email system to span a maximum of 1/8th > > of the ring then the > > hash could be hash = (username.hashCode() << 29) | (id.hashCode() >> 3) > > This could work. Of course, fixing my bug it would be (username.hashCode() << 29) | (id.hashCode() >>> 3) :-) > > Or if the number of emails per user is small, hash = username.hashCode() > > We cannot really assume that, right? :) Well, any assumptions like that are up to the specific application if they want to try their own partitioning. I think most just use the default hash. > Let's use long for now. I'm still not sure I see the value over an int hash, but I guess it's not a big deal as long as we don't have to index it or use the FieldCache for it. That leaves calculating it on the fly on the node when needed, or storing it in a quickly accessible manner (payload or upcomming column store) -Yonik |