You could use the MyPartitionResolver to store all keys with the same ID in the same bucket. This PartitionResolver has to be configured at the time of Partition Region creation either declaratively using xml OR using APIs. See Configuring Partitioned Regions for more information.

/** This resolver returns the value of the ID field in the key. With this resolver,
* all Portfolios using the same ID are colocated in the same bucket.
*/
public class MyPartitionResolver implements PartitionResolver, Declarable {
public Serializable getRoutingObject(EntryOperation operation) {
return operation.getKey().getId();
}

Execute the function on a client or any other node by setting the filter in the function call.