[ 
https://issues.apache.org/jira/browse/GEODE-6922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Juan José Ramos Cassella reassigned GEODE-6922:
-----------------------------------------------

    Assignee: Juan José Ramos Cassella

> Distribute the Execution of RegionSizeFunction Evenly Across Members
> --------------------------------------------------------------------
>
>                 Key: GEODE-6922
>                 URL: https://issues.apache.org/jira/browse/GEODE-6922
>             Project: Geode
>          Issue Type: Bug
>          Components: http session
>            Reporter: Juan José Ramos Cassella
>            Assignee: Juan José Ramos Cassella
>            Priority: Major
>
> The {{RegionSizeFunction}} is invoked within 
> {{ClientServerSessionCache.size()}} as below:
> {code:java}
> public int size() {
>     // Add a single dummy key to force the function to go to one server
>     Set<String> filters = new HashSet<String>();
>     filters.add("test-key");
>     // Execute the function on the session region
>     Execution execution = 
> FunctionService.onRegion(getSessionRegion()).withFilter(filters);
>     ResultCollector collector = execution.execute(RegionSizeFunction.ID);
>     List<Integer> result = (List<Integer>) collector.getResult();
>     // Return the first (and only) element
>     return result.get(0);
>   }
> {code}
> This makes the call to go to a single server every time, which may contribute 
> to overload the member. The key should be randomly generated so the 
> executions are spread around the available members.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to