@Override
    public void execute(FunctionContext context) {
      ClientArgs<K, V> args = (ClientArgs<K, V>) context.getArguments();
      ResultSender rs = context.getResultSender();
      ExportSink sink = new ResultSenderSink(rs);

      Region<K, V> region = context.getCache().getRegion(args.getRegion());
      InternalCache cache = (InternalCache) context.getCache();
      Exporter<K, V> exp = args.isPRSingleHop() ? new LocalExporter<>()
          : RegionSnapshotServiceImpl.createExporter(cache, region, args.options);

      try {
        long count = exp.export(region, sink, args.getOptions());
        rs.lastResult(count);

      } catch (IOException e) {
        rs.sendException(e);
      }
    }
Gathers snapshot data on the server and forwards it back to the client.

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