osdir.com
mailing list archive

Subject: Re: hash argument to get call - msg#00045

List: web.cache.memcached

Date: Prev Next Index Thread: Prev Next Index
It is a hash code.  It is not really used to pick the exact bucket/server, but more useful to control that certain different objects live on one server.  The benefit to this is in the use of getMulti() to stream multiple objects back over one connection.  So for example, if I wanted a bunch of objects that we all related, say, a bunch of objects related to a single user account, to be retrievable in one getMulti(), I could set them w/ a specific hash code to ensure they all live on one cache server.

gw

On 1/9/07, S Edirisinghe <edirisinghe.s@xxxxxxxxx> wrote: Thanks greg. So what does the integer mean? Is it,eg bucket #45 ? Does bucket 45 translate to server 45 or would I have to read up the code on how buckets are chosen to really understand what's going?

cheers

On 1/9/07, Greg Whalin <greg@xxxxxxxxxx> wrote: The 3 argument version of that which takes the hash allows the caller to override the chosen bucket by passing in a specified hash key.  By default, you can just call mc.set( key, value) and rely on the client to determine the memcache server internally.

greg

On 1/9/07, S Edirisinghe < edirisinghe.s@xxxxxxxxx> wrote: Hi all,

I'm new to the list and have not found out how to search the archive. While I find out how, I will post this (hopefully not-stupid ) question.

I'm using the java client so, I'll ask about the method in the javadoc
        MemCachedClient mc = new MemCachedClient();
String key = "cacheKey1";
Object value = SomeClass.getObject();
Integer hash = new Integer(45);



mc.set(key, value, hash);

What is the hash (Integer)  arg to this method do? Is this a way for picking the bucket? I wasn't sure if this was a seed for the hash function ? I'm pretty new to using memcache d. Your help is appreciated.

thanks




--
Greg Whalin



--
Greg Whalin
Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: hash argument to get call

Thanks greg. So what does the integer mean? Is it,eg bucket #45 ? Does bucket 45 translate to server 45 or would I have to read up the code on how buckets are chosen to really understand what's going?cheers On 1/9/07, Greg Whalin <greg@xxxxxxxxxx> wrote: The 3 argument version of that which takes the hash allows the caller to override the chosen bucket by passing in a specified hash key.  By default, you can just call mc.set( key, value) and rely on the client to determine the memcache server internally. gregOn 1/9/07, S Edirisinghe < edirisinghe.s@xxxxxxxxx> wrote: Hi all, I'm new to the list and have not found out how to search the archive. While I find out how, I will post this (hopefully not-stupid ) question.I'm using the java client so, I'll ask about the method in the javadoc MemCachedClient mc = new MemCachedClient(); String key = "cacheKey1"; Object value = SomeClass.getObject(); Integer hash = new Integer(45); mc.set(key, value, hash);What is the hash (Integer)  arg to this method do? Is this a way for picking the bucket? I wasn't sure if this was a seed for the hash function ? I'm pretty new to using memcache d. Your help is appreciated. thanks -- Greg Whalin

Next Message by Date: click to view message preview

searching support for win32 environment

hi,   it would be great if somebody could contact me which is able to support us with the win32 1.2.1 version. We would also pay for those efforts.   roni.schuetz@xxxxxxxxxxxxxxx-- Kind regards,Roni

Previous Message by Thread: click to view message preview

Re: hash argument to get call

Thanks greg. So what does the integer mean? Is it,eg bucket #45 ? Does bucket 45 translate to server 45 or would I have to read up the code on how buckets are chosen to really understand what's going?cheers On 1/9/07, Greg Whalin <greg@xxxxxxxxxx> wrote: The 3 argument version of that which takes the hash allows the caller to override the chosen bucket by passing in a specified hash key.  By default, you can just call mc.set( key, value) and rely on the client to determine the memcache server internally. gregOn 1/9/07, S Edirisinghe < edirisinghe.s@xxxxxxxxx> wrote: Hi all, I'm new to the list and have not found out how to search the archive. While I find out how, I will post this (hopefully not-stupid ) question.I'm using the java client so, I'll ask about the method in the javadoc MemCachedClient mc = new MemCachedClient(); String key = "cacheKey1"; Object value = SomeClass.getObject(); Integer hash = new Integer(45); mc.set(key, value, hash);What is the hash (Integer)  arg to this method do? Is this a way for picking the bucket? I wasn't sure if this was a seed for the hash function ? I'm pretty new to using memcache d. Your help is appreciated. thanks -- Greg Whalin

Next Message by Thread: click to view message preview

searching support for win32 environment

hi,   it would be great if somebody could contact me which is able to support us with the win32 1.2.1 version. We would also pay for those efforts.   roni.schuetz@xxxxxxxxxxxxxxx-- Kind regards,Roni
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by