private ResultCollector executeOnServer(Function function, ResultCollector collector,
      byte hasResult, int timeoutMs) throws FunctionException {
    ServerRegionProxy srp = getServerRegionProxy();
    FunctionStats stats =
        FunctionStatsManager.getFunctionStats(function.getId(), region.getSystem());
    long start = stats.startFunctionExecution(true);
    try {
      validateExecution(function, null);
      srp.executeFunction(function, this, collector, hasResult,
          timeoutMs);
      stats.endFunctionExecution(start, true);
      return collector;
    } catch (FunctionException functionException) {
      stats.endFunctionExecutionWithException(start, true);
      throw functionException;
    } catch (Exception exception) {
      stats.endFunctionExecutionWithException(start, true);
      throw new FunctionException(exception);
    }
  }
Executes Function with FunctionService#onRegion(Region region) in client server mode.

@see FunctionService#onRegion(Region) *
@since GemFire 5.8 LA
geode-core/src/main/java/org/apache/geode/internal/cache/execute/ServerRegionFunctionExecutor.java