1 Reply Latest reply on Feb 21, 2018 9:45 AM by Radim Vansa

    Grouping API

    Karthi Keyan Newbie

      Can Someone guide me through this Grouping API.I knew that  this is used to co-locate a group of entries onto a specific node. ,but it doesn't work for me.

       

      I tried a sample program to locate a particular key to an particular node and i used extrinsic grouping by implementing a grouper class.I have also override the method computeGroup function which is used to return the group name.But the problem is,I don't know how to point that group name onto an physical node.Can someone Help me please?

       

      I also want to know what is this @Group annotation and where to use it?

       

      Can someone send me an sample code for this If available?

       

      Urgent need in answers.

        • 1. Re: Grouping API
          Radim Vansa Master

          Hi,

           

          Grouping API is not designed to locate group of entries onto *a specific node* but just *together*. If you want to address specific node, you need to use Key Affinity service (btw. you could probably use the key from this service as the group name). Regrettably if the topology changes (node joins/leaves) the record may be moved to another node. When the node re-joins, there's no guarantee that it will be relocated back; the algorithm will try to minimalize number of moved data.

           

          If you want to keep very fast access to the entry, you can let it move to the last node that wrote under that key: instead of distributed mode use scattered mode and enable biasing

           

          @Group annotation is used in the class you use for keys; simply annotate one String-returning method and the result will be used to compute key's segment, therefore co-locating keys with the same group.