Great, this is exactly what I need. So then filter always has to be a Set (in this case a set of KeyArgument objects) or I there is a way to use Map also <Key, Argument> as a filter (basically you could have done that automatically without requiring any changes in PartitionResolver) ?
Thank you very much, Hovhannes ________________________________ From: Barry Oglesby <[email protected]> Sent: Wednesday, January 27, 2016 11:30 PM To: [email protected] Subject: Re: Partitioning onRegion function arguments according to keys Attached is a simple script-based example of this idea. Barry Oglesby GemFire Advanced Customer Engineering (ACE) For immediate support please contact Pivotal Support at http://support.pivotal.io/<https://urldefense.proofpoint.com/v2/url?u=http-3A__support.pivotal.io_&d=BQMFaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=bIt5r7erIk2FRv4Meej3vuWToY3QHT-2W8ak_AP93qs&m=ECQwf6oY6YT0dB1WIgcGbjBTv8qDbX0x8iQ7DGL1acw&s=nQvlWYSJ-vh6y7VFZCtxlTzWblbG8cBZFXVKH8wy3KM&e=> On Wed, Jan 27, 2016 at 9:50 AM, Barry Oglesby <[email protected]<mailto:[email protected]>> wrote: Yes, this is possible. Normally, the arguments are passed to all nodes that execute the function, but the filters are split up and routed to only the appropriate nodes. So, you'll need to change your filter to include not only the keys but also the arguments. Then, add (or change) a PartitionResolver that routes based on just the key part of that key-and-argument filter. For example, if your key is a string then you'll need to create a KeyWithArguments that includes the string and the argument. Then add a PartitionResolver whose getRoutingObject method can handle either a string or a KeyWithArguments. If the input key is a string, then just return it; if the input key is a KeyWithArguments, then return the string field. Barry Oglesby GemFire Advanced Customer Engineering (ACE) For immediate support please contact Pivotal Support at http://support.pivotal.io/<https://urldefense.proofpoint.com/v2/url?u=http-3A__support.pivotal.io_&d=BQMFaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=bIt5r7erIk2FRv4Meej3vuWToY3QHT-2W8ak_AP93qs&m=ECQwf6oY6YT0dB1WIgcGbjBTv8qDbX0x8iQ7DGL1acw&s=nQvlWYSJ-vh6y7VFZCtxlTzWblbG8cBZFXVKH8wy3KM&e=> On Wed, Jan 27, 2016 at 4:48 AM, Hovhannes Antonyan <[email protected]<mailto:[email protected]>> wrote: Hi, I have a question about partitioning provided arguments to corresponding keys upon onRegion call. Lets say I have 3 keys (from 1 to 3) each hosting on different node and I want to make onRegion call by passing individual argument for each key. I don't want to pass all arguments to all nodes, I want each node to receive arguments only for keys it is hosting. How can I achieve this? Thanks in advance, Hovhannes
