@Override
  public Execution onRegion(Region region) {
    if (region == null) {
      throw new FunctionException("Region instance passed is null");
    }

    if (region.isDestroyed()) {
      ((LocalRegion) region).getCancelCriterion().checkCancelInProgress();
      throw new RegionDestroyedException("Region is destroyed", region.getFullPath());
    }

    ProxyCache proxyCache = null;
    String poolName = region.getAttributes().getPoolName();
    if (poolName != null) {
      Pool pool = findPool(poolName);

      if (pool == null) {
        throw new IllegalStateException(String.format("Could not find a pool named %s.", poolName));
      } else {
        if (pool.getMultiuserAuthentication()) {
          if (region instanceof ProxyRegion) {
            ProxyRegion proxyRegion = (ProxyRegion) region;
            region = proxyRegion.getRealRegion();
            proxyCache = proxyRegion.getAuthenticatedCache();
          } else {
            throw new UnsupportedOperationException();
          }
        }
      }
    }

    if (isClientRegion(region)) {
      return new ServerRegionFunctionExecutor(region, proxyCache);
    }
    if (PartitionRegionHelper.isPartitionedRegion(region)) {
      return new PartitionedRegionFunctionExecutor(region);
    }
    return new DistributedRegionFunctionExecutor(region);
  }
use when the optimization to execute onMember locally is not desired.
geode-core/src/main/java/org/apache/geode/internal/cache/execute/InternalFunctionExecutionServiceImpl.java