2 Replies Latest reply on Mar 15, 2012 6:08 AM by agnihere

    keyaffinity and grouper API questoion

    gdanov

      Hi,

      I am using the remote executor to do some processing where I send custom command to particular node owning particular key. As part of the command I want to manipulate entry in second cache. I want the key for the second cache to be colocated with the key of the first cache.

       

      Knowing the address if the node holding the key for the first cache I used the keyaffinity service to generate key for the second cache, but when the cluster has more than two nodes it is always hit and miss.

      Tried the grouping api with similar success. Half of the time the command executed on the target node detects that the locality if the second key is not_local.

       

      Are these two apis designed so that they can help me colocate two keys from different caches on the same node? The two caches are configured in the same manner with the same parameters

       

      Cheers,

      Georgi

        • 1. Re: keyaffinity and grouper API questoion
          gdanov

          I am happy to report it was misconfiguration on my side

          Grouping API works just fine and coordinates the keys between different caches

          • 2. Re: keyaffinity and grouper API questoion
            agnihere

            Hi Georgi,

             

            We are trying to do exactly this but the keys in destination cache are still getting distributed differently from source cache. Following is the configuration setting we have done:

                configuration.fluent().clustering().hash().groups().enabled(true);

            and we have  used @Group annotation on toString() method of the "Key" object.

             

            Can you please tell us if we are missing some configuration?

             

            Thanks