@Override
  public long export(Region<K, V> region, ExportSink sink, SnapshotOptions<K, V> options)
      throws IOException {
    try {
      ClientArgs<K, V> args =
          new ClientArgs<>(region.getFullPath(), pool.getPRSingleHopEnabled(), options);
      ClientExportCollector results = new ClientExportCollector(sink);

      // For single hop we rely on tcp queuing to throttle the export; otherwise
      // we allow the WindowedExporter to provide back pressure.
      Execution exec = pool.getPRSingleHopEnabled() ? FunctionService.onRegion(region)
          : FunctionService.onServer(pool);

      ResultCollector<?, ?> rc =
          exec.setArguments(args).withCollector(results).execute(new ProxyExportFunction<>());

      // Our custom result collector is writing the data, but this will
      // check for errors.
      return (Long) rc.getResult();

    } catch (FunctionException e) {
      throw new IOException(e);
    }
  }
Gathers snapshot data from the server using a proxy function. If PRSingleHop is enabled, the
proxy function will use a {@link LocalExporter} to forward results directly back to the client.
This relies on TCP queuing to provide back pressure on the senders. If PRSingleHop is not
enabled, the proxy function will use a {@link WindowedExporter} to rate the data gathering prior
to forwarding back to the client. The client uses a custom {@link ResultCollector} to write
entries immediately into the snapshot file.


@param <K> the key type
@param <V> the value type
geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/ClientExporter.java