[
https://issues.apache.org/jira/browse/GEODE-6922?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Juan José Ramos Cassella updated GEODE-6922:
--------------------------------------------
Summary: Session State Module - Use sizeOnServer instead of
RegionSizeFunction (was: Session State Module - Use sizeOnServer/size instead
of RegionSizeFunction)
> 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
> Time Spent: 20m
> 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)