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

             Summary: 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


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