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

Juan José Ramos Cassella resolved GEODE-6922.
---------------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.10.0

> Session State Module - Use sizeOnServer instead of RegionSizeFunction
> ---------------------------------------------------------------------
>
>                 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
>              Labels: GeodeCommons
>             Fix For: 1.10.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> 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. Change the implementation to use 
> {{Region.sizeOnServer()}} instead, the client will end up using any server on 
> the pool and reduce the boiler plate around the execution.



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

Reply via email to