@Override
  public long export(Region<K, V> region, ExportSink sink, SnapshotOptions<K, V> options)
      throws IOException {
    LocalRegion local = RegionSnapshotServiceImpl.getLocalRegion(region);

    long count = 0;
    for (Entry<K, V> entry : region.entrySet()) {
      try {
        if (options.getFilter() == null || options.getFilter().accept(entry)) {
          sink.write(new SnapshotRecord(local, entry));
          count++;
        }
      } catch (EntryDestroyedException e) {
        // continue to next entry
      }
    }
    return count;
  }
Exports snapshot data directly to the supplied {@link ExportSink}. All data is assumed to be
local so snapshot data is obtained directly by iterating over the {@link Region#entrySet()}.


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