private void exportOnMember(File snapshot, SnapshotFormat format, SnapshotOptions<K, V> options) throws IOException { LocalRegion local = getLocalRegion(region); Exporter<K, V> exp = createExporter(region, options); if (getLoggerI18n().fineEnabled()) { getLoggerI18n().fine("Writing to snapshot " + snapshot.getAbsolutePath()); } long count = 0; long start = CachePerfStats.getStatTime(); SnapshotWriter writer = GFSnapshot.create(snapshot, region.getFullPath()); try { if (getLoggerI18n().infoEnabled()) getLoggerI18n().info(LocalizedStrings.Snapshot_EXPORT_BEGIN_0, region.getName()); SnapshotWriterSink sink = new SnapshotWriterSink(writer); count = exp.export(region, sink, options); if (getLoggerI18n().infoEnabled()) { getLoggerI18n() .info( LocalizedStrings.Snapshot_EXPORT_END_0_1_2_3, new Object[] {count, sink.getBytesWritten(), region.getName(), snapshot}); } } finally { writer.snapshotComplete(); local.getCachePerfStats().endExport(count, start); } }
@Override public void write(SnapshotRecord... records) throws IOException { for (SnapshotRecord rec : records) { writer.snapshotEntry(rec); bytes += rec.getSize(); } }