Welcome! Log In Create A New Profile

Advanced

Determining what node a key is located on for testing

Posted by ehalpern 
I'm trying to test some failure scenarios with our application which
uses a memcached cluster for caching dirty data. To do this, I need a
programmatic way to determine which memcached node is responsible for
storing a particular key. Does anyone know of a way to do this using
the spymemcached client?

Thanks in advance
Take a look at SpyNodeLocator, it has the info that you're looking for.

On Mon, Aug 2, 2010 at 6:21 PM, ehalpern <[email protected]> wrote:

> I'm trying to test some failure scenarios with our application which
> uses a memcached cluster for caching dirty data. To do this, I need a
> programmatic way to determine which memcached node is responsible for
> storing a particular key. Does anyone know of a way to do this using
> the spymemcached client?
>
> Thanks in advance
>



--
awl
D'oh, just remembered that SpyNodeLocator is something we developed
in-house. Please disregard...

Depending on which hashing strategy you're using, one of the NodeLocators
will be used. If you're using Ketama hashing, then take a look at
net.spy.memcached.KetamaNodeLocator.

On Mon, Aug 2, 2010 at 7:20 PM, Adam Lee <[email protected]> wrote:

> Take a look at SpyNodeLocator, it has the info that you're looking for.
>
>
> On Mon, Aug 2, 2010 at 6:21 PM, ehalpern <[email protected]> wrote:
>
>> I'm trying to test some failure scenarios with our application which
>> uses a memcached cluster for caching dirty data. To do this, I need a
>> programmatic way to determine which memcached node is responsible for
>> storing a particular key. Does anyone know of a way to do this using
>> the spymemcached client?
>>
>> Thanks in advance
>>
>
>
>
> --
> awl
>



--
awl
Thanks for the quick response.

Looks like I can also use MemcachedClient.getNodeLocator() which is
nice because it allows me to keep the particulars of which NodeLocator
I'm using hidden behind the MemachedClientFactory.

On Aug 2, 4:24 pm, Adam Lee <[email protected]> wrote:
> D'oh, just remembered that SpyNodeLocator is something we developed
> in-house.   Please disregard...
>
> Depending on which hashing strategy you're using, one of the NodeLocators
> will be used.  If you're using Ketama hashing, then take a look at
> net.spy.memcached.KetamaNodeLocator.
>
>
>
>
>
> On Mon, Aug 2, 2010 at 7:20 PM, Adam Lee <[email protected]> wrote:
> > Take a look at SpyNodeLocator, it has the info that you're looking for.
>
> > On Mon, Aug 2, 2010 at 6:21 PM, ehalpern <[email protected]> wrote:
>
> >> I'm trying to test some failure scenarios with our application which
> >> uses a memcached cluster for caching dirty data.  To do this, I need a
> >> programmatic way to determine which memcached node is responsible for
> >> storing a particular key.  Does anyone know of a way to do this using
> >> the spymemcached client?
>
> >> Thanks in advance
>
> > --
> > awl
>
> --
> awl
Sorry, only registered users may post in this forum.

Click here to login