}
}
@Override
public void createSnapshot(String name) throws IOException {
SnapshotDeletionPolicy snapshotter = getSnapshotter();
Map<String, String> existingSnapshots = snapshotter.getSnapshots();
if (existingSnapshots.containsKey(name)) {
LOG.error("A Snapshot already exists with the same name [{0}] on [{1}/{2}].",
name, _tableContext.getTable(), _shardContext.getShard());
throw new IOException("A Snapshot already exists with the same name [" + name + "] on " +
"["+_tableContext.getTable()+"/"+_shardContext.getShard()+"].");
}
_writer.commit();
IndexCommit indexCommit = snapshotter.snapshot(name);
/*
* Persist the snapshots info into a tmp file under the snapshots sub-folder
* and once writing is finished, close the writer.
* Now rename the tmp file to an actual snapshots file.